com.sas.graphics.components
Class TableAxisColumn

com.sas.graphics.components.TableAxisColumn

public class TableAxisColumn

The TableAxisColumn class stores column attributes for a table axis.

Usage

An array of TableAxisColumn is used to set the column attributes of a TableAxis with the TableAxisModel.setColumns method. If no TableAxisColumns are set with this method, then no columns will appear in the TableAxis.
You can access a TableAxisModel in the chart by calling the getTableAxisModel() on the GraphModel. From there you can specify the TableAxisColumns you wish to see in the table.
Ex.
 GanttChart ganttChart = new GanttChart();
 GanttChartModel ganttChartModel = ganttChart.getGraphModel();
 TableAxisModel tableAxisModel = ganttChartModel.getTableAxisModel();
 TableAxisColumn tac[] = new TableAxisColumn[3];
 tac[0] = new TableAxisColumn(variable1);
 tac[1] = new TableAxisColumn(variable2);
 tac[2] = new TableAxisColumn(variable3);
 tableAxisModel.setColumns(tac);
 
 
Use setSort method to cause a graph to sort the associated data values. The default sort is GraphConstants.SORT_NONE meaning that graph will order the values in the same order as they found in the data source.

You can also set the column width and visibility.

Changing a property in a TableAxisColumn will cause a PropertyChangeEvent to be fired. Changing a property in any of the contained models will also cause the TableAxisColumn to fire a PropertyChangeEvent. No matter how deep the contained model is the event will cascade up the containment chain to finally reach the TableAxisColumn which will fire an event. The table to which the TableAxisColumn is attached, listens to these events and the changes are applied to the table immediately.

Behavior

Only one instance of a Variable is allowed in the TableAxis. If you desire to see the same data in two separate columns in the table, then create a second Variable with the same data in it.

Since:
SAS 9.1.2
See Also:
ModelBase, TableAxisModel, Variable

Constructor Summary
TableAxisColumn(Variable var)
          Constructor designating variable to display in the table.
TableAxisColumn(Variable var, int sort)
          Constructor designating variable to display in the table along with the sort type for this column.
TableAxisColumn(Variable var, int sort, int index)
          Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done.
TableAxisColumn(Variable var, int sort, int index, com.sas.measures.BaseLength wid)
          Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done and a column width.
TableAxisColumn(Variable var, int sort, int index, com.sas.measures.BaseLength wid, boolean vis)
          Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done and a column width and if the column is visible.
 
Method Summary
 void apply(TableAxisColumn theOtherObject)
          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 TableAxisColumn.
 int getSort()
          Returns the type of sort type applied to the values in the data column designated by this variable.
 int getSortIndex()
          Returns the sort index applied to the values in the data column designated by this variable when multiple sort variables are designated.
 Variable getVariable()
          Returns the Variable used in this table column.
 com.sas.measures.BaseLength getWidth()
          Returns the width applied to the table column.
 int hashCode()
          Computes the hash code for this TableAxisColumn.
 boolean isVisible()
          Get whether or not the column is displayed.
 void setSort(int newSort)
          Set the a sort type.
 void setSortIndex(int newSortIndex)
          Set the order index for this sort to occur in if multiple sort variables have been specified.
 void setVisible(boolean newVisible)
          Set whether or not the column is displayed.
 void setWidth(com.sas.measures.BaseLength newWidth)
          Assigns a new width to be applied to the table column.
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

TableAxisColumn

public TableAxisColumn(Variable var)
Constructor designating variable to display in the table.

Parameters:
var - the Variable to be displayed.
Throws:
java.lang.IllegalArgumentException - if null Variable is passed in.

TableAxisColumn

public TableAxisColumn(Variable var,
                       int sort)
Constructor designating variable to display in the table along with the sort type for this column.

Parameters:
var - the Variable to be displayed.
sort - the type of sort
Throws:
java.lang.IllegalArgumentException - if null Variable is passed in.

TableAxisColumn

public TableAxisColumn(Variable var,
                       int sort,
                       int index)
Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done.

Parameters:
var - the Variable to be displayed.
sort - the type of sort
index - order to place this variable in a multiple variable sort.
Throws:
java.lang.IllegalArgumentException - if index < 0.
java.lang.IllegalArgumentException - if null Variable is passed in.

TableAxisColumn

public TableAxisColumn(Variable var,
                       int sort,
                       int index,
                       com.sas.measures.BaseLength wid)
Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done and a column width.

Parameters:
var - the Variable to be displayed.
wid - the width of the column.
sort - the type of sort
index - order to place this variable in a multiple variable sort.
Throws:
java.lang.IllegalArgumentException - if index < 0.
java.lang.IllegalArgumentException - if null Variable is passed in.

TableAxisColumn

public TableAxisColumn(Variable var,
                       int sort,
                       int index,
                       com.sas.measures.BaseLength wid,
                       boolean vis)
Constructor designating variable to display in the table along with the sort type for this column and the sort index if multiple variable sort is to be done and a column width and if the column is visible.

Parameters:
var - the Variable to be displayed.
wid - the width of the column.
vis - visibility of column
sort - the type of sort
index - order to place this variable in a multiple variable sort.
Throws:
java.lang.IllegalArgumentException - if index < 0.
java.lang.IllegalArgumentException - if null Variable is passed in.
java.lang.IllegalArgumentException - if null BaseLength is passed in.
Method Detail

apply

public void apply(TableAxisColumn theOtherObject)
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.

Parameters:
theOtherObject - properties to apply to this instance

equals

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

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

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

setWidth

public void setWidth(com.sas.measures.BaseLength newWidth)
              throws java.lang.IllegalArgumentException
Assigns a new width to be applied to the table column.

Parameters:
newWidth - Width setting for this table column
Throws:
java.lang.IllegalArgumentException - if newWidth is null.
See Also:
getWidth()

getWidth

public com.sas.measures.BaseLength getWidth()
Returns the width applied to the table column.

Returns:
Width set for the table column
See Also:
setWidth(com.sas.measures.BaseLength)

getVariable

public Variable getVariable()
Returns the Variable used in this table column.

Returns:
Variable for the table column

setVisible

public void setVisible(boolean newVisible)
Set whether or not the column is displayed.

Parameters:
newVisible - true means column is displayed
See Also:
isVisible()

isVisible

public boolean isVisible()
Get whether or not the column is displayed.

Returns:
boolean true means column is displayed
See Also:
setVisible(boolean)

setSort

public void setSort(int newSort)
Set the a sort type.

Valid sort values are:

A default of GraphConstants.SORT_NONE is applied if an invalid sort value is specified.

Parameters:
newSort - the type of sort
See Also:
GraphConstants, getSort()

getSort

public int getSort()
Returns the type of sort type applied to the values in the data column designated by this variable.

Returns:
sort type applied to the values in the data column.
See Also:
GraphConstants

setSortIndex

public void setSortIndex(int newSortIndex)
Set the order index for this sort to occur in if multiple sort variables have been specified. Multiple sort variables can be specifed by having more than one TableAxisColumn with a valid sort specified.

Parameters:
newSortIndex - order to place this variable in a multiple variable sort.
Throws:
java.lang.IllegalArgumentException - if index < 0.
See Also:
getSortIndex()

getSortIndex

public int getSortIndex()
Returns the sort index applied to the values in the data column designated by this variable when multiple sort variables are designated.

Returns:
sortIndex type applied to the values in the data column.

hashCode

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

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.