FileDocCategorySizeDatePackage
WindowsTableHeaderUI.javaAPI DocJava SE 5 API3815Fri Aug 26 14:54:50 BST 2005com.sun.java.swing.plaf.windows

WindowsTableHeaderUI

public class WindowsTableHeaderUI extends BasicTableHeaderUI

Fields Summary
private TableCellRenderer
originalHeaderRenderer
private int
rolloverColumn
Constructors Summary
Methods Summary
protected javax.swing.event.MouseInputListenercreateMouseInputListener()

	if (XPStyle.getXP() != null) {
	    return new MouseInputHandler() {
		public void mouseMoved(MouseEvent e) { 
		    super.mouseMoved(e);
		    updateRolloverColumn(e);
		}

		public void mouseEntered(MouseEvent e) {
		    super.mouseEntered(e);
		    updateRolloverColumn(e);
		}

		public void mouseExited(MouseEvent e) {
		    super.mouseExited(e);
		    rolloverColumn = -1;
		    header.repaint();
		}

		public void mousePressed(MouseEvent e) {
		    super.mousePressed(e);
		    if (header.getReorderingAllowed()) {
			rolloverColumn = -1;
			header.repaint();
		    }
		}

		public void mouseDragged(MouseEvent e) {
		    super.mouseDragged(e);
		    updateRolloverColumn(e);
		}

		public void mouseReleased(MouseEvent e) {
		    super.mouseReleased(e);
		    updateRolloverColumn(e);
		}
	    };
	} else {
	    return super.createMouseInputListener();
	}
    
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent h)


         
        return new WindowsTableHeaderUI();
    
public voidinstallUI(javax.swing.JComponent c)

	super.installUI(c);

	if (XPStyle.getXP() != null) {
	    originalHeaderRenderer = header.getDefaultRenderer();
	    if (originalHeaderRenderer instanceof UIResource) {
		header.setDefaultRenderer(new XPDefaultRenderer());
	    }
	}
    
public voiduninstallUI(javax.swing.JComponent c)

	if (header.getDefaultRenderer() instanceof XPDefaultRenderer) {
	    header.setDefaultRenderer(originalHeaderRenderer);
	}
	super.uninstallUI(c);
    
private voidupdateRolloverColumn(java.awt.event.MouseEvent e)

	if (header.getDraggedColumn() == null &&
	    header.contains(e.getPoint())) {

	    int col = header.columnAtPoint(e.getPoint());
	    if (col != rolloverColumn) {
		rolloverColumn = col;
		header.repaint();
	    }
	}