private void updateDescriptorReferences () { transactionManager.writeAccess (new Runnable () { public void run () { updateDescriptorReferencesCore (); } }); }
public void run () { transactionManager.writeAccess (new Runnable() { public void run () { uid2components.remove (componentID); } }); } }
private void sequenceContainerChanged(final SequenceContainer sequenceContainer) { DesignComponent dcSequenceContainer = designIdMap.get(sequenceContainer); assert(dcSequenceContainer != null); document.getTransactionManager().writeAccess(new Runnable() { public void run() { writeSequencesToSequenceContainerDC(sequenceContainer); } }); if (DEBUG_UNDO) System.out.println("Seq container changed: " + sequenceContainer); // NOI18N }
private void handleScenePropChange(final DesignComponent dcScene, final PropertyChangeEvent e) { if (e.getPropertyName().equals(Editable.PROPERTY_NAME)) { document.getTransactionManager().writeAccess(new Runnable() { public void run() { String newName = (String) e.getNewValue(); dcScene.writeProperty(SceneCD.PROPERTY_NAME, MidpTypes.createStringValue(newName)); changeMap.put(dcScene.getComponentID(), SceneCD.PROPERTY_NAME); } }); if (DEBUG_UNDO) System.out.println("Scene name changed: " + dcScene); // NOI18N } }
private void handleTiledLayerPropChange(final DesignComponent dcTiledLayer, final PropertyChangeEvent e) { if (e.getPropertyName().equals(Editable.PROPERTY_NAME)) { document.getTransactionManager().writeAccess(new Runnable() { public void run() { String newName = (String) e.getNewValue(); dcTiledLayer.writeProperty(LayerCD.PROPERTY_NAME, MidpTypes.createStringValue(newName)); changeMap.put(dcTiledLayer.getComponentID(), LayerCD.PROPERTY_NAME); } }); if (DEBUG_UNDO) System.out.println("TiledLayer name changed: " + dcTiledLayer); // NOI18N } }
public void run() { activeDocument.getTransactionManager().writeAccess(new Runnable() { public void run() { DeleteSupport.invokeDirectUserDeletion (activeDocument, activeDocument.getSelectedComponents (), true); } }); } });
private void updateTiledLayerDCProps(final TiledLayer layer) { document.getTransactionManager().writeAccess(new Runnable() { public void run() { DesignComponent dcLayer = designIdMap.get(layer); assert(dcLayer != null); changeMap.put(dcLayer.getComponentID(), TiledLayerCD.PROPERTY_TILES); PropertyValue propTiles = GameTypes.createTilesProperty(layer.getTiles()); dcLayer.writeProperty(TiledLayerCD.PROPERTY_TILES, propTiles); } }); if (DEBUG_UNDO) System.out.println("Layer props changed: " + layer); // NOI18N }
private void updateSequenceFrames(final Sequence sequence) { document.getTransactionManager().writeAccess(new Runnable() { public void run() { DesignComponent dcSequence = designIdMap.get(sequence); assert(dcSequence != null); changeMap.put(dcSequence.getComponentID(), SequenceCD.PROPERTY_FRAMES); int[] frames = sequence.getFramesAsArray(); dcSequence.writeProperty(SequenceCD.PROPERTY_FRAMES, GameTypes.createFramesProperty(frames)); } }); if (DEBUG_UNDO) System.out.println("Seq frames changed: " + sequence); // NOI18N }
protected synchronized void insideActionPerformed(final DesignComponent unusedCommandComponent) { final DesignDocument document = unusedCommandComponent.getDocument(); document.getTransactionManager().writeAccess(new Runnable() { public void run() { selectedCommandSource = MidpDocumentSupport.attachCommandToDisplayable(getComponent(), unusedCommandComponent); } }); selectComponent(selectedCommandSource); selectedCommandSource = null; } };
protected synchronized void insideActionPerformed(final DesignComponent unusedCommandComponent) { final DesignDocument document = unusedCommandComponent.getDocument(); document.getTransactionManager().writeAccess(new Runnable() { public void run() { selectedCommandSource = MidpDocumentSupport.attachCommandToItem(getComponent(), unusedCommandComponent); } }); selectComponent(selectedCommandSource); selectedCommandSource = null; } };
private static void selectComponent(final DesignComponent selectedCommandSource) { final DesignDocument document = selectedCommandSource.getDocument(); document.getTransactionManager().writeAccess(new Runnable() { public void run() { document.setSelectedComponents(null, Collections.singleton(selectedCommandSource)); } }); }
public void run () { final DesignComponent relatedComponent = property.getRelatedComponent (); relatedComponent.getDocument ().getTransactionManager ().writeAccess (new Runnable() { public void run () { PropertyValue propertyValue = relatedComponent.readProperty (propertyName); boolean state = propertyValue.getKind () == PropertyValue.Kind.VALUE && MidpTypes.getBoolean (propertyValue); state = ! state; relatedComponent.writeProperty (propertyName, MidpTypes.createBooleanValue (state)); } }); } });
public void keyTyped (KeyEvent e) { if (e.getKeyChar () != KeyEvent.VK_ENTER) return; final DesignComponent relatedComponent = property.getRelatedComponent (); relatedComponent.getDocument ().getTransactionManager ().writeAccess (new Runnable() { public void run () { PropertyValue value = MidpTypes.createStringValue (getText ()); relatedComponent.writeProperty (propertyName, value); } }); PopupUtil.hidePopup (); }
public void actionPerformed (ActionEvent e) { DesignComponent component = ScreenMenuItemInjectorPresenter.this.getComponent (); component.getDocument ().getTransactionManager ().writeAccess (new Runnable () { public void run () { ScreenMenuItemInjectorPresenter.this.actionPerformed (); } }); PopupUtil.hidePopup (); }
public void keyTyped(KeyEvent e) { if (e.getKeyChar() != KeyEvent.VK_ENTER) return; property.getRelatedComponent().getDocument().getTransactionManager().writeAccess(new Runnable() { public void run() { PropertyValue value = MidpTypes.createStringValue(getText()); resolveRelatedComponent (property).writeProperty(propertyName, value); MidpDatabindingSupport.removeUnusedConnector(property.getRelatedComponent(), propertyName); } }); PopupUtil.hidePopup(); }
public void actionPerformed (ActionEvent e) { final DesignComponent comp = ScreenBooleanInjectorPresenter.this.getComponent (); comp.getDocument ().getTransactionManager ().writeAccess (new Runnable () { public void run () { comp.writeProperty (propertyName, MidpTypes.createBooleanValue (InjectorCheckBox.this.isSelected ())); } }); PopupUtil.hidePopup (); } }
public void accept(final Point point, final Transferable transferable, final AcceptSuggestion suggestion) { final DesignDocument document = devicePanel.getController().getDocument(); if (document == null) return; document.getTransactionManager().writeAccess(new Runnable() { public void run() { DesignComponent component = devicePanel.getDesignComponentAt(point); ComponentProducer.Result result = AcceptSupport.accept(component, transferable, suggestion); AcceptSupport.selectComponentProducerResult(result); } }); }
public void actionPerformed (ActionEvent e) { DesignComponent component = ScreenButtonInjectorPresenter.this.getComponent (); component.getDocument ().getTransactionManager ().writeAccess (new Runnable () { public void run () { ScreenButtonInjectorPresenter.this.actionPerformed (); } }); PopupUtil.hidePopup (); }
public void keyTyped(KeyEvent e) { if (e.getKeyChar() != KeyEvent.VK_ENTER || (e.getModifiersEx () & MouseEvent.CTRL_DOWN_MASK) == 0) return; property.getRelatedComponent().getDocument().getTransactionManager().writeAccess(new Runnable() { public void run() { PropertyValue value = MidpTypes.createStringValue(getText()); property.getRelatedComponent ().writeProperty(propertyName, value); } }); PopupUtil.hidePopup(); }
public void focusLost(FocusEvent arg0) { property.getRelatedComponent().getDocument().getTransactionManager().writeAccess(new Runnable() { public void run() { PropertyValue value = MidpTypes.createStringValue(getText()); property.getRelatedComponent ().writeProperty(propertyName, value); } }); PopupUtil.hidePopup(); } }