org.eclipse.graphiti.pattern
Class TypedPattern

java.lang.Object
  extended by org.eclipse.graphiti.pattern.AbstractBasePattern
      extended by org.eclipse.graphiti.pattern.AbstractPattern
          extended by org.eclipse.graphiti.pattern.TypedPattern
All Implemented Interfaces:
IFeatureProviderHolder, IAdd, ICreate, ICreateInfo, IDelete, IDirectEditing, ILayout, IMoveShape, IRemove, IResizeShape, IUpdate, IPattern
Direct Known Subclasses:
IdPattern

public abstract class TypedPattern
extends AbstractPattern

This class provides the basis for all specific pattern types. It provides functionality to tag a shape as being created and maintained by a specific pattern type. Type type is identified using a special Property with the key PROPERTY_KEY_PATTERN_TYPE.

Since:
0.10

Field Summary
protected static String PROPERTY_KEY_PATTERN_TYPE
          Constant indication the type of pattern, e.g.
 
Fields inherited from class org.eclipse.graphiti.pattern.AbstractPattern
EMPTY_STRING_ARRAY
 
Fields inherited from interface org.eclipse.graphiti.func.ICreate
EMPTY
 
Fields inherited from interface org.eclipse.graphiti.func.IDirectEditing
TYPE_CUSTOM, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT
 
Constructor Summary
TypedPattern()
          Constructor to be used when no configuration data is needed.
TypedPattern(IPatternConfiguration patternConfiguration)
          Constructor to be used when configuration data is needed.
 
Method Summary
protected  String getPatternType(PropertyContainer patternRootShape)
          Returns the property that indicates that the given root shape of the pattern is created and maintained by a specific pattern type if it is set for the given shape or one of its parents.
protected  void setPatternType(PropertyContainer patternRootShape, String patternType)
          Sets the property that indicates that the given root shape of the pattern is created and maintained by a specific pattern type.
 
Methods inherited from class org.eclipse.graphiti.pattern.AbstractPattern
addGraphicalRepresentation, avoidNegativeCoordinates, canCreate, canDelete, canDirectEdit, canLayout, canMoveShape, canRemove, canResizeShape, canUpdate, checkValueValid, completeInfo, completeInfo, completeValue, create, createDeleteFeature, createRemoveFeature, delete, getCreateDescription, getCreateImageId, getCreateLargeImageId, getCreateName, getEditingType, getInitialValue, getPatternConfiguration, getPossibleValues, getProposalSupport, getResizeConfiguration, getValueProposals, hasDoneChanges, internalMove, isAutoCompletionEnabled, isCompletionAvailable, isMainBusinessObjectApplicable, isPaletteApplicable, isPatternControlled, isPatternRoot, layout, layoutPictogramElement, moveAllBendpoints, moveShape, postDelete, postMoveShape, postRemove, preDelete, preMoveShape, preRemove, remove, resizeShape, setPatternConfiguration, setValue, stretchFieldToFitText, update, updateNeeded, updatePictogramElement
 
Methods inherited from class org.eclipse.graphiti.pattern.AbstractBasePattern
add, canAdd, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getDiagramEditor, getFeatureProvider, getMappingProvider, link, link, manageColor, manageColor, manageFont, manageFont, setFeatureProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.graphiti.pattern.IPattern
add, canAdd, setFeatureProvider
 

Field Detail

PROPERTY_KEY_PATTERN_TYPE

protected static final String PROPERTY_KEY_PATTERN_TYPE
Constant indication the type of pattern, e.g. ID pattern.

See Also:
Constant Field Values
Constructor Detail

TypedPattern

public TypedPattern()
Constructor to be used when no configuration data is needed.


TypedPattern

public TypedPattern(IPatternConfiguration patternConfiguration)
Constructor to be used when configuration data is needed.

Method Detail

setPatternType

protected void setPatternType(PropertyContainer patternRootShape,
                              String patternType)
Sets the property that indicates that the given root shape of the pattern is created and maintained by a specific pattern type.

Parameters:
patternRootShape - The PropertyContainer object that is used as root shape of the pattern.
patternType - The String type of the pattern.

getPatternType

protected String getPatternType(PropertyContainer patternRootShape)
Returns the property that indicates that the given root shape of the pattern is created and maintained by a specific pattern type if it is set for the given shape or one of its parents. If the property is set for the given shape it is returned, otherwise the parents are asked for the property; first the parent ContainerShape in the shape hierarchy is asked if there is no parent the GraphicsAlgorithm parent is asked.

Parameters:
patternRootShape - The PropertyContainer object that is used as root shape of the pattern.
Returns:
The String type of the pattern.


Copyright (c) SAP AG 2005, 2012.