org.jdesktop.jdnc
Class JNTable
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.jdnc.JNComponent
org.jdesktop.jdnc.JNTable
- All Implemented Interfaces:
- Accessible, ImageObserver, MenuContainer, MessageSource, Serializable, Targetable
- Direct Known Subclasses:
- JNTreeTable
- public class JNTable
- extends JNComponent
JNTable
- See Also:
- Serialized Form
|
Constructor Summary |
|
JNTable()
Default constructor |
protected |
JNTable(JTable table)
|
|
JNTable(TableModel model)
Creates a new JNTable component that presents a JTable view for
the specified model. |
| Methods inherited from class org.jdesktop.jdnc.JNComponent |
addAction, addMessageListener, addSeparator, addToolBar, addToolBarComponent, doCommand, getBackgroundImage, getCommands, getComponent, getMessageListeners, getPopupMenu, hasCommand, paint, removeMessageListener, sendMessage, setBackgroundImage, setComponent, setFont, setPopupMenu |
| 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, processMouseEvent, 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, transferFocus, transferFocusUpCycle |
DEFAULT_ROW_HEIGHT
public int DEFAULT_ROW_HEIGHT
DEFAULT_ROW_MARGIN
public int DEFAULT_ROW_MARGIN
DEFAULT_VISIBLE_ROW_COUNT
public int DEFAULT_VISIBLE_ROW_COUNT
DEFAULT_COLUMN_MARGIN
public int DEFAULT_COLUMN_MARGIN
scrollPane
protected final JScrollPane scrollPane
table
protected JXTable table
JNTable
public JNTable()
- Default constructor
JNTable
public JNTable(TableModel model)
- Creates a new JNTable component that presents a JTable view for
the specified model.
- Parameters:
model - data model for the tree table
- Throws:
throws - IllegalArgumentException if model is null
JNTable
protected JNTable(JTable table)
setTable
protected void setTable(JXTable table)
getTable
public JXTable getTable()
- Returns:
- the table for this component
setModel
public void setModel(TableModel model)
getModel
public TableModel getModel()
addColumn
public void addColumn(TableColumnExt column)
getColumn
public TableColumnExt getColumn(String name)
getColumn
public TableColumnExt getColumn(int currentViewIndex)
getOddRowBackground
public Color getOddRowBackground()
setOddRowBackground
public void setOddRowBackground(Color color)
getEvenRowBackground
public Color getEvenRowBackground()
setEvenRowBackground
public void setEvenRowBackground(Color color)
getHasColumnControl
public boolean getHasColumnControl()
setHasColumnControl
public void setHasColumnControl(boolean hasControl)
isRowHeaderLocked
public boolean isRowHeaderLocked()
setRowHeaderLocked
public void setRowHeaderLocked(boolean lockState)
- Initialization property. Do not set after table has been shown.
- Parameters:
lockState -
initRowHeader
protected TableColumn initRowHeader()
lockRowHeader
protected void lockRowHeader()
unlockRowHeader
protected void unlockRowHeader()
getRowHeight
public int getRowHeight()
setRowHeight
public void setRowHeight(int value)
getVisibleRowCount
public int getVisibleRowCount()
setVisibleRowCount
public void setVisibleRowCount(int value)
getColumnMargin
public int getColumnMargin()
setColumnMargin
public void setColumnMargin(int value)
getRowMargin
public int getRowMargin()
setRowMargin
public void setRowMargin(int value)
getSelectionMode
public int getSelectionMode()
setSelectionMode
public void setSelectionMode(int mode)
getShowHorizontalLines
public boolean getShowHorizontalLines()
setShowHorizontalLines
public void setShowHorizontalLines(boolean value)
getShowVerticalLines
public boolean getShowVerticalLines()
setShowVerticalLines
public void setShowVerticalLines(boolean value)
getFilters
public FilterPipeline getFilters()
setFilters
public void setFilters(FilterPipeline pipeline)
getHighlighters
public HighlighterPipeline getHighlighters()
setHighlighters
public void setHighlighters(HighlighterPipeline pipeline)
setBackground
public void setBackground(Color color)
setForeground
public void setForeground(Color color)
setGridColor
public void setGridColor(Color color)
setColumnProperties
public void setColumnProperties(String columnName,
LabelProperties props)
- Applies label rendering properties, such as background, font,
horizontalAlignment, etc, to the table column with the specified name
indentifier, so that all cells within that column will render with those
properties by default. Only properties which have been explicitly set on
the LabelProperties object will be applied; all cell properties which
were not set in LabelProperties will remain unchanged. Also note that
the values are copied, so that subsequent changes to the LabelProperties
object will have no effect on the column.
Example usage:
LabelProperties props = new LabelProperties();
// set bold font & center alignment
props.setFont(boldFont);
props.setHorizontalAlignment(JLabel.CENTER);
table.setColumnProperties("phonenumber", props);
// set bold font & leading alignment
props.setHorizontalAlignment(JLabel.LEADING);
table.setColumnProperties("lastname", props);
- Parameters:
columnName - String containing the name identifier for the columnprops - LabelProperties object containing label property settings
- Throws:
IllegalParameterException - if no column exists with the specified name
setColumnHeaderProperties
public void setColumnHeaderProperties(String columnName,
LabelProperties props)
print
public boolean print()
throws PrinterException
- Throws:
PrinterException
toString
public String toString()
Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.