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.TransformerA 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.StrokebasicThe basic strokestatic java.awt.StrokedottedThe dotted strokeprotected ComponentGroupMultiGraphgraphThe graphstatic java.awt.StrokeheavyThe heavy strokestatic intMAX_EDGE_SIZEThe max edge sizestatic intMIN_EDGE_SIZEThe min edge sizeprotected intpropFactorThe proportional factor (1<= proFactor<= 100)protected booleanscaleIf stroke scaling is enabledprotected intscaleRangeThe scale range.
-
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 booleanisScaling()voidsetPropValue(int value)voidsetScaleRange(int scaleRange)voidsetScaling(boolean scale)java.lang.Objecttransform(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:
transformin interfaceorg.apache.commons.collections15.Transformer- Parameters:
group- The message group.- Returns:
- The icon.
-
setScaling
public void setScaling(boolean scale)
- Parameters:
scale-trueif scaling ought to be enabled.
-
isScaling
public boolean isScaling()
- Returns:
trueif 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.
-
-