lt.monarch.chart.models
Class MetaDataModel

java.lang.Object
  extended by lt.monarch.chart.models.MetaDataModel
All Implemented Interfaces:
java.io.Serializable

public class MetaDataModel
extends java.lang.Object
implements java.io.Serializable

Meta data model. Used to set the styles for the specified series also style and labels for specified markers. Here are some examples of the meta data:

setData(MetaDataType.LABEL_DATA,"x1==null||x0==null","There is no data");

setData(MetaDataType.STYLE_DATA,"x1==null||x0==null",new Style());

setData(MetaDataType.HINT_DATA,"x1==null||x0==null","Wow!");

setData(MetaDataType.HINT_DATA,"$index$%2==0","Wow!");

setData(MetaDataType.HINT_DATA,"$row$==$column$","Diagonal!");

setData(MetaDataType.HINT_DATA,1,"$index$ data");

setData(MetaDataType.LABEL_DATA,"x1==200","$x1$ km/h");

setData(MetaDataType.LABEL_DATA,"x1<200","Too little");

setData(MetaDataType.LABEL_DATA,"x1==null","No data");

setData(MetaDataType.DATE_FORMAT,"yy.MM.dd");

setData(MetaDataType.NUMBER_FORMAT,"#.00");

setData(MetaDataType.BAR_WIDTH,"x0>70 && x0<100","x0/1000") This one is handy, since it lets to specify the bar width according to the logical expression and dynamic value according to the data model.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  java.util.Map<MetaDataType,DataModelColumn> virtualColumns
           
 
Constructor Summary
Constructor and Description
MetaDataModel()
           
 
Method Summary
Modifier and Type Method and Description
 void clear()
           
 void dispose()
          Disposes the object
protected  java.lang.String exchangeExpression(int index, java.lang.String expression)
          Exchanges $index$ value in the expression to be integer value
protected  void finalize()
           
 java.lang.Object getData(MetaDataType dataType, int index, DataModel dataModel)
          Gets the object for the specified data point (array model)
 java.lang.Object getData(MetaDataType dataType, int row, int column, DataModel dataModel)
          Gets the object for the specified data point (matrix model)
 java.lang.Object getData(MetaDataType dataType, java.lang.String value, int index)
          Gets the object for the specified label
 void setData(MetaDataType dataType, DataModelColumn column)
          Sets the data type calculation function
 void setData(MetaDataType dataType, int row, int column, java.lang.Object object)
          Sets object for the specified data point (used for matrix)
 void setData(MetaDataType dataType, int index, java.lang.Object object)
          Sets object for the specified data point (array)
 void setData(MetaDataType dataType, java.lang.Object object)
          Sets general object for all data points
 void setData(MetaDataType dataType, java.lang.String logExpression, java.lang.Object object)
          Sets the label when the data point satisfies the logical expression
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

virtualColumns

protected java.util.Map<MetaDataType,DataModelColumn> virtualColumns
Constructor Detail

MetaDataModel

public MetaDataModel()
Method Detail

exchangeExpression

protected java.lang.String exchangeExpression(int index,
                                              java.lang.String expression)
Exchanges $index$ value in the expression to be integer value

Parameters:
index - index
expression - expression
Returns:
new expression containing integer

setData

public void setData(MetaDataType dataType,
                    java.lang.Object object)
Sets general object for all data points

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
object - general object for all data points

setData

public void setData(MetaDataType dataType,
                    int index,
                    java.lang.Object object)
Sets object for the specified data point (array)

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
index - index of the data model
object - object for specified index

setData

public void setData(MetaDataType dataType,
                    int row,
                    int column,
                    java.lang.Object object)
Sets object for the specified data point (used for matrix)

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
row - row of the data model
column - column of the data model
object - object for specified column and row

setData

public void setData(MetaDataType dataType,
                    java.lang.String logExpression,
                    java.lang.Object object)
             throws java.lang.Exception
Sets the label when the data point satisfies the logical expression

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
logExpression - logical expression, which will have to be evaluated for each data point
object - object, which satisfies the condition
Throws:
java.lang.Exception - throws exception if any error occurs parsing the logical formula

setData

public void setData(MetaDataType dataType,
                    DataModelColumn column)
Sets the data type calculation function

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
column - function which evaluates data model data and returns required meta model value

getData

public java.lang.Object getData(MetaDataType dataType,
                                int index,
                                DataModel dataModel)
Gets the object for the specified data point (array model)

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
index - data point index
dataModel - data model
Returns:
object of the specified point

getData

public java.lang.Object getData(MetaDataType dataType,
                                java.lang.String value,
                                int index)
Gets the object for the specified label

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
value - label to evaluate value
index - label index
Returns:
object of the specified point

getData

public java.lang.Object getData(MetaDataType dataType,
                                int row,
                                int column,
                                DataModel dataModel)
Gets the object for the specified data point (matrix model)

Parameters:
dataType - enumeration form MetaDataType, which specifies the type of the data: label, hint, style and etc.
row - row of the data model
column - column of the data model
dataModel - matrix data model
Returns:
object of the specified data point

dispose

public void dispose()
Disposes the object


finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

clear

public void clear()