Package java.awt

Examples of java.awt.ComponentOrientation


        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


   */
  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

            final int len = text.length();
            final int prefixLen = "<pre>".length(); //NON-NLS
            if (len > prefixLen) {
                final int maxOrientChars = Math.min(len, 1024);
                final String orientDetectText = EscapeUtil.unEscapeHtml(text.substring(prefixLen, maxOrientChars));
                ComponentOrientation direction = TextUtil.getTextDirection(orientDetectText);
                //logger.log(Level.INFO, "ORIENTATION LEFT TO RIGHT: " + direction.isLeftToRight());
                extractedTextPane.applyComponentOrientation(direction);
            } else {
                extractedTextPane.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
            }
View Full Code Here

                    || direction == Character.DIRECTIONALITY_RIGHT_TO_LEFT) {
                ++rtl_cnt;
            }
        }

        ComponentOrientation orientation = ComponentOrientation.LEFT_TO_RIGHT;
        if (text.length() > 1024 && rtl_cnt > 50) {
            orientation = ComponentOrientation.RIGHT_TO_LEFT;
        } else if (text.length() <= 1024 && rtl_cnt > text.length() / 4) {
            orientation = ComponentOrientation.RIGHT_TO_LEFT;
        }
View Full Code Here

          installPreviewPanel();
        }
      }
      if (e.getPropertyName().equals("componentOrientation"))
      {
        ComponentOrientation o = (ComponentOrientation) e.getNewValue();
        JColorChooser cc = (JColorChooser) e.getSource();
        if (o != (ComponentOrientation) e.getOldValue())
        {
          cc.applyComponentOrientation(o);
          cc.updateUI();
View Full Code Here

        {
          applyEdit();
        }
        else if (s.equals("componentOrientation"))
        {
          ComponentOrientation o = (ComponentOrientation) e.getNewValue();
          JFileChooser cc = (JFileChooser) e.getSource();
          if (o != (ComponentOrientation) e.getOldValue())
          {
            cc.applyComponentOrientation(o);
          }
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.