|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.table.JTableHeader
com.sciapp.table.AdvancedTableHeader
com.sciapp.table.GroupTableHeader
com.sciapp.filter.FilterTableHeader
com.sciapp.table.group.TreeTableHeader
public class TreeTableHeader
TreeTableHeader is a JTableHeader component that is able to display table columns in a hierarchical
structure. The structure is defined by a TreeTableColumnModel
, while the visible columns
are stored in a TreeTableColumnModelAdapter
.
Nested Class Summary | |
---|---|
protected class |
TreeTableHeader.CachingHeaderControl
CachingHeaderControl caches tree header renderers and components returned by them. |
Nested classes/interfaces inherited from class javax.swing.table.JTableHeader |
---|
JTableHeader.AccessibleJTableHeader |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected Cursor |
defaultHeaderCursor
the header's default cursor |
protected boolean |
delayed
boolean flag that determines whether events received from the treemodel will be added to the swing event queue. |
protected TreeTableHeader.CachingHeaderControl |
headerControl
provides caching for tree header renderers and components returned by them. |
protected static Comparator |
pathComparator
a comparator that compares paths used internally |
protected Dimension |
prefSize
the preferred size of the tree header |
protected TreeExpansionListener |
tel
a tree expansion listener added to the tree |
protected TreeTableHeaderRendererFactory |
treeHeaderFactory
the factory for creating tree header renderers |
protected int |
wrapperPriority
the wrapper's priority |
Fields inherited from class com.sciapp.filter.FilterTableHeader |
---|
callBack |
Fields inherited from class com.sciapp.table.GroupTableHeader |
---|
allowGroupColumnReordering, allowGroupReordering, factory, groupTableColumnModel |
Fields inherited from class javax.swing.table.JTableHeader |
---|
columnModel, draggedColumn, draggedDistance, reorderingAllowed, resizingAllowed, resizingColumn, table, updateTableInRealTime |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TreeTableHeader()
Constructs a TreeTableHeader. |
|
TreeTableHeader(TreeTableColumnModel model)
Constructs a TreeTableHeader. |
|
TreeTableHeader(TreeTableColumnModelAdapter cm)
Constructs a TreeTableHeader. |
Method Summary | |
---|---|
protected boolean |
canMove(int fromIndex,
int toIndex)
Determines whether the column at fromIndex can be moved to toIndex .
By default, this method returns true. You will need to override it in order to
define conditions for which columns cannot be moved. |
protected void |
columnsChanged()
Notification that the structure of the entire column model has changed. |
protected TableColumnModel |
createDefaultColumnModel()
Creates a new instance of DefaultVetoableColumnModel . |
protected TreeTableHeaderRendererFactory |
createDefaultTreeHeaderFactory()
Creates and returns the default factory for creating TreeTableHeaderRenderers. |
protected void |
doProcessMouseMotionEvent(MouseEvent e)
Processes mouse motion events, such as MouseEvent.MOUSE_DRAGGED. |
boolean |
getAllowGroupColumnReordering()
Determines whether group columns can be reordered with the mouse. |
Cursor |
getDefaultHeaderCursor()
Retrieves the default header's cursor. |
boolean |
getDelayed()
Returns true if events received from the treemodel are to be added to the swing event queue. |
Dimension |
getPreferredSize()
If the preferredSize has been set to a
non-null value just returns it. |
JTree |
getTree()
Returns the associated tree. |
TreeTableHeaderRendererFactory |
getTreeHeaderFactory()
Retrieves the factory for creating TreeTableHeaderRenderers. |
TreeTableColumnModel |
getTreeTableColumnModel()
Convenience method to retrieve the treetable column model. |
TreeTableColumnModelAdapter |
getTreeTableColumnModelAdapter()
Convenience method to retrieve the treetable model adapter. |
protected boolean |
handleEvent(MouseEvent e,
Component comp)
Handles a mouse event on the header. This method is called before the event is propagated to any mouse listeners. |
protected void |
nodeCollapsed(TreePath path)
Notification that columns at the specified path were collapsed. |
protected void |
nodeExpanded(TreePath path)
Notification that columns at the specified path were expanded. |
protected void |
nodeExpanded(TreePath path,
boolean checkExpansions)
Notification that columns at the specified path were expanded. |
protected void |
nodesInserted(TreeModelEvent e)
Notification that columns at the specified path have been added. |
protected void |
nodesRemoved(TreeModelEvent e)
Notification that columns at the specified path have been removed. |
void |
revalidate()
Supports deferred automatic layout. |
void |
setColumnModel(TableColumnModel newModel)
Sets the column model for this table to newModel and registers
for listener notifications from the new column model. |
void |
setDefaultHeaderCursor(Cursor cursor)
Assigns the default headers' cursor. |
void |
setDelayed(boolean delayed)
Sets the delay property, which if true, events received from the treemodel are to be added to the swing event queue. |
void |
setFactory(TableCellRendererFactory newFactory)
Assigns a new table cell renderer factory. |
void |
setTreeHeaderFactory(TreeTableHeaderRendererFactory treeHeaderFactory)
Assigns a new factory for creating TreeTableHeaderRenderers. |
protected void |
structureChanged(TreeModelEvent e)
Notification that the structure of the columns at the specified path has changed. |
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 . |
void |
validate()
Validates this container and all of its subcomponents. |
Methods inherited from class com.sciapp.filter.FilterTableHeader |
---|
getCallBack, setCallBack |
Methods inherited from class com.sciapp.table.AdvancedTableHeader |
---|
addNotify, columnWillBeAdded, columnWillBeRemoved, doProcessMouseEvent, getComponentAtPoint, getDraggedDistance, getReorderingAllowed, getToolTipLocation, getToolTipText, initializeLocalVars, processMouseEvent, processMouseMotionEvent, setDraggedColumn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Dimension prefSize
protected boolean delayed
protected transient TreeExpansionListener tel
protected Cursor defaultHeaderCursor
protected int wrapperPriority
protected TreeTableHeaderRendererFactory treeHeaderFactory
protected TreeTableHeader.CachingHeaderControl headerControl
protected static final transient Comparator pathComparator
Constructor Detail |
---|
public TreeTableHeader()
public TreeTableHeader(TreeTableColumnModel model)
public TreeTableHeader(TreeTableColumnModelAdapter cm)
Method Detail |
---|
protected boolean canMove(int fromIndex, int toIndex)
fromIndex
can be moved to toIndex
.
By default, this method returns true. You will need to override it in order to
define conditions for which columns cannot be moved.
canMove
in class GroupTableHeader
fromIndex
- the current view index of the column being movedtoIndex
- the index the column is being moved to
protected void columnsChanged()
protected TableColumnModel createDefaultColumnModel()
DefaultVetoableColumnModel
.
Returns the default column model object which is
a DefaultTableColumnModel
. A subclass can override this
method to return a different column model object
createDefaultColumnModel
in class AdvancedTableHeader
protected TreeTableHeaderRendererFactory createDefaultTreeHeaderFactory()
protected void doProcessMouseMotionEvent(MouseEvent e)
doProcessMouseMotionEvent
in class AdvancedTableHeader
e
- the 'converted' mouse eventpublic boolean getAllowGroupColumnReordering()
getAllowGroupColumnReordering
in class GroupTableHeader
public Cursor getDefaultHeaderCursor()
public boolean getDelayed()
public Dimension getPreferredSize()
preferredSize
has been set to a
non-null
value just returns it.
If the UI delegate's getPreferredSize
method returns a non null
value then return that;
otherwise defer to the component's layout manager.
getPreferredSize
in class JComponent
preferredSize
propertyJComponent.setPreferredSize(java.awt.Dimension)
,
ComponentUI
public JTree getTree()
public TreeTableHeaderRendererFactory getTreeHeaderFactory()
public TreeTableColumnModel getTreeTableColumnModel()
public TreeTableColumnModelAdapter getTreeTableColumnModelAdapter()
protected boolean handleEvent(MouseEvent e, Component comp)
handleEvent
in class FilterTableHeader
e
- the mouse event that triggered the methodcomp
- the drawn table cell component
protected void nodeCollapsed(TreePath path)
path
- the column path at which columns were collapsedprotected void nodeExpanded(TreePath path)
path
- the column path at which columns were expandedprotected void nodeExpanded(TreePath path, boolean checkExpansions)
path
- the column path at which columns were expandedcheckExpansions
- flag to indicate whether to generate nodeExpanded events for expanded columns beneath the specified pathprotected void nodesInserted(TreeModelEvent e)
e
- the event generating the notificationprotected void nodesRemoved(TreeModelEvent e)
e
- the event generating the notificationpublic void revalidate()
Calls invalidate
and then adds this component's
validateRoot
to a list of components that need to be
validated. Validation will occur after all currently pending
events have been dispatched. In other words after this method
is called, the first validateRoot (if any) found when walking
up the containment hierarchy of this component will be validated.
By default, JRootPane
, JScrollPane
,
and JTextField
return true
from isValidateRoot
.
This method will automatically be called on this component
when a property value changes such that size, location, or
internal layout of this component has been affected. This automatic
updating differs from the AWT because programs generally no
longer need to invoke validate
to get the contents of the
GUI to update.
revalidate
in class JComponent
Component.invalidate()
,
Container.validate()
,
JComponent.isValidateRoot()
,
RepaintManager#addInvalidComponent
public void setColumnModel(TableColumnModel newModel)
newModel
and registers
for listener notifications from the new column model.
setColumnModel
in class GroupTableHeader
newModel
- the new data source for this tableJTableHeader.getColumnModel()
public void setDefaultHeaderCursor(Cursor cursor)
cursor
- the default header cursor to assignpublic void setDelayed(boolean delayed)
delayed
- set to true if events received from the treemodel are to be added to the swing event queue.public void setFactory(TableCellRendererFactory newFactory)
setFactory
in class GroupTableHeader
newFactory
- the new table cell renderer factory to assign.public void setTreeHeaderFactory(TreeTableHeaderRendererFactory treeHeaderFactory)
treeHeaderFactory
- the new factory to assignprotected void structureChanged(TreeModelEvent e)
e
- the event generating the notificationpublic void updateUI()
UIManager
that the look and feel
(L&F) has changed.
Replaces the current UI object with the latest version from the
UIManager
.
updateUI
in class GroupTableHeader
JComponent.updateUI()
public void validate()
The validate
method is used to cause a container
to lay out its subcomponents again. It should be invoked when
this container's subcomponents are modified (added to or
removed from the container, or layout-related information
changed) after the container has been displayed.
validate
in class Container
Container.add(java.awt.Component)
,
Component.invalidate()
,
JComponent.revalidate()
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |