### Eclipse Workspace Patch 1.0 #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.21 diff -u -r1.21 plugin.properties --- plugin.properties 23 May 2006 21:09:50 -0000 1.21 +++ plugin.properties 24 Aug 2006 15:02:10 -0000 @@ -1 +1 @@ -##################################################### # 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_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 \ No newline at end of file +##################################################### # 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_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 \ No newline at end of file Index: src/org/eclipse/gmf/gmfgraph/provider/LabelItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/LabelItemProvider.java,v retrieving revision 1.9 diff -u -r1.9 LabelItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/LabelItemProvider.java 17 May 2006 14:22:41 -0000 1.9 +++ src/org/eclipse/gmf/gmfgraph/provider/LabelItemProvider.java 24 Aug 2006 15:02:12 -0000 @@ -311,6 +311,11 @@ newChildDescriptors.add (createChildParameter (GMFGraphPackage.eINSTANCE.getFigure_Children(), + GMFGraphFactory.eINSTANCE.createScalablePolygon())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getFigure_Children(), GMFGraphFactory.eINSTANCE.createPolylineConnection())); newChildDescriptors.add Index: src/org/eclipse/gmf/gmfgraph/provider/CustomFigureItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/CustomFigureItemProvider.java,v retrieving revision 1.10 diff -u -r1.10 CustomFigureItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/CustomFigureItemProvider.java 23 May 2006 21:09:50 -0000 1.10 +++ src/org/eclipse/gmf/gmfgraph/provider/CustomFigureItemProvider.java 24 Aug 2006 15:02:11 -0000 @@ -339,6 +339,11 @@ newChildDescriptors.add (createChildParameter (GMFGraphPackage.eINSTANCE.getFigure_Children(), + GMFGraphFactory.eINSTANCE.createScalablePolygon())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getFigure_Children(), GMFGraphFactory.eINSTANCE.createPolylineConnection())); newChildDescriptors.add Index: src/org/eclipse/gmf/gmfgraph/provider/FigureGalleryItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/FigureGalleryItemProvider.java,v retrieving revision 1.6 diff -u -r1.6 FigureGalleryItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/FigureGalleryItemProvider.java 17 May 2006 14:22:41 -0000 1.6 +++ src/org/eclipse/gmf/gmfgraph/provider/FigureGalleryItemProvider.java 24 Aug 2006 15:02:11 -0000 @@ -219,6 +219,11 @@ newChildDescriptors.add (createChildParameter (GMFGraphPackage.eINSTANCE.getFigureGallery_Figures(), + GMFGraphFactory.eINSTANCE.createScalablePolygon())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getFigureGallery_Figures(), GMFGraphFactory.eINSTANCE.createPolylineConnection())); newChildDescriptors.add Index: src/org/eclipse/gmf/gmfgraph/provider/LabeledContainerItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/LabeledContainerItemProvider.java,v retrieving revision 1.9 diff -u -r1.9 LabeledContainerItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/LabeledContainerItemProvider.java 17 May 2006 14:22:41 -0000 1.9 +++ src/org/eclipse/gmf/gmfgraph/provider/LabeledContainerItemProvider.java 24 Aug 2006 15:02:12 -0000 @@ -287,6 +287,11 @@ newChildDescriptors.add (createChildParameter (GMFGraphPackage.eINSTANCE.getFigure_Children(), + GMFGraphFactory.eINSTANCE.createScalablePolygon())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getFigure_Children(), GMFGraphFactory.eINSTANCE.createPolylineConnection())); newChildDescriptors.add Index: src/org/eclipse/gmf/gmfgraph/provider/ShapeItemProvider.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/provider/ShapeItemProvider.java,v retrieving revision 1.10 diff -u -r1.10 ShapeItemProvider.java --- src/org/eclipse/gmf/gmfgraph/provider/ShapeItemProvider.java 17 May 2006 14:22:41 -0000 1.10 +++ src/org/eclipse/gmf/gmfgraph/provider/ShapeItemProvider.java 24 Aug 2006 15:02:12 -0000 @@ -421,6 +421,11 @@ newChildDescriptors.add (createChildParameter (GMFGraphPackage.eINSTANCE.getFigure_Children(), + GMFGraphFactory.eINSTANCE.createScalablePolygon())); + + newChildDescriptors.add + (createChildParameter + (GMFGraphPackage.eINSTANCE.getFigure_Children(), GMFGraphFactory.eINSTANCE.createPolylineConnection())); newChildDescriptors.add 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.8 diff -u -r1.8 GMFGraphItemProviderAdapterFactory.java --- src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java 23 May 2006 21:09:50 -0000 1.8 +++ src/org/eclipse/gmf/gmfgraph/provider/GMFGraphItemProviderAdapterFactory.java 24 Aug 2006 15:02:11 -0000 @@ -470,6 +470,28 @@ } /** + * This keeps track of the one adapter used for all {@link org.eclipse.gmf.gmfgraph.ScalablePolygon} instances. + * + * + * @generated + */ + protected ScalablePolygonItemProvider scalablePolygonItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.gmf.gmfgraph.ScalablePolygon}. + * + * + * @generated + */ + public Adapter createScalablePolygonAdapter() { + if (scalablePolygonItemProvider == null) { + scalablePolygonItemProvider = new ScalablePolygonItemProvider(this); + } + + return scalablePolygonItemProvider; + } + + /** * This keeps track of the one adapter used for all {@link org.eclipse.gmf.gmfgraph.PolylineConnection} instances. * * @@ -1199,6 +1221,7 @@ if (ellipseItemProvider != null) ellipseItemProvider.dispose(); if (polylineItemProvider != null) polylineItemProvider.dispose(); if (polygonItemProvider != null) polygonItemProvider.dispose(); + if (scalablePolygonItemProvider != null) scalablePolygonItemProvider.dispose(); if (polylineConnectionItemProvider != null) polylineConnectionItemProvider.dispose(); if (polylineDecorationItemProvider != null) polylineDecorationItemProvider.dispose(); if (polygonDecorationItemProvider != null) polygonDecorationItemProvider.dispose(); Index: src/org/eclipse/gmf/gmfgraph/presentation/GMFGraphEditor.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.edit/src/org/eclipse/gmf/gmfgraph/presentation/GMFGraphEditor.java,v retrieving revision 1.7 diff -u -r1.7 GMFGraphEditor.java --- src/org/eclipse/gmf/gmfgraph/presentation/GMFGraphEditor.java 12 Jun 2006 14:02:48 -0000 1.7 +++ src/org/eclipse/gmf/gmfgraph/presentation/GMFGraphEditor.java 24 Aug 2006 15:02:11 -0000 @@ -846,7 +846,7 @@ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } - + public void createModel() { if (getEditorInput() instanceof IFileEditorInput) { createModelGen(); Index: icons/full/ctool16/CreateFigureGallery_figures_ScalablePolygon.gif =================================================================== RCS file: icons/full/ctool16/CreateFigureGallery_figures_ScalablePolygon.gif diff -N icons/full/ctool16/CreateFigureGallery_figures_ScalablePolygon.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/ctool16/CreateFigureGallery_figures_ScalablePolygon.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89aÄÿÿÿßß¿??_¼èҌٲfÌ™@À€ÿÿ_Ÿ_?ÿß?€€€ÀÀÀœœœ€€€s&Lº—&º—&µ’#®Š¥‚žy™tþýïþýïýóÏýóÏüç£û݃!ù,\ ŽdY>&™ÍÔе’?ƒŽ’tI3ó4ŒÖk’)'?ciCQ(›§ÈŽ*œÊÉF:,&ßKD8R€›è`ð¢É‡¡`FØ„|Ûm*Ëégol|‚e?‚k%!; Index: icons/full/obj16/ScalablePolygon.gif =================================================================== RCS file: icons/full/obj16/ScalablePolygon.gif diff -N icons/full/obj16/ScalablePolygon.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/obj16/ScalablePolygon.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89a³€€€€ÀÀÀ€€€ÿÿÀÀÀÿÿÿÿÿÿ¼èҌٲfÌ™@À€!ù ,.0ÉI«½8ëôö$áqE·5Úd`J ¡õ<.ñ–&Õ6wŒ©)-§‰FÄ‘; Index: icons/full/ctool16/CreateFigure_children_ScalablePolygon.gif =================================================================== RCS file: icons/full/ctool16/CreateFigure_children_ScalablePolygon.gif diff -N icons/full/ctool16/CreateFigure_children_ScalablePolygon.gif --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ icons/full/ctool16/CreateFigure_children_ScalablePolygon.gif 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +GIF89aÄÿÿÿßß¿??_¼èҌٲfÌ™@À€ÿÿ_Ÿ_?ÿß?€€€øûõØìſߟ¦Òyº—&º—&µ’#®Š¥‚žy™tþýïþýïýóÏýóÏüç£û݃!ù,\ ŽdY>&™ÍÔе’?ƒŽ’tI3ó4ŒÖk’)'?ciCQ(›§ÈŽ*œÊÉF:,&ßKD8R€›è`ð¢É‡¡`FØ„|Ûm*Ëégol|‚e?‚k%!; Index: src/org/eclipse/gmf/gmfgraph/provider/ScalablePolygonItemProvider.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/provider/ScalablePolygonItemProvider.java diff -N src/org/eclipse/gmf/gmfgraph/provider/ScalablePolygonItemProvider.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/provider/ScalablePolygonItemProvider.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,149 @@ +/** + * + * + * + * $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.gmf.gmfgraph.GMFGraphPackage; +import org.eclipse.gmf.gmfgraph.ScalablePolygon; + +/** + * This is the item provider adapter for a {@link org.eclipse.gmf.gmfgraph.ScalablePolygon} object. + * + * + * @generated + */ +public class ScalablePolygonItemProvider + extends PolygonItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ScalablePolygonItemProvider(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 returns ScalablePolygon.gif. + * + * + * @generated + */ + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ScalablePolygon")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + public String getText(Object object) { + String label = ((ScalablePolygon)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ScalablePolygon_type") : + getString("_UI_ScalablePolygon_type") + " " + label; + } + + /** + * 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); + 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); + } + + /** + * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. + * + * + * @generated + */ + public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { + Object childFeature = feature; + Object childObject = child; + + boolean qualify = + childFeature == GMFGraphPackage.eINSTANCE.getFigure_ForegroundColor() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_BackgroundColor() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_MaximumSize() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_MinimumSize() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_PreferredSize() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_Location() || + childFeature == GMFGraphPackage.eINSTANCE.getFigure_Size() || + childFeature == GMFGraphPackage.eINSTANCE.getPolyline_Template(); + + if (qualify) { + return getString + ("_UI_CreateChild_text2", + new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); + } + return super.getCreateChildText(owner, feature, child, selection); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + public ResourceLocator getResourceLocator() { + return GMFGraphEditPlugin.INSTANCE; + } + +} #P org.eclipse.gmf.tests Index: src/org/eclipse/gmf/tests/gen/ShapePropertiesTest.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gen/ShapePropertiesTest.java,v retrieving revision 1.5 diff -u -r1.5 ShapePropertiesTest.java --- src/org/eclipse/gmf/tests/gen/ShapePropertiesTest.java 24 Aug 2006 13:13:36 -0000 1.5 +++ src/org/eclipse/gmf/tests/gen/ShapePropertiesTest.java 24 Aug 2006 15:02:15 -0000 @@ -74,4 +74,9 @@ performTests(getSessionSetup().getRoot()); } + public void testScalablePolygon(){ + performTests(getSessionSetup().getScalablePolygon()); + performTests(getSessionSetup().getInnerScalablePolygonTester()); + } + } #P org.eclipse.gmf.graphdef.codegen Index: templates/top/PolylineConnection.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/PolylineConnection.javajet,v retrieving revision 1.7 diff -u -r1.7 PolylineConnection.javajet --- templates/top/PolylineConnection.javajet 24 Aug 2006 13:13:37 -0000 1.7 +++ templates/top/PolylineConnection.javajet 24 Aug 2006 15:02:17 -0000 @@ -1,23 +1,14 @@ <%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopConnectionGenerator" imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.emf.ecore.* java.util.Iterator org.eclipse.emf.ecore.util.EcoreUtil org.eclipse.emf.codegen.util.CodeGenUtil;"%> <% -Object[] args = (Object[]) argument; -PolylineConnection figure = (PolylineConnection) args[0]; -final ImportAssistant importManager = (ImportAssistant) args[1]; -final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2]; -final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3]; -final boolean isInnerClass = ((Boolean) args[4]).booleanValue(); +GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final PolylineConnection figure = (PolylineConnection)innerArgs.getFigure(); +final GraphDefDispatcher dispatcher = innerArgs.getDispatcher(); +final ImportAssistant importManager = dispatcher.getImportManager(); +final FigureQualifiedNameSwitch fqnSwitch = dispatcher.getFQNSwitch(); %> -<%importManager.emitPackageStatement(stringBuffer);%> -<%importManager.markImportLocation(stringBuffer);%> - -/** - * @generated - */ -public class <%=importManager.getCompilationUnitName()%> extends <%=fqnSwitch.get(figure, importManager)%> { - -<%@ include file="../customBorderFactoryMethods.jetinc"%> +<%@ include file="customBorderFactoryMethods.jetinc"%> /** * @generated @@ -53,5 +44,3 @@ return df; } <%}%> -<%@ include file="classFooter.jetinc"%> -<%importManager.emitSortedImports();%> Index: templates/top/Figure.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Figure.javajet,v retrieving revision 1.12 diff -u -r1.12 Figure.javajet --- templates/top/Figure.javajet 24 Aug 2006 13:13:37 -0000 1.12 +++ templates/top/Figure.javajet 24 Aug 2006 15:02:17 -0000 @@ -1,25 +1,13 @@ <%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopFigureGenerator" - imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.emf.ecore.* java.util.Iterator org.eclipse.emf.ecore.util.EcoreUtil org.eclipse.emf.codegen.util.CodeGenUtil; "%> + imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.emf.ecore.* java.util.Iterator org.eclipse.emf.ecore.util.EcoreUtil org.eclipse.emf.codegen.util.CodeGenUtil; "%> <% -Object[] args = (Object[]) argument; -Figure figure = (Figure) args[0]; -final ImportAssistant importManager = (ImportAssistant) args[1]; -final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2]; -final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3]; - -//[MG] FIXME: Why we need this? Is it in use somewhere? -final boolean isInnerClass = ((Boolean) args[4]).booleanValue(); +GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final Figure figure = innerArgs.getFigure(); +final GraphDefDispatcher dispatcher = innerArgs.getDispatcher(); +final ImportAssistant importManager = dispatcher.getImportManager(); %> -<%importManager.emitPackageStatement(stringBuffer);%> - -<%importManager.markImportLocation(stringBuffer);%> - -/** - * @generated - */ -public class <%=importManager.getCompilationUnitName()%> extends <%=fqnSwitch.get(figure, importManager)%> { -<%@ include file="../customBorderFactoryMethods.jetinc"%> +<%@ include file="customBorderFactoryMethods.jetinc"%> /** * @generated @@ -38,5 +26,3 @@ <%if (false == figure instanceof Polyline) {/*no much sense to define useLocalCoordinates for polyline and its descendants*/%> <%@ include file="localCoordinates.jetinc"%> <%}%> -<%@ include file="classFooter.jetinc"%> -<%importManager.emitSortedImports();%> Index: templates/top/classFooter.jetinc =================================================================== RCS file: templates/top/classFooter.jetinc diff -N templates/top/classFooter.jetinc --- templates/top/classFooter.jetinc 26 Jun 2006 16:49:27 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ -<% -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -//input: boolean isInnerClass -if (isInnerClass){ /*put fields out of inner class body*/ %> -} - <%@ include file="staticFields.jetinc"%> -<% } else { %> - <%@ include file="staticFields.jetinc"%> -} -<%}%> Index: templates/customBorderFactoryMethods.jetinc =================================================================== RCS file: templates/customBorderFactoryMethods.jetinc diff -N templates/customBorderFactoryMethods.jetinc --- templates/customBorderFactoryMethods.jetinc 24 Aug 2006 13:13:37 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -<% -//input: [oeg].common.codegen.ImportAssistant importManager -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -//input: [oeg].gmfgraph.Figure figure - -{ //namespace -- use "bfm" (stands for BorderFactoryMethod) to avoid name clashes - int bfmNextIndex = 1; - String bfmLastFigureName = ""; - for (Iterator bfmAllCustomBorders = EcoreUtil.getAllContents(figure, false); bfmAllCustomBorders.hasNext();){ - EObject bfmNext = (EObject)bfmAllCustomBorders.next(); - if (GMFGraphPackage.eINSTANCE.getFigure().isSuperTypeOf(bfmNext.eClass())){ - bfmLastFigureName = (String)bfmNext.eGet(GMFGraphPackage.eINSTANCE.getIdentity_Name()); - if (bfmLastFigureName == null){ - bfmLastFigureName = ""; - } - } - // XXX [artem] why not do this with ((Figure) bfmNext).getBorder()? - if (bfmNext.eClass().getClassifierID() != GMFGraphPackage.CUSTOM_BORDER){ - continue; - } - - String bfmNextImplClass = dispatcher.getFQNSwitch().get(bfmNext, importManager); - String bfmNextMethodName = "createBorder_" + CodeGenUtil.capName(bfmLastFigureName) + "_" + (bfmNextIndex++); - -%> - /** - * @generated - */ - private <%=importManager.getImportedName("org.eclipse.draw2d.Border")%> <%=bfmNextMethodName%>() { - <%=bfmNextImplClass%> result = new <%=bfmNextImplClass%>(); - <%=dispatcher.dispatch("customAttributes", new Object[] {bfmNext, dispatcher, "result"} )%> - return result; - } -<% - dispatcher.getAuxiliaryDataStorage().registerData(bfmNext, bfmNextMethodName); - } -} //end of namespace -%> Index: src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java,v retrieving revision 1.8 diff -u -r1.8 TopConnectionGenerator.java --- src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java 24 Aug 2006 13:13:37 -0000 1.8 +++ src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java 24 Aug 2006 15:02:17 -0000 @@ -22,65 +22,42 @@ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_3 = " extends "; - protected final String TEXT_4 = " {" + NL; - protected final String TEXT_5 = NL; - protected final String TEXT_6 = "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_7 = " "; - protected final String TEXT_8 = "() {" + NL + "\t\t"; - protected final String TEXT_9 = " result = new "; - protected final String TEXT_10 = "();" + NL + "\t\t"; - protected final String TEXT_11 = NL + "\t\treturn result;" + NL + "\t}"; - protected final String TEXT_12 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_13 = "() {"; - protected final String TEXT_14 = NL; - protected final String TEXT_15 = NL + "\t\tsetSourceDecoration(createSourceDecoration());"; - protected final String TEXT_16 = NL + "\t\tsetTargetDecoration(createTargetDecoration());"; - protected final String TEXT_17 = NL + "\t}" + NL; - protected final String TEXT_18 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_19 = " createSourceDecoration() {"; - protected final String TEXT_20 = NL; - protected final String TEXT_21 = NL + "\t\treturn df;" + NL + "\t}"; + protected final String TEXT_2 = NL; + protected final String TEXT_3 = "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_4 = " "; + protected final String TEXT_5 = "() {" + NL + "\t\t"; + protected final String TEXT_6 = " result = new "; + protected final String TEXT_7 = "();" + NL + "\t\t"; + protected final String TEXT_8 = NL + "\t\treturn result;" + NL + "\t}"; + protected final String TEXT_9 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_10 = "() {"; + protected final String TEXT_11 = NL; + protected final String TEXT_12 = NL + "\t\tsetSourceDecoration(createSourceDecoration());"; + protected final String TEXT_13 = NL + "\t\tsetTargetDecoration(createTargetDecoration());"; + protected final String TEXT_14 = NL + "\t}" + NL; + protected final String TEXT_15 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_16 = " createSourceDecoration() {"; + protected final String TEXT_17 = NL; + protected final String TEXT_18 = NL + "\t\treturn df;" + NL + "\t}"; + protected final String TEXT_19 = NL; + protected final String TEXT_20 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_21 = " createTargetDecoration() {"; protected final String TEXT_22 = NL; - protected final String TEXT_23 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_24 = " createTargetDecoration() {"; - protected final String TEXT_25 = NL; - protected final String TEXT_26 = NL + "\t\treturn df;" + NL + "\t}"; - protected final String TEXT_27 = NL; - protected final String TEXT_28 = NL + "}" + NL + "\t"; - protected final String TEXT_29 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; - protected final String TEXT_30 = " "; - protected final String TEXT_31 = " = "; - protected final String TEXT_32 = ";"; - protected final String TEXT_33 = NL + "\t"; - protected final String TEXT_34 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; - protected final String TEXT_35 = " "; - protected final String TEXT_36 = " = "; - protected final String TEXT_37 = ";"; - protected final String TEXT_38 = NL + "}"; - protected final String TEXT_39 = NL; + protected final String TEXT_23 = NL + "\t\treturn df;" + NL + "\t}"; + protected final String TEXT_24 = NL; public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); -Object[] args = (Object[]) argument; -PolylineConnection figure = (PolylineConnection) args[0]; -final ImportAssistant importManager = (ImportAssistant) args[1]; -final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2]; -final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3]; -final boolean isInnerClass = ((Boolean) args[4]).booleanValue(); +GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final PolylineConnection figure = (PolylineConnection)innerArgs.getFigure(); +final GraphDefDispatcher dispatcher = innerArgs.getDispatcher(); +final ImportAssistant importManager = dispatcher.getImportManager(); +final FigureQualifiedNameSwitch fqnSwitch = dispatcher.getFQNSwitch(); - importManager.emitPackageStatement(stringBuffer); stringBuffer.append(TEXT_1); - importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_2); - stringBuffer.append(importManager.getCompilationUnitName()); - stringBuffer.append(TEXT_3); - stringBuffer.append(fqnSwitch.get(figure, importManager)); - stringBuffer.append(TEXT_4); - stringBuffer.append(TEXT_5); //input: [oeg].common.codegen.ImportAssistant importManager //input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher @@ -97,7 +74,6 @@ bfmLastFigureName = ""; } } - // XXX [artem] why not do this with ((Figure) bfmNext).getBorder()? if (bfmNext.eClass().getClassifierID() != GMFGraphPackage.CUSTOM_BORDER){ continue; } @@ -106,93 +82,54 @@ String bfmNextMethodName = "createBorder_" + CodeGenUtil.capName(bfmLastFigureName) + "_" + (bfmNextIndex++); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_3); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Border")); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_4); stringBuffer.append(bfmNextMethodName); - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_5); stringBuffer.append(bfmNextImplClass); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_6); stringBuffer.append(bfmNextImplClass); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_7); stringBuffer.append(dispatcher.dispatch("customAttributes", new Object[] {bfmNext, dispatcher, "result"} )); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_8); dispatcher.getAuxiliaryDataStorage().registerData(bfmNext, bfmNextMethodName); } } //end of namespace - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_9); stringBuffer.append(figure.getName()); - stringBuffer.append(TEXT_13); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_11); stringBuffer.append(dispatcher.dispatch("Shape", dispatcher.create(figure, "this"))); if (figure.getSourceDecoration() != null) { - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_12); } if (figure.getTargetDecoration() != null) { - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_13); } - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_14); if (figure.getSourceDecoration() != null) { final String className = fqnSwitch.get(figure.getSourceDecoration(), importManager); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_15); stringBuffer.append(className); - stringBuffer.append(TEXT_19); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_17); stringBuffer.append(dispatcher.dispatch("instantiate", dispatcher.create(figure.getSourceDecoration(), "df"))); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_18); } /*if sourceDecoration != null */ - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_19); if (figure.getTargetDecoration() != null) { final String className = fqnSwitch.get(figure.getTargetDecoration(), importManager); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_20); stringBuffer.append(className); - stringBuffer.append(TEXT_24); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_22); stringBuffer.append(dispatcher.dispatch("instantiate", dispatcher.create(figure.getTargetDecoration(), "df"))); - stringBuffer.append(TEXT_26); - } - stringBuffer.append(TEXT_27); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -//input: boolean isInnerClass -if (isInnerClass){ /*put fields out of inner class body*/ - stringBuffer.append(TEXT_28); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { - StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); - stringBuffer.append(TEXT_29); - stringBuffer.append(next.getType()); - stringBuffer.append(TEXT_30); - stringBuffer.append(next.getName()); - stringBuffer.append(TEXT_31); - stringBuffer.append(next.getValue()); - stringBuffer.append(TEXT_32); - -} - - } else { - stringBuffer.append(TEXT_33); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { - StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); - stringBuffer.append(TEXT_34); - stringBuffer.append(next.getType()); - stringBuffer.append(TEXT_35); - stringBuffer.append(next.getName()); - stringBuffer.append(TEXT_36); - stringBuffer.append(next.getValue()); - stringBuffer.append(TEXT_37); - -} - - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_23); } - importManager.emitSortedImports(); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_24); return stringBuffer.toString(); } } Index: src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java,v retrieving revision 1.13 diff -u -r1.13 TopFigureGenerator.java --- src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java 24 Aug 2006 13:13:37 -0000 1.13 +++ src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java 24 Aug 2006 15:02:17 -0000 @@ -1,7 +1,6 @@ package org.eclipse.gmf.graphdef.codegen.templates; import org.eclipse.gmf.gmfgraph.*; -import org.eclipse.gmf.gmfgraph.util.*; import org.eclipse.gmf.common.codegen.*; import org.eclipse.gmf.graphdef.codegen.*; import org.eclipse.emf.ecore.*; @@ -22,62 +21,36 @@ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_3 = " extends "; - protected final String TEXT_4 = " {" + NL; - protected final String TEXT_5 = NL; - protected final String TEXT_6 = "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_7 = " "; - protected final String TEXT_8 = "() {" + NL + "\t\t"; - protected final String TEXT_9 = " result = new "; - protected final String TEXT_10 = "();" + NL + "\t\t"; - protected final String TEXT_11 = NL + "\t\treturn result;" + NL + "\t}"; - protected final String TEXT_12 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_13 = "() {"; - protected final String TEXT_14 = NL + "\t\t"; - protected final String TEXT_15 = NL + "\t\t"; - protected final String TEXT_16 = NL + "\t\tcreateContents();" + NL + "\t}" + NL; - protected final String TEXT_17 = NL; - protected final String TEXT_18 = NL; + protected final String TEXT_2 = NL; + protected final String TEXT_3 = "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_4 = " "; + protected final String TEXT_5 = "() {" + NL + "\t\t"; + protected final String TEXT_6 = " result = new "; + protected final String TEXT_7 = "();" + NL + "\t\t"; + protected final String TEXT_8 = NL + "\t\treturn result;" + NL + "\t}"; + protected final String TEXT_9 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_10 = "() {"; + protected final String TEXT_11 = NL + "\t\t"; + protected final String TEXT_12 = NL + "\t\t"; + protected final String TEXT_13 = NL + "\t\tcreateContents();" + NL + "\t}" + NL; + protected final String TEXT_14 = NL; + protected final String TEXT_15 = NL; + protected final String TEXT_16 = NL; + protected final String TEXT_17 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean myUseLocalCoordinates = "; + protected final String TEXT_18 = ";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean useLocalCoordinates() {" + NL + "\t\treturn myUseLocalCoordinates;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setUseLocalCoordinates(boolean useLocalCoordinates) {" + NL + "\t\tmyUseLocalCoordinates = useLocalCoordinates;" + NL + "\t}" + NL + "\t"; protected final String TEXT_19 = NL; - protected final String TEXT_20 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean myUseLocalCoordinates = "; - protected final String TEXT_21 = ";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean useLocalCoordinates() {" + NL + "\t\treturn myUseLocalCoordinates;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setUseLocalCoordinates(boolean useLocalCoordinates) {" + NL + "\t\tmyUseLocalCoordinates = useLocalCoordinates;" + NL + "\t}" + NL + "\t"; - protected final String TEXT_22 = NL; - protected final String TEXT_23 = NL + "}" + NL + "\t"; - protected final String TEXT_24 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; - protected final String TEXT_25 = " "; - protected final String TEXT_26 = " = "; - protected final String TEXT_27 = ";"; - protected final String TEXT_28 = NL + "\t"; - protected final String TEXT_29 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; - protected final String TEXT_30 = " "; - protected final String TEXT_31 = " = "; - protected final String TEXT_32 = ";"; - protected final String TEXT_33 = NL + "}"; - protected final String TEXT_34 = NL; public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); -Object[] args = (Object[]) argument; -Figure figure = (Figure) args[0]; -final ImportAssistant importManager = (ImportAssistant) args[1]; -final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2]; -final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3]; +GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final Figure figure = innerArgs.getFigure(); +final GraphDefDispatcher dispatcher = innerArgs.getDispatcher(); +final ImportAssistant importManager = dispatcher.getImportManager(); -//[MG] FIXME: Why we need this? Is it in use somewhere? -final boolean isInnerClass = ((Boolean) args[4]).booleanValue(); - - importManager.emitPackageStatement(stringBuffer); stringBuffer.append(TEXT_1); - importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_2); - stringBuffer.append(importManager.getCompilationUnitName()); - stringBuffer.append(TEXT_3); - stringBuffer.append(fqnSwitch.get(figure, importManager)); - stringBuffer.append(TEXT_4); - stringBuffer.append(TEXT_5); //input: [oeg].common.codegen.ImportAssistant importManager //input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher @@ -94,7 +67,6 @@ bfmLastFigureName = ""; } } - // XXX [artem] why not do this with ((Figure) bfmNext).getBorder()? if (bfmNext.eClass().getClassifierID() != GMFGraphPackage.CUSTOM_BORDER){ continue; } @@ -103,38 +75,38 @@ String bfmNextMethodName = "createBorder_" + CodeGenUtil.capName(bfmLastFigureName) + "_" + (bfmNextIndex++); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_3); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Border")); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_4); stringBuffer.append(bfmNextMethodName); - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_5); stringBuffer.append(bfmNextImplClass); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_6); stringBuffer.append(bfmNextImplClass); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_7); stringBuffer.append(dispatcher.dispatch("customAttributes", new Object[] {bfmNext, dispatcher, "result"} )); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_8); dispatcher.getAuxiliaryDataStorage().registerData(bfmNext, bfmNextMethodName); } } //end of namespace - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_9); stringBuffer.append(figure.getName()); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_10); GraphDefDispatcher.LayoutArgs dispatcherArgs = dispatcher.createLayoutArgs(figure, "this", "myGenLayoutManager", null); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_11); stringBuffer.append(dispatcher.dispatch("createLayout", dispatcherArgs)); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_12); stringBuffer.append(dispatcher.dispatch(figure, dispatcherArgs)); - stringBuffer.append(TEXT_16); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_14); stringBuffer.append(dispatcher.dispatch("Children", dispatcherArgs)); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_15); if (false == figure instanceof Polyline) {/*no much sense to define useLocalCoordinates for polyline and its descendants*/ - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_16); // simple heuristic to detect need for local coordinates boolean useLocalDefaultValue = false; @@ -145,50 +117,11 @@ } } - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_17); stringBuffer.append(useLocalDefaultValue); - stringBuffer.append(TEXT_21); - } - stringBuffer.append(TEXT_22); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -//input: boolean isInnerClass -if (isInnerClass){ /*put fields out of inner class body*/ - stringBuffer.append(TEXT_23); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { - StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); - stringBuffer.append(TEXT_24); - stringBuffer.append(next.getType()); - stringBuffer.append(TEXT_25); - stringBuffer.append(next.getName()); - stringBuffer.append(TEXT_26); - stringBuffer.append(next.getValue()); - stringBuffer.append(TEXT_27); - -} - - } else { - stringBuffer.append(TEXT_28); - -//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher -for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { - StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); - stringBuffer.append(TEXT_29); - stringBuffer.append(next.getType()); - stringBuffer.append(TEXT_30); - stringBuffer.append(next.getName()); - stringBuffer.append(TEXT_31); - stringBuffer.append(next.getValue()); - stringBuffer.append(TEXT_32); - -} - - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_18); } - importManager.emitSortedImports(); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_19); return stringBuffer.toString(); } } Index: src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java,v retrieving revision 1.22 diff -u -r1.22 FigureGenerator.java --- src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java 24 Aug 2006 13:13:37 -0000 1.22 +++ src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java 24 Aug 2006 15:02:17 -0000 @@ -36,6 +36,7 @@ import org.eclipse.gmf.gmfgraph.PolylineConnection; import org.eclipse.gmf.gmfgraph.PolylineDecoration; import org.eclipse.gmf.gmfgraph.RoundedRectangle; +import org.eclipse.gmf.gmfgraph.ScalablePolygon; import org.eclipse.gmf.gmfgraph.Shape; import org.eclipse.gmf.gmfgraph.XYLayoutData; import org.eclipse.gmf.gmfgraph.util.FigureQualifiedNameSwitch; @@ -66,6 +67,8 @@ import org.eclipse.gmf.graphdef.codegen.templates.ShapeAttrGenerator; import org.eclipse.gmf.graphdef.codegen.templates.TopConnectionGenerator; import org.eclipse.gmf.graphdef.codegen.templates.TopFigureGenerator; +import org.eclipse.gmf.graphdef.codegen.templates.TopGenerator; +import org.eclipse.gmf.graphdef.codegen.templates.TopScalablePolygonGenerator; import org.eclipse.gmf.internal.codegen.dispatch.EmitterFactory; import org.eclipse.gmf.internal.codegen.dispatch.HierarchyKeyMap; import org.eclipse.gmf.internal.codegen.dispatch.KeyChain; @@ -80,6 +83,8 @@ * */ public class FigureGenerator implements TextEmitter { + private static final String ENTRY_POINT = "main"; + private final GraphDefDispatcher myTopDispatcher; private final GraphDefDispatcher myInnerDispatcher; private final boolean myIsInnerClassCode; @@ -99,18 +104,7 @@ "org.eclipse.gmf.graphdef.codegen" }; - KeyMap keyMap = new HierarchyKeyMap() { - /* - * Capture knowledge that we use classes and strings as keys - */ - public KeyChain map(Object key) { - if (key instanceof String) { - return super.map(key); - } else { - return super.map(key.getClass()); - } - } - }; + KeyMap keyMap = new ClassesOrStringsKeyMap(); String[] templatePath = new String[] {thisBundle.getEntry("/templates/").toString()}; EmitterFactory topFactory = new EmitterFactory(templatePath, fillTopLevel(), true, variables, true); myTopDispatcher = new GraphDefDispatcher(topFactory, keyMap, figureNameSwitch, mapModeStrategy); @@ -120,8 +114,10 @@ private static TemplateRegistry fillTopLevel() { StaticTemplateRegistry tr = new StaticTemplateRegistry(FigureGenerator.class.getClassLoader()); + tr.put(ENTRY_POINT, "/top/Top.javajet", TopGenerator.class); tr.put(PolylineConnection.class, "/top/PolylineConnection.javajet", TopConnectionGenerator.class); tr.put(Figure.class, "/top/Figure.javajet", TopFigureGenerator.class); + tr.put(ScalablePolygon.class, "/top/ScalablePolygon.javajet", TopScalablePolygonGenerator.class); return tr; } @@ -184,13 +180,26 @@ String res = null; myTopDispatcher.resetForNewClass(importManager); myInnerDispatcher.resetForNewClass(importManager); - Object args = new Object[] {fig, importManager, myTopDispatcher.getFQNSwitch(), myInnerDispatcher, Boolean.valueOf(myIsInnerClassCode)}; - res = myTopDispatcher.dispatch(fig, args); + Object args = new Object[] {fig, myInnerDispatcher, myTopDispatcher, Boolean.valueOf(myIsInnerClassCode)}; + res = myTopDispatcher.dispatch(ENTRY_POINT, args); if (res == null) { throw new IllegalStateException(); } return res; } + + public static class ClassesOrStringsKeyMap extends HierarchyKeyMap { + /* + * Capture knowledge that we use classes and strings as keys + */ + public KeyChain map(Object key) { + if (key instanceof String) { + return super.map(key); + } else { + return super.map(key.getClass()); + } + } + } /* public static class Feedback { void registerChildAccessor(Figure parent, Figure child, String getterName, String setterName) { Index: templates/top/customBorderFactoryMethods.jetinc =================================================================== RCS file: templates/top/customBorderFactoryMethods.jetinc diff -N templates/top/customBorderFactoryMethods.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/top/customBorderFactoryMethods.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,37 @@ +<% +//input: [oeg].common.codegen.ImportAssistant importManager +//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher +//input: [oeg].gmfgraph.Figure figure + +{ //namespace -- use "bfm" (stands for BorderFactoryMethod) to avoid name clashes + int bfmNextIndex = 1; + String bfmLastFigureName = ""; + for (Iterator bfmAllCustomBorders = EcoreUtil.getAllContents(figure, false); bfmAllCustomBorders.hasNext();){ + EObject bfmNext = (EObject)bfmAllCustomBorders.next(); + if (GMFGraphPackage.eINSTANCE.getFigure().isSuperTypeOf(bfmNext.eClass())){ + bfmLastFigureName = (String)bfmNext.eGet(GMFGraphPackage.eINSTANCE.getIdentity_Name()); + if (bfmLastFigureName == null){ + bfmLastFigureName = ""; + } + } + if (bfmNext.eClass().getClassifierID() != GMFGraphPackage.CUSTOM_BORDER){ + continue; + } + + String bfmNextImplClass = dispatcher.getFQNSwitch().get(bfmNext, importManager); + String bfmNextMethodName = "createBorder_" + CodeGenUtil.capName(bfmLastFigureName) + "_" + (bfmNextIndex++); + +%> + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.draw2d.Border")%> <%=bfmNextMethodName%>() { + <%=bfmNextImplClass%> result = new <%=bfmNextImplClass%>(); + <%=dispatcher.dispatch("customAttributes", new Object[] {bfmNext, dispatcher, "result"} )%> + return result; + } +<% + dispatcher.getAuxiliaryDataStorage().registerData(bfmNext, bfmNextMethodName); + } +} //end of namespace +%> Index: src/org/eclipse/gmf/graphdef/codegen/templates/TopScalablePolygonGenerator.java =================================================================== RCS file: src/org/eclipse/gmf/graphdef/codegen/templates/TopScalablePolygonGenerator.java diff -N src/org/eclipse/gmf/graphdef/codegen/templates/TopScalablePolygonGenerator.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/graphdef/codegen/templates/TopScalablePolygonGenerator.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,37 @@ +package org.eclipse.gmf.graphdef.codegen.templates; + +import org.eclipse.gmf.graphdef.codegen.*; + +public class TopScalablePolygonGenerator +{ + protected static String nl; + public static synchronized TopScalablePolygonGenerator create(String lineSeparator) + { + nl = lineSeparator; + TopScalablePolygonGenerator result = new TopScalablePolygonGenerator(); + nl = null; + return result; + } + + protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; + protected final String TEXT_1 = ""; + protected final String TEXT_2 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final org.eclipse.draw2d.geometry.PointList myTemplate = new org.eclipse.draw2d.geometry.PointList();" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate org.eclipse.draw2d.geometry.Rectangle myTemplateBounds;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addPoint(org.eclipse.draw2d.geometry.Point point){" + NL + "\t\tmyTemplate.addPoint(point);" + NL + "\t\tmyTemplateBounds = null;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void fillShape(org.eclipse.draw2d.Graphics graphics) {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle bounds = getBounds();" + NL + "\t\tgraphics.pushState();" + NL + "\t\tgraphics.translate(bounds.x, bounds.y);" + NL + "\t\tgraphics.fillPolygon(scalePointList());" + NL + "\t\tgraphics.popState();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void outlineShape(org.eclipse.draw2d.Graphics graphics) {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle bounds = getBounds();" + NL + "\t\tgraphics.pushState();" + NL + "\t\tgraphics.translate(bounds.x, bounds.y);" + NL + "\t\tgraphics.drawPolygon(scalePointList());" + NL + "\t\tgraphics.popState();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate org.eclipse.draw2d.geometry.Rectangle getTemplateBounds(){" + NL + "\t\tif (myTemplateBounds == null){" + NL + "\t\t\tmyTemplateBounds = new org.eclipse.draw2d.geometry.Rectangle();" + NL + "\t\t\tmyTemplateBounds = myTemplate.getBounds().union(0, 0);" + NL + "\t\t\t//just safety -- we are going to use this as divider " + NL + "\t\t\tif (myTemplateBounds.width < 1){" + NL + "\t\t\t\tmyTemplateBounds.width = 1;" + NL + "\t\t\t}" + NL + "\t\t\tif (myTemplateBounds.height < 1){" + NL + "\t\t\t\tmyTemplateBounds.height = 1;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn myTemplateBounds;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate int[] scalePointList() {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle pointsBounds = getTemplateBounds();" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle actualBounds = getBounds();" + NL + "" + NL + "\t\tfloat xScale = ((float) actualBounds.width) / pointsBounds.width;" + NL + "\t\tfloat yScale = ((float) actualBounds.height) / pointsBounds.height;" + NL + "" + NL + "\t\tif (xScale == 1 && yScale == 1) {" + NL + "\t\t\treturn myTemplate.toIntArray();" + NL + "\t\t}" + NL + "\t\tint[] scaled = (int[]) myTemplate.toIntArray().clone();" + NL + "\t\tfor (int i = 0; i < scaled.length; i += 2) {" + NL + "\t\t\tscaled[i] = (int) Math.floor(scaled[i] * xScale);" + NL + "\t\t\tscaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale);" + NL + "\t\t}" + NL + "\t\treturn scaled;" + NL + "\t}"; + protected final String TEXT_3 = NL; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + +//final GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final GraphDefDispatcher.Args topArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[1]; + +//We just want to insert static code from scalablePolygonBehavior.jetinc and +//redispatch to common Figure.javajet to generate constructors, contents etc + + stringBuffer.append(TEXT_1); + stringBuffer.append(TEXT_2); + stringBuffer.append(TEXT_3); + stringBuffer.append(topArgs.getDispatcher().dispatchToSuper()); + return stringBuffer.toString(); + } +} Index: templates/top/scalablePolygonBehavior.jetinc =================================================================== RCS file: templates/top/scalablePolygonBehavior.jetinc diff -N templates/top/scalablePolygonBehavior.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/top/scalablePolygonBehavior.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,77 @@ + /** + * @generated + */ + private final org.eclipse.draw2d.geometry.PointList myTemplate = new org.eclipse.draw2d.geometry.PointList(); + /** + * @generated + */ + private org.eclipse.draw2d.geometry.Rectangle myTemplateBounds; + + /** + * @generated + */ + public void addPoint(org.eclipse.draw2d.geometry.Point point){ + myTemplate.addPoint(point); + myTemplateBounds = null; + } + + /** + * @generated + */ + protected void fillShape(org.eclipse.draw2d.Graphics graphics) { + org.eclipse.draw2d.geometry.Rectangle bounds = getBounds(); + graphics.pushState(); + graphics.translate(bounds.x, bounds.y); + graphics.fillPolygon(scalePointList()); + graphics.popState(); + } + + /** + * @generated + */ + protected void outlineShape(org.eclipse.draw2d.Graphics graphics) { + org.eclipse.draw2d.geometry.Rectangle bounds = getBounds(); + graphics.pushState(); + graphics.translate(bounds.x, bounds.y); + graphics.drawPolygon(scalePointList()); + graphics.popState(); + } + + /** + * @generated + */ + private org.eclipse.draw2d.geometry.Rectangle getTemplateBounds(){ + if (myTemplateBounds == null){ + myTemplateBounds = new org.eclipse.draw2d.geometry.Rectangle(); + myTemplateBounds = myTemplate.getBounds().union(0, 0); + //just safety -- we are going to use this as divider + if (myTemplateBounds.width < 1){ + myTemplateBounds.width = 1; + } + if (myTemplateBounds.height < 1){ + myTemplateBounds.height = 1; + } + } + return myTemplateBounds; + } + + /** + * @generated + */ + private int[] scalePointList() { + org.eclipse.draw2d.geometry.Rectangle pointsBounds = getTemplateBounds(); + org.eclipse.draw2d.geometry.Rectangle actualBounds = getBounds(); + + float xScale = ((float) actualBounds.width) / pointsBounds.width; + float yScale = ((float) actualBounds.height) / pointsBounds.height; + + if (xScale == 1 && yScale == 1) { + return myTemplate.toIntArray(); + } + int[] scaled = (int[]) myTemplate.toIntArray().clone(); + for (int i = 0; i < scaled.length; i += 2) { + scaled[i] = (int) Math.floor(scaled[i] * xScale); + scaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale); + } + return scaled; + } Index: templates/top/Top.javajet =================================================================== RCS file: templates/top/Top.javajet diff -N templates/top/Top.javajet --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/top/Top.javajet 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ +<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopGenerator" + imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.emf.ecore.* java.util.Iterator org.eclipse.emf.ecore.util.EcoreUtil; "%> +<% +Object[] args = (Object[]) argument; +Figure figure = (Figure) args[0]; +final GraphDefDispatcher /*inner*/dispatcher = (GraphDefDispatcher) args[1]; +final GraphDefDispatcher topDispatcher = (GraphDefDispatcher) args[2]; +final boolean isStaticFieldsOutsideClassBody = ((Boolean) args[3]).booleanValue(); + +class Asserter { + void makeAssert(boolean checkTrue){ + assert checkTrue; + //temporarily use more forced way to ensure assertion + //TODO: replace with single assert + if (!checkTrue){ + throw new IllegalStateException("Enable Assertions"); + } + } +} + +final Asserter myAsserter = new Asserter(); +myAsserter.makeAssert(topDispatcher.getImportManager() == /*inner*/dispatcher.getImportManager()); +myAsserter.makeAssert(topDispatcher.getFQNSwitch() == /*inner*/dispatcher.getFQNSwitch()); + +final ImportAssistant importManager = topDispatcher.getImportManager(); +final FigureQualifiedNameSwitch fqnSwitch = topDispatcher.getFQNSwitch(); +%> +<%importManager.emitPackageStatement(stringBuffer);%> + +<%importManager.markImportLocation(stringBuffer);%> + +/** + * @generated + */ +public class <%=importManager.getCompilationUnitName()%> extends <%=fqnSwitch.get(figure, importManager)%> { + +<%@ include file="scalablePolygonAsInnerClass.jetinc"%> + +<% /*NOTE: class structure is selected by topDispatcher, but children, attributes etc -- by inner dispatcher*/ %> +<%=topDispatcher.dispatch(figure, new Object[] { + /*inner*/dispatcher.create(figure, "this"), + topDispatcher.create(figure, "this") +})%> + +<% +if (isStaticFieldsOutsideClassBody){ /*put fields out of inner class body*/ %> +} + <%@ include file="staticFields.jetinc"%> +<% } else { %> + <%@ include file="staticFields.jetinc"%> +} +<%}%> +<%importManager.emitSortedImports();%> Index: templates/top/ScalablePolygon.javajet =================================================================== RCS file: templates/top/ScalablePolygon.javajet diff -N templates/top/ScalablePolygon.javajet --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/top/ScalablePolygon.javajet 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,11 @@ +<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopScalablePolygonGenerator" + imports="org.eclipse.gmf.graphdef.codegen.* "%> +<% +//final GraphDefDispatcher.Args innerArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[0]; +final GraphDefDispatcher.Args topArgs = (GraphDefDispatcher.Args) ((Object[]) argument)[1]; + +//We just want to insert static code from scalablePolygonBehavior.jetinc and +//redispatch to common Figure.javajet to generate constructors, contents etc +%> +<%@ include file="scalablePolygonBehavior.jetinc"%> +<%=topArgs.getDispatcher().dispatchToSuper()%> Index: src/org/eclipse/gmf/graphdef/codegen/templates/TopGenerator.java =================================================================== RCS file: src/org/eclipse/gmf/graphdef/codegen/templates/TopGenerator.java diff -N src/org/eclipse/gmf/graphdef/codegen/templates/TopGenerator.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/graphdef/codegen/templates/TopGenerator.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,148 @@ +package org.eclipse.gmf.graphdef.codegen.templates; + +import org.eclipse.gmf.gmfgraph.*; +import org.eclipse.gmf.gmfgraph.util.*; +import org.eclipse.gmf.common.codegen.*; +import org.eclipse.gmf.graphdef.codegen.*; +import org.eclipse.emf.ecore.*; +import java.util.Iterator; +import org.eclipse.emf.ecore.util.EcoreUtil;; + +public class TopGenerator +{ + protected static String nl; + public static synchronized TopGenerator create(String lineSeparator) + { + nl = lineSeparator; + TopGenerator result = new TopGenerator(); + nl = null; + return result; + } + + protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; + protected final String TEXT_1 = ""; + protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_3 = " extends "; + protected final String TEXT_4 = " {" + NL; + protected final String TEXT_5 = NL; + protected final String TEXT_6 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ScalablePolygon extends org.eclipse.draw2d.Shape {"; + protected final String TEXT_7 = NL; + protected final String TEXT_8 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final org.eclipse.draw2d.geometry.PointList myTemplate = new org.eclipse.draw2d.geometry.PointList();" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate org.eclipse.draw2d.geometry.Rectangle myTemplateBounds;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addPoint(org.eclipse.draw2d.geometry.Point point){" + NL + "\t\tmyTemplate.addPoint(point);" + NL + "\t\tmyTemplateBounds = null;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void fillShape(org.eclipse.draw2d.Graphics graphics) {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle bounds = getBounds();" + NL + "\t\tgraphics.pushState();" + NL + "\t\tgraphics.translate(bounds.x, bounds.y);" + NL + "\t\tgraphics.fillPolygon(scalePointList());" + NL + "\t\tgraphics.popState();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void outlineShape(org.eclipse.draw2d.Graphics graphics) {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle bounds = getBounds();" + NL + "\t\tgraphics.pushState();" + NL + "\t\tgraphics.translate(bounds.x, bounds.y);" + NL + "\t\tgraphics.drawPolygon(scalePointList());" + NL + "\t\tgraphics.popState();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate org.eclipse.draw2d.geometry.Rectangle getTemplateBounds(){" + NL + "\t\tif (myTemplateBounds == null){" + NL + "\t\t\tmyTemplateBounds = new org.eclipse.draw2d.geometry.Rectangle();" + NL + "\t\t\tmyTemplateBounds = myTemplate.getBounds().union(0, 0);" + NL + "\t\t\t//just safety -- we are going to use this as divider " + NL + "\t\t\tif (myTemplateBounds.width < 1){" + NL + "\t\t\t\tmyTemplateBounds.width = 1;" + NL + "\t\t\t}" + NL + "\t\t\tif (myTemplateBounds.height < 1){" + NL + "\t\t\t\tmyTemplateBounds.height = 1;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn myTemplateBounds;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate int[] scalePointList() {" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle pointsBounds = getTemplateBounds();" + NL + "\t\torg.eclipse.draw2d.geometry.Rectangle actualBounds = getBounds();" + NL + "" + NL + "\t\tfloat xScale = ((float) actualBounds.width) / pointsBounds.width;" + NL + "\t\tfloat yScale = ((float) actualBounds.height) / pointsBounds.height;" + NL + "" + NL + "\t\tif (xScale == 1 && yScale == 1) {" + NL + "\t\t\treturn myTemplate.toIntArray();" + NL + "\t\t}" + NL + "\t\tint[] scaled = (int[]) myTemplate.toIntArray().clone();" + NL + "\t\tfor (int i = 0; i < scaled.length; i += 2) {" + NL + "\t\t\tscaled[i] = (int) Math.floor(scaled[i] * xScale);" + NL + "\t\t\tscaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale);" + NL + "\t\t}" + NL + "\t\treturn scaled;" + NL + "\t}" + NL + "}"; + protected final String TEXT_9 = NL; + protected final String TEXT_10 = NL; + protected final String TEXT_11 = NL; + protected final String TEXT_12 = NL + "}" + NL + "\t"; + protected final String TEXT_13 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; + protected final String TEXT_14 = " "; + protected final String TEXT_15 = " = "; + protected final String TEXT_16 = ";"; + protected final String TEXT_17 = NL + "\t"; + protected final String TEXT_18 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; + protected final String TEXT_19 = " "; + protected final String TEXT_20 = " = "; + protected final String TEXT_21 = ";"; + protected final String TEXT_22 = NL + "}"; + protected final String TEXT_23 = NL; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + +Object[] args = (Object[]) argument; +Figure figure = (Figure) args[0]; +final GraphDefDispatcher /*inner*/dispatcher = (GraphDefDispatcher) args[1]; +final GraphDefDispatcher topDispatcher = (GraphDefDispatcher) args[2]; +final boolean isStaticFieldsOutsideClassBody = ((Boolean) args[3]).booleanValue(); + +class Asserter { + void makeAssert(boolean checkTrue){ + assert checkTrue; + //temporarily use more forced way to ensure assertion + //TODO: replace with single assert + if (!checkTrue){ + throw new IllegalStateException("Enable Assertions"); + } + } +} + +final Asserter myAsserter = new Asserter(); +myAsserter.makeAssert(topDispatcher.getImportManager() == /*inner*/dispatcher.getImportManager()); +myAsserter.makeAssert(topDispatcher.getFQNSwitch() == /*inner*/dispatcher.getFQNSwitch()); + +final ImportAssistant importManager = topDispatcher.getImportManager(); +final FigureQualifiedNameSwitch fqnSwitch = topDispatcher.getFQNSwitch(); + + importManager.emitPackageStatement(stringBuffer); + stringBuffer.append(TEXT_1); + importManager.markImportLocation(stringBuffer); + stringBuffer.append(TEXT_2); + stringBuffer.append(importManager.getCompilationUnitName()); + stringBuffer.append(TEXT_3); + stringBuffer.append(fqnSwitch.get(figure, importManager)); + stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_5); + +//input: [oeg].gmfgraph.Figure figure +{ //namespace, prefix spic (stands for Scalable Polygon as Inner Class) to avoid name clashes + boolean spicFound = false; + for (Iterator spicAllPolygons = EcoreUtil.getAllContents(figure, false); !spicFound && spicAllPolygons.hasNext();){ + EObject spicNext = (EObject)spicAllPolygons.next(); + spicFound = GMFGraphPackage.eINSTANCE.getScalablePolygon().isSuperTypeOf(spicNext.eClass()); + } + if (spicFound) { + + stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_8); + + } +} // end of namespace + + stringBuffer.append(TEXT_9); + /*NOTE: class structure is selected by topDispatcher, but children, attributes etc -- by inner dispatcher*/ + stringBuffer.append(TEXT_10); + stringBuffer.append(topDispatcher.dispatch(figure, new Object[] { + /*inner*/dispatcher.create(figure, "this"), + topDispatcher.create(figure, "this") +})); + stringBuffer.append(TEXT_11); + +if (isStaticFieldsOutsideClassBody){ /*put fields out of inner class body*/ + stringBuffer.append(TEXT_12); + +//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher +for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { + StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); + stringBuffer.append(TEXT_13); + stringBuffer.append(next.getType()); + stringBuffer.append(TEXT_14); + stringBuffer.append(next.getName()); + stringBuffer.append(TEXT_15); + stringBuffer.append(next.getValue()); + stringBuffer.append(TEXT_16); + +} + + } else { + stringBuffer.append(TEXT_17); + +//input: [oeg].graphdef.codegen GraphDefDispatcher dispatcher +for (Iterator allFields = dispatcher.getStaticFieldsManager().allFields(); allFields.hasNext();) { + StaticFieldsManager.StaticField next = (StaticFieldsManager.StaticField)allFields.next(); + stringBuffer.append(TEXT_18); + stringBuffer.append(next.getType()); + stringBuffer.append(TEXT_19); + stringBuffer.append(next.getName()); + stringBuffer.append(TEXT_20); + stringBuffer.append(next.getValue()); + stringBuffer.append(TEXT_21); + +} + + stringBuffer.append(TEXT_22); + } + importManager.emitSortedImports(); + stringBuffer.append(TEXT_23); + return stringBuffer.toString(); + } +} Index: templates/top/scalablePolygonAsInnerClass.jetinc =================================================================== RCS file: templates/top/scalablePolygonAsInnerClass.jetinc diff -N templates/top/scalablePolygonAsInnerClass.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/top/scalablePolygonAsInnerClass.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,20 @@ +<% +//input: [oeg].gmfgraph.Figure figure +{ //namespace, prefix spic (stands for Scalable Polygon as Inner Class) to avoid name clashes + boolean spicFound = false; + for (Iterator spicAllPolygons = EcoreUtil.getAllContents(figure, false); !spicFound && spicAllPolygons.hasNext();){ + EObject spicNext = (EObject)spicAllPolygons.next(); + spicFound = GMFGraphPackage.eINSTANCE.getScalablePolygon().isSuperTypeOf(spicNext.eClass()); + } + if (spicFound) { +%> +/** + * @generated + */ +public class ScalablePolygon extends org.eclipse.draw2d.Shape { +<%@ include file="scalablePolygonBehavior.jetinc"%> +} +<% + } +} // end of namespace +%> #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.8 diff -u -r1.8 GMFGraphFactory.java --- src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java 23 May 2006 21:09:56 -0000 1.8 +++ src/org/eclipse/gmf/gmfgraph/GMFGraphFactory.java 24 Aug 2006 15:02:21 -0000 @@ -188,6 +188,15 @@ Polygon createPolygon(); /** + * Returns a new object of class 'Scalable Polygon'. + * + * + * @return a new object of class 'Scalable Polygon'. + * @generated + */ + ScalablePolygon createScalablePolygon(); + + /** * Returns a new object of class 'Polyline Connection'. * * 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.16 diff -u -r1.16 GMFGraphPackage.java --- src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java 23 May 2006 21:09:56 -0000 1.16 +++ src/org/eclipse/gmf/gmfgraph/GMFGraphPackage.java 24 Aug 2006 15:02:25 -0000 @@ -666,7 +666,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayoutable() * @generated */ - int LAYOUTABLE = 53; + int LAYOUTABLE = 54; /** * The feature id for the 'Layout Data' containment reference. @@ -3041,6 +3041,241 @@ int POLYGON_FEATURE_COUNT = POLYLINE_FEATURE_COUNT + 0; /** + * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.ScalablePolygonImpl Scalable Polygon}' class. + * + * + * @see org.eclipse.gmf.gmfgraph.impl.ScalablePolygonImpl + * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getScalablePolygon() + * @generated + */ + int SCALABLE_POLYGON = 27; + + /** + * The feature id for the 'Layout Data' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__LAYOUT_DATA = POLYGON__LAYOUT_DATA; + + /** + * The feature id for the 'Layout' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__LAYOUT = POLYGON__LAYOUT; + + /** + * The feature id for the 'Parent' container reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__PARENT = POLYGON__PARENT; + + /** + * The feature id for the 'Referencing Elements' reference list. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__REFERENCING_ELEMENTS = POLYGON__REFERENCING_ELEMENTS; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__NAME = POLYGON__NAME; + + /** + * The feature id for the 'Children' containment reference list. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__CHILDREN = POLYGON__CHILDREN; + + /** + * The feature id for the 'Foreground Color' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__FOREGROUND_COLOR = POLYGON__FOREGROUND_COLOR; + + /** + * The feature id for the 'Background Color' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__BACKGROUND_COLOR = POLYGON__BACKGROUND_COLOR; + + /** + * The feature id for the 'Maximum Size' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__MAXIMUM_SIZE = POLYGON__MAXIMUM_SIZE; + + /** + * The feature id for the 'Minimum Size' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__MINIMUM_SIZE = POLYGON__MINIMUM_SIZE; + + /** + * The feature id for the 'Preferred Size' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__PREFERRED_SIZE = POLYGON__PREFERRED_SIZE; + + /** + * The feature id for the 'Font' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__FONT = POLYGON__FONT; + + /** + * The feature id for the 'Insets' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__INSETS = POLYGON__INSETS; + + /** + * The feature id for the 'Border' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__BORDER = POLYGON__BORDER; + + /** + * The feature id for the 'Location' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__LOCATION = POLYGON__LOCATION; + + /** + * The feature id for the 'Size' containment reference. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__SIZE = POLYGON__SIZE; + + /** + * The feature id for the 'Outline' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__OUTLINE = POLYGON__OUTLINE; + + /** + * The feature id for the 'Fill' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__FILL = POLYGON__FILL; + + /** + * The feature id for the 'Line Width' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__LINE_WIDTH = POLYGON__LINE_WIDTH; + + /** + * The feature id for the 'Line Kind' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__LINE_KIND = POLYGON__LINE_KIND; + + /** + * The feature id for the 'Xor Fill' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__XOR_FILL = POLYGON__XOR_FILL; + + /** + * The feature id for the 'Xor Outline' attribute. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__XOR_OUTLINE = POLYGON__XOR_OUTLINE; + + /** + * The feature id for the 'Resolved Children' reference list. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__RESOLVED_CHILDREN = POLYGON__RESOLVED_CHILDREN; + + /** + * The feature id for the 'Template' containment reference list. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON__TEMPLATE = POLYGON__TEMPLATE; + + /** + * The number of structural features of the 'Scalable Polygon' class. + * + * + * @generated + * @ordered + */ + int SCALABLE_POLYGON_FEATURE_COUNT = POLYGON_FEATURE_COUNT + 0; + + /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.PolylineConnectionImpl Polyline Connection}' class. * * @@ -3048,7 +3283,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolylineConnection() * @generated */ - int POLYLINE_CONNECTION = 27; + int POLYLINE_CONNECTION = 28; /** * The feature id for the 'Layout Data' containment reference. @@ -3301,7 +3536,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolylineDecoration() * @generated */ - int POLYLINE_DECORATION = 28; + int POLYLINE_DECORATION = 29; /** * The feature id for the 'Layout Data' containment reference. @@ -3536,7 +3771,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPolygonDecoration() * @generated */ - int POLYGON_DECORATION = 29; + int POLYGON_DECORATION = 30; /** * The feature id for the 'Layout Data' containment reference. @@ -3771,7 +4006,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomClass() * @generated */ - int CUSTOM_CLASS = 30; + int CUSTOM_CLASS = 31; /** * The feature id for the 'Qualified Class Name' attribute. @@ -3817,7 +4052,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomFigure() * @generated */ - int CUSTOM_FIGURE = 33; + int CUSTOM_FIGURE = 34; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomDecorationImpl Custom Decoration}' class. @@ -3827,7 +4062,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomDecoration() * @generated */ - int CUSTOM_DECORATION = 34; + int CUSTOM_DECORATION = 35; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomConnectionImpl Custom Connection}' class. @@ -3837,7 +4072,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomConnection() * @generated */ - int CUSTOM_CONNECTION = 35; + int CUSTOM_CONNECTION = 36; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Color Color}' class. @@ -3847,7 +4082,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getColor() * @generated */ - int COLOR = 36; + int COLOR = 37; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.RGBColorImpl RGB Color}' class. @@ -3857,7 +4092,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getRGBColor() * @generated */ - int RGB_COLOR = 37; + int RGB_COLOR = 38; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.ConstantColorImpl Constant Color}' class. @@ -3867,7 +4102,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getConstantColor() * @generated */ - int CONSTANT_COLOR = 38; + int CONSTANT_COLOR = 39; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Font Font}' class. @@ -3877,7 +4112,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFont() * @generated */ - int FONT = 39; + int FONT = 40; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BasicFontImpl Basic Font}' class. @@ -3887,7 +4122,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBasicFont() * @generated */ - int BASIC_FONT = 40; + int BASIC_FONT = 41; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.FontStyle Font Style}' enum. @@ -3897,7 +4132,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFontStyle() * @generated */ - int FONT_STYLE = 63; + int FONT_STYLE = 64; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.PointImpl Point}' class. @@ -3907,7 +4142,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getPoint() * @generated */ - int POINT = 41; + int POINT = 42; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.DimensionImpl Dimension}' class. @@ -3917,7 +4152,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDimension() * @generated */ - int DIMENSION = 42; + int DIMENSION = 43; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.InsetsImpl Insets}' class. @@ -3927,7 +4162,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getInsets() * @generated */ - int INSETS = 43; + int INSETS = 44; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Border Border}' class. @@ -3937,7 +4172,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorder() * @generated */ - int BORDER = 44; + int BORDER = 45; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.LineBorderImpl Line Border}' class. @@ -3947,7 +4182,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLineBorder() * @generated */ - int LINE_BORDER = 45; + int LINE_BORDER = 46; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.MarginBorderImpl Margin Border}' class. @@ -3957,7 +4192,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getMarginBorder() * @generated */ - int MARGIN_BORDER = 46; + int MARGIN_BORDER = 47; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CompoundBorderImpl Compound Border}' class. @@ -3967,7 +4202,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCompoundBorder() * @generated */ - int COMPOUND_BORDER = 47; + int COMPOUND_BORDER = 48; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomBorderImpl Custom Border}' class. @@ -3977,7 +4212,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomBorder() * @generated */ - int CUSTOM_BORDER = 48; + int CUSTOM_BORDER = 49; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.LayoutData Layout Data}' class. @@ -3987,7 +4222,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayoutData() * @generated */ - int LAYOUT_DATA = 49; + int LAYOUT_DATA = 50; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.GridLayoutDataImpl Grid Layout Data}' class. @@ -3997,7 +4232,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getGridLayoutData() * @generated */ - int GRID_LAYOUT_DATA = 51; + int GRID_LAYOUT_DATA = 52; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BorderLayoutDataImpl Border Layout Data}' class. @@ -4007,7 +4242,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorderLayoutData() * @generated */ - int BORDER_LAYOUT_DATA = 52; + int BORDER_LAYOUT_DATA = 53; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomLayoutImpl Custom Layout}' class. @@ -4017,7 +4252,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomLayout() * @generated */ - int CUSTOM_LAYOUT = 55; + int CUSTOM_LAYOUT = 56; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Layout Layout}' class. @@ -4027,7 +4262,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLayout() * @generated */ - int LAYOUT = 54; + int LAYOUT = 55; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomLayoutDataImpl Custom Layout Data}' class. @@ -4037,7 +4272,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomLayoutData() * @generated */ - int CUSTOM_LAYOUT_DATA = 50; + int CUSTOM_LAYOUT_DATA = 51; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.GridLayoutImpl Grid Layout}' class. @@ -4047,7 +4282,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getGridLayout() * @generated */ - int GRID_LAYOUT = 56; + int GRID_LAYOUT = 57; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.BorderLayoutImpl Border Layout}' class. @@ -4057,7 +4292,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getBorderLayout() * @generated */ - int BORDER_LAYOUT = 57; + int BORDER_LAYOUT = 58; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.impl.CustomAttributeImpl Custom Attribute}' class. @@ -4067,7 +4302,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getCustomAttribute() * @generated */ - int CUSTOM_ATTRIBUTE = 31; + int CUSTOM_ATTRIBUTE = 32; /** * The feature id for the 'Name' attribute. @@ -4122,7 +4357,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFigureAccessor() * @generated */ - int FIGURE_ACCESSOR = 32; + int FIGURE_ACCESSOR = 33; /** * The feature id for the 'Referencing Elements' reference list. @@ -5356,7 +5591,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getFlowLayout() * @generated */ - int FLOW_LAYOUT = 58; + int FLOW_LAYOUT = 59; /** * The feature id for the 'Vertical' attribute. @@ -5438,7 +5673,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getXYLayout() * @generated */ - int XY_LAYOUT = 59; + int XY_LAYOUT = 60; /** * The number of structural features of the 'XY Layout' class. @@ -5457,7 +5692,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getXYLayoutData() * @generated */ - int XY_LAYOUT_DATA = 60; + int XY_LAYOUT_DATA = 61; /** * The feature id for the 'Owner' container reference. @@ -5503,7 +5738,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getStackLayout() * @generated */ - int STACK_LAYOUT = 61; + int STACK_LAYOUT = 62; /** * The number of structural features of the 'Stack Layout' class. @@ -5522,7 +5757,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getColorConstants() * @generated */ - int COLOR_CONSTANTS = 62; + int COLOR_CONSTANTS = 63; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.Direction Direction}' enum. @@ -5532,7 +5767,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getDirection() * @generated */ - int DIRECTION = 64; + int DIRECTION = 65; /** * The meta object id for the '{@link org.eclipse.gmf.gmfgraph.LineKind Line Kind}' enum. @@ -5542,7 +5777,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getLineKind() * @generated */ - int LINE_KIND = 65; + int LINE_KIND = 66; /** @@ -5553,7 +5788,7 @@ * @see org.eclipse.gmf.gmfgraph.impl.GMFGraphPackageImpl#getAlignment() * @generated */ - int ALIGNMENT = 66; + int ALIGNMENT = 67; /** @@ -6344,6 +6579,16 @@ EClass getPolygon(); /** + * Returns the meta object for class '{@link org.eclipse.gmf.gmfgraph.ScalablePolygon Scalable Polygon}'. + * + * + * @return the meta object for class 'Scalable Polygon'. + * @see org.eclipse.gmf.gmfgraph.ScalablePolygon + * @generated + */ + EClass getScalablePolygon(); + + /** * Returns the meta object for class '{@link org.eclipse.gmf.gmfgraph.PolylineConnection Polyline Connection}'. * * 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.12 diff -u -r1.12 GMFGraphAdapterFactory.java --- src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java 26 Jun 2006 13:42:59 -0000 1.12 +++ src/org/eclipse/gmf/gmfgraph/util/GMFGraphAdapterFactory.java 24 Aug 2006 15:02:28 -0000 @@ -10,6 +10,8 @@ import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.gmfgraph.*; + import org.eclipse.gmf.gmfgraph.AlignmentFacet; import org.eclipse.gmf.gmfgraph.BasicFont; import org.eclipse.gmf.gmfgraph.Border; @@ -210,6 +212,9 @@ public Object casePolygon(Polygon object) { return createPolygonAdapter(); } + public Object caseScalablePolygon(ScalablePolygon object) { + return createScalablePolygonAdapter(); + } public Object casePolylineConnection(PolylineConnection object) { return createPolylineConnectionAdapter(); } @@ -712,6 +717,20 @@ } /** + * Creates a new adapter for an object of class '{@link org.eclipse.gmf.gmfgraph.ScalablePolygon Scalable Polygon}'. + * + * 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.ScalablePolygon + * @generated + */ + public Adapter createScalablePolygonAdapter() { + return null; + } + + /** * Creates a new adapter for an object of class '{@link org.eclipse.gmf.gmfgraph.PolylineConnection Polyline Connection}'. * * 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.14 diff -u -r1.14 GMFGraphSwitch.java --- src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java 26 Jun 2006 13:42:59 -0000 1.14 +++ src/org/eclipse/gmf/gmfgraph/util/GMFGraphSwitch.java 24 Aug 2006 15:02:29 -0000 @@ -10,6 +10,8 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.gmfgraph.*; + import org.eclipse.gmf.gmfgraph.AlignmentFacet; import org.eclipse.gmf.gmfgraph.BasicFont; import org.eclipse.gmf.gmfgraph.Border; @@ -389,6 +391,20 @@ if (result == null) result = defaultCase(theEObject); return result; } + case GMFGraphPackage.SCALABLE_POLYGON: { + ScalablePolygon scalablePolygon = (ScalablePolygon)theEObject; + Object result = caseScalablePolygon(scalablePolygon); + if (result == null) result = casePolygon(scalablePolygon); + if (result == null) result = casePolyline(scalablePolygon); + if (result == null) result = caseShape(scalablePolygon); + if (result == null) result = caseFigure(scalablePolygon); + if (result == null) result = caseFigureMarker(scalablePolygon); + if (result == null) result = caseFigureHandle(scalablePolygon); + if (result == null) result = caseIdentity(scalablePolygon); + if (result == null) result = caseLayoutable(scalablePolygon); + if (result == null) result = defaultCase(theEObject); + return result; + } case GMFGraphPackage.POLYLINE_CONNECTION: { PolylineConnection polylineConnection = (PolylineConnection)theEObject; Object result = casePolylineConnection(polylineConnection); @@ -1077,6 +1093,21 @@ } /** + * Returns the result of interpretting the object as an instance of 'Scalable Polygon'. + * + * 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 'Scalable Polygon'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseScalablePolygon(ScalablePolygon object) { + return null; + } + + /** * Returns the result of interpretting the object as an instance of 'Polyline Connection'. * * This implementation returns null; Index: src/org/eclipse/gmf/gmfgraph/util/PureGEFFigureQualifiedNameSwitch.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/src/org/eclipse/gmf/gmfgraph/util/PureGEFFigureQualifiedNameSwitch.java,v retrieving revision 1.1 diff -u -r1.1 PureGEFFigureQualifiedNameSwitch.java --- src/org/eclipse/gmf/gmfgraph/util/PureGEFFigureQualifiedNameSwitch.java 14 Apr 2006 10:52:36 -0000 1.1 +++ src/org/eclipse/gmf/gmfgraph/util/PureGEFFigureQualifiedNameSwitch.java 24 Aug 2006 15:02:29 -0000 @@ -28,6 +28,7 @@ import org.eclipse.gmf.gmfgraph.PolylineDecoration; import org.eclipse.gmf.gmfgraph.Rectangle; import org.eclipse.gmf.gmfgraph.RoundedRectangle; +import org.eclipse.gmf.gmfgraph.ScalablePolygon; import org.eclipse.gmf.gmfgraph.StackLayout; import org.eclipse.gmf.gmfgraph.XYLayout; import org.eclipse.gmf.gmfgraph.XYLayoutData; @@ -113,6 +114,13 @@ public Object casePolygon(Polygon object) { return "org.eclipse.draw2d.Polygon"; //$NON-NLS-1$ } + + public Object caseScalablePolygon(ScalablePolygon object) { + //custom implementation + return object.eContainer() instanceof FigureGallery ? + "org.eclipse.draw2d.Shape" : //$NON-NLS-1$ + "ScalablePolygon"; + } public Object casePolygonDecoration(PolygonDecoration object) { return "org.eclipse.draw2d.PolygonDecoration"; //$NON-NLS-1$ Index: models/gmfgraph.ecore =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/models/gmfgraph.ecore,v retrieving revision 1.23 diff -u -r1.23 gmfgraph.ecore --- models/gmfgraph.ecore 5 Jun 2006 14:26:30 -0000 1.23 +++ models/gmfgraph.ecore 24 Aug 2006 15:02:21 -0000 @@ -215,6 +215,11 @@
+ + +
+ +
Index: models/gmfgraph.genmodel =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel,v retrieving revision 1.18 diff -u -r1.18 gmfgraph.genmodel --- models/gmfgraph.genmodel 23 May 2006 21:09:56 -0000 1.18 +++ models/gmfgraph.genmodel 24 Aug 2006 15:02:21 -0000 @@ -155,6 +155,7 @@ + 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.22 diff -u -r1.22 GMFGraphPackageImpl.java --- src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java 5 Jun 2006 14:26:30 -0000 1.22 +++ src/org/eclipse/gmf/gmfgraph/impl/GMFGraphPackageImpl.java 24 Aug 2006 15:02:27 -0000 @@ -77,6 +77,7 @@ import org.eclipse.gmf.gmfgraph.RGBColor; import org.eclipse.gmf.gmfgraph.Rectangle; import org.eclipse.gmf.gmfgraph.RoundedRectangle; +import org.eclipse.gmf.gmfgraph.ScalablePolygon; import org.eclipse.gmf.gmfgraph.Shape; import org.eclipse.gmf.gmfgraph.StackLayout; import org.eclipse.gmf.gmfgraph.VisualFacet; @@ -284,6 +285,13 @@ * * @generated */ + private EClass scalablePolygonEClass = null; + + /** + * + * + * @generated + */ private EClass polylineConnectionEClass = null; /** @@ -1298,6 +1306,15 @@ * * @generated */ + public EClass getScalablePolygon() { + return scalablePolygonEClass; + } + + /** + * + * + * @generated + */ public EClass getPolylineConnection() { return polylineConnectionEClass; } @@ -2313,6 +2330,8 @@ polygonEClass = createEClass(POLYGON); + scalablePolygonEClass = createEClass(SCALABLE_POLYGON); + polylineConnectionEClass = createEClass(POLYLINE_CONNECTION); createEReference(polylineConnectionEClass, POLYLINE_CONNECTION__SOURCE_DECORATION); createEReference(polylineConnectionEClass, POLYLINE_CONNECTION__TARGET_DECORATION); @@ -2500,6 +2519,7 @@ ellipseEClass.getESuperTypes().add(this.getShape()); polylineEClass.getESuperTypes().add(this.getShape()); polygonEClass.getESuperTypes().add(this.getPolyline()); + scalablePolygonEClass.getESuperTypes().add(this.getPolygon()); polylineConnectionEClass.getESuperTypes().add(this.getPolyline()); polylineConnectionEClass.getESuperTypes().add(this.getConnectionFigure()); polylineDecorationEClass.getESuperTypes().add(this.getPolyline()); @@ -2639,6 +2659,8 @@ initEClass(polygonEClass, Polygon.class, "Polygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(scalablePolygonEClass, ScalablePolygon.class, "ScalablePolygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(polylineConnectionEClass, PolylineConnection.class, "PolylineConnection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getPolylineConnection_SourceDecoration(), this.getDecorationFigure(), null, "sourceDecoration", null, 0, 1, PolylineConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getPolylineConnection_TargetDecoration(), this.getDecorationFigure(), null, "targetDecoration", null, 0, 1, PolylineConnection.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.13 diff -u -r1.13 GMFGraphFactoryImpl.java --- src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java 26 Jun 2006 13:42:59 -0000 1.13 +++ src/org/eclipse/gmf/gmfgraph/impl/GMFGraphFactoryImpl.java 24 Aug 2006 15:02:25 -0000 @@ -12,6 +12,8 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.gmf.gmfgraph.*; + import org.eclipse.gmf.gmfgraph.Alignment; import org.eclipse.gmf.gmfgraph.AlignmentFacet; import org.eclipse.gmf.gmfgraph.BasicFont; @@ -127,6 +129,7 @@ case GMFGraphPackage.ELLIPSE: return createEllipse(); case GMFGraphPackage.POLYLINE: return createPolyline(); case GMFGraphPackage.POLYGON: return createPolygon(); + case GMFGraphPackage.SCALABLE_POLYGON: return createScalablePolygon(); case GMFGraphPackage.POLYLINE_CONNECTION: return createPolylineConnection(); case GMFGraphPackage.POLYLINE_DECORATION: return createPolylineDecoration(); case GMFGraphPackage.POLYGON_DECORATION: return createPolygonDecoration(); @@ -389,6 +392,16 @@ * * @generated */ + public ScalablePolygon createScalablePolygon() { + ScalablePolygonImpl scalablePolygon = new ScalablePolygonImpl(); + return scalablePolygon; + } + + /** + * + * + * @generated + */ public PolylineConnection createPolylineConnection() { PolylineConnectionImpl polylineConnection = new PolylineConnectionImpl(); return polylineConnection; Index: src/org/eclipse/gmf/gmfgraph/ScalablePolygon.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/ScalablePolygon.java diff -N src/org/eclipse/gmf/gmfgraph/ScalablePolygon.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/ScalablePolygon.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,25 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.gmf.gmfgraph; + + +/** + * + * A representation of the model object 'Scalable Polygon'. + * + * + * + * 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 + * + * + * + * @see org.eclipse.gmf.gmfgraph.GMFGraphPackage#getScalablePolygon() + * @model + * @generated + */ +public interface ScalablePolygon extends Polygon { +} // ScalablePolygon Index: src/org/eclipse/gmf/gmfgraph/impl/ScalablePolygonImpl.java =================================================================== RCS file: src/org/eclipse/gmf/gmfgraph/impl/ScalablePolygonImpl.java diff -N src/org/eclipse/gmf/gmfgraph/impl/ScalablePolygonImpl.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/gmfgraph/impl/ScalablePolygonImpl.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,42 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.gmf.gmfgraph.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.gmf.gmfgraph.GMFGraphPackage; +import org.eclipse.gmf.gmfgraph.ScalablePolygon; + +/** + * + * An implementation of the model object 'Scalable Polygon'. + * + *

+ *

+ * + * @generated + */ +public class ScalablePolygonImpl extends PolygonImpl implements ScalablePolygon { + /** + * + * + * @generated + */ + protected ScalablePolygonImpl() { + super(); + } + + /** + * + * + * @generated + */ + protected EClass eStaticClass() { + return GMFGraphPackage.eINSTANCE.getScalablePolygon(); + } + +} //ScalablePolygonImpl