public final class PresentationVariation
extends java.lang.Object
PresentationVariation
is a graphical respresentation of a simple option the user may select when building out a pattern. A presentation generally differs from a custom GUI made by a binder or creator in that since it is a simple choice (the user picks the variation they want), the framework can handle the asking the user to make that choice. A variation constists of three parts: The first part is how it is presented to the user. Thus, a variation has a description, optional help text, icon, and even an image. A variation does not need to supply all of these, although it should coordinate with its CreatorPresentation
to determine what is needed. The second part is it's structure. A variation can hold other variations. Thus the root variations can be the roots of subtrees. Again, the structure should conform to the requirements of the CreatorPresentation
. In general, only leaf nodes of the tree should be selected by the user. The third part is how it affects the pattern. It does this via it's properties. These properties are merged with the pattern properties, and then used by the creator/binder to modify how the pattern is built out.Constructor and Description |
---|
PresentationVariation(java.lang.String name, java.lang.String description, java.lang.String helpText, java.lang.String iconPath, java.lang.String imagePath, java.util.Map<java.lang.String,java.lang.String> properties, java.util.List<PresentationVariation> childVariations) |
PresentationVariation(java.lang.String name, java.lang.String description, java.lang.String helpText, java.lang.String iconPath, java.lang.String imagePath, java.util.Map<java.lang.String,java.lang.String> properties, java.util.List<PresentationVariation> childVariations, java.lang.ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
java.util.List<PresentationVariation> |
getChildren()
Returns children, or an empty list if it does not have any children.
|
java.lang.String |
getDescription()
Returns a brief description of the variation.
|
java.lang.String |
getHelpText()
Returns optional help text.
|
javax.swing.Icon |
getIcon()
Returns the icon lazily, if it exists.
|
javax.swing.ImageIcon |
getImage()
Returns the image lazily, if it exists.
|
java.lang.String |
getName()
Returns the name of the variation.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns the properties for this particular variation that should be merged with the pattern.
|
public PresentationVariation(java.lang.String name, java.lang.String description, java.lang.String helpText, java.lang.String iconPath, java.lang.String imagePath, java.util.Map<java.lang.String,java.lang.String> properties, java.util.List<PresentationVariation> childVariations)
public PresentationVariation(java.lang.String name, java.lang.String description, java.lang.String helpText, java.lang.String iconPath, java.lang.String imagePath, java.util.Map<java.lang.String,java.lang.String> properties, java.util.List<PresentationVariation> childVariations, java.lang.ClassLoader classLoader)
public java.lang.String getName()
public java.lang.String getDescription()
public java.lang.String getHelpText()
public javax.swing.Icon getIcon()
public javax.swing.ImageIcon getImage()
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public java.util.List<PresentationVariation> getChildren()