com.sas.graphics.components.tilechart
Class TileChartTableDataModel

com.sas.graphics.components.tilechart.TileChartTableDataModel

public class TileChartTableDataModel

A TileChartTableDataModel encapsulates relational data from a javax.swing.table.TableModel and maps the TableModel's data columns onto a TileChart component. To do the mapping, it assigns variable roles to the data columns that will be used in the graph, and the assigned roles determine how the TileChart displays the data.

By default when generating a graph, a TileChart summarizes the data from a TileChartTableDataModel.

Topics:
Basic Charts
Data Summarization and Statistic Calculation
Multiple Tile Variables
Multiple Response Variables
Valid Variable Roles for a TileChartTableDataModel
Behavior
Events
Error Handling
Samples:
Swing-based Samples
Servlet-based Samples

Since:
SAS 9.1
See Also:
TileChartDataModel

Constructor Summary
TileChartTableDataModel()
          Default Constructor
TileChartTableDataModel(javax.swing.table.TableModel newModel)
          Constructor with assigned model
 
Method Summary
 void apply(TileChartTableDataModel theOtherModel)
          Utility method to convey properties contained in "theOtherObject" to this object.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this TileChartTableDataModel.
 Variable[] getAuxiliaryVariable()
          Returns the array of data columns that was most recently set by the setAuxiliaryVariable() method.
 Variable getAuxVariable()
          Deprecated. user getDataTipVariable()
 AnalysisVariable getColorVariable()
          Returns the data column that was most recently set in the Color role by the setColorVariable() method.
 Variable[] getDataTipVariable()
          Returns the array of data columns that was most recently set by the setDataTipVariable() method.
 ClassificationVariable getIdVariable()
          Deprecated. Use getTileVariable()
 javax.swing.table.TableModel getModel()
          Return the data table associated with this model.
 javax.swing.ListSelectionModel getSelectionModel()
          Returns the ListSelectionModel that indicates which data values are selected.
 AnalysisVariable getSizeVariable()
          Returns the data column that was most recently set in the Size role by the setSizeVariable() method.
 ClassificationVariable getTileVariable()
          Returns the data column that was most recently set in the TILE role by the setTileVariable() method.
 java.lang.String getVariableLabel(java.lang.String variableName)
          Returns the label corresponding to a variable
 Variable getWebLinkVariable()
          Returns the data column that was most recently set in the WebLink role by the setWebLinkVariable() method.
 AnalysisVariable getXVariable()
          Returns the data column that was most recently set in the X role by the setXVariable() method.
 AnalysisVariable getYVariable()
          Returns the data column that was most recently set in the Y role by the setYVariable() method.
 int hashCode()
          Computes the hash code for this TileChartTableDataModel.
 void setAuxiliaryVariable(Variable[] newVariables)
          Specifies an array of Variables that are included among the variables that are passed in the events on the TileChart data elements.
 void setAuxVariable(Variable newVariable)
          Deprecated. use setDataTipVariable()
 void setColorVariable(AnalysisVariable newVariable)
          Specifies the data column in the attached TableModel whose values are to be used to determine the relative colors of the rectangles.
 void setDataTipVariable(Variable[] newVariables)
          Specifies an array of Variables to be displayed in the data tip.
 void setIdVariable(ClassificationVariable newVariable)
          Deprecated. Use setTileVariable()
 void setModel(javax.swing.table.TableModel newModel)
          Assign the data table to the model.
 void setSelectionModel(javax.swing.ListSelectionModel newModel)
          Sets the ListSelectionModel which indicates which data values are selected.
 void setSizeVariable(AnalysisVariable newVariable)
          Specifies the data column in the attached TableModel whose values are to be used to determine the relative sizes of the rectangles.
 void setTileVariable(ClassificationVariable newVariable)
          Specifies the data column(s) in the attached TableModel whose values are to be used to produce the tiles to be displayed in the chart.
 void setVariableLabel(java.lang.String variableName, java.lang.String label)
          Specifies the label corresponding to a variable
 void setWebLinkVariable(Variable newVariable)
          Specifies the column(s) in the attached TableModel whose values are to be used as Web Link information.
 void setXVariable(AnalysisVariable newVariable)
          Specifies the data column in the attached TableModel whose values are to be used to determine the approximate horizontal position of the tile when used with PLACEMENT_GEOGRAPHIC mode.
 void setYVariable(AnalysisVariable newVariable)
          Specifies the data column in the attached TableModel whose values are to be used to determine the approximate vertical position of the tile when used with PLACEMENT_GEOGRAPHIC mode.
 
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

TileChartTableDataModel

public TileChartTableDataModel()
Default Constructor


TileChartTableDataModel

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

Method Detail

setSelectionModel

public void setSelectionModel(javax.swing.ListSelectionModel newModel)
Sets the ListSelectionModel which indicates which data values are selected.

Parameters:
newModel - the ListSelectionModel containing the indicies of the selected data values.
Throws:
java.lang.IllegalArgumentException - if newModel is null.
See Also:
getSelectionModel()

getSelectionModel

public javax.swing.ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that indicates which data values are selected.

Returns:
the ListSelectionModel containing the indicies of the selected data values.
See Also:
setSelectionModel(javax.swing.ListSelectionModel)

apply

public void apply(TileChartTableDataModel theOtherModel)
Utility method to convey properties contained in "theOtherObject" 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.


setModel

public void setModel(javax.swing.table.TableModel newModel)
Assign the data table to the model.

See Also:
getModel()

getModel

public javax.swing.table.TableModel getModel()
Return the data table associated with this model.

Returns:
table model associated with this data model
See Also:
setModel(javax.swing.table.TableModel)

setTileVariable

public void setTileVariable(ClassificationVariable newVariable)
Specifies the data column(s) in the attached TableModel whose values are to be used to produce the tiles to be displayed in the chart.

See Also:
getTileVariable()

getTileVariable

public ClassificationVariable getTileVariable()
Returns the data column that was most recently set in the TILE role by the setTileVariable() method. Returns null if the variable role has not been set.

Returns:
classification variable(s) for tile hierarchy definition
See Also:
setTileVariable(com.sas.graphics.components.ClassificationVariable)

setIdVariable

public void setIdVariable(ClassificationVariable newVariable)
Deprecated. Use setTileVariable()


getIdVariable

public ClassificationVariable getIdVariable()
Deprecated. Use getTileVariable()


setVariableLabel

public void setVariableLabel(java.lang.String variableName,
                             java.lang.String label)
Specifies the label corresponding to a variable


getVariableLabel

public java.lang.String getVariableLabel(java.lang.String variableName)
Returns the label corresponding to a variable

Parameters:
variableName -

setSizeVariable

public void setSizeVariable(AnalysisVariable newVariable)
Specifies the data column in the attached TableModel whose values are to be used to determine the relative sizes of the rectangles. Zero and negative size values are ignored (after summarizing) because these sizes cannot be displayed proportionally with positive values.

See Also:
getSizeVariable()

getSizeVariable

public AnalysisVariable getSizeVariable()
Returns the data column that was most recently set in the Size role by the setSizeVariable() method. Returns null if the variable role has not been set.

Returns:
analysis variable for size
See Also:
setSizeVariable(com.sas.graphics.components.AnalysisVariable)

setColorVariable

public void setColorVariable(AnalysisVariable newVariable)
Specifies the data column in the attached TableModel whose values are to be used to determine the relative colors of the rectangles.

See Also:
getColorVariable()

getColorVariable

public AnalysisVariable getColorVariable()
Returns the data column that was most recently set in the Color role by the setColorVariable() method. Returns null if the variable role has not been set.

Returns:
analysis variable for color
See Also:
setColorVariable(com.sas.graphics.components.AnalysisVariable)

setXVariable

public void setXVariable(AnalysisVariable newVariable)
Specifies the data column in the attached TableModel whose values are to be used to determine the approximate horizontal position of the tile when used with PLACEMENT_GEOGRAPHIC mode.

See Also:
getXVariable()

getXVariable

public AnalysisVariable getXVariable()
Returns the data column that was most recently set in the X role by the setXVariable() method. Returns null if the variable role has not been set.

Returns:
analysis variable for X
See Also:
setXVariable(com.sas.graphics.components.AnalysisVariable)

setYVariable

public void setYVariable(AnalysisVariable newVariable)
Specifies the data column in the attached TableModel whose values are to be used to determine the approximate vertical position of the tile when used with PLACEMENT_GEOGRAPHIC mode.

See Also:
getYVariable()

getYVariable

public AnalysisVariable getYVariable()
Returns the data column that was most recently set in the Y role by the setYVariable() method. Returns null if the variable role has not been set.

Returns:
analysis variable for Y
See Also:
setYVariable(com.sas.graphics.components.AnalysisVariable)

setAuxVariable

public void setAuxVariable(Variable newVariable)
Deprecated. use setDataTipVariable()

Specifies the column(s) in the attached TableModel whose values are to be used as auxilliary information. This will possibly be displayed in labels or datatips, although values may have no direct impact on the chart.

See Also:
getAuxVariable()

getAuxVariable

public Variable getAuxVariable()
Deprecated. user getDataTipVariable()

Returns the data column that was most recently set in the Auxiliary role by the setAuxVariable() method. Returns null if the variable role has not been set.

Returns:
auxilliary variables
See Also:
setAuxVariable(com.sas.graphics.components.Variable)

setDataTipVariable

public void setDataTipVariable(Variable[] newVariables)
Specifies an array of Variables to be displayed in the data tip. By default, the variables specified on setDataTipVariable() are appended to the end of the default data tip display. To replace the default display with the list of variables in the Variable[] array, use the GraphModel to get the DataTipModel , and the call the DataTipModel's setContent() method with the value GraphConstants.DATA_TIP_REPLACE.

The following code fragment specifies two variables for the data tip display and uses them to replace the default data tip display:


 // Create an array of variables to set in the data tip display
 Variable dataTipVars[]=new Variable[2];
 dataTipVars[0]=new Variable("Task");
 dataTipVars[1]=new Variable("Duration");
 tileChart.getGraphModel().getDataTipModel().setContent(
                GraphConstants.DATA_TIP_REPLACE);
 

Parameters:
newVariables - array of Variables to display in data tip
Throws:
java.lang.IllegalArgumentException - if a non-null array of zero length is passed in.
See Also:
getDataTipVariable(), setAuxiliaryVariable(com.sas.graphics.components.Variable[])

getDataTipVariable

public Variable[] getDataTipVariable()
Returns the array of data columns that was most recently set by the setDataTipVariable() method. Returns null if the data tip variables were not set.

Returns:
variables for data tip values
See Also:
setDataTipVariable(com.sas.graphics.components.Variable[])

setAuxiliaryVariable

public void setAuxiliaryVariable(Variable[] newVariables)
Specifies an array of Variables that are included among the variables that are passed in the events on the TileChart data elements. Auxiliary variables are not represented in the chart. By default, they are not displayed in the datatip, although they can be included in the array of variables set by setDataTipVariable().

Parameters:
newVariables - contains Variables for GraphActionEvent return.
Throws:
java.lang.IllegalArgumentException - if a non-null array of zero length is passed in.
See Also:
getAuxiliaryVariable(), setDataTipVariable(com.sas.graphics.components.Variable[])

getAuxiliaryVariable

public Variable[] getAuxiliaryVariable()
Returns the array of data columns that was most recently set by the setAuxiliaryVariable() method. Returns null if the auxiliary variables were not set.

Returns:
variables for Auxiliary values
See Also:
setAuxiliaryVariable(com.sas.graphics.components.Variable[]), setDataTipVariable(com.sas.graphics.components.Variable[])

setWebLinkVariable

public void setWebLinkVariable(Variable newVariable)
Specifies the column(s) in the attached TableModel whose values are to be used as Web Link information. This will determine links which users may connect to from tiles, although values may have no direct impact on the chart.

See Also:
getWebLinkVariable()

getWebLinkVariable

public Variable getWebLinkVariable()
Returns the data column that was most recently set in the WebLink role by the setWebLinkVariable() method. Returns null if the variable role has not been set.

Returns:
web link variable
See Also:
setWebLinkVariable(com.sas.graphics.components.Variable)

equals

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

The result is true if and only if the argument is not null and is a TileChartTableDataModel 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 TileChartTableDataModel
Returns:
true if the objects are the same; false otherwise.

hashCode

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

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.