|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.table.CellVector
public abstract class CellVector
Defines an abstract base class for TableView's columns and rows.
TableView
,
Column
,
Row
,
CellVectorStyle
Field Summary |
---|
Fields inherited from class com.sas.table.TableElement |
---|
emptyModelTypesArray, emptyModelTypeStylesArray, tableView |
Fields inherited from interface com.sas.table.TableElementInterface |
---|
REFRESH_ALL, REFRESH_DATA, REFRESH_DATA_STYLE, REFRESH_LABEL, REFRESH_LABEL_STYLE, REFRESH_STYLE |
Constructor Summary | |
---|---|
protected |
CellVector(TableView table,
int index)
Constructor. |
Method Summary | |
---|---|
int |
computePreferredSize(java.awt.Graphics g)
Returns the preferred amount of space needed to display the cell vector in the given graphics context. |
abstract boolean |
contains(DataCell cell)
Test for the presence of a cell in the cell vector. |
boolean |
contains(int coord)
Checks whether the bounds of this vector contains the specified coordinate. |
boolean |
contains(java.lang.Object obj)
Test for the presence of an object in the cell vector. |
int |
count()
Returns the number of cells in the vector, not including the label. |
abstract int |
count(int maxCount)
Returns the number of cells in the vector, not including the label, up to a specified count if the real number is not readily determined. |
abstract boolean |
equals(CellVector other)
Compares this and a given cell vector for equality. |
boolean |
equals(TableElement obj)
Compares this and a given table element for equality. |
abstract DataCell |
getCell(int index)
Returns the cell at a given index. |
int |
getCellsToSizeCount()
Helper method for determing the number of cells to consider when measuring the cell vector. |
int |
getDisplayedSize()
Returns the size of the area allotted to the CellVector in the table's current display. |
abstract int |
getIndex()
Returns the vector's one-based position in the table view's model. |
abstract LabelCell |
getLabel()
Returns the label associated with the cell vector. |
abstract int |
getMaxPosition()
Returns the right edge of the table if this is a Column and the bottom edge of the table if this is a Row. |
java.lang.String[] |
getModelTypes()
Returns an empty array since support for querying a model for its column or row types is not yet available. |
com.sas.collection.StaticPropertyBagInterface[] |
getModelTypeStyles()
Returns an empty array since support for querying a model for its column or row type styles is not yet available. |
abstract java.lang.String |
getPixelUnit()
Returns the pixel unit, "px" or "py", that getSize is in terms of. |
int |
getPosition()
Returns the value of the position property. |
int |
getPreferredSize()
Returns the preferred amount of space needed to display the cell vector. |
int |
getSize()
Returns the value of the size property. |
protected TableElement |
getThis()
Returns the TableElement instance to delegate all variable access to. |
protected abstract CellVector |
getThisCellVector()
Returns the CellVector instance to delegate all variable access to. |
int |
hashCode()
Returns a hash code value for the cell vector. |
boolean |
isDisplayed()
Indicates whether the cell vector is currently displayed by the table view. |
abstract boolean |
isHeld()
Indicates whether the cell vector is "held". |
boolean |
isModified()
Indicates whether the cell vector's data has been modified. |
boolean |
isPartiallyDisplayed()
Indicates whether the cell vector is currently displayed by the table view, but also clipped. |
boolean |
isResizable()
Indicates whether the cell vector can be resized interactively. |
boolean |
isResized()
Indicates whether the cell vector has been resized. |
boolean |
isTransient()
Indicates whether the cell vector is transient. |
CellVector |
next()
Returns the next cell vector if any, otherwise null . |
protected abstract int |
onComputePreferredSize(java.awt.Graphics g)
Framework method called by computePreferredSize. |
protected abstract CellVector |
onNext()
Framework method called by next for determining the CellVector that follows this. |
protected abstract CellVector |
onPrevious()
Framework method called by previous for determining the CellVector that precedes this. |
protected abstract void |
onResized()
Framework method called by setSize to notify subclasses of a change in size. |
CellVector |
previous()
Returns the previous cell vector if any, otherwise null . |
void |
remeasure()
Remeasures the cell vector. |
static int |
resize(com.sas.collection.OrderedCollection cellVectors,
int newSize,
boolean relative)
Resizes a given set of CellVectors to conform to a given size. |
static int |
resize(com.sas.collection.OrderedCollection cellVectors,
int newSize,
boolean relative,
boolean preserve)
Resizes a given set of CellVectors to conform to a given size. |
void |
setPreferredSize(int newValue)
Specifies the preferred amount of space needed to display the cell vector. |
void |
setSize(int newValue)
Sets the value of the size property. |
Methods inherited from class com.sas.table.TableElement |
---|
equals, getDefaultStyle, getEffectiveStylePropertyBag, getEffectiveStylePropertyValue, getModelDefaultStyle, getModelStyle, getStyle, getTableView, isCurrent, onGetEffectiveStylePropertyBag, onGetEffectiveStylePropertyValue, onGetModelStyle, refresh, setObsolete, setStyle |
Methods inherited from interface com.sas.table.TableElementInterface |
---|
isSelected, repaint |
Constructor Detail |
---|
protected CellVector(TableView table, int index)
table
- The TableView instance that contains this cell vector.index
- The one-based position of the cell vector in the table view's model.Method Detail |
---|
public boolean contains(int coord)
coord
- The coordinate to test.
true
if the coordinate is within the bounds;
false
otherwise.public final boolean contains(java.lang.Object obj)
obj
- The object to check for.
java.lang.ClassCastException
- Thrown if the object is not a DataCell.public abstract boolean contains(DataCell cell)
cell
- The cell to check for.public final int count()
Note that some models do not readily know how
many columns or rows they have, but calling this method will force them
to compute it which could be expensive. Therefore WARNING, be wary of
calling this method without knowing the nature of your model. In
such a case, consider using count(int maxCount)
with a
non-zero maxCount as this method simply does count(0)
.
count
in interface com.sas.util.Countable
StaticTableInterface.countColumns(int)
,
StaticTableInterface.countRows(int)
public abstract int count(int maxCount)
maxCount
- Defines a limiting factor for cases where the number of cells is
not readily determined. Such a case is a function of the table
view's model. maxCount allows you to limit how much
computation is done. If the count is already known to be larger
than maxCount without doing any computation, then the
larger number is returned. Specifying a maxCount of
zero will force the computation of the total count no matter the
cost.
StaticTableInterface.countColumns(int)
,
StaticTableInterface.countRows(int)
public final boolean equals(TableElement obj)
equals
in class TableElement
true
if obj is a CellVector and
equals((CellVector)obj)
returns true
;
false
otherwise.public abstract boolean equals(CellVector other)
true
if this cell vector is equivalent to
other; false
otherwise.public abstract DataCell getCell(int index)
index
- The position of the cell using one-based indexing.
java.lang.IndexOutOfBoundsException
- If index is not in the range [1, count()].public int getCellsToSizeCount()
public int getDisplayedSize()
getSize()
public abstract int getIndex()
public abstract LabelCell getLabel()
null
.public abstract int getMaxPosition()
public java.lang.String[] getModelTypes()
getModelTypes
in class TableElement
null
.TableElement.getModelTypes()
public com.sas.collection.StaticPropertyBagInterface[] getModelTypeStyles()
getModelTypeStyles
in class TableElement
null
.TableElement.getModelTypeStyles()
public abstract java.lang.String getPixelUnit()
public int getPosition()
public int getPreferredSize()
For Columns, the preferred size will represent a width or horizontal distance.
For Rows, it will represent a height or vertical distance.
computePreferredSize(java.awt.Graphics)
,
setPreferredSize(int)
,
getSize()
public void setPreferredSize(int newValue)
For Columns, the preferred size will represent a width or horizontal distance.
For Rows, it will represent a height or vertical distance.
newValue
- The newValue to assign the preferredSize property.computePreferredSize(java.awt.Graphics)
,
getPreferredSize()
,
setSize(int)
public int computePreferredSize(java.awt.Graphics g)
For Columns, the preferred size will represent a width or horizontal distance.
For Rows, it will represent a height or vertical distance.
g
- The graphics context to measure the cell vector in.
public int getSize()
setSize(int)
,
getPreferredSize()
protected final TableElement getThis()
this
, but if this
has been obsoleted then a different, but equivalent, instance will be
returned.
getThis
in class TableElement
TableElement.setObsolete()
protected abstract CellVector getThisCellVector()
this
, but if this
has been obsoleted then a different, but equivalent, instance will be
returned.
TableElement.setObsolete()
public int hashCode()
hashCode
in class java.lang.Object
getIndex()
.equals(com.sas.table.TableElement)
public boolean isDisplayed()
isDisplayed
in interface TableElementInterface
true
if the cell vector is displayed, and
false
otherwise.isPartiallyDisplayed()
public abstract boolean isHeld()
true
if the cell vector is held and
false
otherwise.TableView.getHeldColumns()
,
TableView.getHeldRows()
public boolean isModified()
isModified
in interface TableElementInterface
true
if the label or at least one of the data cells
are modified, and false
otherwise.public boolean isPartiallyDisplayed()
true
if the cell vector is displayed but clipped, and
false
otherwise.isDisplayed()
public boolean isResizable()
true
if the cell vector can be resized interactively, and
false
otherwise.isResized()
public boolean isResized()
setSize()
has been
called with a non-zero value.
true
if the cell vector has been resized,
and false
otherwise.isResizable()
public boolean isTransient()
Augments super
to treat cell vectors that have been
resized as intransient.
isTransient
in class TableElement
true
if the cell vector is transient,
and false
otherwise.TableElement.isTransient()
public CellVector next()
null
.
null
.previous()
protected abstract int onComputePreferredSize(java.awt.Graphics g)
g
- The graphics context to measure the cell vector in.
computePreferredSize(java.awt.Graphics)
protected abstract CellVector onNext()
null
.next()
protected abstract CellVector onPrevious()
null
.previous()
protected abstract void onResized()
setSize(int)
public CellVector previous()
null
.
null
.next()
public void remeasure()
public static int resize(com.sas.collection.OrderedCollection cellVectors, int newSize, boolean relative)
resize(OrderedCollection, int, boolean, boolean)
public static int resize(com.sas.collection.OrderedCollection cellVectors, int newSize, boolean relative, boolean preserve)
cellVectors
- The set of CellVectors to resize.newSize
- If relative is false
,
specifies the new cumulative size in pixels.
If relative is true
,
specifies a size offset (positive or negative) in
pixels, i.e. the amount to change the current cumulative size by.relative
- See newSize.preserve
- If true
, the size of any cellVectors that
have been resized will be preserved.
public final void setSize(int newValue)
newValue
- The new value to assign the size property.getSize()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |