java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TableUI
javax.swing.plaf.basic.BasicTableUI
- Direct Known Subclasses:
- SynthTableUI
public class BasicTableUI extends TableUI
BasicTableUI implementation
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classBasicTableUI.FocusHandlerThis class should be treated as a "protected" inner class.classBasicTableUI.KeyHandlerThis class should be treated as a "protected" inner class.classBasicTableUI.MouseInputHandlerThis class should be treated as a "protected" inner class.
- 
Field SummaryFields Modifier and Type Field Description protected FocusListenerfocusListenerFocusListenerthat are attached to theJTable.protected KeyListenerkeyListenerKeyListenerthat are attached to theJTable.protected MouseInputListenermouseInputListenerMouseInputListenerthat are attached to theJTable.protected CellRendererPanerendererPaneThe instance ofCellRendererPane.protected JTabletableThe instance ofJTable.
- 
Constructor SummaryConstructors Constructor Description BasicTableUI()
- 
Method SummaryModifier and Type Method Description protected FocusListenercreateFocusListener()Creates the focus listener for handling keyboard navigation in theJTable.protected KeyListenercreateKeyListener()Creates the key listener for handling keyboard navigation in theJTable.protected MouseInputListenercreateMouseInputListener()Creates the mouse listener for theJTable.static ComponentUIcreateUI(JComponent c)Returns a new instance ofBasicTableUI.intgetBaseline(JComponent c, int width, int height)Returns the baseline.Component.BaselineResizeBehaviorgetBaselineResizeBehavior(JComponent c)Returns an enum indicating how the baseline of the component changes as the size changes.DimensiongetMaximumSize(JComponent c)Return the maximum size of the table.DimensiongetMinimumSize(JComponent c)Return the minimum size of the table.DimensiongetPreferredSize(JComponent c)Return the preferred size of the table.protected voidinstallDefaults()Initialize JTable properties, e.g. font, foreground, and background.protected voidinstallKeyboardActions()Register all keyboard actions on the JTable.protected voidinstallListeners()Attaches listeners to the JTable.voidpaint(Graphics g, JComponent c)Paint a representation of thetableinstance that was set in installUI().protected voiduninstallDefaults()Uninstalls default properties.protected voiduninstallKeyboardActions()Unregisters keyboard actions.protected voiduninstallListeners()Unregisters listeners.Methods declared in class javax.swing.plaf.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, installUI, uninstallUI, update
- 
Field Details- 
tableThe instance ofJTable.
- 
rendererPaneThe instance ofCellRendererPane.
- 
keyListenerKeyListenerthat are attached to theJTable.
- 
focusListenerFocusListenerthat are attached to theJTable.
- 
mouseInputListenerMouseInputListenerthat are attached to theJTable.
 
- 
- 
Constructor Details- 
BasicTableUIpublic BasicTableUI()
 
- 
- 
Method Details- 
createKeyListenerCreates the key listener for handling keyboard navigation in theJTable.- Returns:
- the key listener for handling keyboard navigation in the JTable
 
- 
createFocusListenerCreates the focus listener for handling keyboard navigation in theJTable.- Returns:
- the focus listener for handling keyboard navigation in the JTable
 
- 
createMouseInputListenerCreates the mouse listener for theJTable.- Returns:
- the mouse listener for the JTable
 
- 
createUIReturns a new instance ofBasicTableUI.- Parameters:
- c- a component
- Returns:
- a new instance of BasicTableUI
 
- 
installDefaultsprotected void installDefaults()Initialize JTable properties, e.g. font, foreground, and background. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.
- 
installListenersprotected void installListeners()Attaches listeners to the JTable.
- 
installKeyboardActionsprotected void installKeyboardActions()Register all keyboard actions on the JTable.
- 
uninstallDefaultsprotected void uninstallDefaults()Uninstalls default properties.
- 
uninstallListenersprotected void uninstallListeners()Unregisters listeners.
- 
uninstallKeyboardActionsprotected void uninstallKeyboardActions()Unregisters keyboard actions.
- 
getBaselineReturns the baseline.- Overrides:
- getBaselinein class- ComponentUI
- Parameters:
- c-- JComponentbaseline is being requested for
- width- the width to get the baseline for
- height- the height to get the baseline for
- Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
- NullPointerException- if- cis- null
- IllegalArgumentException- if width or height is < 0
- Since:
- 1.6
- See Also:
- JComponent.getBaseline(int, int)
 
- 
getBaselineResizeBehaviorReturns an enum indicating how the baseline of the component changes as the size changes.- Overrides:
- getBaselineResizeBehaviorin class- ComponentUI
- Parameters:
- c-- JComponentto return baseline resize behavior for
- Returns:
- an enum indicating how the baseline changes as the component size changes
- Throws:
- NullPointerException- if- cis- null
- Since:
- 1.6
- See Also:
- JComponent.getBaseline(int, int)
 
- 
getMinimumSizeReturn the minimum size of the table. The minimum height is the row height times the number of rows. The minimum width is the sum of the minimum widths of each column.- Overrides:
- getMinimumSizein class- ComponentUI
- Parameters:
- c- the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject ornull
- See Also:
- JComponent.getMinimumSize(),- LayoutManager.minimumLayoutSize(java.awt.Container),- ComponentUI.getPreferredSize(javax.swing.JComponent)
 
- 
getPreferredSizeReturn the preferred size of the table. The preferred height is the row height times the number of rows. The preferred width is the sum of the preferred widths of each column.- Overrides:
- getPreferredSizein class- ComponentUI
- Parameters:
- c- the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject containing given component's preferred size appropriate for the look and feel
- See Also:
- JComponent.getPreferredSize(),- LayoutManager.preferredLayoutSize(java.awt.Container)
 
- 
getMaximumSizeReturn the maximum size of the table. The maximum height is the row heighttimes the number of rows. The maximum width is the sum of the maximum widths of each column.- Overrides:
- getMaximumSizein class- ComponentUI
- Parameters:
- c- the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject ornull
- See Also:
- JComponent.getMaximumSize(),- LayoutManager2.maximumLayoutSize(java.awt.Container)
 
- 
paintPaint a representation of thetableinstance that was set in installUI().- Overrides:
- paintin class- ComponentUI
- Parameters:
- g- the- Graphicscontext in which to paint
- c- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- See Also:
- ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
 
 
-