org.openbp.cockpit.modeler.skins
Class Skin

java.lang.Object
  extended by org.openbp.common.generic.description.DescriptionObjectImpl
      extended by org.openbp.common.generic.description.DisplayObjectImpl
          extended by org.openbp.cockpit.modeler.skins.Skin
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, Copyable, DescriptionObject, Displayable, DisplayObject, Validatable

public class Skin
extends DisplayObjectImpl

A skins defines how elements of the process model should be presented in the workspace. It maintains a list of symbol descriptors that describe how a particular figure (e. g. an initial node figure) should look like.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.openbp.common.generic.Copyable
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW
 
Constructor Summary
Skin()
          Default constructor.
 
Method Summary
 void addLinkDescriptor(LinkDescriptor linkDescriptor)
          Adds a link descriptor.
 void addSymbolDescriptor(SymbolDescriptor symbolDescriptor)
          Adds a symbol descriptor.
 LinkDescriptor getLinkDescriptor(java.lang.String linkType)
          Gets a link descriptor by its link type.
 java.util.List getLinkDescriptorList()
          Gets the list of link descriptors.
 java.lang.String getNodeTitleFormat()
          Gets the node title format.
 java.lang.String getParamTitleFormat()
          Gets the parameter title format.
 ResourceCollection getResource()
          Gets the skin resource.
 java.lang.String getResourceName()
          Gets the resource name.
 java.lang.String getSocketTitleFormat()
          Gets the socket title format.
 SymbolDescriptor getSymbolDescriptor(java.lang.String nodeType)
          Gets a symbol descriptor by its node type.
 java.util.List getSymbolDescriptorList()
          Gets the list of symbol descriptors.
 void initalizeNewProcess(ProcessItem process)
          Initalizes the properties of a new process according to the skin's settings.
 boolean initialize(java.lang.String skinResPath)
          Initializes the descriptor.
 java.lang.Boolean isControlAnchorVisible()
          Gets the flag if control anchors should be visible.
 java.lang.Boolean isControlLinkVisible()
          Gets the flag if control links should be visible.
 java.lang.Boolean isDataLinkVisible()
          Gets the flag if data links should be visible.
 boolean isDefaultSkin()
          Gets the default skin.
 boolean isDisableShadows()
          Gets the disable shadows flag.
 java.lang.Boolean isNameDisplay()
          Gets the flag if technical names should be displayed instead of display names.
 boolean isRadialTags()
          Gets the radial tags flag.
 boolean isValid()
          Gets the valid.
 void setControlAnchorVisible(java.lang.Boolean controlAnchorVisible)
          Sets the flag if control anchors should be visible.
 void setControlLinkVisible(java.lang.Boolean controlLinkVisible)
          Sets the flag if control links should be visible.
 void setDataLinkVisible(java.lang.Boolean dataLinkVisible)
          Sets the flag if data links should be visible.
 void setDefaultSkin(boolean defaultSkin)
          Sets the default skin.
 void setDisableShadows(boolean disableShadows)
          Sets the disable shadows flag.
 void setNameDisplay(java.lang.Boolean nameDisplay)
          Sets the flag if technical names should be displayed instead of display names.
 void setNodeTitleFormat(java.lang.String nodeTitleFormat)
          Sets the node title format.
 void setParamTitleFormat(java.lang.String paramTitleFormat)
          Sets the parameter title format.
 void setRadialTags(boolean radialTags)
          Sets the radial tags flag.
 void setResourceCollection(ResourceCollection resourceCollection)
          Sets the skin resource.
 void setResourceName(java.lang.String resourceName)
          Sets the resource name.
 void setSocketTitleFormat(java.lang.String socketTitleFormat)
          Sets the socket title format.
 void setValid(boolean valid)
          Sets the valid.
 boolean validate(java.lang.String descriptorDir, java.util.List errorMsgs)
          Validates the skin.
 
Methods inherited from class org.openbp.common.generic.description.DisplayObjectImpl
copyFrom, getDisplayName, getDisplayText, setDisplayName
 
Methods inherited from class org.openbp.common.generic.description.DescriptionObjectImpl
clone, compareTo, getDescription, getDescriptionEscape, getDescriptionText, getName, setDescription, setDescriptionEscape, setName, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openbp.common.generic.description.DescriptionObject
clone, getDescription, getDescriptionText, getName, setDescription, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Skin

public Skin()
Default constructor.

Method Detail

validate

public boolean validate(java.lang.String descriptorDir,
                        java.util.List errorMsgs)
Validates the skin. Any error messages should be added to the supplied error message list and will be displayed by the caller.

Parameters:
descriptorDir - Path to the directory containing the descriptor
errorMsgs - List of strings that holds error messages
Returns:
true: The descriptor was successfully validated.
false: There was an error validating the descriptor.

initialize

public boolean initialize(java.lang.String skinResPath)
Initializes the descriptor. Loads the symbol image (if an image file has been defined).

Parameters:
skinResPath - Resource path to the resource folder containing the descriptor
Returns:
true: The descriptor was successfully initialize
false: There was an error initializing the descriptor. The descriptor should not be added to the descriptor list.

initalizeNewProcess

public void initalizeNewProcess(ProcessItem process)
Initalizes the properties of a new process according to the skin's settings. Sets the skin name and the orientation.

Parameters:
process - Process to initialize

getResourceName

public java.lang.String getResourceName()
Gets the resource name.


setResourceName

public void setResourceName(java.lang.String resourceName)
Sets the resource name.


isControlAnchorVisible

public java.lang.Boolean isControlAnchorVisible()
Gets the flag if control anchors should be visible.


setControlAnchorVisible

public void setControlAnchorVisible(java.lang.Boolean controlAnchorVisible)
Sets the flag if control anchors should be visible.


isControlLinkVisible

public java.lang.Boolean isControlLinkVisible()
Gets the flag if control links should be visible.


setControlLinkVisible

public void setControlLinkVisible(java.lang.Boolean controlLinkVisible)
Sets the flag if control links should be visible.


isDataLinkVisible

public java.lang.Boolean isDataLinkVisible()
Gets the flag if data links should be visible.


setDataLinkVisible

public void setDataLinkVisible(java.lang.Boolean dataLinkVisible)
Sets the flag if data links should be visible.


isNameDisplay

public java.lang.Boolean isNameDisplay()
Gets the flag if technical names should be displayed instead of display names.


setNameDisplay

public void setNameDisplay(java.lang.Boolean nameDisplay)
Sets the flag if technical names should be displayed instead of display names.


isRadialTags

public boolean isRadialTags()
Gets the radial tags flag.


setRadialTags

public void setRadialTags(boolean radialTags)
Sets the radial tags flag.


isDisableShadows

public boolean isDisableShadows()
Gets the disable shadows flag.


setDisableShadows

public void setDisableShadows(boolean disableShadows)
Sets the disable shadows flag.


isDefaultSkin

public boolean isDefaultSkin()
Gets the default skin.


setDefaultSkin

public void setDefaultSkin(boolean defaultSkin)
Sets the default skin.


getParamTitleFormat

public java.lang.String getParamTitleFormat()
Gets the parameter title format.


setParamTitleFormat

public void setParamTitleFormat(java.lang.String paramTitleFormat)
Sets the parameter title format.


getSocketTitleFormat

public java.lang.String getSocketTitleFormat()
Gets the socket title format.


setSocketTitleFormat

public void setSocketTitleFormat(java.lang.String socketTitleFormat)
Sets the socket title format.


getNodeTitleFormat

public java.lang.String getNodeTitleFormat()
Gets the node title format.


setNodeTitleFormat

public void setNodeTitleFormat(java.lang.String nodeTitleFormat)
Sets the node title format.


getSymbolDescriptor

public SymbolDescriptor getSymbolDescriptor(java.lang.String nodeType)
Gets a symbol descriptor by its node type.

Parameters:
nodeType - Type of the node that should be represented by the symbol descriptor
Returns:
The symbol descriptor or null if no such symbol descriptor exists

addSymbolDescriptor

public void addSymbolDescriptor(SymbolDescriptor symbolDescriptor)
Adds a symbol descriptor.

Parameters:
symbolDescriptor - The symbol descriptor to add

getSymbolDescriptorList

public java.util.List getSymbolDescriptorList()
Gets the list of symbol descriptors.

Returns:
A list of SymbolDescriptor objects

getLinkDescriptor

public LinkDescriptor getLinkDescriptor(java.lang.String linkType)
Gets a link descriptor by its link type.

Parameters:
linkType - Type of the link that should be represented by the link descriptor
Returns:
The link descriptor or null if no such link descriptor exists

addLinkDescriptor

public void addLinkDescriptor(LinkDescriptor linkDescriptor)
Adds a link descriptor.

Parameters:
linkDescriptor - The link descriptor to add

getLinkDescriptorList

public java.util.List getLinkDescriptorList()
Gets the list of link descriptors.

Returns:
A list of LinkDescriptor objects

isValid

public boolean isValid()
Gets the valid.


setValid

public void setValid(boolean valid)
Sets the valid.


getResource

public ResourceCollection getResource()
Gets the skin resource.


setResourceCollection

public void setResourceCollection(ResourceCollection resourceCollection)
Sets the skin resource.



Copyright © 2011. All Rights Reserved.