|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.pattern.AbstractBasePattern
public abstract class AbstractBasePattern
This is the abstract base class for patterns. Clients implementing own
patterns should not subclass this class, but use AbstractPattern
or
AbstractConnectionPattern
instead.
Field Summary | |
---|---|
private IFeatureProvider |
featureProvider
|
Constructor Summary | |
---|---|
AbstractBasePattern()
|
Method Summary | |
---|---|
PictogramElement |
add(IAddContext context)
Clients must override this method to provide the functionality to add an existing domain object to a diagram. |
boolean |
canAdd(IAddContext context)
Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram. |
protected java.lang.Object |
getBusinessObjectForPictogramElement(PictogramElement pe)
Helper method that resolves the domain object for the given pictogram element (shape). |
protected Diagram |
getDiagram()
Returns the Diagram this pattern lives for. |
protected IDiagramEditor |
getDiagramEditor()
Returns the diagram editor instance this pattern lives in. |
IFeatureProvider |
getFeatureProvider()
Returns the feature provider for this pattern. |
protected IMappingProvider |
getMappingProvider()
Returns the IMappingProvider that can be used to map pictogram
elements onto domain objects and vice versa. |
protected void |
link(PictogramElement pe,
java.lang.Object businessObject)
Helper method to link a PictogramElement to a domain object. |
protected void |
link(PictogramElement pe,
java.lang.Object[] businessObjects)
Helper method to link a PictogramElement to a number of domain
objects. |
protected Color |
manageColor(IColorConstant colorConstant)
A convenience method for the color handling which simply calls IGaService.manageColor(Diagram, IColorConstant) to manage a
Color used within the Diagram . |
protected Color |
manageColor(int red,
int green,
int blue)
A convenience method for the color handling which simply calls IGaService.manageColor(Diagram, int, int, int) to manage a
Color used within the Diagram . |
protected Font |
manageFont(java.lang.String name,
int size)
A convenience method for the Font handling which simply calls
IGaService.manageFont(Diagram, String, int) to manage a
Font used within the Diagram . |
protected Font |
manageFont(java.lang.String name,
int size,
boolean isItalic,
boolean isBold)
A convenience method for the Font handling which simply calls
IGaService.manageFont(Diagram, String, int, boolean, boolean) to
manage a Font used within the Diagram . |
void |
setFeatureProvider(IFeatureProvider featureProvider)
Sets the feature provider for this pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IFeatureProvider featureProvider
Constructor Detail |
---|
public AbstractBasePattern()
Method Detail |
---|
public PictogramElement add(IAddContext context)
IAdd.add(IAddContext)
method. The default implementation
simply does nothing and returns null
.
context
- The add context holding information about the added domain
object.
public boolean canAdd(IAddContext context)
IAdd.canAdd(IAddContext)
method. The default
implementation simply returns false
.
context
- The add context holding information about the added domain
object.
true
, if the domain object can be added,
false
otherwise.public IFeatureProvider getFeatureProvider()
getFeatureProvider
in interface IFeatureProviderHolder
public void setFeatureProvider(IFeatureProvider featureProvider)
featureProvider
- The new featureProviderprotected java.lang.Object getBusinessObjectForPictogramElement(PictogramElement pe)
pe
- The pictogram element for which a domain object shall be
resolved.
null
in case none could be found.protected IDiagramEditor getDiagramEditor()
protected IMappingProvider getMappingProvider()
IMappingProvider
that can be used to map pictogram
elements onto domain objects and vice versa.
protected void link(PictogramElement pe, java.lang.Object businessObject)
PictogramElement
to a domain object.
pe
- The pictogram elementbusinessObject
- The domain objectprotected void link(PictogramElement pe, java.lang.Object[] businessObjects)
PictogramElement
to a number of domain
objects.
pe
- The pictogram elementbusinessObjects
- The business objects as an arrayprotected Diagram getDiagram()
Diagram
this pattern lives for.
protected Color manageColor(IColorConstant colorConstant)
IGaService.manageColor(Diagram, IColorConstant)
to manage a
Color
used within the Diagram
.
colorConstant
- The color constant to manage.
protected Color manageColor(int red, int green, int blue)
IGaService.manageColor(Diagram, int, int, int)
to manage a
Color
used within the Diagram
.
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.
protected Font manageFont(java.lang.String name, int size)
Font
handling which simply calls
IGaService.manageFont(Diagram, String, int)
to manage a
Font
used within the Diagram
.
name
- The name of the font.size
- The size of the font.
protected Font manageFont(java.lang.String name, int size, boolean isItalic, boolean isBold)
Font
handling which simply calls
IGaService.manageFont(Diagram, String, int, boolean, boolean)
to
manage a Font
used within the Diagram
.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |