Quaqua 5.4.1 2009-07-14

ch.randelshofer.quaqua
Class QuaquaTableUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TableUI
          extended by javax.swing.plaf.basic.BasicTableUI
              extended by ch.randelshofer.quaqua.QuaquaTableUI
All Implemented Interfaces:
ViewportPainter

public class QuaquaTableUI
extends javax.swing.plaf.basic.BasicTableUI
implements ViewportPainter

QuaquaTableUI.

Version:
1.10.1 2008-11-05 Included fix by laurie_int regarding performance issue #72 "Table renders slow with very large tables".
1.10 2008-07-15 System property "Quaqua.Table.useJ2SE5MouseHandler" enforces use of J2SE5 mouse handler for J2SE6.
1.9.3 2008-07-06 Java 1.4 incorrectly reports button 3 pressed when the user presses the meta key.
1.9.2 2008-06-22 Selection foreground color must be set to inactive (=black) when the current cell is not selected, otherwise we get white text on white background.
1.9.1 2008-05-31 Moved all code related to InactivateableColorUIResource into method paintCell.
1.9 2008-05-10 Treat table as focused, if it is focused or if it is editing a table cell.
1.8.1 2008-05-03 Multiple cell selection did not work.
1.8 2008-04-21 Set client property "terminateEditOnFocusLost" to true on initDefaults. On mousePressed, requestFocusInWindow.
1.7 2008-03-21 Made selection behavior more consistent with native NSTable control.
1.6 2008-02-07 Reworked drawing of list selection. Implemented ListSelectionListener to ensure that selection changes are properly repainted.
1.5 2008-01-13 Set 'showHorizontalLines' and 'showVerticalLines' to false once when installing the UI, instead of overwriting these properties every time when the client property "Quaqua.Table.style" is changed.
1.4 2007-01-16 Focus border repainting factored out into QuaquaViewportUI.
1.3.3 2007-01-15 Change foreground color of cell renderer even if it is not an UIResource.
1.3.2 2007-01-05 Issue #6: Selection needs to be drawn differently when table hasn't focus or is disabled or is on an inactive window. Issue #10: Table cells mustn't draw selection background when rowSelectionAllowed is false.
1.3.1 2006-05-04 EditorCell was always drawn with alternating row2 color even when the table style was not set to striped.
1.3 2006-02-07 Support for client property "Table.isFileList" added.
1.2.1 2005-08-25 If the table is not striped, fill the viewport with the background color of the table.
1.2 2005-03-11 LnF Property "Table.alternateBackground" replaced by "Table.alternateBackground.0" and "Table.alternateBackground.1".
1.1 2004-07-04 FocusHandler added.
1.0 June 22, 2004 Created.
Author:
Werner Randelshofer

Nested Class Summary
 class QuaquaTableUI.MouseHandler
           
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTableUI
javax.swing.plaf.basic.BasicTableUI.KeyHandler, javax.swing.plaf.basic.BasicTableUI.MouseInputHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicTableUI
focusListener, keyListener, mouseInputListener, rendererPane, table
 
Constructor Summary
QuaquaTableUI()
          Creates a new instance.
 
Method Summary
protected  java.awt.event.FocusListener createFocusListener()
          Creates the focus listener for handling keyboard navigation in the JTable.
protected  java.awt.event.KeyListener createKeyListener()
          Creates the key listener for handling keyboard navigation in the JTable.
protected  javax.swing.event.MouseInputListener createMouseInputListener()
          Creates the mouse listener for the JTable.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
protected  void installDefaults()
           
protected  void installListeners()
          Attaches listeners to the JTable.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paint a representation of the table instance that was set in installUI().
 void paintViewport(java.awt.Graphics g, javax.swing.JViewport c)
          Paints the viewport of a JViewport, that contains the component of the user interface delegate.
protected  void uninstallListeners()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicTableUI
getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installUI, uninstallDefaults, uninstallKeyboardActions, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaTableUI

public QuaquaTableUI()
Creates a new instance.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

createKeyListener

protected java.awt.event.KeyListener createKeyListener()
Creates the key listener for handling keyboard navigation in the JTable.

Overrides:
createKeyListener in class javax.swing.plaf.basic.BasicTableUI

installListeners

protected void installListeners()
Attaches listeners to the JTable.

Overrides:
installListeners in class javax.swing.plaf.basic.BasicTableUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicTableUI

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicTableUI

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paint a representation of the table instance that was set in installUI().

Overrides:
paint in class javax.swing.plaf.basic.BasicTableUI

paintViewport

public void paintViewport(java.awt.Graphics g,
                          javax.swing.JViewport c)
Description copied from interface: ViewportPainter
Paints the viewport of a JViewport, that contains the component of the user interface delegate. This method is invoked by QuaquaViewportUI.

Specified by:
paintViewport in interface ViewportPainter

createMouseInputListener

protected javax.swing.event.MouseInputListener createMouseInputListener()
Creates the mouse listener for the JTable.

Overrides:
createMouseInputListener in class javax.swing.plaf.basic.BasicTableUI

createFocusListener

protected java.awt.event.FocusListener createFocusListener()
Creates the focus listener for handling keyboard navigation in the JTable.

Overrides:
createFocusListener in class javax.swing.plaf.basic.BasicTableUI

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.