|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.ChannelAttributes
ChannelAttributes represents a set of chart channel attributes that
describe the interpretation rules and default render attributes for
channel and sub-channel data elements. In particular, channel
attributes add chart -specific meta data to chart -neutral data
streams. The actual assosiation between data and channel attributes
is done by instances of ChartData.
It must be carefully noted, that even if there is an one-to-one correspondence between data channel and channel attributes hierarchies, these structures are completely separate, and they must be kept synchronized by external means. In particular, changing one hierarchy does not automatically change the other.
Channels have explicit order within a data source, and therefore the concept of previous channel is always well defined: a channel is previous to another if the channel order index value is one less than the value of the other channel. The first channel within a data source has channel order index zero, and it has not previous channel. It can also never be cumulative even if it would have been marked so by channel cumulativeness attribute.
Channel elements have also an explicit order within a channel, and
therefore the concept of corresponding data elements is also
always well defined, too: elements with any channel and with equal
element order index always corredpond to each other. If a channel
has more elements than some other channel, the missing elements in
the shorter channel are considered to have null
values.
Element summing is an operation defined by DataValue.add(com.davisor.data.DataValue) method. Summing accross different data types may or
may be possible, according to the implementation of the
add method. In particular, cumulativeness across two
elements is defined only if the add method succeeds
and returns a DataValue instance.
The values of cumulative channels are a function of the cumulative and previous channel values. In particular, it is perfectly possible to base a cumulative channel on another cumulative channel. The value of each such cumulative channel is then the sum over all corresponding element values in previous cumulative channels, plus the first channel the first cumulative channel is based on.
Type data name, accessible with Type.getDataName() and Type.setDataName(java.lang.String) methods. It should
be noted, that type data name is generic chart -neural concept
charts just happen to use as part of channel selection mechanism.
Channel group on the other hand is a chart -specific attribute,
defined in ChartAxes and accessed by ChartAxes.getDataGroup() and ChartAxes.setDataGroup(java.lang.String) methods.
Channels group makes it possible to group channels together by
giving them mutually equal group identifiers. A null
When a chart needs data channels for some purpose, it first uses
the channel type to identify all suitable channel candidates,
and then the group to select only those candidates meant for
that chart. This is usefull in particular when more than one chart
feeds from the same data source.
If a chart has no explicitly set group, it targets only channels
belonging to the default null group. If a chart has
been given a group, but none of the channel candidates chart found
match that group, the chart will fall back to the default group.
In all cases, it is possible that channel selection produces no
matches, which means that that kind of channels the chart searched
for are not availabel for it.
hidden controls if the content
of the channel should be displayed at all. If not, the data is
still read and computed normally, but none of the results will be
displayed in any way. However, any indirect effects the data
has, like for example effects on cumulative channel values, remain,
and they in turn may have visual effects. Indeed, hidden channels
are particularly usefull when used together with cumulative
channels.
DataRenderAttributes
instance. This makes it possible to express desired visualization
details already at the data source. Individual charts may later
override these setting if explicitly told to do so, but otherwise
the render attributes assosiated with a channel will stay in effect
in all the charts that use that channel. The details of which
attribute settings override which are further described in a
separate xml
reference document.
Chart,
ChartData,
ChartFactory,
Serialized Form| Field Summary | |
protected java.lang.Boolean |
M_cumulative
Controls if channel data is cumulative (may be null). |
protected Type |
M_dataType
Type of the data channel for this channel attributes. |
protected ChannelAttributes |
M_defaults
Channel default values (may be null). |
protected java.lang.String |
M_group
Channel group identity. |
protected java.lang.Boolean |
M_hidden
Controls if channel data is to be hidden (may be null). |
protected java.lang.String |
M_idRef
Channel identity. |
protected java.lang.String |
M_name
Channel name (if not null, the channel forms a data series). |
protected DataRenderAttributes |
M_render
Channel render attributes. |
protected ChannelAttributes[] |
M_subChannels
Sub-channel specific attributes (may be null). |
| Constructor Summary | |
ChannelAttributes()
Default constructor. |
|
ChannelAttributes(ChannelAttributes ca)
Deep copy constructor. |
|
ChannelAttributes(ChannelAttributes ca,
ChannelAttributes defaults)
Deep copy constructor, with explicitly given default values. |
|
ChannelAttributes(java.lang.String idRef,
java.lang.String group,
java.lang.String name,
DataRenderAttributes render,
java.lang.Boolean cumulative,
java.lang.Boolean hidden,
ChannelAttributes[] subChannels,
ChannelAttributes defaults,
Type dataType)
Creates a new channel attributes set with default values. |
|
| Method Summary | |
com.davisor.core.Dupable |
dup()
|
boolean |
equals(java.lang.Object object)
Test if these channel attributes equal to given channel attributes. |
ChannelAttributes |
getDefaults()
Gets default attributes. |
java.lang.String |
getGroup()
Gets the channel group identity. |
java.lang.String |
getID()
Gets the channel identity. |
java.lang.String |
getName()
Gets the channel name. |
DataRenderAttributes |
getRender()
Gets the channel render attributes. |
ChannelAttributes |
getSubChannel(int index)
Gets sub-channel attributes for given sub-channel. |
ChannelAttributes |
getSubChannel(java.lang.String id)
Gets sub-channel attributes for given sub-channel. |
ChannelAttributes[] |
getSubChannels()
Gets all sub-channel attributes. |
Type |
getType()
Gets the channel data type. |
boolean |
hasID()
Tests if the channel has an identity. |
boolean |
isArea()
Tests the channel fill status. |
java.lang.Boolean |
isCumulative()
Tests the channel cumulative status. |
boolean |
isCumulativeDefault()
Gets the cumulativeness attribute with a non-null default value. |
java.lang.Boolean |
isHidden()
Tests if the channel is to be hidden. |
boolean |
isHiddenDefault()
Gets the hiddenness attribute with a non-null default value. |
boolean |
isSeries()
Deprecated. Use ChartFactory#isMultiSeriesMode instead |
void |
setCumulative(boolean cumulative)
Sets if the channel data is cumulative. |
void |
setCumulative(java.lang.Boolean cumulative)
Sets if the channel data is cumulative. |
void |
setDefaults(ChannelAttributes defaults)
Replaces the current defaults with new default attributes. |
void |
setGroup(java.lang.String group)
Sets the channel group identity. |
void |
setHidden(boolean hidden)
Sets if the channel is to be hidden. |
void |
setHidden(java.lang.Boolean hidden)
Sets if the channel is to be hidden. |
void |
setID(java.lang.String idRef)
Sets the channel identity. |
void |
setName(java.lang.String name)
Sets the channel name. |
void |
setRender(DataRenderAttributes render)
Sets the chart render attributes. |
void |
setSubChannel(int index,
ChannelAttributes subChannel)
Sets sub-channel attributes for given sub-channel. |
void |
setSubChannels(ChannelAttributes[] subChannels)
Sets sub-channel attributes. |
void |
setType(Type dataType)
Sets the data channel type. |
java.lang.String |
toString()
Gets channel attributes XML representation. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.Boolean M_cumulative
protected ChannelAttributes M_defaults
protected java.lang.String M_group
protected java.lang.Boolean M_hidden
protected java.lang.String M_idRef
protected java.lang.String M_name
protected DataRenderAttributes M_render
protected ChannelAttributes[] M_subChannels
protected Type M_dataType
| Constructor Detail |
public ChannelAttributes()
public ChannelAttributes(ChannelAttributes ca)
ca - channel attributes to be copied (may be null)dup()
public ChannelAttributes(ChannelAttributes ca,
ChannelAttributes defaults)
ca - channel attributes to be copied (may be null)defaults - default channel attributes (may be null)dup()
public ChannelAttributes(java.lang.String idRef,
java.lang.String group,
java.lang.String name,
DataRenderAttributes render,
java.lang.Boolean cumulative,
java.lang.Boolean hidden,
ChannelAttributes[] subChannels,
ChannelAttributes defaults,
Type dataType)
In order to keep the supplied render attribute object unmodified, a new render attribute object is always created, and the values of the given render attributes are copied into it. Furthermore, the render attributes in the given default channel attributes object are made the default values for the new render attribute object.
In order to keep the supplied data type of the data channel into which these channel attributes point at, a new type with the values of the given type is created.
idRef - channel id, used with channel identificationgroup - channel group, used with channel groupingname - channel name, used with channel labelingrender - channel render attributes (may be null)cumulative - channel cumulativeness (may be null)hidden - channel hidden status (may be null)subChannels - sub-channel attributes (may be null)defaults - default values for unset attributes (may be null)dataType - channel data type (may be null)| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupablepublic boolean equals(java.lang.Object object)
public java.lang.String toString()
RenderAttributes.toString(int,String),
Strings.toXML(String,Object)public ChannelAttributes getDefaults()
null if the defaults have
not been setsetDefaults(com.davisor.graphics.chart.ChannelAttributes)public java.lang.String getGroup()
null.
The group is not inherited from default values.
null if the group has not been setpublic java.lang.String getID()
Channel identity is not inherited from default values.
null if the id has not been setpublic java.lang.String getName()
null.
If local name is null, we pass getName() to M_defaults, if not null.
null if the name has not been setpublic DataRenderAttributes getRender()
The new render attribute set defaults to default channel render attributes. In particular, this makes all default channel render attributes visible, but any changes made to the new attribute set will be local, and not change the settings of the default channel.
getSubChannel(int)public ChannelAttributes getSubChannel(int index)
The new sub-channel attributes defaults to corresponding default channel sub-channel attributes. In particular, this makes all default channel sub-channel attributes visible, but any changes made to the new attributes will be local, and not change the settings of the default channel.
index - sub-channel index
getRender(),
getSubChannel(String),
getSubChannels(),
setSubChannel(int,ChannelAttributes),
setSubChannels(ChannelAttributes[])public ChannelAttributes getSubChannel(java.lang.String id)
id - sub-channel id
null if such
sub-channel has not been setgetSubChannel(int),
getSubChannels(),
setSubChannel(int,ChannelAttributes),
setSubChannels(ChannelAttributes[])public ChannelAttributes[] getSubChannels()
null if they have
not been setgetSubChannel(int),
getSubChannel(String),
setSubChannel(int,ChannelAttributes),
setSubChannels(ChannelAttributes[])
public Type getType()
throws InvalidDataException
InvalidDataExceptionpublic boolean hasID()
getID(),
setID(java.lang.String)public boolean isArea()
getRender()public java.lang.Boolean isCumulative()
null.
null if the status
has not been setpublic boolean isCumulativeDefault()
null,
false is returned instead.
isCumulative()public java.lang.Boolean isHidden()
null.
setHidden(Boolean),
setHidden(boolean)public boolean isHiddenDefault()
isHidden()public boolean isSeries()
getName()public void setCumulative(java.lang.Boolean cumulative)
isCumulative()public void setCumulative(boolean cumulative)
isCumulative()public void setDefaults(ChannelAttributes defaults)
If new render attribute defaults are provided, but there is currently no render attributes object, one is created now, and the new default render attributes are then attached to it.
If the new defaults do not define any render attribute defaults, then the current render defaults, if any, are removed. The current render attributes object is not however removed, even if it was automatically created by an earlier call to this method.
Sub-channel defaults are not directly modified, but they are assumed to use this channel attributes instance as the provider for their own default values. The new defalts will therefore affect the sub-channels indirectly because the new defaults of this object will also be the new defaults to the sub-channel defaults.
defaults - default attributes (may be null)public void setGroup(java.lang.String group)
getGroup()public void setHidden(java.lang.Boolean hidden)
isHidden()public void setHidden(boolean hidden)
isHidden()public void setID(java.lang.String idRef)
getID()public void setName(java.lang.String name)
getName()
public void setSubChannel(int index,
ChannelAttributes subChannel)
index - sub-channel indexsubChannel - sub-channel attributes (may be null)
java.lang.ArrayIndexOutOfBoundsException - if index is out of boundsgetSubChannel(int),
getSubChannel(String),
getSubChannels(),
setDefaults(com.davisor.graphics.chart.ChannelAttributes),
setSubChannels(ChannelAttributes[])public void setSubChannels(ChannelAttributes[] subChannels)
subChannels - sub-channel attributes (may be null)getSubChannel(int),
getSubChannel(String),
getSubChannels(),
setDefaults(com.davisor.graphics.chart.ChannelAttributes),
setSubChannel(int,ChannelAttributes)public void setRender(DataRenderAttributes render)
public void setType(Type dataType)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||