ElegantJ Data Tables Java API Specification v1.1

com.elegantj.jfc.table
Class JTableColumnHeader

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.table.JTableHeader
                  extended bycom.elegantj.jfc.table.JTableColumnHeader
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.event.TableColumnModelListener

public class JTableColumnHeader
extends javax.swing.table.JTableHeader

This is the object which manages the column header of the JFCTable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.table.JTableHeader
javax.swing.table.JTableHeader.AccessibleJTableHeader
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean adjustColumnOnClick
          If true, columns can be adjusted with maximum cell width in that column; the default is true.
protected  int height
          The fixed height of the header.
protected  JFCTable table
          The table for which this object is the header; the header is null.
 
Fields inherited from class javax.swing.table.JTableHeader
columnModel, draggedColumn, draggedDistance, reorderingAllowed, resizingAllowed, resizingColumn, 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
JTableColumnHeader()
          Constructs a JTableColumnHeader with a default TableColumnModel.
JTableColumnHeader(javax.swing.table.TableColumnModel cm)
          Constructs a JTableColumnHeader which is initialized with cm as the column model.
 
Method Summary
 void adjustColumnWidth(int column)
          Adjust the column width so that each cell of that column can be displayed properly.
protected  javax.swing.table.TableCellRenderer createDefaultRenderer()
          Returns a default renderer to be used when no header renderer is defined by a TableColumn.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this component.
 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.
protected  void initializeLocalVars()
          Initializes the local variables and properties with default values.
 boolean isAdjustColumnOnClick()
          Returns whether the column can be adjusted on click or not.
protected  java.lang.String paramString()
          Returns a string representation of this JTableColumnHeader.
protected  void processMouseEvent(java.awt.event.MouseEvent e)
          Processes mouse events occurring on this component by dispatching them to any registered KeyListener objects.
protected  void processMouseMotionEvent(java.awt.event.MouseEvent e)
          Processes mouse motion events occurring on this component by dispatching them to any registered KeyListener objects.
 void setAdjustColumnOnClick(boolean flag)
          Sets whether the column can be adjusted on click or not.
 void setHeight(int height)
          Fixes the height of the header.
 void setTable(javax.swing.JTable table)
          Sets the table associated with this header.
 
Methods inherited from class javax.swing.table.JTableHeader
columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, createDefaultColumnModel, getAccessibleContext, getColumnModel, getDefaultRenderer, getDraggedColumn, getDraggedDistance, getHeaderRect, getReorderingAllowed, getResizingAllowed, getResizingColumn, getTable, getToolTipText, getUI, getUpdateTableInRealTime, resizeAndRepaint, setColumnModel, setDefaultRenderer, setDraggedColumn, setDraggedDistance, setReorderingAllowed, setResizingAllowed, setResizingColumn, setUI, setUpdateTableInRealTime, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

height

protected int height
The fixed height of the header. -1 if preferred height is considered.


adjustColumnOnClick

protected boolean adjustColumnOnClick
If true, columns can be adjusted with maximum cell width in that column; the default is true.


table

protected JFCTable table
The table for which this object is the header; the header is null.

Constructor Detail

JTableColumnHeader

public JTableColumnHeader()
Constructs a JTableColumnHeader with a default TableColumnModel.


JTableColumnHeader

public JTableColumnHeader(javax.swing.table.TableColumnModel cm)
Constructs a JTableColumnHeader which is initialized with cm as the column model. If cm is null this method will initialize the table header with a default TableColumnModel.

Parameters:
cm - the column model for the table
Method Detail

setHeight

public void setHeight(int height)
Fixes the height of the header. If the height is -1, the height of the header is calcualated from the maximum preferred height of the header cell.

Parameters:
height - the header height

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this component.

Returns:
A dimension object indicating this component's preferred size.

setTable

public void setTable(javax.swing.JTable table)
Sets the table associated with this header.

Parameters:
table - the new table

initializeLocalVars

protected void initializeLocalVars()
Initializes the local variables and properties with default values. Used by the constructor methods.


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.

Returns:
the string "TableColumnHeaderUI"

createDefaultRenderer

protected javax.swing.table.TableCellRenderer createDefaultRenderer()
Returns a default renderer to be used when no header renderer is defined by a TableColumn.


setAdjustColumnOnClick

public void setAdjustColumnOnClick(boolean flag)
Sets whether the column can be adjusted on click or not.

Parameters:
flag - true to allow the adjust column on click

isAdjustColumnOnClick

public boolean isAdjustColumnOnClick()
Returns whether the column can be adjusted on click or not.

Returns:
true to allow the adjust column on click

adjustColumnWidth

public void adjustColumnWidth(int column)
Adjust the column width so that each cell of that column can be displayed properly.


processMouseMotionEvent

protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
Processes mouse motion events occurring on this component by dispatching them to any registered KeyListener objects.

Parameters:
e - the mouse event

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)
Processes mouse events occurring on this component by dispatching them to any registered KeyListener objects.

Parameters:
e - the mouse event

paramString

protected java.lang.String paramString()
Returns a string representation of this JTableColumnHeader. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overriding paramString to provide information about the specific new aspects of the JFC components.

Returns:
a string representation of this JTableColumnHeader

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjbeans.com
All Rights Reserved.