Package jadex.tools.comanalyzer.graph
Class EdgeTransformer.WeightStroke
- java.lang.Object
-
- jadex.tools.comanalyzer.graph.EdgeTransformer.WeightStroke
-
- All Implemented Interfaces:
org.apache.commons.collections15.Transformer
- Enclosing class:
- EdgeTransformer
public static final class EdgeTransformer.WeightStroke extends java.lang.Object implements org.apache.commons.collections15.Transformer
A Transformer for assigning a weighted stroke to the message group (the edge). The size is calculated from the edge weight of the message group (the number of elements (messages) inside the group) in relation to the highest edge weight of all message groups in the graph.
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.Stroke
basic
The basic strokestatic java.awt.Stroke
dotted
The dotted strokeprotected ComponentGroupMultiGraph
graph
The graphstatic java.awt.Stroke
heavy
The heavy strokestatic int
MAX_EDGE_SIZE
The max edge sizestatic int
MIN_EDGE_SIZE
The min edge sizeprotected int
propFactor
The proportional factor (1<= proFactor<= 100)protected boolean
scale
If stroke scaling is enabledprotected int
scaleRange
The scale range. (0<= scaleRange <= MAX_EDGE_SIZE - MIN_EDGE_SIZE
-
Constructor Summary
Constructors Constructor Description WeightStroke(ComponentGroupMultiGraph graph)
Creates a WeightStroke transformer for the graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isScaling()
void
setPropValue(int value)
void
setScaleRange(int scaleRange)
void
setScaling(boolean scale)
java.lang.Object
transform(java.lang.Object group)
Returns the stroke for the given message group.
-
-
-
Field Detail
-
MIN_EDGE_SIZE
public static final int MIN_EDGE_SIZE
The min edge size- See Also:
- Constant Field Values
-
MAX_EDGE_SIZE
public static final int MAX_EDGE_SIZE
The max edge size- See Also:
- Constant Field Values
-
basic
public static final java.awt.Stroke basic
The basic stroke
-
heavy
public static final java.awt.Stroke heavy
The heavy stroke
-
dotted
public static final java.awt.Stroke dotted
The dotted stroke
-
graph
protected ComponentGroupMultiGraph graph
The graph
-
scale
protected boolean scale
If stroke scaling is enabled
-
scaleRange
protected int scaleRange
The scale range. (0<= scaleRange <= MAX_EDGE_SIZE - MIN_EDGE_SIZE
-
propFactor
protected int propFactor
The proportional factor (1<= proFactor<= 100)
-
-
Constructor Detail
-
WeightStroke
public WeightStroke(ComponentGroupMultiGraph graph)
Creates a WeightStroke transformer for the graph.- Parameters:
graph
- The graph.
-
-
Method Detail
-
transform
public java.lang.Object transform(java.lang.Object group)
Returns the stroke for the given message group.- Specified by:
transform
in interfaceorg.apache.commons.collections15.Transformer
- Parameters:
group
- The message group.- Returns:
- The icon.
-
setScaling
public void setScaling(boolean scale)
- Parameters:
scale
-true
if scaling ought to be enabled.
-
isScaling
public boolean isScaling()
- Returns:
true
if scaling is enabled
-
setScaleRange
public void setScaleRange(int scaleRange)
- Parameters:
scaleRange
- The scale range to set.
-
setPropValue
public void setPropValue(int value)
- Parameters:
value
- The proportional factor to set.
-
-