@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; }
/** * 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; }
/** * 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); } } } } } } }
public ISelectionChangedListener createISelectionChangedListener() { return new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { StructuredSelection sSelection = (StructuredSelection) event .getSelection(); AbstractGraphicalEditPart selectedEditPart = (AbstractGraphicalEditPart) sSelection .getFirstElement(); defaultComponentLocation.setLocation(selectedEditPart .getFigure().getBounds().x, selectedEditPart .getFigure().getBounds().y); } }; }
/** * Sets the figure to visible if the model is visible to the current date or hides it if not. */ protected void refreshVisibility(){ Object model = getModel(); if(model instanceof DwEditorChangeableElement){ model = ((DwEditorChangeableElement)model).getWrappedModelElement(); } if(model instanceof HyTemporalElement){ HyTemporalElement temporalModel = (HyTemporalElement)model; AbstractGraphicalEditPart parent = (AbstractGraphicalEditPart)getParent(); Rectangle constraint = null; if(HyEvolutionUtil.isValid(temporalModel, featureModel.getSelectedDate())){ figure.setVisible(true); constraint = getFigureConstraint(); }else{ figure.setVisible(false); constraint = getFigureConstraint().setSize(0, 0); } if(parent != null) parent.setLayoutConstraint(this, figure, constraint); } }
protected IFigure createFigure() { Node node = (Node)getModel(); GraphEditPart graphEditPart = (GraphEditPart)getParent().getParent(); NodeFigure nodeFigure = graphEditPart.getNodeFigure(node); node.setView(nodeFigure); if (node.getTags() != null) { Iterator iter = node.getTags().iterator(); while (iter.hasNext()) { Node tag = (Node)iter.next(); nodeFigure.addTag(tag); } } nodeFigure.endLayout(); int index; if (graphEditPart.isChronologicalMode()) index = node.getGraphIndex(); else index = node.getBranchIndex(); Rectangle rect = new Rectangle(NODE_OFFSET_X, 10+BranchEditPart.BRANCH_HEIGHT+index*NODE_OFFSET_Y, NODE_WIDTH, NODE_HEIGHT); ((AbstractGraphicalEditPart)getParent()).getFigure().getLayoutManager().setConstraint(nodeFigure, rect); return nodeFigure; }
public static Dimension getSafeParentViewSize(ElementEditPart ep){ AbstractGraphicalEditPart parent = (AbstractGraphicalEditPart)ep.getParent(); Dimension parentSize = parent != null ? parent.getFigure().getClientArea().getSize() : new Dimension(100, 00); if (parent instanceof WindowEditPart){ WindowEditPart windowEP = (WindowEditPart)parent; WindowFigure windowFigure = (WindowFigure)windowEP.getFigure(); parentSize.height -= windowFigure.getTitleBarHeight(); } if (parent instanceof ScreenEditPart){ List<?> children = ((ScreenEditPart) parent).getModelChildren_(); for (Object child : children) { if (child instanceof TabGroup) { parentSize.height -= ep.getSupport().modelToView(ScreenManager.getTabGroupSize(ep.getModel()).height); break; } } } return parentSize; }
protected void addEdges(AbstractGraphicalEditPart diagram) { for (Object obj : diagram.getChildren()) { AbstractGraphicalEditPart part = (AbstractGraphicalEditPart) obj; for (Object item : part.getSourceConnections()) { RelationshipPart rpart = (RelationshipPart) item; Node source = (Node) partToNodesMap.get(rpart.getSource()); Node target = (Node) partToNodesMap.get(rpart.getTarget()); if (source != null && target != null) { Edge e = new Edge(rpart, source, target); e.weight = 2; graph.edges.add(e); partToNodesMap.put(rpart, e); } } } }
protected void applyChildrenResults(AbstractGraphicalEditPart diagram) { List<AbstractGraphicalEditPart> children = diagram.getChildren(); Rectangle r = diagram.getFigure().getBounds(); for (AbstractGraphicalEditPart tp : children) { Node n = (Node) partToNodesMap.get(tp); IFigure f = tp.getFigure(); Dimension psize = f.getPreferredSize(); f.setBounds(new Rectangle(r.x + n.x, r.y + n.y, psize.width, psize.height)); List<RelationshipPart> sc = tp.getSourceConnections(); for (RelationshipPart rp : sc) applyResults(rp); } }
@Test public void testCanExecute() { StepCommand obj = new StepCommand(); obj.setEditPart(new AbstractGraphicalEditPart() { @Override protected void createEditPolicies() { // TODO Auto-generated method stub } @Override protected IFigure createFigure() { // TODO Auto-generated method stub return null; } }); obj.setEditorPart(new ORMMultiPageEditor()); obj.setNewContent(new ORMMultiPageEditor()); assertTrue(obj.canExecute()); }
@Test public void testExecute() { StepCommand obj = new StepCommand(); obj.setEditPart(new AbstractGraphicalEditPart() { @Override protected void createEditPolicies() { // TODO Auto-generated method stub } @Override protected IFigure createFigure() { // TODO Auto-generated method stub return null; } }); obj.setEditorPart(new ORMMultiPageEditor()); obj.setNewContent(new ORMMultiPageEditor()); obj.execute(); assertTrue(true); }
/** * {@inheritDoc} This action is enabled when the selected element is the child of * {@link ORMSegmentEditPart} also a attribute or a operation. * */ @Override protected boolean calculateEnabled() { if (getSelectedObjects().isEmpty() || getSelectedObjects().size() > 1) { return false; } if (getSelectedObjects().get(0) instanceof EditPart) { if (((EditPart) getSelectedObjects().get(0)).getParent() instanceof ORMSegmentEditPart) { editPart = (AbstractGraphicalEditPart) ((AbstractGraphicalEditPart) getSelectedObjects().get(0)) .getParent(); return true; } } return false; }
public void refreshFigure( ) { refreshBorder( getListHandleAdapt( ).getHandle( ), (BaseBorder) getFigure( ).getBorder( ) ); ( (ListFigure) getFigure( ) ).setRecommendSize( getListHandleAdapt( ).getSize( ) ); ( (SectionBorder) ( getFigure( ).getBorder( ) ) ).setPaddingInsets( getListHandleAdapt( ).getPadding( getFigure( ).getInsets( ) ) ); refreshMargin( ); refreshBackground( (DesignElementHandle) getModel( ) ); ( (AbstractGraphicalEditPart) getParent( ) ).setLayoutConstraint( this, getFigure( ), getConstraint( ) ); markDirty( ); }
@Override public EditPart createEditPart(EditPart context, Object model) { AbstractGraphicalEditPart part = null; if (model instanceof ProductSystemNode) part = new ProductSystemPart(); else if (model instanceof ProcessNode) part = new ProcessPart(); else if (model instanceof ExchangeNode) part = new ExchangePart(); else if (model instanceof IONode) part = new IOPart(); else if (model instanceof Link) part = new LinkPart(); if (part != null) part.setModel(model); return part; }
private void adjustExistingPorts(){ List<AbstractGraphicalEditPart> childrenEditParts = getChildren(); PortEditPart portEditPart = null; for(AbstractGraphicalEditPart part:childrenEditParts) { if(part instanceof PortEditPart){ portEditPart = (PortEditPart) part; portEditPart.adjustPortFigure(getCastedModel().getLocation()); } } }
private void adjustComponentLabelPosition(){ List<AbstractGraphicalEditPart> childrenEditParts = getChildren(); for(AbstractGraphicalEditPart part:childrenEditParts) { if(part instanceof ComponentLabelEditPart){ ComponentLabelEditPart componentLabelEditPart = (ComponentLabelEditPart) part; componentLabelEditPart.adjustLabelFigure(getCastedModel().getLocation(), getCastedModel().getSize()); break; } } }
/** * This function returns that watcher is added on selected port * */ public boolean checkWatcher(Component selectedComponent, String portName) { EditPart editPart = (EditPart) selectedComponent.getComponentEditPart(); List<PortEditPart> portEdit = editPart.getChildren(); for(AbstractGraphicalEditPart part : portEdit){ if(part instanceof PortEditPart){ String portLabel = ((PortEditPart) part).getCastedModel().getTerminal(); if(portLabel.equals(portName)){ return ((PortEditPart) part).getPortFigure().isWatched(); } } } return false; }
private boolean checkWatcher(Component selectedComponent, String portName) { ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); IPath path = new Path(editor.getTitleToolTip()); String currentJob = path.lastSegment().replace(Constants.JOB_EXTENSION, ""); watchRecordInner.setCurrentJob(currentJob); GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class); String uniqueJobId = editor.getJobId(); watchRecordInner.setUniqueJobId(uniqueJobId); 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(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; }
private void changePortColor(Component selectedComponent, String portName){ EditPart editPart = (EditPart) selectedComponent.getComponentEditPart(); List<PortEditPart> portEdit = editPart.getChildren(); for(AbstractGraphicalEditPart part : portEdit){ if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){ ((PortEditPart)part).getPortFigure().changeWatcherColor(); ((PortEditPart)part).getCastedModel().setWatched(true); ((PortEditPart)part).getPortFigure().setWatched(true); ((PortEditPart)part).getPortFigure().repaint(); } } }
private void changePortColor(Component selectedComponent, String portName){ EditPart editPart = (EditPart) selectedComponent.getComponentEditPart(); List<PortEditPart> portEdit = editPart.getChildren(); for(AbstractGraphicalEditPart part : portEdit){ if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){ ((PortEditPart)part).getPortFigure().removeWatcherColor(); ((PortEditPart)part).getPortFigure().setWatched(false); ((PortEditPart)part).getCastedModel().setWatched(false); } } }
@Override public void run(){ StructuredSelection selection = (StructuredSelection)this.getSelection(); if(selection.getFirstElement() instanceof AbstractGraphicalEditPart){ AbstractGraphicalEditPart part = (AbstractGraphicalEditPart)selection.getFirstElement(); execute(part.getModel()); } }
public EditPart createEditPart(EditPart context, Object model) { EditPart editPart = null; if (model instanceof String) { final String s = (String) model; return new AbstractGraphicalEditPart() { protected IFigure createFigure() { return new Label(s); } protected void createEditPolicies() { } }; } else if (model instanceof Graph) { editPart = new GraphEditPart(viewer); } else if (model instanceof Branch) { editPart = new BranchEditPart(); } else if (model instanceof Path) { editPart = new PathEditPart(); } else if (model instanceof Node) { editPart = new RevisionEditPart(); } if (editPart == null) throw new RuntimeException("cannot create EditPart for "+model.getClass().getName()+" class"); else editPart.setModel(model); return editPart; }
protected IFigure createFigure() { Figure f = new Figure(); f.setBackgroundColor(ColorConstants.white); f.setOpaque(true); XYLayout layout = new XYLayout(); f.setLayoutManager(layout); Branch branch = (Branch)getModel(); Rectangle rect = new Rectangle(10+branch.getIndex()*BRANCH_OFFSET, 10, BRANCH_WIDTH, -1); ((AbstractGraphicalEditPart)getParent()).getFigure().getLayoutManager().setConstraint(f, rect); return f; }
protected void refreshVisuals() { RoundedRectangle f = (RoundedRectangle) getFigure(); setupLayoutManager(); MFrom mfrom = getModel(); getFigure().setToolTip(new Label(QueryWriter.writeSubQuery(mfrom.getParent()))); AbstractGraphicalEditPart parent = (AbstractGraphicalEditPart) getParent(); Point location = f.getLocation(); if (mfrom.getPropertyActualValue(MFromTable.PROP_X) != null) location.x = (Integer) mfrom.getPropertyValue(MFromTable.PROP_X); if (mfrom.getPropertyActualValue(MFromTable.PROP_Y) != null) location.y = (Integer) mfrom.getPropertyValue(MFromTable.PROP_Y); parent.setLayoutConstraint(this, f, new Rectangle(location.x, location.y, -1, -1)); }
public void layoutDiagram(AbstractGraphicalEditPart diagram) { partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>(); graph = new DirectedGraph(); graph.setDirection(PositionConstants.EAST); addNodes(diagram); Rectangle r = diagram.getFigure().getBounds(); if (r.x < -1000 || r.y < -1000) return; if (graph.nodes.size() > 0) { addEdges(diagram); new NodeJoiningDirectedGraphLayout().visit(graph); applyChildrenResults(diagram); } }
protected void addNodes(AbstractGraphicalEditPart diagram) { for (Object obj : diagram.getChildren()) { AbstractGraphicalEditPart part = (AbstractGraphicalEditPart) obj; Node n = new Node(part); Dimension psize = part.getFigure().getPreferredSize(400, 300); n.width = psize.width; n.height = psize.height; n.setPadding(PADDING); partToNodesMap.put(part, n); graph.nodes.add(n); } }
protected Command createCommand(AbstractGraphicalEditPart axis, List<Dataset> datasets) { CompoundCommand compoundCommand = new CompoundCommand(); // get the dimensions of the first dataset final String units; if (datasets != null && datasets.size() > 0 && datasets.get(0).getUnits() != null) { final Dataset dataset = datasets.get(0); units = dataset.getUnits(); } else { units = "[dimensionless]"; } StackedchartsFactoryImpl factory = new StackedchartsFactoryImpl(); DependentAxis newAxis = factory.createDependentAxis(); newAxis.setName(units); newAxis.setAxisType(factory.createNumberAxis()); final ChartPaneEditPart.AxisLandingPad pad = (ChartPaneEditPart.AxisLandingPad) axis.getModel(); // find out which list (min/max) this axis is currently on final EList<DependentAxis> destination = pad.getPos() == ChartPanePosition.MIN ? pad.getChart().getMinAxes() : pad.getChart().getMaxAxes(); compoundCommand.add(new AddAxisToChartCommand(destination, newAxis)); AddDatasetsToAxisCommand addDatasetsToAxisCommand = new AddDatasetsToAxisCommand(newAxis, datasets .toArray(new Dataset[datasets.size()])); compoundCommand.add(addDatasetsToAxisCommand); return compoundCommand; }
protected Command createCommand(AbstractGraphicalEditPart axis, List<Dataset> datasets) { AddDatasetsToAxisCommand addDatasetsToAxisCommand = new AddDatasetsToAxisCommand((DependentAxis) axis.getModel(), datasets.toArray(new Dataset[datasets.size()])); return addDatasetsToAxisCommand; }
private void openDetailByKeyCode(KeyEvent event, AbstractGraphicalEditPart targetEditPart) { if (targetEditPart != null && isOpenDetailKeyCode(event)) { final Request request = new Request(); request.setType(RequestConstants.REQ_OPEN); targetEditPart.performRequest(request); } }
/** * The constructor of this class. This class is initialized through calling the constructor of the * parent class and through setting the global variables. * */ public ORMShapeComponentEditPolicy(EditPart host) { super(); ORMGraphicalEditor editor = (ORMGraphicalEditor) ((DefaultEditDomain) host.getViewer().getEditDomain()).getEditorPart(); editorPart = (ORMMultiPageEditor) editor.getParentEditor(); hostEditPart = (AbstractGraphicalEditPart) host; hostModel = hostEditPart.getModel(); }
@Override protected Command createAddCommand(ChangeBoundsRequest request, EditPart child, Object constraint) { CompoundCommand result = new CompoundCommand(); @SuppressWarnings("unchecked") List<AbstractGraphicalEditPart> parts = request.getEditParts(); Rectangle r = (Rectangle) constraint; for (AbstractGraphicalEditPart part : parts) { if (part.getModel() instanceof Shape) { Rectangle newBoundarie = r; ORMAddCommand addCommand = new ORMAddCommand(); addCommand.setParent((Model) getHost().getModel()); addCommand.setChild((Shape) part.getModel()); Shape n = (Shape) part.getModel(); org.framed.orm.geometry.Rectangle rec = n.getBoundaries(); int width = Math.abs(rec.getTopLeft().getX() - rec.getBottomRight().getX()); int heigth = Math.abs(rec.getTopLeft().getY() - rec.getBottomRight().getY()); Dimension dim = new Dimension(width, heigth); newBoundarie = new Rectangle(r.getLocation(), dim); addCommand.setBoundaries(createModelReactangle(newBoundarie)); addCommand.setLabel("Adding"); addCommand.setDebugLabel("Adding"); result.add(addCommand); } } return result; }
/** * {@inheritDoc} * <p> * The action is enabled if the selected entity on the editor is a {@link ORMShapeEditPart} * instance , where the Shape is from type compartmenttype or group, and the method testEnabled() * returns true. * </p> */ @Override protected boolean calculateEnabled() { if (getSelectedObjects().isEmpty() || getSelectedObjects().size() > 1) { return false; } else if (getSelectedObjects().get(0) instanceof ORMSuperShapeEditPart) { editPart = (AbstractGraphicalEditPart) getSelectedObjects().get(0); if (((Shape) editPart.getModel()).getType().equals(Type.COMPARTMENT_TYPE) || ((Shape) editPart.getModel()).getType().equals(Type.GROUP)) { return testEnabled(getId()); } } return false; }
public void refreshFigure( ) { refreshBorder( (DesignElementHandle) getModel( ), new LineBorder( ) ); getExtendedElementUI( ).updateFigure( getExtendedItemHandle( ), getFigure( ) ); ( (AbstractGraphicalEditPart) getParent( ) ).setLayoutConstraint( this, getFigure( ), getConstraint( ) ); }
public void refreshFigure( ) { ((MultipleLayout)getFigure( ).getLayoutManager( )).markDirty( ); ( (AbstractGraphicalEditPart) getParent( ) ).setLayoutConstraint( this, getFigure( ), getConstraint( ) ); //do noting }
public void refreshFigure( ) { StyleHandle style = ( (DesignElementHandle) getModel( ) ).getPrivateStyle( ); //( (LabelFigure) getFigure( ) ).setDirection( style.getTextDirection( ) ); // bidi_hcg ( (LabelFigure) getFigure( ) ).setDirection( getTextDirection( ) ); // bidi_hcg ( (LabelFigure) getFigure( ) ).setText( getText( ) ); ( (LabelFigure) getFigure( ) ).setFont( getFont( ) ); ( (LabelFigure) getFigure( ) ).setTextUnderline( style.getTextUnderline( ) ); ( (LabelFigure) getFigure( ) ).setTextLineThrough( style.getTextLineThrough( ) ); ( (LabelFigure) getFigure( ) ).setTextOverline( style.getTextOverline( ) ); ( (LabelFigure) getFigure( ) ).setTextAlign( style.getTextAlign( ) ); ( (LabelFigure) getFigure( ) ).setVerticalAlign( style.getVerticalAlign( ) ); ( (LabelFigure) getFigure( ) ).setDisplay( style.getDisplay( ) ); ( (LabelFigure) getFigure( ) ).setRecommendSize( getLabelAdapter( ).getSize( ) ); ( (LabelFigure) getFigure( ) ).setFixLayout( isFixLayout( ) ); ( (AbstractGraphicalEditPart) getParent( ) ).setLayoutConstraint( this, getFigure( ), getConstraint( ) ); ( (LabelFigure) getFigure( ) ).setForegroundColor( ColorManager.getColor( getForegroundColor( (ReportItemHandle) getModel( ) ) ) ); refreshBorder( (DesignElementHandle) getModel( ), new LineBorder( ) ); Insets pist = getLabelAdapter( ).getPadding( getFigure( ).getInsets( ) ); ( (LineBorder) ( getFigure( ).getBorder( ) ) ).setPaddingInsets( pist ); if ( !hasText( ) ) ( (LabelFigure) getFigure( ) ).setForegroundColor( ReportColorConstants.ShadowLineColor ); else ( (LabelFigure) getFigure( ) ).setForegroundColor( ColorManager.getColor( getForegroundColor( (ReportItemHandle) getModel( ) ) ) ); refreshBackground( (DesignElementHandle) getModel( ) ); refreshMargin( ); }
public void refreshChildren( ) { super.refreshChildren( ); ( (AbstractGraphicalEditPart) getParent( ) ).setLayoutConstraint( this, getFigure( ), getConstraint( ) ); }
protected Command createChangeConstraintCommand(EditPart child, Object constraint) { if (!(child instanceof AbstractGraphicalEditPart)) return null; MoveDepartmentCommand cmd = new MoveDepartmentCommand(); cmd.setNode((DepartmentNode) child.getModel()); cmd.setConstrain(((Rectangle)constraint)); return cmd; }
protected Command createChangeConstraintCommand(EditPart child, Object constraint) { if (!(child instanceof AbstractGraphicalEditPart)) return null; MoveNodeCommand cmd = new MoveNodeCommand(); cmd.setNode((BaseNode) child.getModel()); cmd.setLocation(((Rectangle)constraint).getLocation()); return cmd; }