com.sas.swing.visuals.tableview
Class HoldColumnSupport

com.sas.swing.visuals.tableview.HoldColumnSupport
All Implemented Interfaces:
HoldInterface, javax.swing.SwingConstants
Direct Known Subclasses:
HttpHoldColumnSupport, SwingHoldColumnSupport

public abstract class HoldColumnSupport
implements HoldInterface, javax.swing.SwingConstants

Abstract support class to implement common aspects of HoldInterface.


Field Summary
 int base
           
static java.lang.String RB_KEY
           
 
Constructor Summary
HoldColumnSupport()
           
 
Method Summary
 int calculateViewOffset(int columnModelIndex)
           
abstract  int convertColumnIndexToView(int columnIndex)
           
 void doHoldColumn(int viewIndex, int insertIndex, boolean left)
           
 void doReleaseColumn(int columnModelIndex, int viewIndex)
           
 void firePropertyChange(java.lang.String string, java.lang.Boolean boolean1, java.lang.Boolean boolean2)
           
abstract  int getColumnCount()
           
 java.util.List getHeldIndices()
          Returns a list of the indices of the columns that are being held.
 java.util.List getHeldIndices(int orientation)
          Returns a list of the indices of the columns that are being held for the given orientation.
abstract  int getModelColumnCount()
           
abstract  int getModelIndex(int c)
           
 void hold(int columnModelIndex)
          "Holds" the given column using the default orientation.
 void hold(int columnModelIndex, int orientation)
          "Holds" the given column for the given orientation.
 boolean isHeld(int columnModelIndex)
          Returns true if the given columnModelIndex is held, false otherwise.
 boolean isHeld(int columnModelIndex, int orientation)
          Returns true if the given columnModelIndex is held, false otherwise.
 boolean isHoldingAllowed(int orientation)
          Returns true if holding for a given orientation is allowed or false otherwise.
 boolean isHoldingEnabled()
          Returns true is holding is enabled, should return false if holding is not allowed.
abstract  boolean isLeftToRight()
           
abstract  void moveColumn(int held, int newpos)
           
 void release(int columnModelIndex)
          Releases the given columnModelIndex from being held, so it will return to its original place in the table.
 void releaseAll()
          Releases all held columns and returns them to their previous location.
 void setHoldingEnabled(boolean enableHolding)
          Sets the state of whether holding of indices is enabled or not.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

base

public int base
Constructor Detail

HoldColumnSupport

public HoldColumnSupport()
Method Detail

hold

public void hold(int columnModelIndex)
"Holds" the given column using the default orientation. The default orientation for columns is LEADING. A held column is one that has been made non-scrollable and is thus always, space permitting, displayed; i.e. it is never scrolled out of view.

The order in which columns are held controls the order in which they are displayed.

Does nothing if the column is already held.

Specified by:
hold in interface HoldInterface
Parameters:
columnModelIndex - the data model index of the column wishing to be held
See Also:
release(int), releaseAll()

hold

public void hold(int columnModelIndex,
                 int orientation)
"Holds" the given column for the given orientation. The valid values are LEFT, RIGHT, LEADING, or TRAILING for the orientation paramter. A held column is one that has been made non-scrollable and is thus always, space permitting, displayed; i.e. it is never scrolled out of view.

The order in which columns are held controls the order in which they are displayed.

Does nothing if the column is already held.

Specified by:
hold in interface HoldInterface
Parameters:
columnModelIndex - the data model index of the column wishing to be held
orientation - the orientation or location the index is to be held
See Also:
release(int), releaseAll()

doHoldColumn

public void doHoldColumn(int viewIndex,
                         int insertIndex,
                         boolean left)

convertColumnIndexToView

public abstract int convertColumnIndexToView(int columnIndex)

getColumnCount

public abstract int getColumnCount()

moveColumn

public abstract void moveColumn(int held,
                                int newpos)

release

public void release(int columnModelIndex)
Releases the given columnModelIndex from being held, so it will return to its original place in the table. If the columnModelIndex is not held, nothing is done.

Specified by:
release in interface HoldInterface
Parameters:
columnModelIndex - the column currently held that is wishing to be released
See Also:
hold(int), hold(int, int), releaseAll()

doReleaseColumn

public void doReleaseColumn(int columnModelIndex,
                            int viewIndex)

calculateViewOffset

public int calculateViewOffset(int columnModelIndex)

getModelIndex

public abstract int getModelIndex(int c)

getModelColumnCount

public abstract int getModelColumnCount()

releaseAll

public void releaseAll()
Releases all held columns and returns them to their previous location.

Specified by:
releaseAll in interface HoldInterface
See Also:
hold(int), hold(int, int)

getHeldIndices

public java.util.List getHeldIndices()
Returns a list of the indices of the columns that are being held. This list will include all the indices for all the orientations. Modifications to this list will not be reflected in the held list, this list is a duplicate.

Specified by:
getHeldIndices in interface HoldInterface
Returns:
a list of the held columns
See Also:
HoldInterface.getHeldIndices(int)

getHeldIndices

public java.util.List getHeldIndices(int orientation)
Returns a list of the indices of the columns that are being held for the given orientation. Modifications to this list will be reflected in the held list as this is the true list.

Specified by:
getHeldIndices in interface HoldInterface
Parameters:
orientation - the orientation of the held indices that are being returned
Returns:
a list of the held columns
See Also:
HoldInterface.getHeldIndices()

isHeld

public boolean isHeld(int columnModelIndex)
Returns true if the given columnModelIndex is held, false otherwise.

Specified by:
isHeld in interface HoldInterface
Parameters:
columnModelIndex - the data model index of the column
Returns:
true if the column is held, false otherwise
See Also:
HoldInterface.isHeld(int, int)

isHeld

public boolean isHeld(int columnModelIndex,
                      int orientation)
Returns true if the given columnModelIndex is held, false otherwise.

Specified by:
isHeld in interface HoldInterface
Parameters:
columnModelIndex - the data model index of the column
orientation - the orientation or location that the index is being queried for
Returns:
true if the column is held, false otherwise
See Also:
HoldInterface.isHeld(int)

isHoldingEnabled

public boolean isHoldingEnabled()
Returns true is holding is enabled, should return false if holding is not allowed.

Specified by:
isHoldingEnabled in interface HoldInterface
Returns:
true is holding of indices is enabled, false otherwise
See Also:
setHoldingEnabled(boolean)

setHoldingEnabled

public void setHoldingEnabled(boolean enableHolding)
Sets the state of whether holding of indices is enabled or not.

Specified by:
setHoldingEnabled in interface HoldInterface
Parameters:
enableHolding - true to enable holding, false otherwise
See Also:
isHoldingEnabled()

isHoldingAllowed

public boolean isHoldingAllowed(int orientation)
Returns true if holding for a given orientation is allowed or false otherwise. Holding must be enabled for this to return true.

Specified by:
isHoldingAllowed in interface HoldInterface
Parameters:
orientation - the orientation being queried about
Returns:
true is holding is enabled an dallowed for a given orientation, false otherwise

isLeftToRight

public abstract boolean isLeftToRight()

firePropertyChange

public void firePropertyChange(java.lang.String string,
                               java.lang.Boolean boolean1,
                               java.lang.Boolean boolean2)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.