@Override public EditPart createEditPart(EditPart context, Object model) { if (model instanceof DeploymentNode) return new DeploymentEditPart((DeploymentNode) model, containerName); else if (model instanceof PlatformConfigurationNode) return new PlatformConfigurationEditPart((PlatformConfigurationNode) model, containerName); else if (model instanceof ComputingNodeConfigurationNode) return new ComputingNodeConfigurationEditPart((ComputingNodeConfigurationNode) model, containerName); else if (model instanceof ProtectionDomainNode) return new ProtectionDomainEditPart((ProtectionDomainNode) model, containerName); else if (model instanceof DeployedModuleInstanceNode) return new DeployedModuleInstanceEditPart((DeployedModuleInstanceNode) model, containerName); else if (model instanceof DeployedTriggerInstanceNode) return new DeployedTriggerInstanceEditPart((DeployedTriggerInstanceNode) model, containerName); return null; }
@Override public EditPart createEditPart(EditPart context, Object model) { if (model instanceof CompositeNode) return new CompositeEditPart((CompositeNode) model, containerName); else if (model instanceof CompositePropertyNode) return new CompositePropertyEditPart((CompositePropertyNode) model, containerName); else if (model instanceof ComponentNode) return new ComponentEditPart((ComponentNode) model, containerName); else if (model instanceof ComponentPropertyNode) return new ComponentPropertyEditPart((ComponentPropertyNode) model, containerName); else if (model instanceof ServiceNode) return new ServiceEditPart((ServiceNode) model, containerName); else if (model instanceof ReferenceNode) return new ReferenceEditPart((ReferenceNode) model, containerName); else if (model instanceof Link) return new LinkEditPart((Link) model, containerName); return null; }
private Command createCopyCommand(List<Object> selectedObjects) { if (selectedObjects == null || selectedObjects.isEmpty()) { return null; } CopyNodeCommand cmd = new CopyNodeCommand(); Iterator<Object> it = selectedObjects.iterator(); while (it.hasNext()) { Object obj = it.next(); if (!(obj instanceof EditPart)) continue; EditPart ep = (EditPart) obj; if (!(ep.getModel() instanceof GWNode)) continue; GWNode gWNode = (GWNode) ep.getModel(); if (!cmd.isCopyableNode(gWNode)) return null; cmd.addElement(ep); } return cmd; }
@Override public EditPart createEditPart(EditPart context, Object model) { AbstractGraphicalEditPart part = null; if (model instanceof GWGraph) { part = gpart; } else { if (model instanceof SharedVertex) { part = new SharedVertexPart(); } else if (model instanceof StartVertex) { part = new StartVertexPart(); } else if (model instanceof Vertex) { part = new VertexPart(); } else { if (model instanceof GWEdge) { part = new EdgePart(); } } } if (part==null) { throw new RuntimeException (" UnManaged Model " + model.getClass().getName()); } part.setModel(model); return part; }
@Override public Object getAdapter(Class adapter) { EditPart ep = this; if (adapter == IFile.class) { while (ep!=null && !(ep instanceof GraphPart)) { ep = ep.getParent(); } if (ep!=null) { GraphPart gp = (GraphPart) ep; GWGraph model = (GWGraph)gp.getModel(); return model.getFile(); } return null; } return null; }
@Override protected void performCreation(int button) { super.performCreation(button); EditPartViewer viewer = getCurrentViewer(); final Object model = getCreateRequest().getNewObject(); if (model == null || viewer == null) { return; } final Object o = getCurrentViewer().getEditPartRegistry().get(model); if(o instanceof EditPart) { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { EditPart part = (EditPart)o; Request request = new DirectEditRequest(); part.performRequest(request); } }); } }
/** * @return the graph */ public GWGraph getGraph() { if (graph==null) { List<SWTBotGefEditPart> parts = editor.editParts(new BaseMatcher<EditPart>() { @Override public boolean matches(Object item) { if (item instanceof org.gw4e.eclipse.studio.part.editor.GraphPart) return true; if (item instanceof org.gw4e.eclipse.studio.part.editor.VertexPart) return true; if (item instanceof org.gw4e.eclipse.studio.part.editor.EdgePart) return true; return false; } @Override public void describeTo(Description description) { } }); if (parts==null || parts.size() ==0) { throw new RuntimeException("Empty Graph"); } graph = getGraph (parts.get(0)); } return graph; }
/** * Refresh {@link EditPart} in depth. */ private void deepRefresh() { refresh(); for (Branch branch : getModelChildren()) { final EditPart branchEditPart = (EditPart)getViewer().getEditPartRegistry().get(branch); branchEditPart.refresh(); for (Choice choice : branch.getChoices()) { final EditPart choiceEditPart = (EditPart)getViewer().getEditPartRegistry().get(choice); choiceEditPart.refresh(); for (PossibleStep possibleStep : choice.getPossibleSteps()) { final EditPart possibleStepEditPart = (EditPart)getViewer().getEditPartRegistry().get( possibleStep); possibleStepEditPart.refresh(); } } } }
@Override public EditPart createEditPart(EditPart context, Object model) { final EditPart res; if (model instanceof PossibleStep) { res = new PossibleStepEditPart(withLabel); } else if (model instanceof Connection) { res = new ConnectionEditPart(); } else if (model instanceof Choice) { res = new ChoiceEditPart(); } else if (model instanceof Branch) { res = new BranchEditPart(); } else if (model instanceof TimelineWindow) { res = new TimelineWindowEditPart(); } else { throw new IllegalStateException("don't know what to do with " + model.getClass().getName()); } res.setModel(model); return res; }
/** * Return true if watch point enable otherwise false * * @return boolean */ public boolean checkWatcher(Component selectedComponent, String portName) { ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class); for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) { EditPart editPart = iterator.next(); if (editPart instanceof ComponentEditPart) { Component comp = ((ComponentEditPart) editPart).getCastedModel(); if (comp.equals(selectedComponent)) { List<PortEditPart> portEditParts = editPart.getChildren(); for (AbstractGraphicalEditPart part : portEditParts) { if (part instanceof PortEditPart) { String port_Name = ((PortEditPart) part).getCastedModel().getTerminal(); if (port_Name.equals(portName)) { return ((PortEditPart) part).getPortFigure().isWatched(); } } } } } } return false; }
/** * Collect all subjob file from active editor, also check for nested subjob. * @return list of subjob. */ public List<String> getSubJobList() { ArrayList<String> subJobList=new ArrayList<>(); ELTGraphicalEditor editor = (ELTGraphicalEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if (editor != null && editor instanceof ELTGraphicalEditor) { GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor) .getAdapter(GraphicalViewer.class); for (Iterator<EditPart> ite = graphicalViewer.getEditPartRegistry().values().iterator(); ite.hasNext();) { EditPart editPart = ite.next(); if (editPart instanceof ComponentEditPart) { Component component = ((ComponentEditPart) editPart).getCastedModel(); if(Constants.SUBJOB_COMPONENT.equals(component.getComponentName())){ String subJobPath=(String) component.getProperties().get(Constants.PATH_PROPERTY_NAME); subJobList.add(subJobPath); checkNestedSubJob(subJobList, subJobPath); } } } } return subJobList; }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { if (DebugHelper.INSTANCE.hasMoreWatchPoints()) { ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().getActiveEditor(); GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor) .getAdapter(GraphicalViewer.class); for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator .hasNext();) { EditPart editPart = (EditPart) iterator.next(); if (editPart instanceof ComponentEditPart) { Component comp = ((ComponentEditPart) editPart).getCastedModel(); comp.clearWatchers(); } else if (editPart instanceof PortEditPart) { ((PortEditPart) editPart).getPortFigure().removeWatcherColor(); ((PortEditPart) editPart).getPortFigure().setWatched(false); ((PortEditPart) editPart).getCastedModel().setWatched(false); } } showMessage(Messages.WATCH_POINT_REMOVED_SUCCESSFULLY); } else { showMessage(Messages.NO_WATCH_POINT_AVAILABLE); } return null; }
/** * Gets the unique job id. * * @return the unique job id */ private String getUniqueJobId(){ ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); String uniqueJobId = editor.getJobId(); isJobUpdated =false; GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class); for (Iterator<EditPart> ite = graphicalViewer.getEditPartRegistry().values().iterator();ite.hasNext();){ EditPart editPart = (EditPart) ite.next(); if (editPart instanceof ComponentEditPart){ Component component = ((ComponentEditPart) editPart) .getCastedModel(); if(component.getStatus()!= ComponentExecutionStatus.BLANK){ isJobUpdated = true; break; } } } return uniqueJobId; }
/** * Clear tracking status for editor. * * @param editor * the editor */ public void clearTrackingStatusForEditor(ELTGraphicalEditor editor) { GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor) .getAdapter(GraphicalViewer.class); for (Iterator<EditPart> ite = graphicalViewer.getEditPartRegistry() .values().iterator(); ite.hasNext();) { EditPart editPart = ite.next(); if (editPart instanceof ComponentEditPart) { Component component = ((ComponentEditPart) editPart) .getCastedModel(); component.updateStatus(ComponentExecutionStatus.BLANK.value()); } else if (editPart instanceof LinkEditPart) { ((LinkEditPart) editPart).clearRecordCountAtPort(); } } }
/** * This function will check watch point in the graph and return true if any watch point exist * */ public boolean hasMoreWatchPoints(){ IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if(activeEditor instanceof ELTGraphicalEditor){ ELTGraphicalEditor editor=(ELTGraphicalEditor) activeEditor; if(editor!=null){ GraphicalViewer graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class); for (Object objectEditPart : graphicalViewer.getEditPartRegistry().values()){ if(objectEditPart instanceof ComponentEditPart){ List<PortEditPart> portEditParts = ((EditPart) objectEditPart).getChildren(); for(AbstractGraphicalEditPart part : portEditParts) { if(part instanceof PortEditPart){ boolean isWatch = ((PortEditPart)part).getPortFigure().isWatched(); if(isWatch){ return isWatch; } } } } } } } return false; }
private void removeWatch(Port sourcePort, Component sourceComponent){ ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); GraphicalViewer graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class); for (Object objectEditPart : graphicalViewer.getEditPartRegistry().values()) { EditPart editPart = (EditPart) objectEditPart; if(editPart instanceof ComponentEditPart) { Component comp = ((ComponentEditPart)editPart).getCastedModel(); if(comp.equals(sourceComponent)){ List<PortEditPart> portEditParts = editPart.getChildren(); for(AbstractGraphicalEditPart part:portEditParts) { if(part instanceof PortEditPart){ if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){ ((PortEditPart)part).getPortFigure().removeWatcherColor(); ((PortEditPart)part).getPortFigure().setWatched(false); } } } } } } }
private void removeWatch(Port sourcePort, Component sourceComponent){ ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); GraphicalViewer graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class); for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) { EditPart editPart = (EditPart) iterator.next(); if(editPart instanceof ComponentEditPart) { Component comp = ((ComponentEditPart)editPart).getCastedModel(); if(comp.equals(sourceComponent)){ List<PortEditPart> portEditParts = editPart.getChildren(); for(AbstractGraphicalEditPart part:portEditParts) { if(part instanceof PortEditPart){ if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){ ((PortEditPart)part).getPortFigure().removeWatcherColor(); ((PortEditPart)part).getPortFigure().setWatched(false); } } } } } } }
@Override public void mouseHover(MouseEvent e) { final java.awt.Point mouseLocation1 = MouseInfo.getPointerInfo().getLocation(); EditPart paletteInternalController = viewer.findObjectAt(new Point( e.x, e.y)); if(paletteInternalController.getModel() instanceof CombinedTemplateCreationEntry){ setGenericComponent(paletteInternalController); // Hide tooltip if already showing hidePaletteToolTip(); showToolTipWithDelay(mouseLocation1); } }
/** * * set genericComponent to selected/hovered component in palette * * @param paletteInternalController * @return */ private CreateRequest setGenericComponent(EditPart paletteInternalController) { CombinedTemplateCreationEntry addedPaletteTool = (CombinedTemplateCreationEntry) paletteInternalController .getModel(); CreateRequest componentRequest = new CreateRequest(); componentRequest.setFactory(new SimpleFactory((Class) addedPaletteTool .getTemplate())); genericComponent = (Component) componentRequest .getNewObject(); logger.debug("genericComponent - " + genericComponent.toString()); return componentRequest; }
private void populateDeleteCommands(List<Object> selectedObjects, ComponentDeleteCommand componentDeleteCommand, LinkDeleteCommand linkDeleteCommand) { Model node; for(Object obj:selectedObjects) { if(obj instanceof ComponentEditPart || obj instanceof CommentBoxEditPart) { node = (Model) ((EditPart)obj).getModel(); componentDeleteCommand.addComponentToDelete((Model)node); } if(obj instanceof LinkEditPart) { node = (Link) ((EditPart)obj).getModel(); linkDeleteCommand.addLinkToDelete((Link)node); } } }
@Override public EditPart createEditPart(EditPart context, Object model) { EditPart editPart = null; if (model instanceof Schema) { editPart = new SchemaEditPart(); } else if (model instanceof Table) { editPart = new TableEditPart(); } else if (model instanceof Column) { editPart = new ColumnEditPart(); } else if (model instanceof Connection) { editPart = new ConnectionEditPart(); } if(editPart!=null){ editPart.setModel(model); } return editPart; }
@Override protected Command createMoveChildCommand(EditPart child, EditPart after) { if (child == after || getHost().getChildren().size() == 1) { return null; } int index = getHost().getChildren().indexOf(child); if (index == 0) { if (after == null) return null; } else { if (after == getHost().getChildren().get(index - 1)) return null; } ColumnReorderCommand cmd = new ColumnReorderCommand((Table) getHost().getModel(), (Column) child.getModel()); if (after != null) { cmd.setAfterColumn((Column) after.getModel()); } return cmd; }
@SuppressWarnings("unchecked") @Override protected EditPart getInsertionReference(Request request) { int y = ((ChangeBoundsRequest) request).getLocation().y; List<ColumnEditPart> columnEditParts = getHost().getChildren(); ColumnEditPart afterColumn = null; for (Iterator<ColumnEditPart> iter = columnEditParts.iterator(); iter.hasNext();) { ColumnEditPart columnEditPart = iter.next(); Rectangle r = columnEditPart.getFigure().getBounds(); if (y < r.y) { return afterColumn; } afterColumn = columnEditPart; } return afterColumn; }
@Override protected boolean calculateEnabled() { if(getSelectedObjects().isEmpty()) return false; if(!editor.isLastDateSelected()) return false; for(Object selectedObject : getSelectedObjects()){ if(!(selectedObject instanceof DwAttributeEditPart)){ return false; }else{ if(!(((EditPart)selectedObject).getModel() instanceof HyNumberAttribute)){ return false; } } } return true; }
@Override public void refresh(){ this.figure.erase(); super.refresh(); for(Object child : this.getChildren()){ if(child instanceof DwParentChildConnectionEditPart) ((EditPart)child).refresh(); if(child instanceof DwFeatureEditPart){ ((EditPart)child).refresh(); } if(child instanceof DwEnumEditPart){ ((EditPart)child).refresh(); } } }
public EditPart createEditPart(EditPart arg0, Object arg1) { EditPart part = null; if (arg1 instanceof CFGGraph){ part = new CFGGraphEditPart(); } else if (arg1 instanceof CFGNode){ part = new CFGNodeEditPart(); } else if (arg1 instanceof CFGEdge){ part = new CFGEdgeEditPart(); } else if (arg1 instanceof CFGFlowData){ part = new FlowDataEditPart(); } else if (arg1 instanceof CFGPartialFlowData){ part = new PartialFlowDataEditPart(); } else if (arg1 instanceof CFGFlowInfo){ part = new FlowInfoEditPart(); } else if (arg1 instanceof CFGNodeData){ part = new NodeDataEditPart(); } part.setModel(arg1); return part; }
public EditPart createEditPart(EditPart arg0, Object arg1) { EditPart part = null; if (arg1 instanceof Graph){ part = new GraphEditPart(); } else if (arg1 instanceof SimpleNode){ part = new SimpleNodeEditPart(); } else if (arg1 instanceof Edge){ part = new EdgeEditPart(); } else if (arg1 instanceof ComplexNode){ part = new ComplexNodeEditPart(); } part.setModel(arg1); return part; }
private Object getTargetModel(final DragSourceEvent event) { final List editParts = dragSourceViewer.getSelectedEditParts(); if (editParts.size() != 1) { // ドラッグアンドドロップは選択されているオブジェクトが1つのときのみ可能とする return null; } final EditPart editPart = (EditPart) editParts.get(0); final Object model = editPart.getModel(); if (model instanceof NormalColumn || model instanceof ColumnGroup || model instanceof Word) { return model; } return null; }
/** * {@inheritDoc} */ @Override public void execute(final Event event) { final ERDiagram diagram = getDiagram(); final List selectedEditParts = getTreeViewer().getSelectedEditParts(); final EditPart editPart = (EditPart) selectedEditParts.get(0); final ERTable table = (ERTable) editPart.getModel(); final IndexDialog dialog = new IndexDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, table); if (dialog.open() == IDialogConstants.OK_ID) { final CreateIndexCommand command = new CreateIndexCommand(diagram, dialog.getResultIndex()); this.execute(command); } }
private Command createAlignmentCommand() { final AlignmentRequest request = new AlignmentRequest(RequestConstants.REQ_ALIGN); request.setAlignmentRectangle(calculateAlignmentRectangle(request)); request.setAlignment(alignment); final List editparts = getOperationSet(request); if (editparts.size() < 2) return null; final CompoundCommand command = new CompoundCommand(); command.setDebugLabel(getText()); for (int i = 0; i < editparts.size(); i++) { final EditPart editpart = (EditPart) editparts.get(i); command.add(editpart.getCommand(request)); } return command; }
protected void execute(final Event event) { final GraphicalViewer viewer = getGraphicalViewer(); final List<Command> commandList = new ArrayList<Command>(); for (final Object object : viewer.getSelectedEditParts()) { final List<Command> subCommandList = getCommand((EditPart) object, event); commandList.addAll(subCommandList); } if (!commandList.isEmpty()) { final CompoundCommand compoundCommand = new CompoundCommand(); for (final Command command : commandList) { compoundCommand.add(command); } this.execute(compoundCommand); } }
private List<NormalColumn> getSelectedForeignKeyColulmnList() { final List<NormalColumn> foreignKeyColulmnList = new ArrayList<NormalColumn>(); final TableViewEditPart parent = (TableViewEditPart) getParent(); for (final Object object : parent.getTargetConnections()) { final ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; final int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { final ConnectionElement connectionElement = (ConnectionElement) connectionEditPart.getModel(); if (connectionElement instanceof Relation) { final Relation relation = (Relation) connectionElement; foreignKeyColulmnList.addAll(relation.getForeignKeyColumns()); } } } return foreignKeyColulmnList; }
/** * {@inheritDoc} */ @Override public EditPart getTargetEditPart(final Request request) { if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_COLUMN_GROUP.equals(request.getType()) || ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN_GROUP.equals(request.getType())) { final DirectEditRequest editRequest = (DirectEditRequest) request; final TableView tableView = (TableView) getHost().getModel(); final ColumnGroup columnGroup = (ColumnGroup) ((Map) editRequest.getDirectEditFeature()).get("group"); if (!tableView.getColumns().contains(columnGroup)) { return getHost(); } } else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_WORD.equals(request.getType())) { return getHost(); } else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN.equals(request.getType())) { return getHost(); } return super.getTargetEditPart(request); }
private Object getTargetModel(DragSourceEvent event) { List editParts = dragSourceViewer.getSelectedEditParts(); if (editParts.size() != 1) { // ドラッグアンドドロップは選択されているオブジェクトが1つのときのみ可能とする return null; } EditPart editPart = (EditPart) editParts.get(0); Object model = editPart.getModel(); if (model instanceof NormalColumn || model instanceof ColumnGroup || model instanceof Word) { return model; } return null; }
/** * {@inheritDoc} */ @Override public void execute(Event event) { ERDiagram diagram = this.getDiagram(); List selectedEditParts = this.getTreeViewer().getSelectedEditParts(); EditPart editPart = (EditPart) selectedEditParts.get(0); ERTable table = (ERTable) editPart.getModel(); IndexDialog dialog = new IndexDialog(PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(), null, table); if (dialog.open() == IDialogConstants.OK_ID) { CreateIndexCommand command = new CreateIndexCommand(diagram, dialog .getResultIndex()); this.execute(command); } }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") protected boolean calculateEnabled() { List<EditPart> list = new ArrayList<EditPart>(this.getSelectedObjects()); if (list.isEmpty()) { return false; } if (list.size() == 1 && list.get(0) instanceof ModelPropertiesEditPart || list.get(0) instanceof ERDiagramEditPart) { return false; } return true; }
private Command createAlignmentCommand() { AlignmentRequest request = new AlignmentRequest( RequestConstants.REQ_ALIGN); request.setAlignmentRectangle(calculateAlignmentRectangle(request)); request.setAlignment(alignment); List editparts = getOperationSet(request); if (editparts.size() < 2) return null; CompoundCommand command = new CompoundCommand(); command.setDebugLabel(getText()); for (int i = 0; i < editparts.size(); i++) { EditPart editpart = (EditPart) editparts.get(i); command.add(editpart.getCommand(request)); } return command; }
/** * {@inheritDoc} */ @Override protected List<Command> getCommand(EditPart editPart, Event event) { List<Command> commandList = new ArrayList<Command>(); if (editPart instanceof IResizable) { NodeElement nodeElement = (NodeElement) editPart.getModel(); Category currentCategory = getDiagram().getCurrentCategory(); MoveElementCommand command = new MoveElementCommand( this.getDiagram(), ((NodeElementEditPart) editPart).getFigure() .getBounds(), nodeElement.getX(currentCategory), nodeElement.getY(currentCategory), -1, -1, nodeElement); commandList.add(command); } return commandList; }
/** * {@inheritDoc} */ @Override protected List<Command> getCommand(EditPart editPart, Event event) { List<Command> commandList = new ArrayList<Command>(); if (editPart instanceof IResizable) { NodeElement nodeElement = (NodeElement) editPart.getModel(); Category currentCategory = this.getDiagram().getCurrentCategory(); MoveElementCommand command = new MoveElementCommand(this .getDiagram(), ((NodeElementEditPart) editPart).getFigure() .getBounds(), nodeElement.getX(currentCategory), nodeElement.getY(currentCategory), -1, -1, nodeElement); commandList.add(command); } return commandList; }