public Item removeConditionalStyle(final MapModel map, final ConditionalStyleModel conditionalStyleModel, final int index) { RemoveConditionalStyleActor actor = new RemoveConditionalStyleActor(conditionalStyleModel, index); Controller.getCurrentModeController().execute(actor, map); return actor.item; }
public void addConditionalStyle(final MapModel map, final ConditionalStyleModel conditionalStyleModel, boolean isActive, ASelectableCondition condition, IStyle style, boolean isLast) { AddConditionalStyleActor actor = new AddConditionalStyleActor(conditionalStyleModel, isActive, condition, style, isLast); Controller.getCurrentModeController().execute(actor, map); }
public void moveNodePosition(final NodeModel node, final Quantity<LengthUnits> hGap, final Quantity<LengthUnits> shiftY) { final ModeController currentModeController = Controller.getCurrentModeController(); MapModel map = node.getMap(); ArrayList<IActor> actors = new ArrayList<IActor>(3); actors.add(new ChangeShiftXActor(node, hGap)); actors.add(new ChangeShiftYActor(node, shiftY)); for (final IActor actor : actors) { currentModeController.execute(actor, map); } }
@Override public void visit(final NodeModel node, final NodeAttributeTableModel model) { for (int i = 0; i < model.getRowCount(); i++) { if (model.getName(i).equals(oldName)) { final int row = i; final String name = newName.toString(); final String oldName = this.oldName.toString(); final IActor actor = new SetAttributeNameActor(node, model, name, oldName, row); Controller.getCurrentModeController().execute(actor, node.getMap()); } } } }
public void setSourceLabel(final ConnectorModel model, String label) { if ("".equals(label)) { label = null; } String oldLabel = model.getSourceLabel(); if ("".equals(oldLabel)) { oldLabel = null; } if (label == oldLabel || label != null && label.equals(oldLabel)) { return; } final IActor actor = new SourceLabelSetter(model, label, oldLabel); Controller.getCurrentModeController().execute(actor, model.getSource().getMap()); }
@Override public Attribute performRemoveRow(final NodeModel node, final NodeAttributeTableModel model, final int row) { final Vector<Attribute> attributes = model.getAttributes(); final Object o = attributes.elementAt(row); final IActor actor = new RemoveAttributeActor(node, model, row); Controller.getCurrentModeController().execute(actor, node.getMap()); return (Attribute) o; }
public void setHorizontalShift(NodeModel node, final Quantity<LengthUnits> horizontalShift){ final IActor actor = new ChangeShiftXActor(node, horizontalShift); Controller.getCurrentModeController().execute(actor, node.getMap()); }
public void undoableToggleHook(final NodeModel node, final IExtension extension) { final IActor actor = new ToggleHookActor(node, extension); Controller.getCurrentModeController().execute(actor, node.getMap()); }
public void setVerticalShift(NodeModel node, final Quantity<LengthUnits> verticalShift){ final IActor actor = new ChangeShiftYActor(node, verticalShift); Controller.getCurrentModeController().execute(actor, node.getMap()); }
@Override public void visit(final NodeModel node, final NodeAttributeTableModel model) { for (int i = 0; i < model.getRowCount(); i++) { if (model.getName(i).equals(name) && model.getValue(i).equals(value)) { final IActor actor = new RemoveAttributeActor(node, model, i); Controller.getCurrentModeController().execute(actor, node.getMap()); } } } }
@Override public void visit(final NodeModel node, final NodeAttributeTableModel model) { for (int i = 0; i < model.getRowCount(); i++) { if (model.getName(i).equals(name) && model.getValue(i).equals(oldValue)) { final int row = i; final IActor actor = new SetAttributeValueActor(node, model, row, newValue); Controller.getCurrentModeController().execute(actor, node.getMap()); } } } }
@Override public void visit(final NodeModel node, final NodeAttributeTableModel model) { for (int i = 0; i < model.getRowCount(); i++) { if (model.getName(i).equals(name)) { final int row = i; final IActor actor = new RemoveAttributeActor(node, model, row); Controller.getCurrentModeController().execute(actor, node.getMap()); } } } }
public void setMinimalDistanceBetweenChildren(NodeModel node, final Quantity<LengthUnits> minimalDistanceBetweenChildren){ if(node != null){ Quantity.assertNonNegativeOrNull(minimalDistanceBetweenChildren); final IActor actor = new ChangeVGapActor(node, minimalDistanceBetweenChildren); Controller.getCurrentModeController().execute(actor, node.getMap()); } } }
public ConnectorModel addConnector(final NodeModel source, final String targetID) { final CreateArrowLinkActor actor = new CreateArrowLinkActor(targetID, source); Controller.getCurrentModeController().execute(actor, source.getMap()); return actor.getArrowLink(); }
@Override public void performSetVisibility(MapModel map, final int index, final boolean isVisible) { final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map); if (attributeRegistry.getElement(index).isVisible() == isVisible) { return; } final IActor actor = new SetAttributeVisibleActor(attributeRegistry, index, isVisible); Controller.getCurrentModeController().execute(actor, map); }
@Override public void performSetColumnWidth(final NodeModel node, final NodeAttributeTableModel model, final int col, final Quantity<LengthUnits> width) { final Quantity<LengthUnits> oldWidth = model.getLayout().getColumnWidth(col); if (width.equals(oldWidth)) { return; } final IActor actor = new SetAttributeColumnWidthActor(node, col, oldWidth, width, model); Controller.getCurrentModeController().execute(actor, node.getMap()); }
@Override public void performReplaceAttributeValue(MapModel map, final String name, final Object oldValue, final Object newValue) { final AttributeRegistry registry = AttributeRegistry.getRegistry(map); final IActor actor = new ReplaceAttributeValueActor(registry, name, oldValue, newValue); Controller.getCurrentModeController().execute(actor, map); final IVisitor replacer = new AttributeChanger(name, oldValue, newValue); final Iterator iterator = new Iterator(replacer); final NodeModel root = map.getRootNode(); iterator.iterate(root); }
private void setLocationChoiceUndoable(final OpenMapsExtension extension, final ICoordinate locationChoosen, final int zoomChoosen) { final Coordinate currentLocation = extension.getLocation(); final int currentZoom = extension.getZoom(); if (!currentLocation.equals(locationChoosen)) { final IActor actor = createUndoActor(extension, locationChoosen, currentLocation, zoomChoosen, currentZoom); Controller.getCurrentModeController().execute(actor, Controller.getCurrentModeController().getController() .getMap()); } }
@Override public void performRemoveAttribute(MapModel map, final String name) { final IVisitor remover = new AttributeRemover(name); final Iterator iterator = new Iterator(remover); ModeController modeController = Controller.getCurrentModeController(); final NodeModel root = modeController.getMapController().getRootNode(); iterator.iterate(root); final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map); final IActor actor = new UnregistryAttributeActor(name, attributeRegistry, map); Controller.getCurrentModeController().execute(actor, map); }
@Override public void performRemoveAttributeValue(MapModel map, final String name, final Object value) { final IVisitor remover = new AttributeValueRemover(name, value); final Iterator iterator = new Iterator(remover); ModeController modeController = Controller.getCurrentModeController(); final NodeModel root = modeController.getMapController().getRootNode(); iterator.iterate(root); final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map); final IActor unregistryActor = new UnregistryAttributeValueActor(attributeRegistry.getElement(name), value); Controller.getCurrentModeController().execute(unregistryActor, map); }