Class 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 Details

    • PROPERTY_KEY_PATTERN_TYPE

      protected static final String PROPERTY_KEY_PATTERN_TYPE
      Constant indication the type of pattern, e.g. ID pattern.
      See Also:
  • Constructor Details

    • 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 Details

    • 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.