Class BasicTableUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TableUI
javax.swing.plaf.basic.BasicTableUI
- Direct Known Subclasses:
SynthTableUI
BasicTableUI implementation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis class should be treated as a "protected" inner class.classThis class should be treated as a "protected" inner class.classThis class should be treated as a "protected" inner class. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FocusListenerFocusListenerthat are attached to theJTable.protected KeyListenerKeyListenerthat are attached to theJTable.protected MouseInputListenerMouseInputListenerthat are attached to theJTable.protected CellRendererPaneThe instance ofCellRendererPane.protected JTableThe instance ofJTable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FocusListenerCreates the focus listener for handling keyboard navigation in theJTable.protected KeyListenerCreates the key listener for handling keyboard navigation in theJTable.protected MouseInputListenerCreates the mouse listener for theJTable.static ComponentUIReturns a new instance ofBasicTableUI.intgetBaseline(JComponent c, int width, int height) Returns the baseline.Returns an enum indicating how the baseline of the component changes as the size changes.Return the maximum size of the table.Return the minimum size of the table.Return the preferred size of the table.protected voidInitialize JTable properties, e.g. font, foreground, and background.protected voidRegister all keyboard actions on the JTable.protected voidAttaches listeners to the JTable.voidpaint(Graphics g, JComponent c) Paint a representation of thetableinstance that was set in installUI().protected voidUninstalls default properties.protected voidUnregisters keyboard actions.protected voidUnregisters listeners.Methods declared in class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, installUI, uninstallUI, updateModifier and TypeMethodDescriptionbooleancontains(JComponent c, int x, int y) Returnstrueif the specified x,y location is contained within the look and feel's defined shape of the specified component.getAccessibleChild(JComponent c, int i) Returns theithAccessiblechild of the object.intReturns the number of accessible children in the object.voidConfigures the specified component appropriately for the look and feel.voidReverses configuration which was done on the specified component duringinstallUI.voidupdate(Graphics g, JComponent c) Notifies this UI delegate that it is time to paint the specified component.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
table
The instance ofJTable. -
rendererPane
The instance ofCellRendererPane. -
keyListener
KeyListenerthat are attached to theJTable. -
focusListener
FocusListenerthat are attached to theJTable. -
mouseInputListener
MouseInputListenerthat are attached to theJTable.
-
-
Constructor Details
-
BasicTableUI
public BasicTableUI()Constructs aBasicTableUI.
-
-
Method Details
-
createKeyListener
Creates the key listener for handling keyboard navigation in theJTable.- Returns:
- the key listener for handling keyboard navigation in the
JTable
-
createFocusListener
Creates the focus listener for handling keyboard navigation in theJTable.- Returns:
- the focus listener for handling keyboard navigation in the
JTable
-
createMouseInputListener
Creates the mouse listener for theJTable.- Returns:
- the mouse listener for the
JTable
-
createUI
Returns a new instance ofBasicTableUI.- Parameters:
c- a component- Returns:
- a new instance of
BasicTableUI
-
installDefaults
protected 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.- See Also:
-
installListeners
protected void installListeners()Attaches listeners to the JTable. -
installKeyboardActions
protected void installKeyboardActions()Register all keyboard actions on the JTable. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls default properties. -
uninstallListeners
protected void uninstallListeners()Unregisters listeners. -
uninstallKeyboardActions
protected void uninstallKeyboardActions()Unregisters keyboard actions. -
getBaseline
Returns the baseline.- Overrides:
getBaselinein classComponentUI- Parameters:
c-JComponentbaseline is being requested forwidth- the width to get the baseline forheight- the height to get the baseline for- Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
NullPointerException- ifcisnullIllegalArgumentException- if width or height is < 0- Since:
- 1.6
- See Also:
-
getBaselineResizeBehavior
Returns an enum indicating how the baseline of the component changes as the size changes.- Overrides:
getBaselineResizeBehaviorin classComponentUI- Parameters:
c-JComponentto return baseline resize behavior for- Returns:
- an enum indicating how the baseline changes as the component size changes
- Throws:
NullPointerException- ifcisnull- Since:
- 1.6
- See Also:
-
getMinimumSize
Return 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 classComponentUI- 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:
-
getPreferredSize
Return 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 classComponentUI- 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:
-
getMaximumSize
Return 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 classComponentUI- 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:
-
paint
Paint a representation of thetableinstance that was set in installUI().- Overrides:
paintin classComponentUI- Parameters:
g- theGraphicscontext in which to paintc- 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:
-