/** * Creates the figure for actor refs, and also adds evaluation labels / icons to the background. * * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure() */ protected IFigure createFigure() { evaluationLabel = new Label(); evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL); evaluationLabel.setSize(78, 16); // increased from 58,16 evaluationImg = (JUCMNavPlugin.getImage("icons/Actor16.gif")); //$NON-NLS-1$ evaluationLabel.setIcon(evaluationImg); evaluationLabel.setText(""); //$NON-NLS-1$ evaluationLabel.setVisible(true); try { ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0)) .getChildren().get(0)).add(evaluationLabel); } catch (Exception ex) { System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$ // bug 435: old code.. hoping new code is more robust. ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel); } return new ActorFigure(); }
/** * Overriding because we also have to listen to the Actor definition * * @see org.eclipse.gef.EditPart#deactivate() */ public void deactivate() { if (isActive()) { // if (evaluationImg != null) { // evaluationImg.dispose(); // evaluationImg = null; // } // ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel); ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0)) .getChildren().get(0)).remove(evaluationLabel); if (getActorRef().getContDef() != null) { getActorRef().getContDef().eAdapters().remove(this); } } // stop listening to reference super.deactivate(); }
/** * @see org.eclipse.draw2d.AbstractConnectionAnchor#ancestorMoved(IFigure) */ @Override public void ancestorMoved(IFigure figure) { if (figure instanceof ScalableFigure) return; super.ancestorMoved(figure); }
/** * Create the GrlNode figure and associated evaluation labels. * * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure() */ protected IFigure createFigure() { IntentionalElementFigure fig = new IntentionalElementFigure(); evaluationLabel = new Label(); evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL); evaluationLabel.setVisible(false); evaluationLabel.setSize(100, 16); // resized from 60, 16 evaluationLabel.setTextAlignment(PositionConstants.LEFT); kpiEvaluationValueLabel = new Label(); kpiEvaluationValueLabel.setForegroundColor(ColorManager.BLUE); kpiEvaluationValueLabel.setVisible(false); kpiEvaluationValueLabel.setSize(70, 16); try { ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0)) .getChildren().get(0)).add(evaluationLabel); ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0)) .getChildren().get(0)).add(kpiEvaluationValueLabel); } catch (Exception ex) { System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$ // bug 435: old code.. hoping new code is more robust ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel); ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(kpiEvaluationValueLabel); } return fig; }
/** * Overriding because we also have to listen to the Component definition * * @see org.eclipse.gef.EditPart#deactivate() */ public void deactivate() { if (isActive()) { // bug 435: ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel); ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0)) .getChildren().get(0)).remove(evaluationLabel); if (getNode() instanceof IntentionalElementRef && (getNode()).getDef() != null) (getNode()).getDef().eAdapters().remove(this); } super.deactivate(); }
/** * Creates a new DelegatingZoomManager instance. */ public DelegatingZoomManager(UCMNavMultiPageEditor editor) { super((ScalableFigure) null, (Viewport) null); setEditor(editor); List zoomLevels = new ArrayList(3); zoomLevels.add(ZoomManager.FIT_ALL); zoomLevels.add(ZoomManager.FIT_WIDTH); zoomLevels.add(ZoomManager.FIT_HEIGHT); setZoomLevelContributions(zoomLevels); }
/** * @see org.eclipse.draw2d.AbstractConnectionAnchor#ancestorMoved(IFigure) */ public void ancestorMoved(IFigure figure) { if (figure instanceof ScalableFigure) return; super.ancestorMoved(figure); }
/** * Constructor for ScalableFreeformRootEditPart */ public ScalableFreeformRootEditPart() { zoomManager = new ZoomManager((ScalableFigure) getScaledLayers(), ((Viewport) getFigure())); }
public ScalableFigure getScalableFigure() { if (null == currentZoomManager) return null; return currentZoomManager.getScalableFigure(); }
public void addScaledInteractionFigure(ScalableFigure f, int atDepth) { // Scale the given figure f.setScale(contents.getScale()); addInteractionFigure(f, atDepth); }
/** * Creates a new ZoomManager. * * @param pane * The ScalableFigure associated with this ZoomManager * @param viewport * The Viewport assoicated with this ZoomManager */ public ZoomManager(ScalableFigure pane, Viewport viewport) { this.pane = pane; this.viewport = viewport; }
/** * Returns the figure which performs the actual zooming. * * @return the scalable figure */ public ScalableFigure getScalableFigure() { return pane; }