FileDocCategorySizeDatePackage
MotifScrollPaneUI.javaAPI DocJava SE 5 API3802Fri Aug 26 14:54:48 BST 2005com.sun.java.swing.plaf.motif

MotifScrollPaneUI

public class MotifScrollPaneUI extends BasicScrollPaneUI
A CDE/Motif L&F implementation of ScrollPaneUI.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

version
1.10 08/28/98
author
Hans Muller

Fields Summary
private static final Border
vsbMarginBorderR
private static final Border
vsbMarginBorderL
private static final Border
hsbMarginBorder
private CompoundBorder
vsbBorder
private CompoundBorder
hsbBorder
private PropertyChangeListener
propertyChangeHandler
Constructors Summary
Methods Summary
private java.beans.PropertyChangeListenercreatePropertyChangeHandler()

        return new PropertyChangeListener() {
	    public void propertyChange(PropertyChangeEvent e) {
		  String propertyName = e.getPropertyName();

		  if (propertyName.equals("componentOrientation")) {
			JScrollPane pane = (JScrollPane)e.getSource();
			JScrollBar vsb = pane.getVerticalScrollBar();
			if (vsb != null && vsbBorder != null &&
			    vsb.getBorder() == vsbBorder) {
			    // The Border on the verticall scrollbar matches
			    // what we installed, reset it.
			    if (MotifGraphicsUtils.isLeftToRight(pane)) {
				vsbBorder = new CompoundBorder(vsbMarginBorderR,
						vsbBorder.getInsideBorder());
			    } else {
				vsbBorder = new CompoundBorder(vsbMarginBorderL,
						vsbBorder.getInsideBorder());
			    }
			    vsb.setBorder(vsbBorder);
			}
                  }
	}};
    
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent x)

	return new MotifScrollPaneUI();
    
protected voidinstallDefaults(javax.swing.JScrollPane scrollpane)

	super.installDefaults(scrollpane);

	JScrollBar vsb = scrollpane.getVerticalScrollBar();
	if (vsb != null) {
	    if (MotifGraphicsUtils.isLeftToRight(scrollpane)) {
	        vsbBorder = new CompoundBorder(vsbMarginBorderR, 
					       vsb.getBorder());
	    }
	    else {
	        vsbBorder = new CompoundBorder(vsbMarginBorderL, 
					       vsb.getBorder());
	    }
	    vsb.setBorder(vsbBorder);
	}

	JScrollBar hsb = scrollpane.getHorizontalScrollBar();
	if (hsb != null) {
	    hsbBorder = new CompoundBorder(hsbMarginBorder, hsb.getBorder());
	    hsb.setBorder(hsbBorder);
	}
    
protected voidinstallListeners(javax.swing.JScrollPane scrollPane)


        
        super.installListeners(scrollPane);
	propertyChangeHandler = createPropertyChangeHandler();
	scrollPane.addPropertyChangeListener(propertyChangeHandler);
    
protected voiduninstallDefaults(javax.swing.JScrollPane c)

	super.uninstallDefaults(c);

	JScrollBar vsb = scrollpane.getVerticalScrollBar();
	if (vsb != null) {
	    if (vsb.getBorder() == vsbBorder) {
		vsb.setBorder(null);
	    }
	    vsbBorder = null;
	}

	JScrollBar hsb = scrollpane.getHorizontalScrollBar();
	if (hsb != null) {
	    if (hsb.getBorder() == hsbBorder) {
		hsb.setBorder(null);
	    }
	    hsbBorder = null;
	}
    
protected voiduninstallListeners(javax.swing.JScrollPane scrollPane)

        super.uninstallListeners(scrollPane);
	scrollPane.removePropertyChangeListener(propertyChangeHandler);