Package java.awt

Examples of java.awt.ComponentOrientation


    if (osxSizeGrip!=null) {
      g.drawImage(osxSizeGrip, dim.width-16, dim.height-16, null);
      return;
    }

    ComponentOrientation orientation = getComponentOrientation();

    if (orientation.isLeftToRight()) {
      int width = dim.width  -= 3;
      int height = dim.height -= 3;
      g.setColor(c1);
      g.fillRect(width-9,height-1, 3,3);
      g.fillRect(width-5,height-1, 3,3);
View Full Code Here


   */
  public JPopupMenu getPopupMenu() {
    if (!popupMenuCreated) {
      popupMenu = createPopupMenu();
      if (popupMenu!=null) {
        ComponentOrientation orientation = ComponentOrientation.
                    getOrientation(Locale.getDefault());
        popupMenu.applyComponentOrientation(orientation);
      }
      popupMenuCreated = true;
    }
View Full Code Here

    }
   
    @Action
    public void toggleCO() {
        JFrame frame = getMainFrame();
        ComponentOrientation current = frame.getComponentOrientation();
        if (current == ComponentOrientation.LEFT_TO_RIGHT) {
            frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        } else {
            frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
View Full Code Here

/**
* @param align The align to set.
*/
public void setAlignment(int align) {
  if (align == LEADING || align == TRAILING) {
    ComponentOrientation orientation =
      ComponentOrientation.getOrientation(Locale.getDefault());
    if (align == LEADING)
      align = orientation.isLeftToRight() ? LEFT : RIGHT;
      else
        align = orientation.isLeftToRight() ? RIGHT : LEFT;
  }

  this.align = align;
}
View Full Code Here

                    setButtonsAttrs(fileChooser.getDialogType());
                } else {
                    approveButtonText = (String)event.getNewValue();
                }
            } else if (StringConstants.COMPONENT_ORIENTATION.equals(changedProperty)) {
                ComponentOrientation co = (ComponentOrientation)event.getNewValue();
                fileChooser.applyComponentOrientation(co);
            }
        }
View Full Code Here

   */
  public JPopupMenu getPopupMenu() {
    if (!popupMenuCreated) {
      popupMenu = createPopupMenu();
      if (popupMenu!=null) {
        ComponentOrientation orientation = ComponentOrientation.
                    getOrientation(Locale.getDefault());
        popupMenu.applyComponentOrientation(orientation);
      }
      popupMenuCreated = true;
    }
View Full Code Here

        if (tipWindow==null) {
          return;
        }

        tipWindow.fixSize();
        ComponentOrientation o = textArea.getComponentOrientation();

        Point p = e.getPoint();
        SwingUtilities.convertPointToScreen(p, textArea);

        // Ensure tool tip is in the window bounds.
        // Multi-monitor support - make sure the completion window (and
        // description window, if applicable) both fit in the same
        // window in a multi-monitor environment.  To do this, we decide
        // which monitor the rectangle "p" is in, and use that one.
        Rectangle sb = TipUtil.getScreenBoundsForPoint(p.x, p.y);
        //Dimension ss = tipWindow.getToolkit().getScreenSize();

        // Try putting our stuff "below" the mouse first.
        int y = p.y + Y_MARGIN;
        if (y+tipWindow.getHeight()>=sb.y+sb.height) {
          y = p.y - Y_MARGIN - tipWindow.getHeight();
        }

        // Get x-coordinate of completions.  Try to align left edge
        // with the mouse first (with a slight margin).
        int x = p.x - X_MARGIN; // ltr
        if (!o.isLeftToRight()) {
          x = p.x - tipWindow.getWidth() + X_MARGIN;
        }
        if (x<sb.x) {
          x = sb.x;
        }
View Full Code Here

      return;
    }

    Color c1 = UIManager.getColor("Label.disabledShadow");
    Color c2 = UIManager.getColor("Label.disabledForeground");
    ComponentOrientation orientation = getComponentOrientation();

    if (orientation.isLeftToRight()) {
      int width = dim.width  -= 3;
      int height = dim.height -= 3;
      g.setColor(c1);
      g.fillRect(width-9,height-1, 3,3);
      g.fillRect(width-5,height-1, 3,3);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void setComponentOrientation(ComponentOrientation o) {
        ComponentOrientation old = label.getComponentOrientation();
        label.setComponentOrientation(o);
        firePropertyChange("componentOrientation", old, label.getComponentOrientation());
    }
View Full Code Here

        if (tipWindow==null) {
          return;
        }

        tipWindow.fixSize();
        ComponentOrientation o = textArea.getComponentOrientation();

        Point p = e.getPoint();
        SwingUtilities.convertPointToScreen(p, textArea);

        // Ensure tool tip is in the window bounds.
        // Multi-monitor support - make sure the completion window (and
        // description window, if applicable) both fit in the same
        // window in a multi-monitor environment.  To do this, we decide
        // which monitor the rectangle "p" is in, and use that one.
        Rectangle sb = TipUtil.getScreenBoundsForPoint(p.x, p.y);
        //Dimension ss = tipWindow.getToolkit().getScreenSize();

        // Try putting our stuff "below" the mouse first.
        int y = p.y + Y_MARGIN;
        if (y+tipWindow.getHeight()>=sb.y+sb.height) {
          y = p.y - Y_MARGIN - tipWindow.getHeight();
        }

        // Get x-coordinate of completions.  Try to align left edge
        // with the mouse first (with a slight margin).
        int x = p.x - X_MARGIN; // ltr
        if (!o.isLeftToRight()) {
          x = p.x - tipWindow.getWidth() + X_MARGIN;
        }
        if (x<sb.x) {
          x = sb.x;
        }
View Full Code Here

TOP

Related Classes of java.awt.ComponentOrientation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.