com.sas.graphics.components.ganttchart
Class GanttChartAnnotationTableDataModel

com.sas.graphics.components.ganttchart.GanttChartAnnotationTableDataModel

public class GanttChartAnnotationTableDataModel

A GanttChartAnnotationTableDataModel sets annotations to display on a Gantt chart. The annotations can flag start or finish dates for any task, or they can flag other significant dates within the schedule. The annotations can be marker symbols or labels, each of which must be defined in the data.

Although a GanttChartTableDataModel can define annotations, a GanttChartAnnotationTableDataModel is more flexible because it separates the annotation data from the schedule data and can define multiple annotations for the same task.

Topics:
Setting Annotations
Positioning Annotations in the Chart

Samples

Since:
SAS 9.1
See Also:
GanttChartDataModel, GanttChart

Constructor Summary
GanttChartAnnotationTableDataModel()
          Default Constructor
GanttChartAnnotationTableDataModel(javax.swing.table.TableModel newModel)
          Constructor with assigned model
 
Method Summary
 void apply(GanttChartAnnotationTableDataModel theOtherModel)
          Utility method to convey properties contained in "theOtherModel" to this object.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this GanttChartAnnotateTableDataModel.
 Variable getLabelColorVariable()
          Returns the data column that was most recently set in the TextColor role by the setLabelColorVariable() method.
 Variable getLabelJustificationVariable()
          Returns the data column that was most recently set in the Justification role by the setJustificaionVariable() method.
 Variable getLabelVariable()
          Returns the data column that was most recently set in the Text role by the setLabelVariable() method.
 Variable getLocationVariable()
          Returns the data column that was most recently set in the Location role by the setLocationVariable() method.
 javax.swing.table.TableModel getModel()
          Returns the Swing TableModel containing chart data.
 Variable getPositionVariable()
          Returns the data column that was most recently set in the Position role by the setPositionVariable() method.
 Variable getSymbolColorVariable()
          Returns the data column that was most recently set in the SymbolColor role by the setSymbolColorVariable() method.
 Variable getSymbolVariable()
          Returns the data column that was most recently set in the Symbol role by the setSymbolVariable() method.
 Variable getTaskVariable()
          Returns the data column that was most recently set in the Task role by the setTaskVariable() method.
 int hashCode()
          Computes the hash code for this GanttChartAnnotateTableDataModel.
 void setLabelColorVariable(Variable newVariable)
          Specifies a variable containing color values for the text markers.
 void setLabelJustificationVariable(Variable newVariable)
          Specifies a variable containing justification values for the text.
 void setLabelVariable(Variable newVariable)
          Specifies a variable containing text string to annotate on the gantt bars.
 void setLocationVariable(Variable newVariable)
          Specifies a variable containing which gantt box variable value to locate the annotation on.
 void setModel(javax.swing.table.TableModel newModel)
          Sets Swing TableModel containing chart data.
 void setPositionVariable(Variable newVariable)
          Specifies a variable containing the date position to place the annotation.
 void setSymbolColorVariable(Variable newVariable)
          Specifies a variable containing color values for the marker symbols.
 void setSymbolVariable(Variable newVariable)
          Specifies the Variable that contains values denoting which symbol to draw.
 void setTaskVariable(Variable newVariable)
          Specifies a variable containing the task variable value in which to annotate (draw) the marker and text on.
 
Methods inherited from class com.sas.graphics.components.DataModel
apply, getLocale, getRulesContext, getSortStrategy, setLocale, setRulesContext, setSortStrategy
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

GanttChartAnnotationTableDataModel

public GanttChartAnnotationTableDataModel()
Default Constructor


GanttChartAnnotationTableDataModel

public GanttChartAnnotationTableDataModel(javax.swing.table.TableModel newModel)
Constructor with assigned model

Method Detail

apply

public void apply(GanttChartAnnotationTableDataModel theOtherModel)
Utility method to convey properties contained in "theOtherModel" to this object.
Note: Contained "models" (i.e. properties that are subclasses of ModelBase) will in turn be called on to convey their properties to the like contained models in the other object. In that respect this can be considered a "tree" type copy.
Also Note: This is a deep copy. Thus after the copy, mutable properties will not be shared by the two instances.

Parameters:
theOtherModel - properties applied to this instance

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this GanttChartAnnotateTableDataModel.

The result is true if and only if the argument is not null and is a GanttChartAnnotateTableDataModel object that has the same property values as this object.

Overrides:
equals in class DataModel
Parameters:
obj - the object to test for equality with this GanttChartAnnotateTableDataModel
Returns:
true if the objects are the same; false otherwise.

hashCode

public int hashCode()
Computes the hash code for this GanttChartAnnotateTableDataModel.

Overrides:
hashCode in class DataModel
Returns:
a hash code value for this object.

setModel

public void setModel(javax.swing.table.TableModel newModel)
Sets Swing TableModel containing chart data.

Parameters:
newModel - containing chart data
See Also:
getModel()

getModel

public javax.swing.table.TableModel getModel()
Returns the Swing TableModel containing chart data.

Returns:
TableModel of chart data
See Also:
setModel(javax.swing.table.TableModel)

setTaskVariable

public void setTaskVariable(Variable newVariable)
Specifies a variable containing the task variable value in which to annotate (draw) the marker and text on.

Define the marker to be drawn with the setSymbolVariable() and define the text to be drawn with the setTextVariable() method calls.

Parameters:
newVariable - contains task variable values to annotate.
See Also:
getTaskVariable()

getTaskVariable

public Variable getTaskVariable()
Returns the data column that was most recently set in the Task role by the setTaskVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for task to annotate
See Also:
setTaskVariable(com.sas.graphics.components.Variable)

setLocationVariable

public void setLocationVariable(Variable newVariable)
Specifies a variable containing which gantt box variable value to locate the annotation on.

Valid values for this variable are:

Parameters:
newVariable - contains where to locate the annotation
See Also:
getLocationVariable()

getLocationVariable

public Variable getLocationVariable()
Returns the data column that was most recently set in the Location role by the setLocationVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for annotation location values
See Also:
setLocationVariable(com.sas.graphics.components.Variable)

setPositionVariable

public void setPositionVariable(Variable newVariable)
Specifies a variable containing the date position to place the annotation.

Note: This variable must be the same format as the chart's Start and Finish Variables and have a valid date format specifed on the newVariable.
Examples of valid date formats are:

Parameters:
newVariable - contains the date position to place the annotation
Throws:
java.lang.IllegalArgumentException - if format is null, needs a valid date format specifed.
See Also:
getPositionVariable()

getPositionVariable

public Variable getPositionVariable()
Returns the data column that was most recently set in the Position role by the setPositionVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for annotation position
See Also:
setPositionVariable(com.sas.graphics.components.Variable)

setSymbolVariable

public void setSymbolVariable(Variable newVariable)
Specifies the Variable that contains values denoting which symbol to draw. Expects int values defined in the MarkerStyle class. Valid values are:

Parameters:
newVariable - Variable containing valid values for symbols.
See Also:
getSymbolVariable()

getSymbolVariable

public Variable getSymbolVariable()
Returns the data column that was most recently set in the Symbol role by the setSymbolVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for the marker symbols
See Also:
setSymbolVariable(com.sas.graphics.components.Variable)

setLabelVariable

public void setLabelVariable(Variable newVariable)
Specifies a variable containing text string to annotate on the gantt bars.

Parameters:
newVariable - contains text strings to annotate
See Also:
getLabelVariable()

getLabelVariable

public Variable getLabelVariable()
Returns the data column that was most recently set in the Text role by the setLabelVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for text to annotate
See Also:
setLabelVariable(com.sas.graphics.components.Variable)

setSymbolColorVariable

public void setSymbolColorVariable(Variable newVariable)
Specifies a variable containing color values for the marker symbols.

Parameters:
newVariable - contains marker symbol color
See Also:
getSymbolColorVariable()

getSymbolColorVariable

public Variable getSymbolColorVariable()
Returns the data column that was most recently set in the SymbolColor role by the setSymbolColorVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for symbol color
See Also:
setSymbolColorVariable(com.sas.graphics.components.Variable)

setLabelColorVariable

public void setLabelColorVariable(Variable newVariable)
Specifies a variable containing color values for the text markers.

Parameters:
newVariable - contains text marker color
See Also:
getLabelColorVariable()

getLabelColorVariable

public Variable getLabelColorVariable()
Returns the data column that was most recently set in the TextColor role by the setLabelColorVariable() method. Returns a null pointer exception if the variable role has not been set.

Returns:
variable for label color
See Also:
setLabelColorVariable(com.sas.graphics.components.Variable)

setLabelJustificationVariable

public void setLabelJustificationVariable(Variable newVariable)
Specifies a variable containing justification values for the text. The justification is based the value found in the setPositionVariable or setLocationVariable variable, and the String variable's values must be one of the following enumeration values:
LEFT
Set the annotation to be left justified
RIGHT
Set the annotation to be right justified
CENTER
Set the annotation to be center justified
However, if a Numeric variable is applied, the variable's values must be one of the following SwingContants:
javax.swing.SwingConstants.LEFT
Set the annotation to be left justified
javax.swing.SwingConstants.RIGHT
Set the annotation to be right justified
javax.swing.SwingConstants.CENTER
Set the annotation to be center justified

Parameters:
newVariable - contains where to justify the text
See Also:
getLocationVariable(), setLabelVariable(com.sas.graphics.components.Variable), setPositionVariable(com.sas.graphics.components.Variable)

getLabelJustificationVariable

public Variable getLabelJustificationVariable()
Returns the data column that was most recently set in the Justification role by the setJustificaionVariable() method. Returns a null if the variable role has not been set.

Returns:
variable for text justification values
See Also:
setLabelJustificationVariable(com.sas.graphics.components.Variable)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.