org.openbp.cockpit.modeler.skins
Class LinkDescriptor

java.lang.Object
  extended by org.openbp.cockpit.modeler.skins.LinkDescriptor

public class LinkDescriptor
extends java.lang.Object

Control or data link descriptor.

Author:
Heiko Erhardt

Field Summary
static int DECORATION_ARROW
          Decoration: Arrow
static int DECORATION_NONE
          Decoration: None
static int DEFAULT_STROKE_WIDTH
          Default stroke width
static int LINETYPE_DOTTED
          Line type: Dotted line
static int LINETYPE_SOLID
          Line type: Solid line
 
Constructor Summary
LinkDescriptor()
          Default constructor.
 
Method Summary
 java.awt.Color getColor()
          Gets the link color.
 java.awt.Color getColor2()
          Gets the link color 2.
 java.lang.String getColor2Str()
          Gets the link color 2 (colon-separated RGBA value).
 java.awt.Color getColor3()
          Gets the link color 3.
 java.lang.String getColor3Str()
          Gets the link color 3 (colon-separated RGBA value).
 java.awt.Color getColor4()
          Gets the link color 4.
 java.lang.String getColor4Str()
          Gets the link color 4 (colon-separated RGBA value).
 java.lang.String getColorStr()
          Gets the link color (colon-separated RGBA value).
 int getEndDecoration()
          Gets the end decoration.
 java.lang.String getEndDecorationStr()
          Gets the end decoration (string value).
 int getLineType()
          Gets the line type.
 java.lang.String getLineTypeStr()
          Gets the line type (string value).
 java.lang.String getLinkType()
          Gets the link type.
 int getStartDecoration()
          Gets the start decoration.
 java.lang.String getStartDecorationStr()
          Gets the start decoration (string value).
 java.awt.Stroke getStroke()
          Gets the frame stroke.
 int getStrokeWidth()
          Gets the stroke width.
 boolean hasStrokeWidth()
          Determines if the stroke width should be persisted.
 boolean initialize(java.lang.String skinResPath)
          Initializes the descriptor.
 void setColor(java.awt.Color color)
          Sets the link color.
 void setColor2(java.awt.Color color2)
          Sets the link color 2.
 void setColor2Str(java.lang.String s)
          Sets the link color 2 (colon-separated RGBA value).
 void setColor3(java.awt.Color color3)
          Sets the link color 3.
 void setColor3Str(java.lang.String s)
          Sets the link color 3 (colon-separated RGBA value).
 void setColor4(java.awt.Color color4)
          Sets the link color 4.
 void setColor4Str(java.lang.String s)
          Sets the link color 4 (colon-separated RGBA value).
 void setColorStr(java.lang.String s)
          Sets the link color (colon-separated RGBA value).
 void setEndDecoration(int endDecoration)
          Sets the end decoration.
 void setEndDecorationStr(java.lang.String endDecorationStr)
          Sets the end decoration.
 void setLineType(int lineType)
          Sets the line type.
 void setLineTypeStr(java.lang.String lineTypeStr)
          Sets the line type.
 void setLinkType(java.lang.String linkType)
          Sets the link type.
 void setStartDecoration(int startDecoration)
          Sets the start decoration.
 void setStartDecorationStr(java.lang.String startDecorationStr)
          Sets the start decoration.
 void setStrokeWidth(int strokeWidth)
          Sets the stroke width.
 boolean validate(java.lang.String descriptorDir, java.util.List errorMsgs)
          Validates the descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STROKE_WIDTH

public static final int DEFAULT_STROKE_WIDTH
Default stroke width

See Also:
Constant Field Values

LINETYPE_SOLID

public static final int LINETYPE_SOLID
Line type: Solid line

See Also:
Constant Field Values

LINETYPE_DOTTED

public static final int LINETYPE_DOTTED
Line type: Dotted line

See Also:
Constant Field Values

DECORATION_NONE

public static final int DECORATION_NONE
Decoration: None

See Also:
Constant Field Values

DECORATION_ARROW

public static final int DECORATION_ARROW
Decoration: Arrow

See Also:
Constant Field Values
Constructor Detail

LinkDescriptor

public LinkDescriptor()
Default constructor.

Method Detail

validate

public boolean validate(java.lang.String descriptorDir,
                        java.util.List errorMsgs)
Validates the descriptor. 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 figure 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 initialized.
false: There was an error initializing the descriptor. The descriptor should not be used.

getLinkType

public java.lang.String getLinkType()
Gets the link type.


setLinkType

public void setLinkType(java.lang.String linkType)
Sets the link type.


getColor

public java.awt.Color getColor()
Gets the link color.


setColor

public void setColor(java.awt.Color color)
Sets the link color.


getColorStr

public java.lang.String getColorStr()
Gets the link color (colon-separated RGBA value).


setColorStr

public void setColorStr(java.lang.String s)
Sets the link color (colon-separated RGBA value).


getColor2

public java.awt.Color getColor2()
Gets the link color 2.


setColor2

public void setColor2(java.awt.Color color2)
Sets the link color 2.


getColor2Str

public java.lang.String getColor2Str()
Gets the link color 2 (colon-separated RGBA value).


setColor2Str

public void setColor2Str(java.lang.String s)
Sets the link color 2 (colon-separated RGBA value).


getColor3

public java.awt.Color getColor3()
Gets the link color 3.


setColor3

public void setColor3(java.awt.Color color3)
Sets the link color 3.


getColor3Str

public java.lang.String getColor3Str()
Gets the link color 3 (colon-separated RGBA value).


setColor3Str

public void setColor3Str(java.lang.String s)
Sets the link color 3 (colon-separated RGBA value).


getColor4

public java.awt.Color getColor4()
Gets the link color 4.


setColor4

public void setColor4(java.awt.Color color4)
Sets the link color 4.


getColor4Str

public java.lang.String getColor4Str()
Gets the link color 4 (colon-separated RGBA value).


setColor4Str

public void setColor4Str(java.lang.String s)
Sets the link color 4 (colon-separated RGBA value).


hasStrokeWidth

public boolean hasStrokeWidth()
Determines if the stroke width should be persisted.


getStrokeWidth

public int getStrokeWidth()
Gets the stroke width.

Returns:
The stroke width in pixel/10 or 0 for no stroke

setStrokeWidth

public void setStrokeWidth(int strokeWidth)
Sets the stroke width.

Parameters:
strokeWidth - The stroke width in pixel/10 or 0 for no stroke

getLineType

public int getLineType()
Gets the line type.

Returns:
LINETYPE_SOLID/LINETYPE_DOTTED

setLineType

public void setLineType(int lineType)
Sets the line type.

Parameters:
lineType - LINETYPE_SOLID/LINETYPE_DOTTED

getLineTypeStr

public java.lang.String getLineTypeStr()
Gets the line type (string value).

Returns:
"solid"/"dotted"

setLineTypeStr

public void setLineTypeStr(java.lang.String lineTypeStr)
Sets the line type.

Parameters:
lineTypeStr - "solid"/"dotted"

getStartDecoration

public int getStartDecoration()
Gets the start decoration.

Returns:
DECORATION_NONE/DECORATION_ARROW

setStartDecoration

public void setStartDecoration(int startDecoration)
Sets the start decoration.

Parameters:
startDecoration - DECORATION_NONE/DECORATION_ARROW

getStartDecorationStr

public java.lang.String getStartDecorationStr()
Gets the start decoration (string value).

Returns:
"none"/"arrow"

setStartDecorationStr

public void setStartDecorationStr(java.lang.String startDecorationStr)
Sets the start decoration.

Parameters:
startDecorationStr - "none"/"arrow"

getEndDecoration

public int getEndDecoration()
Gets the end decoration.

Returns:
DECORATION_NONE/DECORATION_ARROW

setEndDecoration

public void setEndDecoration(int endDecoration)
Sets the end decoration.

Parameters:
endDecoration - DECORATION_NONE/DECORATION_ARROW

getEndDecorationStr

public java.lang.String getEndDecorationStr()
Gets the end decoration (string value).

Returns:
"none"/"arrow"

setEndDecorationStr

public void setEndDecorationStr(java.lang.String endDecorationStr)
Sets the end decoration.

Parameters:
endDecorationStr - "none"/"arrow"

getStroke

public java.awt.Stroke getStroke()
Gets the frame stroke.



Copyright © 2011. All Rights Reserved.