$search
00001 package org.ros.model.ros_package.diagram.edit.parts; 00002 00003 import org.eclipse.draw2d.ColorConstants; 00004 import org.eclipse.draw2d.Graphics; 00005 import org.eclipse.draw2d.GridData; 00006 import org.eclipse.draw2d.GridLayout; 00007 import org.eclipse.draw2d.IFigure; 00008 import org.eclipse.draw2d.MarginBorder; 00009 import org.eclipse.draw2d.PositionConstants; 00010 import org.eclipse.draw2d.RectangleFigure; 00011 import org.eclipse.draw2d.RoundedRectangle; 00012 import org.eclipse.draw2d.Shape; 00013 import org.eclipse.draw2d.StackLayout; 00014 import org.eclipse.draw2d.geometry.Dimension; 00015 import org.eclipse.draw2d.geometry.Rectangle; 00016 import org.eclipse.emf.common.notify.Notification; 00017 import org.eclipse.emf.ecore.EcorePackage; 00018 import org.eclipse.gef.EditPart; 00019 import org.eclipse.gef.EditPolicy; 00020 import org.eclipse.gef.Request; 00021 import org.eclipse.gef.commands.Command; 00022 import org.eclipse.gef.editpolicies.LayoutEditPolicy; 00023 import org.eclipse.gef.editpolicies.NonResizableEditPolicy; 00024 import org.eclipse.gef.requests.CreateRequest; 00025 import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter; 00026 import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart; 00027 import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; 00028 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; 00029 import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; 00030 import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; 00031 import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; 00032 import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; 00033 import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator; 00034 import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; 00035 import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; 00036 import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; 00037 import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil; 00038 import org.eclipse.gmf.runtime.emf.type.core.IElementType; 00039 import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; 00040 import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; 00041 import org.eclipse.gmf.runtime.notation.View; 00042 import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent; 00043 import org.eclipse.swt.SWT; 00044 import org.eclipse.swt.graphics.Color; 00045 import org.eclipse.swt.graphics.Font; 00046 import org.eclipse.swt.graphics.Path; 00047 import org.eclipse.swt.widgets.Display; 00048 00052 public class NodeEditPart extends AbstractBorderedShapeEditPart { 00053 00057 public static final int VISUAL_ID = 2001; 00058 00062 protected IFigure contentPane; 00063 00067 protected IFigure primaryShape; 00068 00072 public NodeEditPart(View view) { 00073 super(view); 00074 } 00075 00079 protected void createDefaultEditPolicies() { 00080 installEditPolicy( 00081 EditPolicyRoles.CREATION_ROLE, 00082 new CreationEditPolicyWithCustomReparent( 00083 org.ros.model.ros_package.diagram.part.RosVisualIDRegistry.TYPED_INSTANCE)); 00084 super.createDefaultEditPolicies(); 00085 installEditPolicy( 00086 EditPolicyRoles.SEMANTIC_ROLE, 00087 new org.ros.model.ros_package.diagram.edit.policies.NodeItemSemanticEditPolicy()); 00088 installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, 00089 new DragDropEditPolicy()); 00090 installEditPolicy( 00091 EditPolicyRoles.CANONICAL_ROLE, 00092 new org.ros.model.ros_package.diagram.edit.policies.NodeCanonicalEditPolicy()); 00093 installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); 00094 // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies 00095 // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); 00096 } 00097 00101 protected LayoutEditPolicy createLayoutEditPolicy() { 00102 org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { 00103 00104 protected EditPolicy createChildEditPolicy(EditPart child) { 00105 View childView = (View) child.getModel(); 00106 switch (org.ros.model.ros_package.diagram.part.RosVisualIDRegistry 00107 .getVisualID(childView)) { 00108 case org.ros.model.ros_package.diagram.edit.parts.ServiceServerEditPart.VISUAL_ID: 00109 case org.ros.model.ros_package.diagram.edit.parts.ServiceClientEditPart.VISUAL_ID: 00110 case org.ros.model.ros_package.diagram.edit.parts.PublisherEditPart.VISUAL_ID: 00111 case org.ros.model.ros_package.diagram.edit.parts.ActionServerEditPart.VISUAL_ID: 00112 case org.ros.model.ros_package.diagram.edit.parts.ActionClientEditPart.VISUAL_ID: 00113 case org.ros.model.ros_package.diagram.edit.parts.SubscriberEditPart.VISUAL_ID: 00114 return new BorderItemSelectionEditPolicy(); 00115 } 00116 EditPolicy result = child 00117 .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); 00118 if (result == null) { 00119 result = new NonResizableEditPolicy(); 00120 } 00121 return result; 00122 } 00123 00124 protected Command getMoveChildrenCommand(Request request) { 00125 return null; 00126 } 00127 00128 protected Command getCreateCommand(CreateRequest request) { 00129 return null; 00130 } 00131 }; 00132 return lep; 00133 } 00134 00138 protected IFigure createNodeShape() { 00139 return primaryShape = new NodeFigure2(); 00140 } 00141 00145 public NodeFigure2 getPrimaryShape() { 00146 return (NodeFigure2) primaryShape; 00147 } 00148 00152 protected boolean addFixedChild(EditPart childEditPart) { 00153 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.NodeNameEditPart) { 00154 ((org.ros.model.ros_package.diagram.edit.parts.NodeNameEditPart) childEditPart) 00155 .setLabel(getPrimaryShape().getFigureNodeNameFigure()); 00156 return true; 00157 } 00158 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart) { 00159 IFigure pane = getPrimaryShape() 00160 .getFigureParameterCompartmentFigure(); 00161 setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way 00162 pane.add(((org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart) childEditPart) 00163 .getFigure()); 00164 return true; 00165 } 00166 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ServiceServerEditPart) { 00167 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00168 PositionConstants.EAST); 00169 getBorderedFigure() 00170 .getBorderItemContainer() 00171 .add(((org.ros.model.ros_package.diagram.edit.parts.ServiceServerEditPart) childEditPart) 00172 .getFigure(), locator); 00173 return true; 00174 } 00175 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ServiceClientEditPart) { 00176 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00177 PositionConstants.WEST); 00178 getBorderedFigure() 00179 .getBorderItemContainer() 00180 .add(((org.ros.model.ros_package.diagram.edit.parts.ServiceClientEditPart) childEditPart) 00181 .getFigure(), locator); 00182 return true; 00183 } 00184 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.PublisherEditPart) { 00185 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00186 PositionConstants.EAST); 00187 getBorderedFigure() 00188 .getBorderItemContainer() 00189 .add(((org.ros.model.ros_package.diagram.edit.parts.PublisherEditPart) childEditPart) 00190 .getFigure(), locator); 00191 return true; 00192 } 00193 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ActionServerEditPart) { 00194 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00195 PositionConstants.NONE); 00196 getBorderedFigure() 00197 .getBorderItemContainer() 00198 .add(((org.ros.model.ros_package.diagram.edit.parts.ActionServerEditPart) childEditPart) 00199 .getFigure(), locator); 00200 return true; 00201 } 00202 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ActionClientEditPart) { 00203 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00204 PositionConstants.NONE); 00205 getBorderedFigure() 00206 .getBorderItemContainer() 00207 .add(((org.ros.model.ros_package.diagram.edit.parts.ActionClientEditPart) childEditPart) 00208 .getFigure(), locator); 00209 return true; 00210 } 00211 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.SubscriberEditPart) { 00212 BorderItemLocator locator = new BorderItemLocator(getMainFigure(), 00213 PositionConstants.WEST); 00214 getBorderedFigure() 00215 .getBorderItemContainer() 00216 .add(((org.ros.model.ros_package.diagram.edit.parts.SubscriberEditPart) childEditPart) 00217 .getFigure(), locator); 00218 return true; 00219 } 00220 return false; 00221 } 00222 00226 protected boolean removeFixedChild(EditPart childEditPart) { 00227 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.NodeNameEditPart) { 00228 return true; 00229 } 00230 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart) { 00231 IFigure pane = getPrimaryShape() 00232 .getFigureParameterCompartmentFigure(); 00233 pane.remove(((org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart) childEditPart) 00234 .getFigure()); 00235 return true; 00236 } 00237 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ServiceServerEditPart) { 00238 getBorderedFigure() 00239 .getBorderItemContainer() 00240 .remove(((org.ros.model.ros_package.diagram.edit.parts.ServiceServerEditPart) childEditPart) 00241 .getFigure()); 00242 return true; 00243 } 00244 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ServiceClientEditPart) { 00245 getBorderedFigure() 00246 .getBorderItemContainer() 00247 .remove(((org.ros.model.ros_package.diagram.edit.parts.ServiceClientEditPart) childEditPart) 00248 .getFigure()); 00249 return true; 00250 } 00251 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.PublisherEditPart) { 00252 getBorderedFigure() 00253 .getBorderItemContainer() 00254 .remove(((org.ros.model.ros_package.diagram.edit.parts.PublisherEditPart) childEditPart) 00255 .getFigure()); 00256 return true; 00257 } 00258 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ActionServerEditPart) { 00259 getBorderedFigure() 00260 .getBorderItemContainer() 00261 .remove(((org.ros.model.ros_package.diagram.edit.parts.ActionServerEditPart) childEditPart) 00262 .getFigure()); 00263 return true; 00264 } 00265 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.ActionClientEditPart) { 00266 getBorderedFigure() 00267 .getBorderItemContainer() 00268 .remove(((org.ros.model.ros_package.diagram.edit.parts.ActionClientEditPart) childEditPart) 00269 .getFigure()); 00270 return true; 00271 } 00272 if (childEditPart instanceof org.ros.model.ros_package.diagram.edit.parts.SubscriberEditPart) { 00273 getBorderedFigure() 00274 .getBorderItemContainer() 00275 .remove(((org.ros.model.ros_package.diagram.edit.parts.SubscriberEditPart) childEditPart) 00276 .getFigure()); 00277 return true; 00278 } 00279 return false; 00280 } 00281 00285 protected void addChildVisual(EditPart childEditPart, int index) { 00286 if (addFixedChild(childEditPart)) { 00287 return; 00288 } 00289 super.addChildVisual(childEditPart, -1); 00290 } 00291 00295 protected void removeChildVisual(EditPart childEditPart) { 00296 if (removeFixedChild(childEditPart)) { 00297 return; 00298 } 00299 super.removeChildVisual(childEditPart); 00300 } 00301 00305 protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { 00306 if (editPart instanceof org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart) { 00307 return getPrimaryShape().getFigureParameterCompartmentFigure(); 00308 } 00309 if (editPart instanceof IBorderItemEditPart) { 00310 return getBorderedFigure().getBorderItemContainer(); 00311 } 00312 return getContentPane(); 00313 } 00314 00318 protected NodeFigure createNodePlate() { 00319 DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40); 00320 return result; 00321 } 00322 00331 protected NodeFigure createMainFigure() { 00332 NodeFigure figure = createNodePlate(); 00333 figure.setLayoutManager(new StackLayout()); 00334 IFigure shape = createNodeShape(); 00335 figure.add(shape); 00336 contentPane = setupContentPane(shape); 00337 return figure; 00338 } 00339 00346 protected IFigure setupContentPane(IFigure nodeShape) { 00347 if (nodeShape.getLayoutManager() == null) { 00348 ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); 00349 layout.setSpacing(5); 00350 nodeShape.setLayoutManager(layout); 00351 } 00352 return nodeShape; // use nodeShape itself as contentPane 00353 } 00354 00358 public IFigure getContentPane() { 00359 if (contentPane != null) { 00360 return contentPane; 00361 } 00362 return super.getContentPane(); 00363 } 00364 00368 protected void setForegroundColor(Color color) { 00369 if (primaryShape != null) { 00370 primaryShape.setForegroundColor(color); 00371 } 00372 } 00373 00377 protected void setBackgroundColor(Color color) { 00378 if (primaryShape != null) { 00379 primaryShape.setBackgroundColor(color); 00380 } 00381 } 00382 00386 protected void setLineWidth(int width) { 00387 if (primaryShape instanceof Shape) { 00388 ((Shape) primaryShape).setLineWidth(width); 00389 } 00390 } 00391 00395 protected void setLineType(int style) { 00396 if (primaryShape instanceof Shape) { 00397 ((Shape) primaryShape).setLineStyle(style); 00398 } 00399 } 00400 00404 public EditPart getPrimaryChildEditPart() { 00405 return getChildBySemanticHint(org.ros.model.ros_package.diagram.part.RosVisualIDRegistry 00406 .getType(org.ros.model.ros_package.diagram.edit.parts.NodeNameEditPart.VISUAL_ID)); 00407 } 00408 00412 public EditPart getTargetEditPart(Request request) { 00413 if (request instanceof CreateViewAndElementRequest) { 00414 CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request) 00415 .getViewAndElementDescriptor() 00416 .getCreateElementRequestAdapter(); 00417 IElementType type = (IElementType) adapter 00418 .getAdapter(IElementType.class); 00419 if (type == org.ros.model.ros_package.diagram.providers.RosElementTypes.Parameter_3001) { 00420 return getChildBySemanticHint(org.ros.model.ros_package.diagram.part.RosVisualIDRegistry 00421 .getType(org.ros.model.ros_package.diagram.edit.parts.NodeParametersEditPart.VISUAL_ID)); 00422 } 00423 } 00424 return super.getTargetEditPart(request); 00425 } 00426 00430 protected void handleNotificationEvent(Notification event) { 00431 if (event.getNotifier() == getModel() 00432 && EcorePackage.eINSTANCE.getEModelElement_EAnnotations() 00433 .equals(event.getFeature())) { 00434 handleMajorSemanticChange(); 00435 } else { 00436 super.handleNotificationEvent(event); 00437 } 00438 } 00439 00443 public class NodeFigure2 extends RoundedRectangle { 00444 00445 public static final int BLUR_SHADOW_WIDTH = 5; 00446 00458 public void fillVerticalGradientRoundedRectangle(Graphics graphics, 00459 Rectangle bounds, Dimension corner, Color c1, Color c2) { 00460 00461 graphics.pushState(); 00462 00463 graphics.setForegroundColor(c2); 00464 graphics.setBackgroundColor(c1); 00465 00466 graphics.fillGradient(bounds.x, bounds.y + (corner.height >> 1), 00467 bounds.width, bounds.height - corner.height, true); 00468 00469 Path p = new Path(null); 00470 p.addArc(bounds.x, bounds.y + bounds.height - corner.height - 1, 00471 corner.width, corner.height, 180, 90); 00472 p.addArc(bounds.x + bounds.width - corner.width - 1, bounds.y 00473 + bounds.height - corner.height - 1, corner.width, 00474 corner.height, 270, 90); 00475 graphics.fillPath(p); 00476 p.dispose(); 00477 00478 p = new Path(null); 00479 graphics.setBackgroundColor(c2); 00480 p.addArc(bounds.x + bounds.width - corner.width - 1, bounds.y, 00481 corner.width, corner.height, 0, 90); 00482 p.addArc(bounds.x, bounds.y, corner.width, corner.height, 90, 90); 00483 graphics.fillPath(p); 00484 p.dispose(); 00485 00486 graphics.popState(); 00487 } 00488 00500 public Color mixColor(Color baseColor, Color mixinColor, int ratio) { 00501 return new Color(baseColor.getDevice(), baseColor.getRed() 00502 + (mixinColor.getRed() - baseColor.getRed()) * ratio / 255, 00503 baseColor.getGreen() 00504 + (mixinColor.getGreen() - baseColor.getGreen()) 00505 * ratio / 255, baseColor.getBlue() 00506 + (mixinColor.getBlue() - baseColor.getBlue()) 00507 * ratio / 255); 00508 } 00509 00510 @Override 00511 public void paintFigure(Graphics graphics) { 00512 drawBlurredShadow(graphics); 00513 super.paintFigure(graphics); 00514 } 00515 00520 @Override 00521 protected void fillShape(Graphics graphics) { 00522 Color c = mixColor(getBackgroundColor(), ColorConstants.white, 224); 00523 fillVerticalGradientRoundedRectangle(graphics, getBounds(), 00524 getCornerDimensions(), getBackgroundColor(), c); 00525 c.dispose(); 00526 } 00527 00528 private void drawBlurredShadow(Graphics graphics) { 00529 // draw the shadow... 00530 graphics.pushState(); 00531 00532 int size = MapModeUtil.getMapMode(this).DPtoLP(BLUR_SHADOW_WIDTH); 00533 int step = MapModeUtil.getMapMode(this).DPtoLP(-1); 00534 00535 graphics.setForegroundColor(ColorConstants.gray); 00536 graphics.setLineWidth(MapModeUtil.getMapMode(this).DPtoLP(2)); 00537 graphics.translate(size, size); 00538 graphics.setClip(graphics.getClip(new Rectangle(getBounds())) 00539 .expand(size, size)); 00540 graphics.setAlpha(20); 00541 outlineShape(graphics); 00542 graphics.translate(step, step); 00543 graphics.setAlpha(30); 00544 outlineShape(graphics); 00545 graphics.translate(step, step); 00546 graphics.setAlpha(60); 00547 outlineShape(graphics); 00548 graphics.translate(step, step); 00549 graphics.setAlpha(100); 00550 outlineShape(graphics); 00551 graphics.translate(step, step); 00552 graphics.setAlpha(150); 00553 outlineShape(graphics); 00554 00555 graphics.popState(); 00556 } 00557 00561 private WrappingLabel fFigureNodeNameFigure; 00565 private RectangleFigure fFigureParameterCompartmentFigure; 00566 00570 public NodeFigure2() { 00571 00572 GridLayout layoutThis = new GridLayout(); 00573 layoutThis.numColumns = 1; 00574 layoutThis.makeColumnsEqualWidth = true; 00575 this.setLayoutManager(layoutThis); 00576 00577 this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(20), 00578 getMapMode().DPtoLP(20))); 00579 this.setLineWidth(2); 00580 this.setMinimumSize(new Dimension(getMapMode().DPtoLP(240), 00581 getMapMode().DPtoLP(180))); 00582 createContents(); 00583 } 00584 00588 private void createContents() { 00589 00590 RectangleFigure nodeTopFigure0 = new RectangleFigure(); 00591 nodeTopFigure0.setForegroundColor(NODETOPFIGURE0_FORE); 00592 00593 nodeTopFigure0.setBorder(new MarginBorder(getMapMode().DPtoLP(5), 00594 getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), 00595 getMapMode().DPtoLP(5))); 00596 00597 GridData constraintNodeTopFigure0 = new GridData(); 00598 constraintNodeTopFigure0.verticalAlignment = GridData.BEGINNING; 00599 constraintNodeTopFigure0.horizontalAlignment = GridData.FILL; 00600 constraintNodeTopFigure0.horizontalIndent = 0; 00601 constraintNodeTopFigure0.horizontalSpan = 1; 00602 constraintNodeTopFigure0.verticalSpan = 1; 00603 constraintNodeTopFigure0.grabExcessHorizontalSpace = true; 00604 constraintNodeTopFigure0.grabExcessVerticalSpace = false; 00605 this.add(nodeTopFigure0, constraintNodeTopFigure0); 00606 00607 GridLayout layoutNodeTopFigure0 = new GridLayout(); 00608 layoutNodeTopFigure0.numColumns = 1; 00609 layoutNodeTopFigure0.makeColumnsEqualWidth = true; 00610 nodeTopFigure0.setLayoutManager(layoutNodeTopFigure0); 00611 00612 fFigureNodeNameFigure = new WrappingLabel(); 00613 fFigureNodeNameFigure.setText("<...>"); 00614 00615 fFigureNodeNameFigure.setFont(FFIGURENODENAMEFIGURE_FONT); 00616 00617 GridData constraintFFigureNodeNameFigure = new GridData(); 00618 constraintFFigureNodeNameFigure.verticalAlignment = GridData.BEGINNING; 00619 constraintFFigureNodeNameFigure.horizontalAlignment = GridData.BEGINNING; 00620 constraintFFigureNodeNameFigure.horizontalIndent = 0; 00621 constraintFFigureNodeNameFigure.horizontalSpan = 3; 00622 constraintFFigureNodeNameFigure.verticalSpan = 1; 00623 constraintFFigureNodeNameFigure.grabExcessHorizontalSpace = false; 00624 constraintFFigureNodeNameFigure.grabExcessVerticalSpace = false; 00625 nodeTopFigure0.add(fFigureNodeNameFigure, 00626 constraintFFigureNodeNameFigure); 00627 00628 fFigureParameterCompartmentFigure = new RectangleFigure(); 00629 fFigureParameterCompartmentFigure.setFill(false); 00630 00631 GridData constraintFFigureParameterCompartmentFigure = new GridData(); 00632 constraintFFigureParameterCompartmentFigure.verticalAlignment = GridData.FILL; 00633 constraintFFigureParameterCompartmentFigure.horizontalAlignment = GridData.FILL; 00634 constraintFFigureParameterCompartmentFigure.horizontalIndent = 0; 00635 constraintFFigureParameterCompartmentFigure.horizontalSpan = 1; 00636 constraintFFigureParameterCompartmentFigure.verticalSpan = 1; 00637 constraintFFigureParameterCompartmentFigure.grabExcessHorizontalSpace = true; 00638 constraintFFigureParameterCompartmentFigure.grabExcessVerticalSpace = true; 00639 this.add(fFigureParameterCompartmentFigure, 00640 constraintFFigureParameterCompartmentFigure); 00641 00642 fFigureParameterCompartmentFigure 00643 .setLayoutManager(new StackLayout()); 00644 00645 } 00646 00650 public WrappingLabel getFigureNodeNameFigure() { 00651 return fFigureNodeNameFigure; 00652 } 00653 00657 public RectangleFigure getFigureParameterCompartmentFigure() { 00658 return fFigureParameterCompartmentFigure; 00659 } 00660 00661 } 00662 00666 static final Color NODETOPFIGURE0_FORE = new Color(null, 236, 232, 233); 00667 00671 static final Font FFIGURENODENAMEFIGURE_FONT = new Font( 00672 Display.getCurrent(), Display.getDefault().getSystemFont() 00673 .getFontData()[0].getName(), 10, SWT.BOLD); 00674 00675 }