### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.bridge Index: src/org/eclipse/gmf/internal/bridge/genmodel/DefaultViewmapProducer.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DefaultViewmapProducer.java,v retrieving revision 1.2 diff -u -r1.2 DefaultViewmapProducer.java --- src/org/eclipse/gmf/internal/bridge/genmodel/DefaultViewmapProducer.java 25 Aug 2006 19:02:06 -0000 1.2 +++ src/org/eclipse/gmf/internal/bridge/genmodel/DefaultViewmapProducer.java 1 Sep 2006 14:27:45 -0000 @@ -21,6 +21,7 @@ import org.eclipse.gmf.gmfgraph.Canvas; import org.eclipse.gmf.gmfgraph.Compartment; import org.eclipse.gmf.gmfgraph.Connection; +import org.eclipse.gmf.gmfgraph.DefaultSizeFacet; import org.eclipse.gmf.gmfgraph.DiagramLabel; import org.eclipse.gmf.gmfgraph.Dimension; import org.eclipse.gmf.gmfgraph.Direction; @@ -125,12 +126,19 @@ FigureHandle handle = node.getFigure(); if (handle instanceof Figure){ Figure figure = (Figure)handle; - Dimension prefSize = figure.getPreferredSize(); - if (prefSize != null){ - DefaultSizeAttributes defaultSize = GMFGenFactory.eINSTANCE.createDefaultSizeAttributes(); - defaultSize.setHeight(prefSize.getDy()); - defaultSize.setWidth(prefSize.getDx()); - viewmap.getAttributes().add(defaultSize); + Dimension defaultSize; + DefaultSizeFacet facet = (DefaultSizeFacet) node.find(DefaultSizeFacet.class); + if (facet != null){ + defaultSize = facet.getDefaultSize(); + } else { + defaultSize = figure.getPreferredSize(); + } + + if (defaultSize != null){ + DefaultSizeAttributes attributes = GMFGenFactory.eINSTANCE.createDefaultSizeAttributes(); + attributes.setHeight(defaultSize.getDy()); + attributes.setWidth(defaultSize.getDx()); + viewmap.getAttributes().add(attributes); } } } #P org.eclipse.gmf.tests Index: src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java,v retrieving revision 1.17 diff -u -r1.17 ViewmapProducersTest.java --- src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 25 Aug 2006 19:02:07 -0000 1.17 +++ src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 1 Sep 2006 14:27:46 -0000 @@ -36,6 +36,7 @@ import org.eclipse.gmf.gmfgraph.ConstantColor; import org.eclipse.gmf.gmfgraph.CustomConnection; import org.eclipse.gmf.gmfgraph.CustomFigure; +import org.eclipse.gmf.gmfgraph.DefaultSizeFacet; import org.eclipse.gmf.gmfgraph.DiagramLabel; import org.eclipse.gmf.gmfgraph.Dimension; import org.eclipse.gmf.gmfgraph.Direction; @@ -411,6 +412,31 @@ child.setPreferredSize((Dimension) EcoreUtil.copy(DIMENSION)); new Checker((Dimension)null).check(childHasPrefSizeButFigureDoesNot); new Checker(DIMENSION).check(child); + + Figure noPrefSizeButFacet = GMFGraphFactory.eINSTANCE.createScalablePolygon(); + Node facetNode = createNode("NoPrefSizeButFacet", noPrefSizeButFacet); + DefaultSizeFacet facet = GMFGraphFactory.eINSTANCE.createDefaultSizeFacet(); + facet.setDefaultSize((Dimension) EcoreUtil.copy(DIMENSION)); + facetNode.getFacets().add(facet); + new Checker(DIMENSION).check(getProducer().create(facetNode)); + + final int FACET_VALUE = 42; + final int PREF_SIZE_VALUE = 42 * 2; + Figure bothFacetAndPrefSize = GMFGraphFactory.eINSTANCE.createRectangle(); + Node bothSizesNode = createNode("BothPrefSizeAndFacet", bothFacetAndPrefSize); + facet = GMFGraphFactory.eINSTANCE.createDefaultSizeFacet(); + facet.setDefaultSize(GMFGraphFactory.eINSTANCE.createDimension()); + facet.getDefaultSize().setDx(FACET_VALUE); + facet.getDefaultSize().setDy(FACET_VALUE); + bothSizesNode.getFacets().add(facet); + + Dimension prefSize = GMFGraphFactory.eINSTANCE.createDimension(); + prefSize.setDx(PREF_SIZE_VALUE); + prefSize.setDy(PREF_SIZE_VALUE); + bothFacetAndPrefSize.setPreferredSize(prefSize); + + //facet should have a precedence + new Checker(facet.getDefaultSize()).check(getProducer().create(bothSizesNode)); } public void testViewmapLayoutType(){ #P org.eclipse.gmf.graphdef.edit Index: plugin.properties =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/plugin.properties,v retrieving revision 1.23 diff -u -r1.23 plugin.properties --- plugin.properties 25 Aug 2006 18:32:37 -0000 1.23 +++ plugin.properties 1 Sep 2006 14:27:47 -0000 @@ -1 +1,2 @@ ##################################################### # Properties in this section SHOULD NOT be translated ##################################################### _UI_GMFGraphEditorFilenameDefaultBase = My _UI_GMFGraphEditorFilenameExtension = gmfgraph _UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 ################ # End of section ################ ############################################################# # Properties in this section ARE REALLY NEED to be translated ############################################################# _UI_CreateChild_text = {0} _UI_CreateChild_text2 = {1} {0} _UI_CreateChild_text3 = {1} _UI_CreateChild_tooltip = Create New {0} Under {1} Feature _UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. _UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. _UI_PropertyDescriptor_description = The {0} of the {1} _UI_GMFGraphEditor_menu = &GMFGraph Editor _UI_CreateChild_menu_item = &New Child _UI_CreateSibling_menu_item = N&ew Sibling _UI_ShowPropertiesView_menu_item = Show &Properties View _UI_RefreshViewer_menu_item = &Refresh _UI_SelectionPage_label = Selection _UI_ParentPage_label = Parent _UI_ListPage_label = List _UI_TreePage_label = Tree _UI_TablePage_label = Table _UI_TreeWithColumnsPage_label = Tree with Columns _UI_ObjectColumn_label = Object _UI_SelfColumn_label = Self _UI_NoObjectSelected = Selected Nothing _UI_SingleObjectSelected = Selected Object: {0} _UI_MultiObjectSelected = Selected {0} Objects _UI_OpenEditorError_label = Open Editor _UI_GMFGraphModelWizard_label = GMFGraph Model _UI_GMFGraphModelWizard_description = Create a new GMFGraph model _UI_GMFGraphEditor_label = GMFGraph Model Editor _UI_Wizard_label = New _WARN_FilenameExtension = The file name must end in ".{0}" _UI_ModelObject = Model Object _UI_XMLEncoding = XML Encoding _UI_Wizard_initial_object_description = Select a model object to create _UI_FileConflict_label = File Conflict _WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? _UI_CreateModelError_message = Problems encountered in file "{0}" ################ # End of section ################ ###################################################################################### # Properties in this section MAY be translated, although they are quite ok in English. # Mostly there are names of classes and features that are often referenced to by # their English names ###################################################################################### pluginName = GMFGraph Edit Support providerName = Eclipse.org _UI_Canvas_type = Canvas _UI_FigureGallery_type = Figure Gallery _UI_Identity_type = Identity _UI_DiagramElement_type = Diagram Element _UI_Node_type = Node _UI_Connection_type = Connection _UI_Compartment_type = Compartment _UI_DiagramLabel_type = Diagram Label _UI_DiagramLabel_elementIcon_feature = Element Icon _UI_VisualFacet_type = Visual Facet _UI_GeneralFacet_type = General Facet _UI_AlignmentFacet_type = Alignment Facet _UI_GradientFacet_type = Gradient Facet _UI_LabelOffsetFacet_type = Label Offset Facet _UI_FigureMarker_type = Figure Marker _UI_Figure_type = Figure _UI_FigureRef_type = Figure Ref _UI_ConnectionFigure_type = Connection Figure _UI_DecorationFigure_type = Decoration Figure _UI_Shape_type = Shape _UI_Label_type = Label _UI_LabeledContainer_type = Labeled Container _UI_Rectangle_type = Rectangle _UI_RoundedRectangle_type = Rounded Rectangle _UI_Ellipse_type = Ellipse _UI_Polyline_type = Polyline _UI_Polygon_type = Polygon _UI_PolylineConnection_type = Polyline Connection _UI_PolylineDecoration_type = Polyline Decoration _UI_PolygonDecoration_type = Polygon Decoration _UI_CustomClass_type = Custom Class _UI_CustomFigure_type = Custom Figure _UI_CustomFigure_customChildren_feature = Custom Children _UI_CustomDecoration_type = Custom Decoration _UI_CustomConnection_type = Custom Connection _UI_Color_type = Color _UI_RGBColor_type = RGB Color _UI_ConstantColor_type = Constant Color _UI_Font_type = Font _UI_BasicFont_type = Basic Font _UI_Point_type = Point _UI_Dimension_type = Dimension _UI_Insets_type = Insets _UI_Border_type = Border _UI_LineBorder_type = Line Border _UI_MarginBorder_type = Margin Border _UI_CompoundBorder_type = Compound Border _UI_CustomBorder_type = Custom Border _UI_LayoutData_type = Layout Data _UI_CustomLayoutData_type = Custom Layout Data _UI_GridLayoutData_type = Grid Layout Data _UI_BorderLayoutData_type = Border Layout Data _UI_Layoutable_type = Layoutable _UI_Layout_type = Layout _UI_CustomLayout_type = Custom Layout _UI_GridLayout_type = Grid Layout _UI_BorderLayout_type = Border Layout _UI_CustomAttribute_type = Custom Attribute _UI_FlowLayout_type = Flow Layout _UI_XYLayout_type = XY Layout _UI_XYLayoutData_type = XY Layout Data _UI_StackLayout_type = Stack Layout _UI_Unknown_type = Object _UI_Unknown_datatype= Value _UI_Canvas_figures_feature = Figures _UI_Canvas_nodes_feature = Nodes _UI_Canvas_connections_feature = Connections _UI_Canvas_compartments_feature = Compartments _UI_Canvas_labels_feature = Labels _UI_FigureGallery_figures_feature = Figures _UI_FigureGallery_implementationBundle_feature = Implementation Bundle _UI_Identity_name_feature = Name _UI_DiagramElement_figure_feature = Figure _UI_DiagramElement_facets_feature = Facets _UI_Node_nodeFigure_feature = _UI_Node_resizeConstraint_feature = Resize Constraint _UI_Node_affixedParentSide_feature = Affixed Parent Side _UI_Connection_connectionFigure_feature = _UI_Compartment_collapsible_feature = Collapsible _UI_Compartment_needsTitle_feature = Needs Title _UI_GeneralFacet_identifier_feature = Identifier _UI_GeneralFacet_data_feature = Data _UI_AlignmentFacet_alignment_feature = Alignment _UI_GradientFacet_direction_feature = Direction _UI_LabelOffsetFacet_x_feature = X _UI_LabelOffsetFacet_y_feature = Y _UI_FigureMarker_parent_feature = Parent _UI_Figure_children_feature = Children _UI_Figure_foregroundColor_feature = Foreground Color _UI_Figure_backgroundColor_feature = Background Color _UI_Figure_maximumSize_feature = Maximum Size _UI_Figure_minimumSize_feature = Minimum Size _UI_Figure_preferredSize_feature = Preferred Size _UI_Figure_font_feature = Font _UI_Figure_insets_feature = Insets _UI_Figure_border_feature = Border _UI_Figure_location_feature = Location _UI_Figure_size_feature = Size _UI_FigureRef_figure_feature = Figure _UI_Shape_outline_feature = Outline _UI_Shape_fill_feature = Fill _UI_Shape_lineWidth_feature = Line Width _UI_Shape_lineKind_feature = Line Kind _UI_Shape_xorFill_feature = Xor Fill _UI_Shape_xorOutline_feature = Xor Outline _UI_Shape_resolvedChildren_feature = Resolved Children _UI_Label_text_feature = Text _UI_RoundedRectangle_cornerWidth_feature = Corner Width _UI_RoundedRectangle_cornerHeight_feature = Corner Height _UI_Polyline_template_feature = Template _UI_PolylineConnection_sourceDecoration_feature = Source Decoration _UI_PolylineConnection_targetDecoration_feature = Target Decoration _UI_CustomClass_qualifiedClassName_feature = Qualified Class Name _UI_CustomClass_bundleName_feature = Bundle Name _UI_CustomClass_attributes_feature = Attributes _UI_RGBColor_red_feature = Red _UI_RGBColor_green_feature = Green _UI_RGBColor_blue_feature = Blue _UI_ConstantColor_value_feature = Value _UI_BasicFont_faceName_feature = Face Name _UI_BasicFont_height_feature = Height _UI_BasicFont_style_feature = Style _UI_Point_x_feature = X _UI_Point_y_feature = Y _UI_Dimension_dx_feature = Dx _UI_Dimension_dy_feature = Dy _UI_Insets_top_feature = Top _UI_Insets_left_feature = Left _UI_Insets_bottom_feature = Bottom _UI_Insets_right_feature = Right _UI_LineBorder_color_feature = Color _UI_LineBorder_width_feature = Width _UI_MarginBorder_insets_feature = Insets _UI_CompoundBorder_outer_feature = Outer _UI_CompoundBorder_inner_feature = Inner _UI_LayoutData_owner_feature = Owner _UI_GridLayoutData_grabExcessHorizontalSpace_feature = Grab Excess Horizontal Space _UI_GridLayoutData_grabExcessVerticalSpace_feature = Grab Excess Vertical Space _UI_GridLayoutData_verticalAlignment_feature = Vertical Alignment _UI_GridLayoutData_horizontalAlignment_feature = Horizontal Alignment _UI_GridLayoutData_verticalSpan_feature = Vertical Span _UI_GridLayoutData_horizontalSpan_feature = Horizontal Span _UI_GridLayoutData_horizontalIndent_feature = Horizontal Indent _UI_GridLayoutData_sizeHint_feature = Size Hint _UI_BorderLayoutData_alignment_feature = Alignment _UI_BorderLayoutData_vertical_feature = Vertical _UI_Layoutable_layoutData_feature = Layout Data _UI_Layoutable_layout_feature = Layout _UI_GridLayout_numColumns_feature = Num Columns _UI_GridLayout_equalWidth_feature = Equal Width _UI_GridLayout_margins_feature = Margins _UI_GridLayout_spacing_feature = Spacing _UI_BorderLayout_spacing_feature = Spacing _UI_CustomAttribute_name_feature = Name _UI_CustomAttribute_value_feature = Value _UI_CustomAttribute_directAccess_feature = Direct Access _UI_CustomAttribute_multiStatementValue_feature = Multi Statement Value _UI_FlowLayout_vertical_feature = Vertical _UI_FlowLayout_matchMinorSize_feature = Match Minor Size _UI_FlowLayout_forceSingleLine_feature = Force Single Line _UI_FlowLayout_majorAlignment_feature = Major Alignment _UI_FlowLayout_minorAlignment_feature = Minor Alignment _UI_FlowLayout_majorSpacing_feature = Major Spacing _UI_FlowLayout_minorSpacing_feature = Minor Spacing _UI_XYLayoutData_topLeft_feature = Top Left _UI_XYLayoutData_size_feature = Size _UI_Unknown_feature = Unspecified _UI_ColorConstants_white_literal = white _UI_ColorConstants_black_literal = black _UI_ColorConstants_lightGray_literal = lightGray _UI_ColorConstants_gray_literal = gray _UI_ColorConstants_darkGray_literal = darkGray _UI_ColorConstants_red_literal = red _UI_ColorConstants_orange_literal = orange _UI_ColorConstants_yellow_literal = yellow _UI_ColorConstants_green_literal = green _UI_ColorConstants_lightGreen_literal = lightGreen _UI_ColorConstants_darkGreen_literal = darkGreen _UI_ColorConstants_cyan_literal = cyan _UI_ColorConstants_lightBlue_literal = lightBlue _UI_ColorConstants_blue_literal = blue _UI_ColorConstants_darkBlue_literal = darkBlue _UI_FontStyle_NORMAL_literal = NORMAL _UI_FontStyle_BOLD_literal = BOLD _UI_FontStyle_ITALIC_literal = ITALIC _UI_Direction_NONE_literal = NONE _UI_Direction_NORTH_literal = NORTH _UI_Direction_SOUTH_literal = SOUTH _UI_Direction_WEST_literal = WEST _UI_Direction_EAST_literal = EAST _UI_Direction_NORTH_EAST_literal = NORTH_EAST _UI_Direction_NORTH_WEST_literal = NORTH_WEST _UI_Direction_SOUTH_EAST_literal = SOUTH_EAST _UI_Direction_SOUTH_WEST_literal = SOUTH_WEST _UI_Direction_NORTH_SOUTH_literal = NORTH_SOUTH _UI_Direction_EAST_WEST_literal = EAST_WEST _UI_Direction_NSEW_literal = NSEW _UI_LineKind_LINE_SOLID_literal = LINE_SOLID _UI_LineKind_LINE_DASH_literal = LINE_DASH _UI_LineKind_LINE_DOT_literal = LINE_DOT _UI_LineKind_LINE_DASHDOT_literal = LINE_DASHDOT _UI_LineKind_LINE_DASHDOTDOT_literal = LINE_DASHDOTDOT _UI_LineKind_LINE_CUSTOM_literal = LINE_CUSTOM _UI_Alignment_BEGINNING_literal = BEGINNING _UI_Alignment_CENTER_literal = CENTER _UI_Alignment_END_literal = END _UI_Alignment_FILL_literal = FILL _UI_FigureHandle_type = Figure Handle _UI_FigureHandle_referencingElements_feature = Referencing Elements _UI_FigureAccessor_type = Figure Accessor _UI_FigureAccessor_accessor_feature = Accessor _UI_FigureAccessor_typedFigure_feature = Typed Figure _UI_ScalablePolygon_type = Scalable Polygon + _UI_DefaultSizeFacet_type = Default Size Facet _UI_DefaultSizeFacet_defaultSize_feature = Default Size \ No newline at end of file Index: src/org/eclipse/gmf/gmfgraph/provider/DiagramElementItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/DiagramElementItemProvider.java,v retrieving revision 1.4 diff -u -r1.4 DiagramElementItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/DiagramElementItemProvider.java 17 May 2006 14:22:41 -0000 1.4 +++ src/org/eclipse/gmf/gmfgraph/provider/DiagramElementItemProvider.java 1 Sep 2006 14:27:47 -0000 @@ -189,6 +189,11 @@ (createChildParameter (GMFGraphPackage.eINSTANCE.getDiagramElement_Facets(), GMFGraphFactory.eINSTANCE.createLabelOffsetFacet())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getDiagramElement_Facets(), + GMFGraphFactory.eINSTANCE.createDefaultSizeFacet())); } /** Index: src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java,v retrieving revision 1.9 diff -u -r1.9 GMFGraphItemProviderAdapterFactory.java --- src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java 24 Aug 2006 15:38:49 -0000 1.9 +++ src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java 1 Sep 2006 14:27:47 -0000 @@ -294,6 +294,28 @@ } /** + * This keeps track of the one adapter used for all {@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet} instances. + * + * + * @generated + */ + protected DefaultSizeFacetItemProvider defaultSizeFacetItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet}. + * + * + * @generated + */ + public Adapter createDefaultSizeFacetAdapter() { + if (defaultSizeFacetItemProvider == null) { + defaultSizeFacetItemProvider = new DefaultSizeFacetItemProvider(this); + } + + return defaultSizeFacetItemProvider; + } + + /** * This keeps track of the one adapter used for all {@link org.eclipse.gmf.gmfgraph.FigureRef} instances. * * @@ -1213,6 +1235,7 @@ if (alignmentFacetItemProvider != null) alignmentFacetItemProvider.dispose(); if (gradientFacetItemProvider != null) gradientFacetItemProvider.dispose(); if (labelOffsetFacetItemProvider != null) labelOffsetFacetItemProvider.dispose(); + if (defaultSizeFacetItemProvider != null) defaultSizeFacetItemProvider.dispose(); if (figureRefItemProvider != null) figureRefItemProvider.dispose(); if (labelItemProvider != null) labelItemProvider.dispose(); if (labeledContainerItemProvider != null) labeledContainerItemProvider.dispose(); Index: icons/full/obj16/DefaultSizeFacet.gif =================================================================== RCS file: icons/full/obj16/DefaultSizeFacet.gif diff -N icons/full/obj16/DefaultSizeFacet.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/obj16/DefaultSizeFacet.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89a³€€€€ÀÀÀ€€€ÿÿÀÀÀÿÿÿÿÿÿÀÀÀœœœ€€€SÆŒ!ù ,.0ÉI«½8ëôö$áqE·5Úd`J ¡õ<.ñ–&Õ6wŒ©)-§‰FÄ‘; Index: icons/full/ctool16/CreateDiagramElement_facets_DefaultSizeFacet.gif =================================================================== RCS file: icons/full/ctool16/CreateDiagramElement_facets_DefaultSizeFacet.gif diff -N icons/full/ctool16/CreateDiagramElement_facets_DefaultSizeFacet.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/ctool16/CreateDiagramElement_facets_DefaultSizeFacet.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89aÄÿÿÿßß¿??_ÀÀÀœœœ€€€SÆŒÿÿ_Ÿ_?ÿß?€€€ÀÀÀ™Ìf€€€@@@º—&º—&µ’#®Š¥‚žy™tþýïþýïýóÏýóÏüç£û݃!ù,\ ŽdY>&™ÍÔе’?ƒŽ’tI3ó4ŒÖk’)'?ciCQ(›§ÈŽ*œÊÉF:,&ßKD8R€›è`ð¢É‡¡`FØ„|Ûm*Ëégol|‚e?‚k%!; Index: src/org/eclipse/gmf/gmfgraph/provider/DefaultSizeFacetItemProvider.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/provider/DefaultSizeFacetItemProvider.java diff -N src/org/eclipse/gmf/gmfgraph/provider/DefaultSizeFacetItemProvider.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/provider/DefaultSizeFacetItemProvider.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,148 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.gmf.gmfgraph.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import org.eclipse.gmf.gmfgraph.DefaultSizeFacet; +import org.eclipse.gmf.gmfgraph.GMFGraphFactory; +import org.eclipse.gmf.gmfgraph.GMFGraphPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet} object. + * + * + * @generated + */ +public class DefaultSizeFacetItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public DefaultSizeFacetItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(GMFGraphPackage.eINSTANCE.getDefaultSizeFacet_DefaultSize()); + } + return childrenFeatures; + } + + /** + * This returns DefaultSizeFacet.gif. + * + * + * @generated + */ + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/DefaultSizeFacet")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + public String getText(Object object) { + return getString("_UI_DefaultSizeFacet_type"); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(DefaultSizeFacet.class)) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s + * describing all of the children that can be created under this object. + * + * + * @generated + */ + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getDefaultSizeFacet_DefaultSize(), + GMFGraphFactory.eINSTANCE.createDimension())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + public ResourceLocator getResourceLocator() { + return GMFGraphEditPlugin.INSTANCE; + } + +} Index: icons/full/ctool16/CreateDefaultSizeFacet_defaultSize_Dimension.gif =================================================================== RCS file: icons/full/ctool16/CreateDefaultSizeFacet_defaultSize_Dimension.gif diff -N icons/full/ctool16/CreateDefaultSizeFacet_defaultSize_Dimension.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/ctool16/CreateDefaultSizeFacet_defaultSize_Dimension.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89aÄÿÿÿßß¿??_ÀÀÀœœœ€€€™3fÿÿ_Ÿ_?ÿß?€€€ÀÀÀœœœ€€€SÆŒº—&º—&µ’#®Š¥‚žy™tþýïþýïýóÏýóÏüç£û݃!ù,\ ŽdY>&™ÍÔе’?ƒŽ’tI3ó4ŒÖk’)'?ciCQ(›§ÈŽ*œÊÉF:,&ßKD8R€›è`ð¢É‡¡`FØ„|Ûm*Ëégol|‚e?‚k%!; #P org.eclipse.gmf.graphdef Index: src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java,v retrieving revision 1.9 diff -u -r1.9 GMFGraphFactory.java --- src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java 24 Aug 2006 15:38:47 -0000 1.9 +++ src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java 1 Sep 2006 14:27:49 -0000 @@ -116,6 +116,15 @@ LabelOffsetFacet createLabelOffsetFacet(); /** + * Returns a new object of class 'Default Size Facet'. + * + * + * @return a new object of class 'Default Size Facet'. + * @generated + */ + DefaultSizeFacet createDefaultSizeFacet(); + + /** * Returns a new object of class 'Figure Ref'. * * Index: src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java,v retrieving revision 1.18 diff -u -r1.18 GMFGraphPackage.java --- src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java 25 Aug 2006 18:56:02 -0000 1.18 +++ src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java 1 Sep 2006 14:27:51 -0000 @@ -677,6 +677,34 @@ int LABEL_OFFSET_FACET_FEATURE_COUNT = VISUAL_FACET_FEATURE_COUNT + 2; /** + * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.DefaultSizeFacetImpl Default Size Facet}' class. + * + * + * @see org.eclipse.gmf.gmfgraph.impl.DefaultSizeFacetImpl + * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDefaultSizeFacet() + * @generated + */ + int DEFAULT_SIZE_FACET = 13; + + /** + * The feature id for the 'Default Size' containment reference. + * + * + * @generated + * @ordered + */ + int DEFAULT_SIZE_FACET__DEFAULT_SIZE = VISUAL_FACET_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Default Size Facet' class. + * + * + * @generated + * @ordered + */ + int DEFAULT_SIZE_FACET_FEATURE_COUNT = VISUAL_FACET_FEATURE_COUNT + 1; + + /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Layoutable Layoutable}' class. * * @@ -684,7 +712,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayoutable() * @generated */ - int LAYOUTABLE = 54; + int LAYOUTABLE = 55; /** * The feature id for the 'Layout Data' containment reference. @@ -721,7 +749,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigureMarker() * @generated */ - int FIGURE_MARKER = 13; + int FIGURE_MARKER = 14; /** * The feature id for the 'Layout Data' containment reference. @@ -767,7 +795,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigureHandle() * @generated */ - int FIGURE_HANDLE = 14; + int FIGURE_HANDLE = 15; /** * The feature id for the 'Referencing Elements' reference list. @@ -795,7 +823,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigure() * @generated */ - int FIGURE = 15; + int FIGURE = 16; /** * The feature id for the 'Layout Data' containment reference. @@ -958,7 +986,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigureRef() * @generated */ - int FIGURE_REF = 16; + int FIGURE_REF = 17; /** * The feature id for the 'Layout Data' containment reference. @@ -1013,7 +1041,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getConnectionFigure() * @generated */ - int CONNECTION_FIGURE = 17; + int CONNECTION_FIGURE = 18; /** * The feature id for the 'Layout Data' containment reference. @@ -1176,7 +1204,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDecorationFigure() * @generated */ - int DECORATION_FIGURE = 18; + int DECORATION_FIGURE = 19; /** * The feature id for the 'Layout Data' containment reference. @@ -1339,7 +1367,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getShape() * @generated */ - int SHAPE = 19; + int SHAPE = 20; /** * The feature id for the 'Layout Data' containment reference. @@ -1565,7 +1593,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLabel() * @generated */ - int LABEL = 20; + int LABEL = 21; /** * The feature id for the 'Layout Data' containment reference. @@ -1737,7 +1765,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLabeledContainer() * @generated */ - int LABELED_CONTAINER = 21; + int LABELED_CONTAINER = 22; /** * The feature id for the 'Layout Data' containment reference. @@ -1900,7 +1928,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getRectangle() * @generated */ - int RECTANGLE = 22; + int RECTANGLE = 23; /** * The feature id for the 'Layout Data' containment reference. @@ -2126,7 +2154,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getRoundedRectangle() * @generated */ - int ROUNDED_RECTANGLE = 23; + int ROUNDED_RECTANGLE = 24; /** * The feature id for the 'Layout Data' containment reference. @@ -2370,7 +2398,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getEllipse() * @generated */ - int ELLIPSE = 24; + int ELLIPSE = 25; /** * The feature id for the 'Layout Data' containment reference. @@ -2596,7 +2624,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolyline() * @generated */ - int POLYLINE = 25; + int POLYLINE = 26; /** * The feature id for the 'Layout Data' containment reference. @@ -2831,7 +2859,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolygon() * @generated */ - int POLYGON = 26; + int POLYGON = 27; /** * The feature id for the 'Layout Data' containment reference. @@ -3066,7 +3094,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getScalablePolygon() * @generated */ - int SCALABLE_POLYGON = 27; + int SCALABLE_POLYGON = 28; /** * The feature id for the 'Layout Data' containment reference. @@ -3301,7 +3329,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolylineConnection() * @generated */ - int POLYLINE_CONNECTION = 28; + int POLYLINE_CONNECTION = 29; /** * The feature id for the 'Layout Data' containment reference. @@ -3554,7 +3582,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolylineDecoration() * @generated */ - int POLYLINE_DECORATION = 29; + int POLYLINE_DECORATION = 30; /** * The feature id for the 'Layout Data' containment reference. @@ -3789,7 +3817,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolygonDecoration() * @generated */ - int POLYGON_DECORATION = 30; + int POLYGON_DECORATION = 31; /** * The feature id for the 'Layout Data' containment reference. @@ -4024,7 +4052,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomClass() * @generated */ - int CUSTOM_CLASS = 31; + int CUSTOM_CLASS = 32; /** * The feature id for the 'Qualified Class Name' attribute. @@ -4070,7 +4098,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomFigure() * @generated */ - int CUSTOM_FIGURE = 34; + int CUSTOM_FIGURE = 35; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomDecorationImpl Custom Decoration}' class. @@ -4080,7 +4108,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomDecoration() * @generated */ - int CUSTOM_DECORATION = 35; + int CUSTOM_DECORATION = 36; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomConnectionImpl Custom Connection}' class. @@ -4090,7 +4118,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomConnection() * @generated */ - int CUSTOM_CONNECTION = 36; + int CUSTOM_CONNECTION = 37; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Color Color}' class. @@ -4100,7 +4128,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getColor() * @generated */ - int COLOR = 37; + int COLOR = 38; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.RGBColorImpl RGB Color}' class. @@ -4110,7 +4138,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getRGBColor() * @generated */ - int RGB_COLOR = 38; + int RGB_COLOR = 39; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.ConstantColorImpl Constant Color}' class. @@ -4120,7 +4148,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getConstantColor() * @generated */ - int CONSTANT_COLOR = 39; + int CONSTANT_COLOR = 40; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Font Font}' class. @@ -4130,7 +4158,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFont() * @generated */ - int FONT = 40; + int FONT = 41; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BasicFontImpl Basic Font}' class. @@ -4140,7 +4168,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBasicFont() * @generated */ - int BASIC_FONT = 41; + int BASIC_FONT = 42; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.FontStyle Font Style}' enum. @@ -4150,7 +4178,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFontStyle() * @generated */ - int FONT_STYLE = 64; + int FONT_STYLE = 65; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.PointImpl Point}' class. @@ -4160,7 +4188,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPoint() * @generated */ - int POINT = 42; + int POINT = 43; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.DimensionImpl Dimension}' class. @@ -4170,7 +4198,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDimension() * @generated */ - int DIMENSION = 43; + int DIMENSION = 44; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.InsetsImpl Insets}' class. @@ -4180,7 +4208,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getInsets() * @generated */ - int INSETS = 44; + int INSETS = 45; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Border Border}' class. @@ -4190,7 +4218,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorder() * @generated */ - int BORDER = 45; + int BORDER = 46; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.LineBorderImpl Line Border}' class. @@ -4200,7 +4228,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLineBorder() * @generated */ - int LINE_BORDER = 46; + int LINE_BORDER = 47; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.MarginBorderImpl Margin Border}' class. @@ -4210,7 +4238,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getMarginBorder() * @generated */ - int MARGIN_BORDER = 47; + int MARGIN_BORDER = 48; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CompoundBorderImpl Compound Border}' class. @@ -4220,7 +4248,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCompoundBorder() * @generated */ - int COMPOUND_BORDER = 48; + int COMPOUND_BORDER = 49; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomBorderImpl Custom Border}' class. @@ -4230,7 +4258,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomBorder() * @generated */ - int CUSTOM_BORDER = 49; + int CUSTOM_BORDER = 50; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.LayoutData Layout Data}' class. @@ -4240,7 +4268,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayoutData() * @generated */ - int LAYOUT_DATA = 50; + int LAYOUT_DATA = 51; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.GridLayoutDataImpl Grid Layout Data}' class. @@ -4250,7 +4278,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getGridLayoutData() * @generated */ - int GRID_LAYOUT_DATA = 52; + int GRID_LAYOUT_DATA = 53; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BorderLayoutDataImpl Border Layout Data}' class. @@ -4260,7 +4288,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorderLayoutData() * @generated */ - int BORDER_LAYOUT_DATA = 53; + int BORDER_LAYOUT_DATA = 54; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomLayoutImpl Custom Layout}' class. @@ -4270,7 +4298,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomLayout() * @generated */ - int CUSTOM_LAYOUT = 56; + int CUSTOM_LAYOUT = 57; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Layout Layout}' class. @@ -4280,7 +4308,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayout() * @generated */ - int LAYOUT = 55; + int LAYOUT = 56; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomLayoutDataImpl Custom Layout Data}' class. @@ -4290,7 +4318,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomLayoutData() * @generated */ - int CUSTOM_LAYOUT_DATA = 51; + int CUSTOM_LAYOUT_DATA = 52; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.GridLayoutImpl Grid Layout}' class. @@ -4300,7 +4328,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getGridLayout() * @generated */ - int GRID_LAYOUT = 57; + int GRID_LAYOUT = 58; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BorderLayoutImpl Border Layout}' class. @@ -4310,7 +4338,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorderLayout() * @generated */ - int BORDER_LAYOUT = 58; + int BORDER_LAYOUT = 59; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomAttributeImpl Custom Attribute}' class. @@ -4320,7 +4348,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomAttribute() * @generated */ - int CUSTOM_ATTRIBUTE = 32; + int CUSTOM_ATTRIBUTE = 33; /** * The feature id for the 'Name' attribute. @@ -4375,7 +4403,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigureAccessor() * @generated */ - int FIGURE_ACCESSOR = 33; + int FIGURE_ACCESSOR = 34; /** * The feature id for the 'Referencing Elements' reference list. @@ -5609,7 +5637,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFlowLayout() * @generated */ - int FLOW_LAYOUT = 59; + int FLOW_LAYOUT = 60; /** * The feature id for the 'Vertical' attribute. @@ -5691,7 +5719,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getXYLayout() * @generated */ - int XY_LAYOUT = 60; + int XY_LAYOUT = 61; /** * The number of structural features of the 'XY Layout' class. @@ -5710,7 +5738,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getXYLayoutData() * @generated */ - int XY_LAYOUT_DATA = 61; + int XY_LAYOUT_DATA = 62; /** * The feature id for the 'Owner' container reference. @@ -5756,7 +5784,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getStackLayout() * @generated */ - int STACK_LAYOUT = 62; + int STACK_LAYOUT = 63; /** * The number of structural features of the 'Stack Layout' class. @@ -5775,7 +5803,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getColorConstants() * @generated */ - int COLOR_CONSTANTS = 63; + int COLOR_CONSTANTS = 64; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Direction Direction}' enum. @@ -5785,7 +5813,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDirection() * @generated */ - int DIRECTION = 65; + int DIRECTION = 66; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.LineKind Line Kind}' enum. @@ -5795,7 +5823,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLineKind() * @generated */ - int LINE_KIND = 66; + int LINE_KIND = 67; /** @@ -5806,7 +5834,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getAlignment() * @generated */ - int ALIGNMENT = 67; + int ALIGNMENT = 68; /** @@ -6193,6 +6221,27 @@ EAttribute getLabelOffsetFacet_Y(); /** + * Returns the meta object for class '{@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet Default Size Facet}'. + * + * + * @return the meta object for class 'Default Size Facet'. + * @see org.eclipse.gmf.gmfgraph.DefaultSizeFacet + * @generated + */ + EClass getDefaultSizeFacet(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet#getDefaultSize Default Size}'. + * + * + * @return the meta object for the containment reference 'Default Size'. + * @see org.eclipse.gmf.gmfgraph.DefaultSizeFacet#getDefaultSize() + * @see #getDefaultSizeFacet() + * @generated + */ + EReference getDefaultSizeFacet_DefaultSize(); + + /** * Returns the meta object for class '{@link org.eclipse.gmf.gmfgraph.FigureMarker Figure Marker}'. * * Index: src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java,v retrieving revision 1.13 diff -u -r1.13 GMFGraphAdapterFactory.java --- src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java 24 Aug 2006 15:38:47 -0000 1.13 +++ src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java 1 Sep 2006 14:27:52 -0000 @@ -170,6 +170,9 @@ public Object caseLabelOffsetFacet(LabelOffsetFacet object) { return createLabelOffsetFacetAdapter(); } + public Object caseDefaultSizeFacet(DefaultSizeFacet object) { + return createDefaultSizeFacetAdapter(); + } public Object caseFigureMarker(FigureMarker object) { return createFigureMarkerAdapter(); } @@ -521,6 +524,20 @@ } /** + * Creates a new adapter for an object of class '{@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet Default Size Facet}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.gmf.gmfgraph.DefaultSizeFacet + * @generated + */ + public Adapter createDefaultSizeFacetAdapter() { + return null; + } + + /** * Creates a new adapter for an object of class '{@link org.eclipse.gmf.gmfgraph.FigureMarker Figure Marker}'. * * This default implementation returns null so that we can easily ignore cases; Index: src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java,v retrieving revision 1.15 diff -u -r1.15 GMFGraphSwitch.java --- src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java 24 Aug 2006 15:38:47 -0000 1.15 +++ src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java 1 Sep 2006 14:27:52 -0000 @@ -244,6 +244,13 @@ if (result == null) result = defaultCase(theEObject); return result; } + case GMFGraphPackage.DEFAULT_SIZE_FACET: { + DefaultSizeFacet defaultSizeFacet = (DefaultSizeFacet)theEObject; + Object result = caseDefaultSizeFacet(defaultSizeFacet); + if (result == null) result = caseVisualFacet(defaultSizeFacet); + if (result == null) result = defaultCase(theEObject); + return result; + } case GMFGraphPackage.FIGURE_MARKER: { FigureMarker figureMarker = (FigureMarker)theEObject; Object result = caseFigureMarker(figureMarker); @@ -883,6 +890,21 @@ } /** + * Returns the result of interpretting the object as an instance of 'Default Size Facet'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpretting the object as an instance of 'Default Size Facet'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseDefaultSizeFacet(DefaultSizeFacet object) { + return null; + } + + /** * Returns the result of interpretting the object as an instance of 'Figure Marker'. * * This implementation returns null; Index: models/gmfgraph.ecore =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/models/gmfgraph.ecore,v retrieving revision 1.25 diff -u -r1.25 gmfgraph.ecore --- models/gmfgraph.ecore 25 Aug 2006 18:33:03 -0000 1.25 +++ models/gmfgraph.ecore 1 Sep 2006 14:27:49 -0000 @@ -102,6 +102,10 @@ + + +
Index: models/gmfgraph.genmodel =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel,v retrieving revision 1.20 diff -u -r1.20 gmfgraph.genmodel --- models/gmfgraph.genmodel 25 Aug 2006 18:33:03 -0000 1.20 +++ models/gmfgraph.genmodel 1 Sep 2006 14:27:49 -0000 @@ -108,6 +108,9 @@ + + + Index: src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java,v retrieving revision 1.24 diff -u -r1.24 GMFGraphPackageImpl.java --- src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java 25 Aug 2006 18:33:02 -0000 1.24 +++ src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java 1 Sep 2006 14:27:52 -0000 @@ -36,6 +36,7 @@ import org.eclipse.gmf.gmfgraph.CustomLayout; import org.eclipse.gmf.gmfgraph.CustomLayoutData; import org.eclipse.gmf.gmfgraph.DecorationFigure; +import org.eclipse.gmf.gmfgraph.DefaultSizeFacet; import org.eclipse.gmf.gmfgraph.DiagramElement; import org.eclipse.gmf.gmfgraph.DiagramLabel; import org.eclipse.gmf.gmfgraph.Dimension; @@ -187,6 +188,13 @@ * * @generated */ + private EClass defaultSizeFacetEClass = null; + + /** + * + * + * @generated + */ private EClass figureMarkerEClass = null; /** @@ -964,6 +972,24 @@ * * @generated */ + public EClass getDefaultSizeFacet() { + return defaultSizeFacetEClass; + } + + /** + * + * + * @generated + */ + public EReference getDefaultSizeFacet_DefaultSize() { + return (EReference)defaultSizeFacetEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ public EClass getFigureMarker() { return figureMarkerEClass; } @@ -2287,6 +2313,9 @@ createEAttribute(labelOffsetFacetEClass, LABEL_OFFSET_FACET__X); createEAttribute(labelOffsetFacetEClass, LABEL_OFFSET_FACET__Y); + defaultSizeFacetEClass = createEClass(DEFAULT_SIZE_FACET); + createEReference(defaultSizeFacetEClass, DEFAULT_SIZE_FACET__DEFAULT_SIZE); + figureMarkerEClass = createEClass(FIGURE_MARKER); createEReference(figureMarkerEClass, FIGURE_MARKER__PARENT); @@ -2514,6 +2543,7 @@ alignmentFacetEClass.getESuperTypes().add(this.getVisualFacet()); gradientFacetEClass.getESuperTypes().add(this.getVisualFacet()); labelOffsetFacetEClass.getESuperTypes().add(this.getVisualFacet()); + defaultSizeFacetEClass.getESuperTypes().add(this.getVisualFacet()); figureMarkerEClass.getESuperTypes().add(this.getLayoutable()); figureEClass.getESuperTypes().add(this.getFigureMarker()); figureEClass.getESuperTypes().add(this.getFigureHandle()); @@ -2617,6 +2647,9 @@ initEAttribute(getLabelOffsetFacet_X(), ecorePackage.getEInt(), "x", null, 0, 1, LabelOffsetFacet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLabelOffsetFacet_Y(), ecorePackage.getEInt(), "y", null, 0, 1, LabelOffsetFacet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(defaultSizeFacetEClass, DefaultSizeFacet.class, "DefaultSizeFacet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getDefaultSizeFacet_DefaultSize(), this.getDimension(), null, "defaultSize", null, 0, 1, DefaultSizeFacet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(figureMarkerEClass, FigureMarker.class, "FigureMarker", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getFigureMarker_Parent(), this.getFigure(), this.getFigure_Children(), "parent", null, 0, 1, FigureMarker.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); Index: src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java,v retrieving revision 1.14 diff -u -r1.14 GMFGraphFactoryImpl.java --- src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java 24 Aug 2006 15:38:46 -0000 1.14 +++ src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java 1 Sep 2006 14:27:51 -0000 @@ -121,6 +121,7 @@ case GMFGraphPackage.ALIGNMENT_FACET: return createAlignmentFacet(); case GMFGraphPackage.GRADIENT_FACET: return createGradientFacet(); case GMFGraphPackage.LABEL_OFFSET_FACET: return createLabelOffsetFacet(); + case GMFGraphPackage.DEFAULT_SIZE_FACET: return createDefaultSizeFacet(); case GMFGraphPackage.FIGURE_REF: return createFigureRef(); case GMFGraphPackage.LABEL: return createLabel(); case GMFGraphPackage.LABELED_CONTAINER: return createLabeledContainer(); @@ -312,6 +313,16 @@ * * @generated */ + public DefaultSizeFacet createDefaultSizeFacet() { + DefaultSizeFacetImpl defaultSizeFacet = new DefaultSizeFacetImpl(); + return defaultSizeFacet; + } + + /** + * + * + * @generated + */ public FigureRef createFigureRef() { FigureRefImpl figureRef = new FigureRefImpl(); return figureRef; Index: src/org/eclipse/gmf/gmfgraph/DefaultSizeFacet.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/DefaultSizeFacet.java diff -N src/org/eclipse/gmf/gmfgraph/DefaultSizeFacet.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/DefaultSizeFacet.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.gmf.gmfgraph; + + +/** + * + * A representation of the model object 'Default Size Facet'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet#getDefaultSize Default Size}
  • + *
+ *

+ * + * @see org.eclipse.gmf.gmfgraph.GMFGraphPackage#getDefaultSizeFacet() + * @model + * @generated + */ +public interface DefaultSizeFacet extends VisualFacet { + /** + * Returns the value of the 'Default Size' containment reference. + * + *

+ * If the meaning of the 'Default Size' containment reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Default Size' containment reference. + * @see #setDefaultSize(Dimension) + * @see org.eclipse.gmf.gmfgraph.GMFGraphPackage#getDefaultSizeFacet_DefaultSize() + * @model containment="true" + * @generated + */ + Dimension getDefaultSize(); + + /** + * Sets the value of the '{@link org.eclipse.gmf.gmfgraph.DefaultSizeFacet#getDefaultSize Default Size}' containment reference. + * + * + * @param value the new value of the 'Default Size' containment reference. + * @see #getDefaultSize() + * @generated + */ + void setDefaultSize(Dimension value); + +} // DefaultSizeFacet Index: src/org/eclipse/gmf/gmfgraph/impl/DefaultSizeFacetImpl.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/impl/DefaultSizeFacetImpl.java diff -N src/org/eclipse/gmf/gmfgraph/impl/DefaultSizeFacetImpl.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/impl/DefaultSizeFacetImpl.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,174 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.gmf.gmfgraph.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.gmf.gmfgraph.DefaultSizeFacet; +import org.eclipse.gmf.gmfgraph.Dimension; +import org.eclipse.gmf.gmfgraph.GMFGraphPackage; + +/** + * + * An implementation of the model object 'Default Size Facet'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.gmf.gmfgraph.impl.DefaultSizeFacetImpl#getDefaultSize Default Size}
  • + *
+ *

+ * + * @generated + */ +public class DefaultSizeFacetImpl extends EObjectImpl implements DefaultSizeFacet { + /** + * The cached value of the '{@link #getDefaultSize() Default Size}' containment reference. + * + * + * @see #getDefaultSize() + * @generated + * @ordered + */ + protected Dimension defaultSize = null; + + /** + * + * + * @generated + */ + protected DefaultSizeFacetImpl() { + super(); + } + + /** + * + * + * @generated + */ + protected EClass eStaticClass() { + return GMFGraphPackage.eINSTANCE.getDefaultSizeFacet(); + } + + /** + * + * + * @generated + */ + public Dimension getDefaultSize() { + return defaultSize; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDefaultSize(Dimension newDefaultSize, NotificationChain msgs) { + Dimension oldDefaultSize = defaultSize; + defaultSize = newDefaultSize; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE, oldDefaultSize, newDefaultSize); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setDefaultSize(Dimension newDefaultSize) { + if (newDefaultSize != defaultSize) { + NotificationChain msgs = null; + if (defaultSize != null) + msgs = ((InternalEObject)defaultSize).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE, null, msgs); + if (newDefaultSize != null) + msgs = ((InternalEObject)newDefaultSize).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE, null, msgs); + msgs = basicSetDefaultSize(newDefaultSize, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE, newDefaultSize, newDefaultSize)); + } + + /** + * + * + * @generated + */ + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + return basicSetDefaultSize(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + return getDefaultSize(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + setDefaultSize((Dimension)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + public void eUnset(int featureID) { + switch (featureID) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + setDefaultSize((Dimension)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + public boolean eIsSet(int featureID) { + switch (featureID) { + case GMFGraphPackage.DEFAULT_SIZE_FACET__DEFAULT_SIZE: + return defaultSize != null; + } + return super.eIsSet(featureID); + } + +} //DefaultSizeFacetImpl Index: models/gmfgraph.emf =================================================================== RCS file: models/gmfgraph.emf diff -N models/gmfgraph.emf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ models/gmfgraph.emf 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,424 @@ +@namespace(uri="http://www.eclipse.org/gmf/2005/GraphicalDefinition", prefix="gmfgraph") +package gmfgraph; // TODO rename to graphdef. Sic! + +// THINK OVER: template file name from eObjInstance.eClass() U eSuperInterfaces() - to find most specific template +// for the figure instance and to facilitate extended models + +class Canvas extends Identity { + @genmodel(documentation="containment here doesn't restrict nodes/connection from using figure galeries defined elsewhere. No assumption should be made whether or not node/connection figure is defined in the galery beloning to this canvas") + val FigureGallery[*] figures; + val Node[*] nodes; + val Connection[*] connections; + val Compartment[*] compartments; + val DiagramLabel[*] labels; +} + +@genmodel(documentation="Kind of explicit figure library notion. Bundle of figures. Allows to specify plugin id (allows importing it later from gmfgen code) in addition to figures") +class FigureGallery extends Identity { + val Figure[*] figures; + attr String implementationBundle; +} + +@genmodel(documentation="Easy and readable way to reference element of the model from another one") +interface Identity { + id attr String[1] name; +} + +// doesn't extend FigureRef, otherwise, DiagramElement could become children of Figure +abstract class DiagramElement extends Identity { + ref FigureHandle[1]#referencingElements figure; + @genmodel(documentation="anything to further specify constraint or any other aspect of the element") + val VisualFacet[*] facets; + @genmodel(documentation="utility operation to get first visual facet assignable (in Java terms, {@link Class#isAssignableFrom(Class)}) to variables of designated class. Argument can't be null") + op VisualFacet find(Class facetClass); +} + +class Node extends DiagramElement { + @genmodel(documentation="Specializes DiagramElement.figure") + readonly derived transient volatile !resolve ref Figure[1] nodeFigure; // in fact, DiagramLabel which extends Node breaks this constraint, just because DL SHOULD NOT extend Node, but rather some common AbstractNode superclass. + attr Direction resizeConstraint = "NSEW"; // #114061. As a facet, perhaps? + attr Direction affixedParentSide = "NONE"; + // TODO map connection-anchor +} + +class Connection extends DiagramElement { + @genmodel(documentation="Specializes DiagramElement.figure") + readonly derived transient volatile !resolve ref Figure[1] connectionFigure; +// constraint: super.figure instanceof ConnectionFigure + // boolean bendable? +} +class Compartment extends DiagramElement { + attr boolean collapsible; + attr boolean needsTitle; +} +class DiagramLabel extends Node { // doesn't follow Figure[1] nodeFigure from superclass Node because DL is not essentially Node + attr boolean elementIcon = true; +} + +interface VisualFacet { +} + +@genmodel(documentation="provide means to attach arbitrary data to your diagram element definition. It's up to you (template author) to process it somehow.") +class GeneralFacet extends VisualFacet { + id attr String[?] identifier; + attr String data; +} + +@genmodel(documentation="Makes sense for DiagramLabels of Links only (now). Constants from {@link org.eclipse.draw2d.ConnectionLocator} are: MIDDLE = Alignment.CENTER, TARGET = Alignment.END, SOURCE = Alignment.BEGINNING") +class AlignmentFacet extends VisualFacet { + attr Alignment alignment; +} + +class GradientFacet extends VisualFacet { + attr Direction direction; +} + +class LabelOffsetFacet extends VisualFacet { + attr int x; + attr int y; +} + +class DefaultSizeFacet extends VisualFacet { + val Dimension defaultSize; +} + +// LayoutConstraint as VisualFacet? + +// TODO placeholders + + +@genmodel(documentation="Anything you could combine visual representation from. Ordinary GEF figures, custom-defined or references to defined elsewhere.") +interface FigureMarker extends Layoutable { + readonly !resolve ref Figure#children parent; +} + +@genmodel(documentation="Entry in the figure's hierarchy to reference from diagram element") +interface FigureHandle { + ref DiagramElement[*]#figure referencingElements; +} + +@genmodel(documentation="org.eclipse.draw2d.Figure") +interface Figure extends FigureMarker, FigureHandle, Identity { + ordered val FigureMarker[*]#parent children; + val Color foregroundColor; + val Color backgroundColor; + val Dimension maximumSize; + val Dimension minimumSize; + val Dimension preferredSize; + val Font font; + val Insets insets; + val Border border; + val Point[?] location; // relative to parent figure + val Point[?] size; +} + +@genmodel(documentation="Need this to facilitate reuse of figures while keeping (so nice looking) containment relationship in the Figure class") +class FigureRef extends FigureMarker { + @genmodel(documentation="not FigureMarker because don't want to reference figure references.") + ref Figure[1] figure; +} + +interface ConnectionFigure extends Figure { +// typedef connectionRouter? +} +interface DecorationFigure extends Figure { +} + +@genmodel(documentation="org.eclipse.draw2d.Shape") +abstract class Shape extends Figure { + attr boolean outline = true; + attr boolean fill = true; + attr int lineWidth = 1; + attr LineKind lineKind; + attr boolean xorFill; + attr boolean xorOutline; + @genmodel(documentation="Same as children, but resolves child FigureRefs, if any, to Figures") + readonly derived transient volatile ref Figure[*] resolvedChildren; +} + + +// well-known, predefined Figures + +@genmodel(documentation="org.eclipse.draw2d.Label") +class Label extends Figure { + attr String text; +} +@genmodel(documentation="org.eclipse.draw2d.LabeledContainer") +class LabeledContainer extends Figure { +} +// ImageFigure? +// Layer? +// Panel? +// ScrollPane? + + +// well-known, predefined shapes + +@genmodel(documentation="org.eclipse.draw2d.RectangleFigure") +class Rectangle extends Shape { +} + +@genmodel(documentation="org.eclipse.draw2d.RoundedRectangle") +class RoundedRectangle extends Shape { + // FIXME dimension instead of two separate ints? + attr int cornerWidth = 8; // defaults from implementation code + attr int cornerHeight = 8; +} + +@genmodel(documentation="org.eclipse.draw2d.Ellipse") +class Ellipse extends Shape { +} + +@genmodel(documentation="org.eclipse.draw2d.Polyline") +class Polyline extends Shape { + val Point[*] template; +} + +@genmodel(documentation="org.eclipse.draw2d.Polygon") +class Polygon extends Polyline { +} + +@genmodel(documentation="Marker interface to denote polygons with ability to autoscale to fit all available bounds. Separate class is needed instead of property in the Polygon class because of generalization PolygonDecoration extends Polygon") +class ScalablePolygon extends Polygon { +} + +// predefined connections + +// DOES IT MAKE SENSE to extend Polyline - is there usecase for Polyline.template (i.e. predefined connection shape?)? +@genmodel(documentation="org.eclipse.draw2d.PolylineConnection") +class PolylineConnection extends Polyline, ConnectionFigure { + ref DecorationFigure sourceDecoration; + ref DecorationFigure targetDecoration; +} + +// predefined decorations + +@genmodel(documentation="org.eclipse.draw2d.PolylineDecoration") +class PolylineDecoration extends Polyline, DecorationFigure { +// val Point scale?; +} + +@genmodel(documentation="org.eclipse.draw2d.PolygonDecoration") +class PolygonDecoration extends Polygon, DecorationFigure { +// val Point scale?; + +} + +// custom figures + +interface CustomClass { + attr String qualifiedClassName; + attr String bundleName; // TODO remove? Leave one in FigureGallery - works for Figures, but not for, say, Border... + val CustomAttribute[*] attributes; +} + +class CustomAttribute { + attr String[1] name; + attr String[1] value = "null"; + attr boolean[1] directAccess = false; + attr boolean[1] multiStatementValue = false; +} + +class FigureAccessor extends FigureHandle { + attr String[1] accessor; + ref CustomFigure[?] typedFigure; + // add directAccess attribute? +} + +@genmodel(documentation="Any figure class provided by some bundle") +class CustomFigure extends Figure, CustomClass { + val FigureAccessor[*] customChildren; +} + +@genmodel(documentation="Same as CustomFigure, but for Decorations") +class CustomDecoration extends CustomFigure, DecorationFigure { +} + +@genmodel(documentation="Same as CustomFigure, but for Connections") +class CustomConnection extends CustomFigure, ConnectionFigure { +} + +// Misc + +interface Color { +} + +class RGBColor extends Color { + attr int[1] red; + attr int[1] green; + attr int[1] blue; +} + +class ConstantColor extends Color { + attr ColorConstants[1] value; +} + +enum ColorConstants { +// TODO capitalize and use mixed-case values as literals + white; + black; + lightGray; + gray; + darkGray; + red; + orange; + yellow; + green; + lightGreen; + darkGreen; + cyan; + lightBlue; + blue; + darkBlue; +} + +interface Font { +} + +class BasicFont extends Font { + attr String faceName; + attr int height = 9; + attr FontStyle style = "NORMAL"; +} + +enum FontStyle { + NORMAL; + BOLD; + ITALIC; +} + +class Point { + attr int x; + attr int y; +} + +class Dimension { + attr int dx; + attr int dy; +} + +class Insets { + attr int top; + attr int left; + attr int bottom; + attr int right; +} + +interface Border { +} + +class LineBorder extends Border { + val Color color; + attr int width = 1; +} + +class MarginBorder extends Border { + val Insets insets; +} + +class CompoundBorder extends Border { + val Border outer; + val Border inner; +} + +class CustomBorder extends Border, CustomClass { +} + +@genmodel(documentation="Geographical bit constants from org.eclipse.draw2d.PositionConstants") +enum Direction { + NONE = 0; // host can't be resized; see 'directions' attribute in ResizableEditPolicy + NORTH = 1; + SOUTH = 4; + WEST = 8; + EAST = 16; + NORTH_EAST = 17; + NORTH_WEST = 9; + SOUTH_EAST = 20; + SOUTH_WEST = 12; + NORTH_SOUTH = 5; + EAST_WEST = 24; + NSEW = 29; +} + +@genmodel(documentation="org.eclipse.draw2d.Graphics.LINE_* (== org.eclipse.swt.SWT.LINE_*. Values are same as SWT constants") +enum LineKind { + LINE_SOLID = 1; + LINE_DASH = 2; + LINE_DOT = 3; + LINE_DASHDOT = 4; + LINE_DASHDOTDOT = 5; + LINE_CUSTOM = 6; +} + +interface LayoutData { + ref Layoutable[1]#layoutData owner; +} + +class CustomLayoutData extends LayoutData, CustomClass { +} + +class GridLayoutData extends LayoutData { + attr boolean[1] grabExcessHorizontalSpace = false; + attr boolean[1] grabExcessVerticalSpace = false; + attr Alignment[1] verticalAlignment = "CENTER"; + attr Alignment[1] horizontalAlignment = "CENTER"; + attr int[1] verticalSpan = 1; + attr int[1] horizontalSpan = 1; + attr int[1] horizontalIndent; + val Dimension sizeHint; +} + +class BorderLayoutData extends LayoutData { + attr Alignment[1] alignment = "CENTER"; + attr boolean[?] vertical = false; +} + +enum Alignment { + BEGINNING = 0; + CENTER = 1; + END = 2; + FILL = 3; +} + +interface Layoutable { + val LayoutData#owner layoutData; + val Layout layout; +} + +interface Layout { +} + +class CustomLayout extends Layout, CustomClass { +} + +class GridLayout extends Layout { + attr int[1] numColumns = 1; + attr boolean[1] equalWidth = true; + val Dimension margins; + val Dimension spacing; +} + +class BorderLayout extends Layout { + val Dimension spacing; +} + +class FlowLayout extends Layout { + attr boolean vertical = false; + attr boolean matchMinorSize = false; + attr boolean forceSingleLine = false; + attr Alignment majorAlignment = "BEGINNING"; + attr Alignment minorAlignment = "BEGINNING"; + attr int majorSpacing = 5; + attr int minorSpacing = 5; +} + +class XYLayout extends Layout { +} + +class XYLayoutData extends LayoutData { + val Point[1] topLeft; + val Dimension[1] size; +} + +class StackLayout extends Layout { +}