30 import javax.swing.plaf.*; 31 import javax.swing.plaf.basic.BasicScrollPaneUI; 32 33 import java.beans.PropertyChangeEvent; 34 import java.beans.PropertyChangeListener; 35 36 /** 37 * A CDE/Motif {@code L&F} implementation of ScrollPaneUI. 38 * <p> 39 * <strong>Warning:</strong> 40 * Serialized objects of this class will not be compatible with 41 * future Swing releases. The current serialization support is appropriate 42 * for short term storage or RMI between applications running the same 43 * version of Swing. A future release of Swing will provide support for 44 * long term persistence. 45 * 46 * @author Hans Muller 47 */ 48 public class MotifScrollPaneUI extends BasicScrollPaneUI 49 { 50 private final static Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0); 51 private final static Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4); 52 private final static Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0); 53 54 private CompoundBorder vsbBorder; 55 private CompoundBorder hsbBorder; 56 57 private PropertyChangeListener propertyChangeHandler; 58 59 @Override 60 protected void installListeners(JScrollPane scrollPane) { 61 super.installListeners(scrollPane); 62 propertyChangeHandler = createPropertyChangeHandler(); 63 scrollPane.addPropertyChangeListener(propertyChangeHandler); 64 } 65 66 @Override 67 protected void uninstallListeners(JComponent scrollPane) { 68 super.uninstallListeners(scrollPane); 69 scrollPane.removePropertyChangeListener(propertyChangeHandler); 70 } 71 72 private PropertyChangeListener createPropertyChangeHandler() { | 30 import javax.swing.plaf.*; 31 import javax.swing.plaf.basic.BasicScrollPaneUI; 32 33 import java.beans.PropertyChangeEvent; 34 import java.beans.PropertyChangeListener; 35 36 /** 37 * A CDE/Motif {@code L&F} implementation of ScrollPaneUI. 38 * <p> 39 * <strong>Warning:</strong> 40 * Serialized objects of this class will not be compatible with 41 * future Swing releases. The current serialization support is appropriate 42 * for short term storage or RMI between applications running the same 43 * version of Swing. A future release of Swing will provide support for 44 * long term persistence. 45 * 46 * @author Hans Muller 47 */ 48 public class MotifScrollPaneUI extends BasicScrollPaneUI 49 { 50 private static final Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0); 51 private static final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4); 52 private static final Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0); 53 54 private CompoundBorder vsbBorder; 55 private CompoundBorder hsbBorder; 56 57 private PropertyChangeListener propertyChangeHandler; 58 59 @Override 60 protected void installListeners(JScrollPane scrollPane) { 61 super.installListeners(scrollPane); 62 propertyChangeHandler = createPropertyChangeHandler(); 63 scrollPane.addPropertyChangeListener(propertyChangeHandler); 64 } 65 66 @Override 67 protected void uninstallListeners(JComponent scrollPane) { 68 super.uninstallListeners(scrollPane); 69 scrollPane.removePropertyChangeListener(propertyChangeHandler); 70 } 71 72 private PropertyChangeListener createPropertyChangeHandler() { |