Methods Summary |
---|
private java.beans.PropertyChangeListener | createPropertyChangeHandler()
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.ComponentUI | createUI(javax.swing.JComponent x)
return new MotifScrollPaneUI();
|
protected void | installDefaults(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 void | installListeners(javax.swing.JScrollPane scrollPane)
super.installListeners(scrollPane);
propertyChangeHandler = createPropertyChangeHandler();
scrollPane.addPropertyChangeListener(propertyChangeHandler);
|
protected void | uninstallDefaults(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 void | uninstallListeners(javax.swing.JScrollPane scrollPane)
super.uninstallListeners(scrollPane);
scrollPane.removePropertyChangeListener(propertyChangeHandler);
|