Examples of JLayeredPane


Examples of javax.swing.JLayeredPane

    super(null);
  }

  @Override
  protected Component createWidget() {
    JLayeredPane jlp = new JLayeredPane();
    Dimension size = new Dimension(100, 100);
    jlp.setSize(size);
    return jlp;
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

    return jlp;
  }

  @Override
  protected Component newWidget() {
    return new JLayeredPane();
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

    return new JLayeredPane();
  }

  @Override
  public void addChildByConstraints(Component child, Object constraints) {
    JLayeredPane layeredPane = (JLayeredPane)getWidget();
    layeredPane.setLayer(child, constraints==null?0:((Integer)constraints).intValue());
    layeredPane.add(child);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

    layeredPane.add(child);
  }

  @Override
  public Object getChildConstraints(Component child) {
    JLayeredPane layeredPane = (JLayeredPane)getWidget();
    return layeredPane.getLayer(child);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

   * @param harness the test harness to use
   */
  private void testSimple(TestHarness harness)
  {
    harness.checkPoint("testSimple");
    JLayeredPane l = new JLayeredPane();
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    l.add(p1);
    l.add(p2);
    l.add(p3);
    l.moveToFront(p2);
    harness.check(l.getComponent(0), p2);
    harness.check(l.getComponent(1), p1);
    harness.check(l.getComponent(2), p3);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

* values the behavior should be like DO_NOTHING_ON_CLOSE</p>
*/
public class defaultLayoutManager implements Testlet {
 
  public void test(TestHarness harness) {
    JLayeredPane lp = new JLayeredPane();
                harness.check (lp.getLayout(), null);

  }
View Full Code Here

Examples of javax.swing.JLayeredPane

   * @param harness the test harness to use
   */
  private void testUnknownLayer(TestHarness harness)
  {
    harness.checkPoint("unknownLayer");
    JLayeredPane l = new JLayeredPane();
    // We add one component to layer 1 and one to layer 3 and check what
    // happens when we request the components in layer -1 (negative), 0
    // (positive and less then the minimum layer), 2 (between the layers),
    // 4 (greater than the maximum layer).
    JLabel l1 = new JLabel("Hello");
    l.setLayer(l1, 1);
    l.add(l1);
    JLabel l2 = new JLabel("World");
    l.setLayer(l2, 3);
    l.add(l2);
    harness.check(l.getComponentsInLayer(-1).length, 0);
    harness.check(l.getComponentsInLayer(-0).length, 0);
    harness.check(l.getComponentsInLayer(-2).length, 0);
    harness.check(l.getComponentsInLayer(-4).length, 0);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

   *
   * @param h the test harness to use
   */
  private void testAddSameLayer(TestHarness h)
  {
    JLayeredPane l = new JLayeredPane();
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    l.add(p1, JLayeredPane.FRAME_CONTENT_LAYER);
    l.add(p2, JLayeredPane.FRAME_CONTENT_LAYER);
    l.add(p3, JLayeredPane.FRAME_CONTENT_LAYER);
    h.check(l.getComponent(0), p1);
    h.check(l.getComponent(1), p2);
    h.check(l.getComponent(2), p3);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

   *
   * @param h the test harness to use
   */
  private void testAddDifferentLayers(TestHarness h)
  {
    JLayeredPane l = new JLayeredPane();
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    l.add(p1, new Integer(0));
    l.add(p2, new Integer(1));
    l.add(p3, new Integer(2));
    h.check(l.getComponent(0), p3);
    h.check(l.getComponent(1), p2);
    h.check(l.getComponent(2), p1);
  }
View Full Code Here

Examples of javax.swing.JLayeredPane

   *
   * @param h the test harness to use
   */
  private void testAddZeroPosition(TestHarness h)
  {
    JLayeredPane l = new JLayeredPane();
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    l.add(p1, JLayeredPane.FRAME_CONTENT_LAYER, 0);
    l.add(p2, JLayeredPane.FRAME_CONTENT_LAYER, 0);
    l.add(p3, JLayeredPane.FRAME_CONTENT_LAYER, 0);
    h.check(l.getComponent(0), p3);
    h.check(l.getComponent(1), p2);
    h.check(l.getComponent(2), p1);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.