Package java.awt

Examples of java.awt.ComponentOrientation


   * @param ac The auto-completion instance.
   */
  public AutoCompletePopupWindow(Window parent, AutoCompletion ac) {

    super(parent);
    ComponentOrientation o = ac.getTextComponentOrientation();

    this.ac = ac;
    model = new CompletionListModel();
    list = new JList(model);
//    list.setCellRenderer(new DelegatingCellRenderer());
    list.setCellRenderer(new DefaultListCellRenderer());
    list.addListSelectionListener(this);
    list.addMouseListener(this);
    list.setFixedCellHeight(20);
   
    JPanel contentPane = new JPanel(new BorderLayout());
    JScrollPane sp = new JScrollPane(list,
              JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
              JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    // In 1.4, JScrollPane.setCorner() has a bug where it won't accept
    // JScrollPane.LOWER_TRAILING_CORNER, even though that constant is
    // defined.  So we have to put the logic added in 1.5 to handle it
    // here.
    JPanel corner = new SizeGrip();
    //sp.setCorner(JScrollPane.LOWER_TRAILING_CORNER, corner);
    boolean isLeftToRight = o.isLeftToRight();
      String str = isLeftToRight ? JScrollPane.LOWER_RIGHT_CORNER :
                      JScrollPane.LOWER_LEFT_CORNER;
//      sp.setCorner(str, corner);

    contentPane.add(sp);
View Full Code Here


  public AutoCompleteDescWindow(Window owner, AutoCompletion ac) {

    super(owner);
    this.ac = ac;

    ComponentOrientation o = ac.getTextComponentOrientation();
   
    JPanel cp = new JPanel(new BorderLayout());
//    cp.setBorder(BorderFactory.createLineBorder(Color.BLACK));

    descArea = new JEditorPane("text/html", null);
    TipUtil.tweakTipEditorPane(descArea);
    descArea.addHyperlinkListener(this);
    scrollPane = new JScrollPane(descArea);
    scrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    scrollPane.setBackground(descArea.getBackground());
    scrollPane.getViewport().setBackground(descArea.getBackground());
    cp.add(scrollPane);

    descWindowNavBar = new JToolBar();
    backAction = new ToolBarBackAction(o.isLeftToRight());
    forwardAction = new ToolBarForwardAction(o.isLeftToRight());
    descWindowNavBar.setFloatable(false);
    descWindowNavBar.add(new JButton(backAction));
    descWindowNavBar.add(new JButton(forwardAction));

    bottomPanel = new JPanel(new BorderLayout());
View Full Code Here

    // First, fill the entire background with toolbar background color.
    g.setColor(secondaryBackground);
    g.fillRect(0,0, bounds.width,bounds.height);

    if (((JToolBar)c).getOrientation() == JToolBar.HORIZONTAL) {
      ComponentOrientation co = toolBar.getComponentOrientation();
      int width = getContainedComponentsWidth(c);
      g.setColor(primaryBackground);
      if (co.isLeftToRight()) {
        g.fillRect(insets.left,insets.top,
          width-insets.left,bounds.height-insets.top);
      }
      else {
        int x = bounds.width-insets.right-width-1;
View Full Code Here

          uninstallComponents();
          installComponents();
          optionPane.validate();
        }
        else if (changeName == "componentOrientation") {
          ComponentOrientation o = (ComponentOrientation)e.getNewValue();
          JOptionPane op = (JOptionPane)e.getSource();
          if (o != (ComponentOrientation)e.getOldValue()) {
            op.applyComponentOrientation(o);
          }
        }
View Full Code Here

        this.container = container;
        this.layout    = layout;

        container.setLayout(layout);
        currentCellConstraints = new CellConstraints();
        ComponentOrientation orientation = container.getComponentOrientation();
        leftToRight = orientation.isLeftToRight()
                  || !orientation.isHorizontal();
    }
View Full Code Here

        container.setLayout(layout);

        setOpaque(false);

        currentCellConstraints = new CellConstraints();
        ComponentOrientation orientation = container.getComponentOrientation();
        leftToRight = orientation.isLeftToRight()
                  || !orientation.isHorizontal();
    }
View Full Code Here

     * @throws NullPointerException if {@code layout} or {@code container} is {@code null}
     */
    protected AbstractButtonPanelBuilder(FormLayout layout, JPanel container) {
        super(layout, container);
        setOpaque(false);
        ComponentOrientation orientation = container.getComponentOrientation();
        leftToRight = orientation.isLeftToRight()
                  || !orientation.isHorizontal();
    }
View Full Code Here

     *
     * @throws NullPointerException if {@code layout} or {@code container} is {@code null}
     */
    public AbstractFormBuilder(FormLayout layout, Container container) {
        super(layout, container);
        ComponentOrientation orientation = container.getComponentOrientation();
        leftToRight = orientation.isLeftToRight()
                  || !orientation.isHorizontal();
    }
View Full Code Here

          uninstallComponents();
          installComponents();
          optionPane.validate();
        }
        else if (changeName == "componentOrientation") {
          ComponentOrientation o = (ComponentOrientation)e.getNewValue();
          JOptionPane op = (JOptionPane)e.getSource();
          if (o != (ComponentOrientation)e.getOldValue()) {
            op.applyComponentOrientation(o);
          }
        }
View Full Code Here

          uninstallComponents();
          installComponents();
          optionPane.validate();
        }
        else if (changeName == "componentOrientation") {
          ComponentOrientation o = (ComponentOrientation)e.getNewValue();
          JOptionPane op = (JOptionPane)e.getSource();
          if (o != (ComponentOrientation)e.getOldValue()) {
            op.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.