|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.gui2.SourcePropertyAdapter | +--gishur.graph.gui.FlowAdapter
An adapter based on SourcePropertyAdapter
, that reads a flow
datas.
Field Summary | |
static byte |
FLOW_VALUE
Signals, that the flow value should be read. |
static byte |
LOWER_CAPACITY
Signals, that the lower capacity should be read. |
static byte |
UPPER_CAPACITY
Signals, that the upper capacity should be read. |
Constructor Summary | |
FlowAdapter(java.lang.String propertyname)
Constructor. |
|
FlowAdapter(java.lang.String propertyname,
double shift,
double scale)
Constructs a FlowDataAdapter , which reads the given flow
and shifts its values by the given number and then scales this
value by the given factor. |
Method Summary | |
protected java.awt.Color |
convertFlowDataColors(byte i,
Flow flow)
Reads flow-value specified by i from the given flow
and returns the - adapted - color value.
|
protected int |
convertFlowDataWidth(byte i,
Flow flow)
Reads flow-value specified by i from the given flow
and returns the - adapted - value.
|
java.lang.Object |
getProperty(java.lang.String key,
java.lang.Object source,
PropertyStatusReader prop)
Returns a property value with a given key using the source-object (and perhaps the given PropertyStatusReader ). |
double |
scale()
Returns the scale-factor. |
double |
shift()
Returns the shift-parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte UPPER_CAPACITY
public static final byte FLOW_VALUE
public static final byte LOWER_CAPACITY
Constructor Detail |
public FlowAdapter(java.lang.String propertyname)
propertyname
- the name of the connected property at the
GraphElement
.public FlowAdapter(java.lang.String propertyname, double shift, double scale)
FlowDataAdapter
, which reads the given flow
and shifts its values by the given number and then scales this
value by the given factor.propertyname
- the name of the connected property at the
GraphElement
.shift
- shift parameterscale
- scale factorMethod Detail |
public double shift()
public double scale()
public java.lang.Object getProperty(java.lang.String key, java.lang.Object source, PropertyStatusReader prop)
PropertyStatusReader
).getProperty
in class SourcePropertyAdapter
key
- the property namesource
- the source object to useprop
- the PropertyStatusReader
protected int convertFlowDataWidth(byte i, Flow flow)
i
from the given flow
and returns the - adapted - value.
Overwrite this method to convert the values otherwise. The default
implementation shifts the values and scales them by the parameters
specified at the constructor.i
- specifies which value to be read (one of {
UPPER_CAPACITY
,LOWER_CAPACITY
,FLOW_VALUE
}
flow
- the GraphElement.FlowData
-object where to read from.-1
.protected java.awt.Color convertFlowDataColors(byte i, Flow flow)
i
from the given flow
and returns the - adapted - color value.
Overwrite this method to convert the values otherwise. The default
implementation returns null
.i
- specifies which value to be read (one of {
UPPER_CAPACITY
,LOWER_CAPACITY
,FLOW_VALUE
}
flow
- the GraphElement.FlowData
-object where to read from.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |