src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java
changeset 47367 7e8a1abb5168
parent 47216 71c04702a3d5
equal deleted inserted replaced
47222:c8ac05bbe477 47367:7e8a1abb5168
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   158             }
   158             }
   159             else {
   159             else {
   160                 in = new Insets( 0, 0, 0, 0 );
   160                 in = new Insets( 0, 0, 0, 0 );
   161             }
   161             }
   162             // Draw the separation
   162             // Draw the separation
   163             if(MotifGraphicsUtils.isLeftToRight(comboBox)) {
   163             if (comboBox.getComponentOrientation().isLeftToRight()) {
   164                 r.x -= (HORIZ_MARGIN + 2);
   164                 r.x -= (HORIZ_MARGIN + 2);
   165             }
   165             }
   166             else {
   166             else {
   167                 r.x += r.width + HORIZ_MARGIN + 1;
   167                 r.x += r.width + HORIZ_MARGIN + 1;
   168             }
   168             }
   209         b.x = in.left;
   209         b.x = in.left;
   210         b.y = in.top;
   210         b.y = in.top;
   211         b.width -= (in.left + in.right);
   211         b.width -= (in.left + in.right);
   212         b.height -= (in.top + in.bottom);
   212         b.height -= (in.top + in.bottom);
   213 
   213 
   214         if(MotifGraphicsUtils.isLeftToRight(comboBox)) {
   214         if (comboBox.getComponentOrientation().isLeftToRight()) {
   215             b.x = b.x + b.width - HORIZ_MARGIN - arrowIcon.getIconWidth();
   215             b.x = b.x + b.width - HORIZ_MARGIN - arrowIcon.getIconWidth();
   216         }
   216         }
   217         else {
   217         else {
   218             b.x += HORIZ_MARGIN;
   218             b.x += HORIZ_MARGIN;
   219         }
   219         }
   225 
   225 
   226     protected Rectangle rectangleForCurrentValue() {
   226     protected Rectangle rectangleForCurrentValue() {
   227         int width = comboBox.getWidth();
   227         int width = comboBox.getWidth();
   228         int height = comboBox.getHeight();
   228         int height = comboBox.getHeight();
   229         Insets insets = getInsets();
   229         Insets insets = getInsets();
   230         if(MotifGraphicsUtils.isLeftToRight(comboBox)) {
   230         if (comboBox.getComponentOrientation().isLeftToRight()) {
   231             return new Rectangle(insets.left, insets.top,
   231             return new Rectangle(insets.left, insets.top,
   232                                  (width - (insets.left + insets.right)) -
   232                                  (width - (insets.left + insets.right)) -
   233                                                         iconAreaWidth(),
   233                                                         iconAreaWidth(),
   234                                  height - (insets.top + insets.bottom));
   234                                  height - (insets.top + insets.bottom));
   235         }
   235         }