ElegantJ Data Tables Java API Specification v1.1

com.elegantj.jfc.table
Class JTableRowHeader

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

public class JTableRowHeader
extends javax.swing.JComponent
implements javax.swing.event.TableModelListener, javax.accessibility.Accessible

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

See Also:
Serialized Form

Nested Class Summary
protected  class JTableRowHeader.AccessibleJTableRowHeader
          This class implements accessibility support for the JTableRowHeader class.
 
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 adjustRowOnClick
          If true, rows can be adjusted with maximum cell height in that row; the default is true.
protected  boolean resizingAllowed
          If true, resizing of rows are allowed by the user; the header is true.
protected  int resizingRow
          The index of the row being resized.
protected  JFCTable table
          The table for which this object is the header; the header is null.
protected  int width
          The fixed width of the header.
 
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
JTableRowHeader()
          Constructs a JTableRowHeader
 
Method Summary
 void adjustRowHeight(int row)
          Adjust the row height so that each cell of that row can be displayed properly.
protected  javax.swing.table.TableCellRenderer createDefaultHeaderRenderer()
          Returns a header renderer to be used when no header renderer is defined by a TableRow.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JTableRowHeader.
 java.awt.Rectangle getHeaderRect(int row)
          Returns the rectangle containing the header tile at row.
 javax.swing.table.TableCellRenderer getHeaderRenderer()
          Returns the header renderer used when no headerRenderer is defined by a int.
 java.lang.String getHeaderValue(int row)
          Returns the header identifier representing the specified header cell.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this component.
 boolean getResizingAllowed()
          Returns true if the user is allowed to resize rows by dragging between their headers, false otherwise.
 int getResizingRow()
          Returns the resizing row.
 JFCTable getTable()
          Returns the table associated with this header.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Allows the renderer's tips to be used if there is text set.
 TableRowHeaderUI getUI()
          Returns the look and feel (L&F) object that renders 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 header values.
 boolean isAdjustRowOnClick()
          Returns whether the row can be adjusted on click or not.
protected  java.lang.String paramString()
          Returns a string representation of this JTableRowHeader.
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 resizeAndRepaint()
          Sizes the header and marks it as needing display.
 int rowAtPoint(java.awt.Point point)
          Returns the index of the row that point lies in, or -1 if it lies out of bounds.
 void setAdjustRowOnClick(boolean flag)
          Sets whether the row can be adjusted on click or not.
 void setHeaderRenderer(javax.swing.table.TableCellRenderer headerRenderer)
          Sets the header renderer to be used when no headerRenderer is defined by a TabelRow.
 void setResizingAllowed(boolean resizingAllowed)
          Sets whether the user can resize rows by dragging between headers.
 void setResizingRow(int aRow)
          Sets the header's resizingRow to aRow.
 void setTable(JFCTable table)
          Sets the table associated with this header.
 void setUI(TableRowHeaderUI ui)
          Sets the look and feel (L&F) object that renders this component.
 void setWidth(int width)
          Fixes the width of the header.
 void tableChanged(javax.swing.event.TableModelEvent e)
          Implementing TableModelListener interface
 void updateUI()
          Notification from the UIManager that the look and feel (L&F) has changed.
 
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

adjustRowOnClick

protected boolean adjustRowOnClick
If true, rows can be adjusted with maximum cell height in that row; the default is true.


table

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


resizingAllowed

protected boolean resizingAllowed
If true, resizing of rows are allowed by the user; the header is true.


resizingRow

protected transient int resizingRow
The index of the row being resized. null if not resizing.


width

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

Constructor Detail

JTableRowHeader

public JTableRowHeader()
Constructs a JTableRowHeader

Method Detail

setWidth

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

Parameters:
width - the header width

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(JFCTable table)
Sets the table associated with this header.

Parameters:
table - the new table

getTable

public JFCTable getTable()
Returns the table associated with this header.

Returns:
the table property

setResizingAllowed

public void setResizingAllowed(boolean resizingAllowed)
Sets whether the user can resize rows by dragging between headers.

Parameters:
resizingAllowed - true if table view should allow resizing

getResizingAllowed

public boolean getResizingAllowed()
Returns true if the user is allowed to resize rows by dragging between their headers, false otherwise. The header is true. You can resize rows programmatically regardless of this setting.

Returns:
the resizingAllowed property

getResizingRow

public int getResizingRow()
Returns the resizing row. If no row is being resized this method returns null.

Returns:
the resizing row

setHeaderRenderer

public void setHeaderRenderer(javax.swing.table.TableCellRenderer headerRenderer)
Sets the header renderer to be used when no headerRenderer is defined by a TabelRow.

Parameters:
headerRenderer - the header renderer

getHeaderRenderer

public javax.swing.table.TableCellRenderer getHeaderRenderer()
Returns the header renderer used when no headerRenderer is defined by a int.

Returns:
the header renderer

rowAtPoint

public int rowAtPoint(java.awt.Point point)
Returns the index of the row that point lies in, or -1 if it lies out of bounds.

Returns:
the index of the row that point lies in, or -1 if it lies out of bounds

getHeaderValue

public java.lang.String getHeaderValue(int row)
Returns the header identifier representing the specified header cell. A Subclass override this method to specify other header cell identifier.

Parameters:
row - the header cell index
Returns:
the row identifier

getHeaderRect

public java.awt.Rectangle getHeaderRect(int row)
Returns the rectangle containing the header tile at row. When the row parameter is out of bounds this method uses the same conventions as the JTable method getCellRect.

Returns:
the rectangle containing the header tile at row

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Allows the renderer's tips to be used if there is text set.

Parameters:
event - the location of the event identifies the proper renderer and, therefore, the proper tip
Returns:
the tool tip for this component

getUI

public TableRowHeaderUI getUI()
Returns the look and feel (L&F) object that renders this component.

Returns:
the TableRowHeaderUI object that renders this component

setUI

public void setUI(TableRowHeaderUI ui)
Sets the look and feel (L&F) object that renders this component.

Parameters:
ui - the TableRowHeaderUI L&F object

updateUI

public 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.


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 "TableRowHeaderUI"

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Implementing TableModelListener interface

Specified by:
tableChanged in interface javax.swing.event.TableModelListener

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

createDefaultHeaderRenderer

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


initializeLocalVars

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


resizeAndRepaint

public void resizeAndRepaint()
Sizes the header and marks it as needing display. Equivalent to revalidate followed by repaint.


setAdjustRowOnClick

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

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

isAdjustRowOnClick

public boolean isAdjustRowOnClick()
Returns whether the row can be adjusted on click or not.

Returns:
true to allow the adjust row on click

adjustRowHeight

public void adjustRowHeight(int row)
Adjust the row height so that each cell of that row can be displayed properly.


setResizingRow

public void setResizingRow(int aRow)
Sets the header's resizingRow to aRow.

Parameters:
aRow - the row being resized

paramString

protected java.lang.String paramString()
Returns a string representation of this JTableRowHeader. 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 JTableRowHeader

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JTableRowHeader. For JTableRowHeaders, the AccessibleContext takes the form of an AccessibleJTableRowHeader. A new AccessibleJTableRowHeader instance is created if necessary.

Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Returns:
an AccessibleJTableRowHeader that serves as the AccessibleContext of this JTableRowHeader

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.