Package javax.swing

Examples of javax.swing.JRootPane$AccessibleJRootPane


      setDropStatus(JInternalFramePainter.DROPPING_PERMITTED);
      return true;
    } else{
      if(hasMenuBar()){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JRootPane rootPane = jif.getRootPane();
        p=SwingUtilities.convertPoint(rootPane, p, adaptable.getContentPane());
      }
      return getContentOperation().dragEnter(p);
    }
  }
View Full Code Here


      setDropStatus(JInternalFramePainter.NOOP);
      return true;
    } else{
      if(hasMenuBar()){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JRootPane rootPane = jif.getRootPane();
        p=SwingUtilities.convertPoint(rootPane, p, adaptable.getContentPane());
      }
      return getContentOperation().dragExit(p);
    }
  }
View Full Code Here

      setDropStatus(JInternalFramePainter.NOOP);
      return true;
    } else{
      if(hasMenuBar()){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JRootPane rootPane = jif.getRootPane();
        p=SwingUtilities.convertPoint(rootPane, p, adaptable.getContentPane());
      }
      return getContentOperation().drop(p);
    }
  }
View Full Code Here

    public TestFrame(TestHarness h)
    {
      super("TestFrame");
      try
  {
    setRootPane(new JRootPane());
    h.check(true, "Root pane changed successfully.");
  }
      catch (IllegalArgumentException e)
  {
    h.debug(e);
View Full Code Here

  public void test(TestHarness harness)
  {
    // This test checks that if an IllegalComponentStateException is
    // thrown if the layered pane parameter is null.
    JRootPane rootPane = new JRootPane();
    boolean fail = false;
    try
      {
        rootPane.setLayeredPane(null);
      }
    catch (IllegalComponentStateException e)
      {
        fail = true;
      }
View Full Code Here

           + "the panel below";
  }

  public Component getTestComponent()
  {
    JRootPane rp = new JRootPane();
    JMenuBar mb = new JMenuBar();
    JMenu menu = new JMenu("Menu");
    final JLabel label =
      new JLabel("The selected menu item should show up here");
    ActionListener l = new ActionListener()
    {
      public void actionPerformed(ActionEvent ev)
      {
        JMenuItem i = (JMenuItem) ev.getSource();
        label.setText(i.getText());
      }
    };
   
    JMenuItem item1 = new JMenuItem("MenuItem 1");
    item1.addActionListener(l);
    JMenuItem item2 = new JMenuItem("MenuItem 2");
    item2.addActionListener(l);
    JMenuItem item3 = new JMenuItem("MenuItem 3");
    item3.addActionListener(l);
    menu.add(item1);
    menu.add(item2);
    menu.add(item3);
    mb.add(menu);
    rp.setJMenuBar(mb);
    rp.getContentPane().add(label);
    return rp;
  }
View Full Code Here

   * @param harness
   */
  private void testWithBorder(TestHarness harness)
  {
    harness.checkPoint("withBorder");
    JRootPane rp = new JRootPane();
    rp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    rp.setSize(100, 100);
    rp.getLayout().layoutContainer(rp);
    Insets i = rp.getInsets();

    // Check the glass pane.
    Component gp = rp.getGlassPane();
    harness.check(gp.getBounds(),
                  new Rectangle(i.left, i.right,
                                rp.getWidth() - i.left - i.right,
                                rp.getHeight() - i.top - i.bottom));
    // Check the layered pane.
    Component lp = rp.getLayeredPane();
    harness.check(lp.getBounds(),
                  new Rectangle(i.left, i.right,
                                rp.getWidth() - i.left - i.right,
                                rp.getHeight() - i.top - i.bottom));

    // Check the content pane.
    Component cp = rp.getContentPane();
    harness.check(cp.getBounds(),
                  new Rectangle(0, 0, rp.getWidth() - i.left - i.right,
                                rp.getHeight() - i.top - i.bottom));
  }
View Full Code Here

public class getLayoutAlignmentY implements Testlet
{

  public void test(TestHarness harness)
  {
    JRootPane rp = new JRootPane();
    LayoutManager2 lm2 = (LayoutManager2) rp.getLayout();

    // Check for the value when nothing is touched.
    harness.check(lm2.getLayoutAlignmentY(rp), 0.0F);

    // Setting the root pane's alignmentY doesn't change anything.
    rp.setAlignmentY(0.5F);
    harness.check(lm2.getLayoutAlignmentY(rp), 0.0F);

    // Setting the content pane's alignmentY doesn't change anything.
    ((JComponent) rp.getContentPane()).setAlignmentY(0.5F);
    harness.check(lm2.getLayoutAlignmentY(rp), 0.0F);

    // Setting the glass pane's alignmentY doesn't change anything.
    ((JComponent) rp.getGlassPane()).setAlignmentY(0.5F);
    harness.check(lm2.getLayoutAlignmentY(rp), 0.0F);

    // Setting the layered pane's alignmentY doesn't change anything.
    ((JComponent) rp.getLayeredPane()).setAlignmentY(0.5F);
    harness.check(lm2.getLayoutAlignmentY(rp), 0.0F);
  }
View Full Code Here

   *
   * @param h the test harness to use
   */
  private void testInvalidLayout(TestHarness h)
  {
    JRootPane rp = new JRootPane();
    LayoutManager l = rp.getLayout();
    JPanel p = new JPanel();
    p.setPreferredSize(new Dimension(100, 100));
    rp.setContentPane(p);
    h.check(l.preferredLayoutSize(rp), new Dimension(100, 100));
    p.setPreferredSize(new Dimension(200, 200));
    h.check(l.preferredLayoutSize(rp), new Dimension(200, 200));
  }
View Full Code Here

public class getLayoutAlignmentX implements Testlet
{

  public void test(TestHarness harness)
  {
    JRootPane rp = new JRootPane();
    LayoutManager2 lm2 = (LayoutManager2) rp.getLayout();

    // Check for the value when nothing is touched.
    harness.check(lm2.getLayoutAlignmentX(rp), 0.0F);

    // Setting the root pane's alignmentX doesn't change anything.
    rp.setAlignmentX(0.5F);
    harness.check(lm2.getLayoutAlignmentX(rp), 0.0F);

    // Setting the content pane's alignmentX doesn't change anything.
    ((JComponent) rp.getContentPane()).setAlignmentX(0.5F);
    harness.check(lm2.getLayoutAlignmentX(rp), 0.0F);

    // Setting the glass pane's alignmentX doesn't change anything.
    ((JComponent) rp.getGlassPane()).setAlignmentX(0.5F);
    harness.check(lm2.getLayoutAlignmentX(rp), 0.0F);

    // Setting the layered pane's alignmentX doesn't change anything.
    ((JComponent) rp.getLayeredPane()).setAlignmentX(0.5F);
    harness.check(lm2.getLayoutAlignmentX(rp), 0.0F);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JRootPane$AccessibleJRootPane

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.