equal
deleted
inserted
replaced
61 |
61 |
62 import javax.swing.JComponent; |
62 import javax.swing.JComponent; |
63 import javax.swing.SwingUtilities; |
63 import javax.swing.SwingUtilities; |
64 import javax.swing.RepaintManager; |
64 import javax.swing.RepaintManager; |
65 |
65 |
66 import sun.lwawt.macosx.CDropTarget; |
|
67 |
|
68 import com.sun.java.swing.SwingUtilities3; |
66 import com.sun.java.swing.SwingUtilities3; |
69 |
67 |
70 public abstract class LWComponentPeer<T extends Component, D extends JComponent> |
68 public abstract class LWComponentPeer<T extends Component, D extends JComponent> |
71 implements ComponentPeer, DropTargetPeer |
69 implements ComponentPeer, DropTargetPeer |
72 { |
70 { |
135 private Container delegateContainer; |
133 private Container delegateContainer; |
136 private Component delegateDropTarget; |
134 private Component delegateDropTarget; |
137 private final Object dropTargetLock = new Object(); |
135 private final Object dropTargetLock = new Object(); |
138 |
136 |
139 private int fNumDropTargets = 0; |
137 private int fNumDropTargets = 0; |
140 private CDropTarget fDropTarget = null; |
138 private PlatformDropTarget fDropTarget = null; |
141 |
139 |
142 private final PlatformComponent platformComponent; |
140 private final PlatformComponent platformComponent; |
143 |
141 |
144 /** |
142 /** |
145 * Character with reasonable value between the minimum width and maximum. |
143 * Character with reasonable value between the minimum width and maximum. |
1061 synchronized (dropTargetLock) { |
1059 synchronized (dropTargetLock) { |
1062 // 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only |
1060 // 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only |
1063 // if it's the first (or last) one for the component. Otherwise this call is a no-op. |
1061 // if it's the first (or last) one for the component. Otherwise this call is a no-op. |
1064 if (++fNumDropTargets == 1) { |
1062 if (++fNumDropTargets == 1) { |
1065 // Having a non-null drop target would be an error but let's check just in case: |
1063 // Having a non-null drop target would be an error but let's check just in case: |
1066 if (fDropTarget != null) |
1064 if (fDropTarget != null) { |
1067 System.err.println("CComponent.addDropTarget(): current drop target is non-null."); |
1065 throw new IllegalStateException("Current drop target is not null"); |
1068 |
1066 } |
1069 // Create a new drop target: |
1067 // Create a new drop target: |
1070 fDropTarget = CDropTarget.createDropTarget(dt, target, this); |
1068 fDropTarget = LWToolkit.getLWToolkit().createDropTarget(dt, target, this); |
1071 } |
1069 } |
1072 } |
1070 } |
1073 } |
1071 } |
1074 } |
1072 } |
1075 |
1073 |