Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicTableUI

extends TableUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.synth.SynthTableUI
Imports
java.awt.*, java.awt.datatransfer.*, java.awt.event.*, java.util.Enumeration, javax.swing.*, javax.swing.event.*, javax.swing.plaf.*, javax.swing.table.*, javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag, sun.swing.SwingUtilities2, .DefaultLookup, .UIAction, java.beans.PropertyChangeEvent, .PropertyChangeListener

BasicTableUI implementation
Authors
Philip Milne, Shannon Hickey (drag and drop)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public class
BasicTableUI.FocusHandler

This class should be treated as a "protected" inner class.

private class
public class
BasicTableUI.KeyHandler

This class should be treated as a "protected" inner class.

public class
BasicTableUI.MouseInputHandler

This class should be treated as a "protected" inner class.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final StringBuilder
private static final TransferHandler
protected FocusListener
focusListener

FocusListener that are attached to the JTable.

private BasicTableUI.Handler
private boolean
isFileList

Local cache of Table's client property "Table.isFileList"

protected KeyListener
keyListener

KeyListener that are attached to the JTable.

protected MouseInputListener
mouseInputListener

MouseInputListener that are attached to the JTable.

protected CellRendererPane
rendererPane

The instance of CellRendererPane.

protected JTable
table

The instance of JTable.

Constructor Summary

AccessConstructor and Description
public
BasicTableUI()

Constructs a BasicTableUI.

Method Summary

Modifier and TypeMethod and Description
protected FocusListener

Returns:

the focus listener for handling keyboard navigation in the JTable
createFocusListener
()

Creates the focus listener for handling keyboard navigation in the JTable.

protected KeyListener

Returns:

the key listener for handling keyboard navigation in the JTable
createKeyListener
()

Creates the key listener for handling keyboard navigation in the JTable.

protected MouseInputListener

Returns:

the mouse listener for the JTable
createMouseInputListener
()

Creates the mouse listener for the JTable.

private Dimension
createTableSize(long width)

public static ComponentUI

Returns:

a new instance of BasicTableUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns a new instance of BasicTableUI.
private Rectangle
extendRect(Rectangle rect, boolean horizontal)

private static int
getAdjustedLead(JTable table, boolean row, ListSelectionModel model)

private static int
getAdjustedLead(JTable table, boolean row)

public int
getBaseline(JComponent
JComponent baseline is being requested for
c
,
int
the width to get the baseline for
width
,
int
the height to get the baseline for
height
)

Overrides javax.swing.plaf.ComponentUI.getBaseline.

Returns the baseline.
public Component.BaselineResizeBehavior
getBaselineResizeBehavior(JComponent
JComponent to return baseline resize behavior for
c
)

Overrides javax.swing.plaf.ComponentUI.getBaselineResizeBehavior.

Returns an enum indicating how the baseline of the component changes as the size changes.
private BasicTableUI.Handler
private Rectangle
pack-priv InputMap
getInputMap(int condition)

public Dimension
getMaximumSize(JComponent
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
c
)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Return the maximum size of the table.
public Dimension
getMinimumSize(JComponent
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
c
)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Return the minimum size of the table.
public Dimension
getPreferredSize(JComponent
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
c
)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Return the preferred size of the table.
private Rectangle
protected void
installDefaults()

Initialize JTable properties, e.g. font, foreground, and background.

private void
protected void
installKeyboardActions()

Register all keyboard actions on the JTable.

protected void
installListeners()

Attaches listeners to the JTable.

public void
installUI(JComponent
the component where this UI delegate is being installed
c
)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.
pack-priv static void
public void
paint(Graphics
the Graphics context in which to paint
g
,
JComponent
the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
c
)

Overrides javax.swing.plaf.ComponentUI.paint.

Paint a representation of the table instance that was set in installUI().
private void
paintCell(Graphics g, Rectangle cellRect, int row, int column)

private void
paintCells(Graphics g, int rMin, int rMax, int cMin, int cMax)

private void
paintDraggedArea(Graphics g, int rMin, int rMax, TableColumn draggedColumn, int distance)

private void
private void
paintGrid(Graphics g, int rMin, int rMax, int cMin, int cMax)

private boolean
pointOutsidePrefSize(int row, int column, Point p)

protected void
uninstallDefaults()

Uninstalls default properties.

protected void
uninstallKeyboardActions()

Unregisters keyboard actions.

protected void
uninstallListeners()

Unregisters listeners.

public void
uninstallUI(JComponent
the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
c
)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.
private int