com.sas.swing.visuals.olaptableview
Class OLAPOriginComponent

com.sas.swing.visuals.olaptableview.OLAPOriginComponent
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.swing.event.TableModelListener

public class OLAPOriginComponent
implements javax.swing.event.TableModelListener

See Also:
Serialized Form

Field Summary
protected  javax.swing.table.TableCellRenderer columnLabelRenderer
           
protected  int preferredHeightForLastColumnLevel
           
protected  int preferredRowLevelHeight
           
protected  int rowAxisLabelsHeight
           
protected  boolean rowHeightSet
           
protected  javax.swing.table.TableCellRenderer rowLabelRenderer
           
 
Fields inherited from class com.sas.swing.visuals.tableview.OriginComponent
renderer, table
 
Constructor Summary
OLAPOriginComponent()
          Constructs a default OLAPOriginComponent.
OLAPOriginComponent(TableView table)
          Constructs a default OLAPOriginComponent with the given table set as the TableView.
 
Method Summary
protected  javax.swing.table.TableCellRenderer createDefaultColumnLabelRenderer()
          Returns a default renderer to be used for renderering the column labels associated with the column levels.
protected  javax.swing.table.TableCellRenderer createDefaultRowLabelRenderer()
          Returns a default renderer to be used for renderering the row labels associated with the row levels.
 OLAPColumnHeader getColumnHeader()
          Returns the instance of the OLAPColumnHeader associated with the table or null if no table has been set.
protected  java.awt.Component getColumnHeaderRendererComponent(int levelIndex)
           
 java.lang.String getColumnLabel(int level)
          Returns the label that is used for the given level for the column levels.
 javax.swing.table.TableCellRenderer getColumnLabelRenderer()
          Returns the renderer that is used to renderer the labels for the column levels.
 int getColumnLevelAtPoint(java.awt.Point point)
          Returns the column level for teh given point.
 int getPreferredColumnLevelHeight(int level)
          Returns the prefered height for the given column level.
 int getPreferredRowLevelWidth(int level)
          Returns the preferred width in pixels of the given row level.
 OLAPRowHeader getRowHeader()
          Returns the instance of the OLAPRowHeader associated with the table or null if no table has been set.
protected  java.awt.Component getRowHeaderRendererComponent(int levelIndex)
           
 java.lang.String getRowLabel(int level)
          Returns the label that is used for the given level for the row levels.
 javax.swing.table.TableCellRenderer getRowLabelRenderer()
          Returns the renderer that is used to renderer the labels for the row levels.
 int getRowLevelAtPoint(java.awt.Point point)
          Returns the row level for teh given point.
 int getRowLevelHeight()
          Returns the height given to the row level labels.
 java.lang.String getUIClassID()
          Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component.
 void initializeLocalVars()
          Initializes the OLAPOriginComponent.
protected  void refreshRowLevelHeight()
           
protected  void resetSizes()
           
 void setColumnLabelRenderer(javax.swing.table.TableCellRenderer newRenderer)
          Sets the renderer responsible for renderer the labels associated with the column levels.
 void setRowLabelRenderer(javax.swing.table.TableCellRenderer newRenderer)
          Sets the renderer responsible for renderer the labels associated with the row levels.
 void setRowLevelHeight(int newHeight)
          Sets the height given to the row level labels.
 void setTable(TableView newTable)
          Sets the new TableView associated with the OLAPOriginComponent.
 void tableChanged(javax.swing.event.TableModelEvent e)
          Invoked when this table's TableModel generates a TableModelEvent.
 void updateUI()
          Notification from the
Methods inherited from class com.sas.swing.visuals.tableview.OriginComponent
createDefaultAction, createDefaultRenderer, getAction, getHeaderValue, getRenderer, getTable, getUI, setAction, setHeaderValue, setRenderer, setUI
 

Field Detail

rowAxisLabelsHeight

protected int rowAxisLabelsHeight

preferredRowLevelHeight

protected int preferredRowLevelHeight

preferredHeightForLastColumnLevel

protected int preferredHeightForLastColumnLevel

rowLabelRenderer

protected javax.swing.table.TableCellRenderer rowLabelRenderer

columnLabelRenderer

protected javax.swing.table.TableCellRenderer columnLabelRenderer

rowHeightSet

protected boolean rowHeightSet
Constructor Detail

OLAPOriginComponent

public OLAPOriginComponent()
Constructs a default OLAPOriginComponent.


OLAPOriginComponent

public OLAPOriginComponent(TableView table)
Constructs a default OLAPOriginComponent with the given table set as the TableView.

Parameters:
table - The TableView associated with this OLAPOriginComponent
Method Detail

initializeLocalVars

public void initializeLocalVars()
Initializes the OLAPOriginComponent.

Overrides:
initializeLocalVars in class OriginComponent

setTable

public void setTable(TableView newTable)
Sets the new TableView associated with the OLAPOriginComponent.

Overrides:
setTable in class OriginComponent
Parameters:
newTable - the new TableView instance associated with the OLAPOriginComponent
See Also:
OriginComponent.getTable()

getRowLabelRenderer

public javax.swing.table.TableCellRenderer getRowLabelRenderer()
Returns the renderer that is used to renderer the labels for the row levels.

Returns:
the renderer used for renderering the labels associated with the row levels
See Also:
setRowLabelRenderer(TableCellRenderer)

setRowLabelRenderer

public void setRowLabelRenderer(javax.swing.table.TableCellRenderer newRenderer)
Sets the renderer responsible for renderer the labels associated with the row levels.

Parameters:
newRenderer - the new renderer to use for renderering the row level labels
See Also:
getRowLabelRenderer()

getColumnLabelRenderer

public javax.swing.table.TableCellRenderer getColumnLabelRenderer()
Returns the renderer that is used to renderer the labels for the column levels.

Returns:
the renderer used for renderering the labels associated with the column levels
See Also:
setColumnLabelRenderer(TableCellRenderer)

setColumnLabelRenderer

public void setColumnLabelRenderer(javax.swing.table.TableCellRenderer newRenderer)
Sets the renderer responsible for renderer the labels associated with the column levels.

Parameters:
newRenderer - the new renderer to use for renderering the column level labels
See Also:
getColumnLabelRenderer()

createDefaultRowLabelRenderer

protected javax.swing.table.TableCellRenderer createDefaultRowLabelRenderer()
Returns a default renderer to be used for renderering the row labels associated with the row levels.

Parameters:
default - renderer to be used when for the row level labels

createDefaultColumnLabelRenderer

protected javax.swing.table.TableCellRenderer createDefaultColumnLabelRenderer()
Returns a default renderer to be used for renderering the column labels associated with the column levels.

Parameters:
default - renderer to be used when for the column level labels

updateUI

public void updateUI()
Notification from the UIManager that the look and feel (L&F) has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI in class OriginComponent
See Also:
JComponent.updateUI()

getUIClassID

public java.lang.String getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component.

Overrides:
getUIClassID in class OriginComponent
Returns:
the string "OLAPOriginComponentUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

getRowHeader

public OLAPRowHeader getRowHeader()
Returns the instance of the OLAPRowHeader associated with the table or null if no table has been set.

Returns:
the instance of the OLAPRowHeader associated with the table

getColumnHeader

public OLAPColumnHeader getColumnHeader()
Returns the instance of the OLAPColumnHeader associated with the table or null if no table has been set.

Returns:
the instance of the OLAPColumnHeader associated with the table

getColumnLabel

public java.lang.String getColumnLabel(int level)
Returns the label that is used for the given level for the column levels. If the level is a measure level, and empty string will be returned.

Parameters:
level - the 0 based level index
Returns:
a string the is used as the label for the given level index

getRowLabel

public java.lang.String getRowLabel(int level)
Returns the label that is used for the given level for the row levels. If the level is a measure level, and empty string will be returned.

Parameters:
level - the 0 based level index
Returns:
a string the is used as the label for the given level index

refreshRowLevelHeight

protected void refreshRowLevelHeight()

getPreferredRowLevelWidth

public int getPreferredRowLevelWidth(int level)
Returns the preferred width in pixels of the given row level.

Parameters:
level - the 0 based level index
Returns:
the preferred width in pixels for the row level

getPreferredColumnLevelHeight

public int getPreferredColumnLevelHeight(int level)
Returns the prefered height for the given column level.

Parameters:
level - the 0 based column level index
Returns:
the preferred height in pixels of the column level

getRowLevelHeight

public int getRowLevelHeight()
Returns the height given to the row level labels. The row level labels splits its space with the label for the last column level.

Returns:
the height in pixels for the row labels
See Also:
setRowLevelHeight(int)

setRowLevelHeight

public void setRowLevelHeight(int newHeight)
Sets the height given to the row level labels. The row level labels splits its space with the label for the last column level.

Parameters:
newHeight - the new height to set the row level labels to
See Also:
getRowLevelHeight()

getColumnHeaderRendererComponent

protected java.awt.Component getColumnHeaderRendererComponent(int levelIndex)

getRowHeaderRendererComponent

protected java.awt.Component getRowHeaderRendererComponent(int levelIndex)

getRowLevelAtPoint

public int getRowLevelAtPoint(java.awt.Point point)
Returns the row level for teh given point. The level returns is 0 based.

Parameters:
point - The point in the OLAPOriginComponent
Returns:
the row level index or -1 if the point is not over a row level label

getColumnLevelAtPoint

public int getColumnLevelAtPoint(java.awt.Point point)
Returns the column level for teh given point. The level returns is 0 based.

Parameters:
point - The point in the OLAPOriginComponent
Returns:
the column level index or -1 if the point is not over a column level label

resetSizes

protected void resetSizes()

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Invoked when this table's TableModel generates a TableModelEvent. The TableModelEvent should be constructed in the coordinate system of the model; the appropriate mapping to the view coordinate system is performed by this OLAPTableView when it receives the event.

Application code will not use these methods explicitly, they are used internally by OLAPTableView.

Specified by:
tableChanged in interface javax.swing.event.TableModelListener



Copyright © 2009 SAS Institute Inc. All Rights Reserved.