< prev index next >

src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java

Print this page




 205         if (newUI != null) {
 206             splitPane = newUI.getSplitPane();
 207             if (splitPane != null) {
 208                 if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
 209                 splitPane.addMouseListener(mouseHandler);
 210                 splitPane.addMouseMotionListener(mouseHandler);
 211                 addMouseListener(mouseHandler);
 212                 addMouseMotionListener(mouseHandler);
 213                 splitPane.addPropertyChangeListener(this);
 214                 if (splitPane.isOneTouchExpandable()) {
 215                     oneTouchExpandableChanged();
 216                 }
 217             }
 218         }
 219         else {
 220             splitPane = null;
 221         }
 222     }
 223 
 224     /**
 225      * Returns true if the point at <code>x</code>, <code>y</code>
 226      * is inside the thumb.
 227      */
 228     private boolean isInThumb(int x, int y) {
 229         Dimension           size = getSize();
 230         int                 thumbX;
 231         int                 thumbY;
 232         int                 thumbWidth;
 233         int                 thumbHeight;
 234 
 235         if (getBasicSplitPaneUI().getOrientation() ==
 236             JSplitPane.HORIZONTAL_SPLIT) {
 237             int center = size.width/2;
 238             thumbX = center - hThumbWidth/2;
 239             thumbY = hThumbOffset;
 240             thumbWidth = hThumbWidth;
 241             thumbHeight = hThumbHeight;
 242         }
 243         else {
 244             int center = size.height/2;
 245             thumbX = size.width - vThumbOffset;




 205         if (newUI != null) {
 206             splitPane = newUI.getSplitPane();
 207             if (splitPane != null) {
 208                 if (mouseHandler == null) mouseHandler=new MotifMouseHandler();
 209                 splitPane.addMouseListener(mouseHandler);
 210                 splitPane.addMouseMotionListener(mouseHandler);
 211                 addMouseListener(mouseHandler);
 212                 addMouseMotionListener(mouseHandler);
 213                 splitPane.addPropertyChangeListener(this);
 214                 if (splitPane.isOneTouchExpandable()) {
 215                     oneTouchExpandableChanged();
 216                 }
 217             }
 218         }
 219         else {
 220             splitPane = null;
 221         }
 222     }
 223 
 224     /**
 225      * Returns true if the point at {@code x}, {@code y}
 226      * is inside the thumb.
 227      */
 228     private boolean isInThumb(int x, int y) {
 229         Dimension           size = getSize();
 230         int                 thumbX;
 231         int                 thumbY;
 232         int                 thumbWidth;
 233         int                 thumbHeight;
 234 
 235         if (getBasicSplitPaneUI().getOrientation() ==
 236             JSplitPane.HORIZONTAL_SPLIT) {
 237             int center = size.width/2;
 238             thumbX = center - hThumbWidth/2;
 239             thumbY = hThumbOffset;
 240             thumbWidth = hThumbWidth;
 241             thumbHeight = hThumbHeight;
 242         }
 243         else {
 244             int center = size.height/2;
 245             thumbX = size.width - vThumbOffset;


< prev index next >