8253965: Delete the outdated java.awt.PeerFixer class
Reviewed-by: prr, pbansal
This commit is contained in:
parent
ced46b19f7
commit
70be8c7a46
@ -827,52 +827,3 @@ public class ScrollPane extends Container implements Accessible {
|
||||
} // class AccessibleAWTScrollPane
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* In JDK 1.1.1, the pkg private class java.awt.PeerFixer was moved to
|
||||
* become an inner class of ScrollPane, which broke serialization
|
||||
* for ScrollPane objects using JDK 1.1.
|
||||
* Instead of moving it back out here, which would break all JDK 1.1.x
|
||||
* releases, we keep PeerFixer in both places. Because of the scoping rules,
|
||||
* the PeerFixer that is used in ScrollPane will be the one that is the
|
||||
* inner class. This pkg private PeerFixer class below will only be used
|
||||
* if the Java 2 platform is used to deserialize ScrollPane objects that were serialized
|
||||
* using JDK1.1
|
||||
*/
|
||||
class PeerFixer implements AdjustmentListener, java.io.Serializable {
|
||||
/*
|
||||
* serialVersionUID
|
||||
*/
|
||||
private static final long serialVersionUID = 7051237413532574756L;
|
||||
|
||||
PeerFixer(ScrollPane scroller) {
|
||||
this.scroller = scroller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when the value of the adjustable has changed.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
Adjustable adj = e.getAdjustable();
|
||||
int value = e.getValue();
|
||||
ScrollPanePeer peer = (ScrollPanePeer) scroller.peer;
|
||||
if (peer != null) {
|
||||
peer.setValue(adj, value);
|
||||
}
|
||||
|
||||
Component c = scroller.getComponent(0);
|
||||
switch(adj.getOrientation()) {
|
||||
case Adjustable.VERTICAL:
|
||||
c.move(c.getLocation().x, -(value));
|
||||
break;
|
||||
case Adjustable.HORIZONTAL:
|
||||
c.move(-(value), c.getLocation().y);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Illegal adjustable orientation");
|
||||
}
|
||||
}
|
||||
|
||||
private ScrollPane scroller;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user