MagicDraw 18.2 Documentation

Skip to end of metadata
Go to start of metadata

A pattern’s target encapsulates information about the classifier you want to apply the pattern for.

A target owns:

  • a classifier
  • a classifier’s presentation element
  • a diagram of a presentation element

A target is passed to the pattern’s method AbstractPattern.applyPattern. It is also accessible from pattern’s properties AbstractPatternProperties.

Open API provides a helper class PatternHelper with useful methods for patterns. For more details about methods of this class, see javadoc.

Every implementation of a specific pattern must provide:

  • Pattern properties
  • Pattern panels
  • Pattern implementation

This information is encapsulated in the PatternInfo class.

PatternInfo is used only for the pattern registration in the PatternsManager. Other usages are internal and do not impact specific patterns.

Every pattern must provide main properties and optionally can have extended properties. Main properties are used for the user input from the first pattern wizard page. Extended properties may be used for storing the user input from other wizard pages.

A specific pattern must provide implementation of this abstract class and override the AbstractPatternProperties.configurePropertyManager method. If a specific pattern has some extended properties, it must override the AbstractPatternProperties.configureExtendedPropertyManager method. Both these methods must configure some property manager – add or remove properties from it.

Every pattern must provide one or more panels for the patterns wizard. The first wizard page is always used for displaying main pattern properties. Other pages are optional and may be the pattern specific. The AbstractPanelContainer class is used for providing the following information:

A specific pattern must provide a pattern implementation class. This class must extend AbstractPattern and implement AbstractPattern.applyPattern and AbstractPattern.getCategorizedName methods.