|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.table.TableElement
public abstract class TableElement
Defines an abstract base class for TableView's cells, columns, and rows.
TableElement anchors a hierarchy of classes that represent the elements of a TableView. Those elements are divided into two general categories, cells and cell vectors, which are represented by the abstract subclasses Cell and CellVector.
Cells are divided into labels (LabelCell) and data cells (DataCell).
Cell vectors are divided into columns (Column) and rows (Row).
TableView
,
Cell
,
CellVector
,
Column
,
DataCell
,
LabelCell
,
Row
Field Summary | |
---|---|
protected static java.lang.String[] |
emptyModelTypesArray
Helper variable to use as return value from getModelTypes when no model types are available for the element. |
protected static com.sas.collection.StaticPropertyBagInterface[] |
emptyModelTypeStylesArray
Helper variable to use as return value from getModelTypeStyles when no model type styles are available for the element. |
TableView |
tableView
Alias for getTableView(). |
Fields inherited from interface com.sas.table.TableElementInterface |
---|
REFRESH_ALL, REFRESH_DATA, REFRESH_DATA_STYLE, REFRESH_LABEL, REFRESH_LABEL_STYLE, REFRESH_STYLE |
Constructor Summary | |
---|---|
TableElement(TableView table)
Constructor. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this and a given object for equality. |
abstract boolean |
equals(TableElement other)
Compares this and a given table element for equality. |
abstract com.sas.collection.StaticPropertyBagInterface |
getDefaultStyle()
Returns the default style associated with elements of this type by the table view. |
void |
getEffectiveStylePropertyBag(java.lang.String propertyID,
com.sas.collection.PropertyBagInterface bag,
boolean clearBag)
Determines the effective value of the specified style property of type StaticPropertyBagInterface. |
java.lang.Object |
getEffectiveStylePropertyValue(java.lang.String propertyID,
java.lang.Object defaultValue)
Returns the effective value of the specified style property. |
abstract com.sas.collection.StaticPropertyBagInterface |
getModelDefaultStyle()
Returns the default style associated with elements of this type by the table view's model. |
com.sas.collection.StaticPropertyBagInterface |
getModelStyle()
Returns the set of model-supplied style property keys and their associated values that serve as formatting and rendering defaults and hints for the element. |
abstract java.lang.String[] |
getModelTypes()
Returns the types associated with this element by the table view's model. |
abstract com.sas.collection.StaticPropertyBagInterface[] |
getModelTypeStyles()
Returns the styles associated with the element's model types. |
com.sas.collection.StaticPropertyBagInterface |
getStyle()
Returns the set of style property keys and their associated values that serve as formatting and rendering defaults and hints for the element. |
TableView |
getTableView()
Returns the instance of the TableView class that contains this element. |
protected abstract TableElement |
getThis()
Returns the TableElement instance to delegate all variable access to. |
boolean |
isCurrent()
Returns true if the element is the table view's currentElement, and false otherwise. |
boolean |
isTransient()
Returns true if the element is transient and false otherwise. |
protected void |
onGetEffectiveStylePropertyBag(java.lang.String propertyID,
com.sas.collection.PropertyBagInterface bag)
TableElement framework method for determining the effective value of a style property of type StaticPropertyBagInterface. |
protected java.lang.Object |
onGetEffectiveStylePropertyValue(java.lang.String propertyID,
java.lang.Object defaultValue)
TableElement framework method for determining the effective value of a style property. |
protected abstract com.sas.collection.StaticPropertyBagInterface |
onGetModelStyle()
TableElement framework method for querying the table view's model for any style properties associated with the element. |
void |
refresh(int flags)
Refreshes the element to its state as maintained by the table view's model. |
abstract void |
setObsolete()
Indicates that the element should be considered obsolete. |
void |
setStyle(com.sas.collection.StaticPropertyBagInterface newValue)
Sets the set of style property keys and their associated values that serve as formatting and rendering defaults and hints for the element. |
Methods inherited from interface com.sas.table.TableElementInterface |
---|
isDisplayed, isModified, isSelected, repaint |
Field Detail |
---|
protected static final java.lang.String[] emptyModelTypesArray
getModelTypes()
protected static final com.sas.collection.StaticPropertyBagInterface[] emptyModelTypeStylesArray
getModelTypeStyles()
public final TableView tableView
getTableView()
Constructor Detail |
---|
public TableElement(TableView table)
table
- The TableView instance that contains this element.Method Detail |
---|
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
true
if obj is a TableElement and
equals((TableElement)obj)
returns true
;
false
otherwise.public abstract boolean equals(TableElement other)
true
if this table element is equivalent to
other; false
otherwise.public final TableView getTableView()
getTableView
in interface TableElementInterface
public com.sas.collection.StaticPropertyBagInterface getStyle()
setStyle(com.sas.collection.StaticPropertyBagInterface)
,
getModelStyle()
,
getDefaultStyle()
,
getModelDefaultStyle()
public void setStyle(com.sas.collection.StaticPropertyBagInterface newValue)
The style is saved as a reference, not a copy, but the element does not
listen for events from the style so a change to the style's properties
will not be immediately reflected by the element. Usually this is not
an issue as styles will be created and assigned and won't change after
that. However if you do plan to change the style after calling setStyle()
and want the element to immediately reflect the change (e.g. new
foreground color), then you can register the table as listener for
changes to the style via
style.addPropertyBagChangedListener (getTableView())
.
newValue
- The new value to assign the style property.getStyle()
,
getModelStyle()
,
getDefaultStyle()
,
getModelDefaultStyle()
,
getTableView()
,
PropertyBag.addPropertyBagChangedListener(com.sas.collection.PropertyBagChangedListener)
public com.sas.collection.StaticPropertyBagInterface getModelStyle()
getStyle()
,
getDefaultStyle()
,
getModelDefaultStyle()
public abstract com.sas.collection.StaticPropertyBagInterface getDefaultStyle()
getStyle()
,
getModelStyle()
,
getModelDefaultStyle()
public abstract com.sas.collection.StaticPropertyBagInterface getModelDefaultStyle()
getStyle()
,
getModelStyle()
,
getDefaultStyle()
public java.lang.Object getEffectiveStylePropertyValue(java.lang.String propertyID, java.lang.Object defaultValue)
propertyID
- An interned String (see String.intern()) which identifies the property,
for example, CellStyle.FOREGROUND_COLOR.defaultValue
- Value to return if no value is found for the property.
onGetEffectiveStylePropertyValue(java.lang.String, java.lang.Object)
public void getEffectiveStylePropertyBag(java.lang.String propertyID, com.sas.collection.PropertyBagInterface bag, boolean clearBag)
When a property represents a set of subproperties, like a PropertyBag does, it is the effective value of those subproperties that is interesting, not the effective value of the property itself. For example, the default FontStyle associated with a table might define a Helvetica 10pt REGULAR ROMAN font, while the FontStyle associated with an individual column might override REGULAR with BOLD, and the FontStyle associated with a cell in that column might override ROMAN with ITALIC.
propertyID
- An interned String (see String.intern()) which identifies a property
of type PropertyBagInterface, for example, CellStyle.FONT_STYLE.bag
- The bag to fill with the effective values of the subproperties
associated with propertyID.clearBag
- If true, an initial bag.removeAll() is done.onGetEffectiveStylePropertyBag(java.lang.String, com.sas.collection.PropertyBagInterface)
,
getEffectiveStylePropertyValue(java.lang.String, java.lang.Object)
,
Cell.getEffectiveFont()
public abstract java.lang.String[] getModelTypes()
StaticTableTypeInterface
,
getModelTypeStyles()
public abstract com.sas.collection.StaticPropertyBagInterface[] getModelTypeStyles()
StaticTableTypeStylesInterface
,
getModelTypes()
public final boolean isCurrent()
public boolean isTransient()
public void refresh(int flags)
refresh
in interface TableElementInterface
flags
- Bitmask of REFRESH_DATA and/or REFRESH_STYLE.public abstract void setObsolete()
An obsolete element is one that has been released or orphaned by its table view. The table view maintains a cache of elements. When the cache is full it will begin removing the least recently used transient elements from that cache. Those elements will be marked as obsolete. Once an element has been marked obsolete it will always be obsolete and will never again be referenced by its table view.
If the logical entity that the element represents, e.g. row five, is later referenced by the table view, the table view will create a new element instance to represent it. The obsolete instance will be logically and functionally equivalent to this new one (comparing the two with the equals method will yield true) except that its implementation must now delegate all variable access to the new instance.
isTransient()
,
equals(java.lang.Object)
protected abstract TableElement getThis()
this
, but if this
has been obsoleted then a different, but equivalent, instance will be
returned.
setObsolete()
protected abstract com.sas.collection.StaticPropertyBagInterface onGetModelStyle() throws com.sas.table.TableException
TableException
- Propagated from call to model.getModelStyle()
protected java.lang.Object onGetEffectiveStylePropertyValue(java.lang.String propertyID, java.lang.Object defaultValue)
propertyID
- An interned String (see String.intern()) which identifies the property,
for example, CellStyle.FOREGROUND_COLOR.defaultValue
- Value to return if no value is found for the property.
getEffectiveStylePropertyValue(java.lang.String, java.lang.Object)
protected void onGetEffectiveStylePropertyBag(java.lang.String propertyID, com.sas.collection.PropertyBagInterface bag)
propertyID
- An interned String (see String.intern()) which identifies a property
of type PropertyBagInterface, for example, CellStyle.FONT_STYLE.bag
- The bag to fill with the effective values of the subproperties
associated with propertyID.getEffectiveStylePropertyBag(java.lang.String, com.sas.collection.PropertyBagInterface, boolean)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |