Package org.eclipse.graphiti.pattern
Class AbstractBasePattern
java.lang.Object
org.eclipse.graphiti.pattern.AbstractBasePattern
- All Implemented Interfaces:
- IFeatureProviderHolder
- Direct Known Subclasses:
- AbstractConnectionPattern,- AbstractPattern
This is the abstract base class for patterns. Clients implementing own
 patterns should not subclass this class, but use 
AbstractPattern or
 AbstractConnectionPattern instead.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionadd(IAddContext context) Clients must override this method to provide the functionality to add an existing domain object to a diagram.booleancanAdd(IAddContext context) Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram.protected ObjectHelper method that resolves the domain object for the given pictogram element (shape).protected DiagramReturns theDiagramthis pattern lives for.protected IDiagramBehaviorReturns the diagram behavior instance this pattern lives in.Returns the feature provider for this pattern.protected IMappingProviderReturns theIMappingProviderthat can be used to map pictogram elements onto domain objects and vice versa.protected voidlink(PictogramElement pe, Object businessObject) Helper method to link aPictogramElementto a domain object.protected voidlink(PictogramElement pe, Object[] businessObjects) Helper method to link aPictogramElementto a number of domain objects.protected ColormanageColor(int red, int green, int blue) A convenience method for the color handling which simply callsIGaService.manageColor(Diagram, int, int, int)to manage aColorused within theDiagram.protected ColormanageColor(IColorConstant colorConstant) A convenience method for the color handling which simply callsIGaService.manageColor(Diagram, IColorConstant)to manage aColorused within theDiagram.protected FontmanageFont(String name, int size) A convenience method for theFonthandling which simply callsIGaService.manageFont(Diagram, String, int)to manage aFontused within theDiagram.protected FontmanageFont(String name, int size, boolean isItalic, boolean isBold) A convenience method for theFonthandling which simply callsIGaService.manageFont(Diagram, String, int, boolean, boolean)to manage aFontused within theDiagram.voidsetFeatureProvider(IFeatureProvider featureProvider) Sets the feature provider for this pattern.
- 
Constructor Details- 
AbstractBasePatternpublic AbstractBasePattern()
 
- 
- 
Method Details- 
addClients must override this method to provide the functionality to add an existing domain object to a diagram. Corresponds to theIAdd.add(IAddContext)method. The default implementation simply does nothing and returnsnull.- Parameters:
- context- The add context holding information about the added domain object.
- Returns:
- The root shape of the created pictogram tree.
 
- 
canAddClients must override this method to indicate the framework that this pattern can add a domain object to the diagram. Corresponds to theIAdd.canAdd(IAddContext)method. The default implementation simply returnsfalse.- Parameters:
- context- The add context holding information about the added domain object.
- Returns:
- true, if the domain object can be added,- falseotherwise.
 
- 
getFeatureProviderReturns the feature provider for this pattern.- Specified by:
- getFeatureProviderin interface- IFeatureProviderHolder
- Returns:
- Returns the featureProvider.
 
- 
setFeatureProviderSets the feature provider for this pattern. Note that once a feature provider has been set, it should not be changed again.- Parameters:
- featureProvider- The new featureProvider
 
- 
getBusinessObjectForPictogramElementHelper method that resolves the domain object for the given pictogram element (shape).- Parameters:
- pe- The pictogram element for which a domain object shall be resolved.
- Returns:
- The domain object for the given pictogram element or
         nullin case none could be found.
 
- 
getDiagramBehaviorReturns the diagram behavior instance this pattern lives in.- Returns:
- The diagram behavior
- Since:
- 0.10
 
- 
getMappingProviderReturns theIMappingProviderthat can be used to map pictogram elements onto domain objects and vice versa.- Returns:
- The mapping provider
 
- 
linkHelper method to link aPictogramElementto a domain object.- Parameters:
- pe- The pictogram element
- businessObject- The domain object
 
- 
linkHelper method to link aPictogramElementto a number of domain objects.- Parameters:
- pe- The pictogram element
- businessObjects- The business objects as an array
 
- 
getDiagramReturns theDiagramthis pattern lives for.- Returns:
- The diagram
 
- 
manageColorA convenience method for the color handling which simply callsIGaService.manageColor(Diagram, IColorConstant)to manage aColorused within theDiagram.- Parameters:
- colorConstant- The color constant to manage.
- Returns:
- The managed color.
 
- 
manageColorA convenience method for the color handling which simply callsIGaService.manageColor(Diagram, int, int, int)to manage aColorused within theDiagram.- Parameters:
- red- The red portion of the color to manage.
- green- The green portion of the color to manage.
- blue- The blue portion of the color to manage.
- Returns:
- The managed color.
 
- 
manageFontA convenience method for theFonthandling which simply callsIGaService.manageFont(Diagram, String, int)to manage aFontused within theDiagram.- Parameters:
- name- The name of the font.
- size- The size of the font.
- Returns:
- The managed font instance.
- Since:
- 0.9
 
- 
manageFontA convenience method for theFonthandling which simply callsIGaService.manageFont(Diagram, String, int, boolean, boolean)to manage aFontused within theDiagram.- Parameters:
- name- The name of the font.
- size- The size of the font.
- isItalic- The italic flag of the font.
- isBold- The bold flag of the font.
- Returns:
- The managed font instance.
- Since:
- 0.9
 
 
-