Package javax.swing

Examples of javax.swing.JInternalFrame$JDesktopIconTest


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame();
    BasicInternalFrameTitlePane p = new BasicInternalFrameTitlePane(f);
    IconifyAction a = p.new IconifyAction();
    harness.check(a.getValue("Name"), "Minimize");
  }
View Full Code Here


    lastEvent = event;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    f.addPropertyChangeListener(this);
    Icon icon = MetalIconFactory.getHorizontalSliderThumbIcon();
    f.setFrameIcon(icon);
    harness.check(f.getFrameIcon(), icon);
    harness.check(lastEvent.getPropertyName(),
            JInternalFrame.FRAME_ICON_PROPERTY);
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getNewValue(), icon);
    harness.check(lastEvent.getOldValue() != null);
   
    lastEvent = null;
    f.setFrameIcon(null);
    harness.check(f.getFrameIcon(), null);
    harness.check(lastEvent.getPropertyName(),
            JInternalFrame.FRAME_ICON_PROPERTY);
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getNewValue(), null);
    harness.check(lastEvent.getOldValue(), icon);
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame();
    BasicInternalFrameTitlePane p = new BasicInternalFrameTitlePane(f);
    MoveAction a = p.new MoveAction();
    harness.check(a.getValue("Name"), "Move");
  }
View Full Code Here

public class isIconifiable implements Testlet
{
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    harness.check(!f.isIconifiable());
    f.setIconifiable(true);
    harness.check(f.isIconifiable());
  }
View Full Code Here

   * @param h the test harness to use
   */
  public void testRepaint(TestHarness h)
  {
    h.checkPoint("testRepaint");
    JInternalFrame f = new TestInternalFrame();
    f.setVisible(true);

    JFrame fr = null;
    try
      {
        // First we try with visible but not showing.
        repainted = false;
        f.setSelected(true);
        h.check(repainted, false);
        repainted = false;
        f.setSelected(false);
        h.check(repainted, false);

        // Now we do the same with the internal frame showing.
        fr = new JFrame();
        fr.getContentPane().add(f);
        fr.setSize(100, 100);
        fr.setVisible(true);

        // Check precondition (not selected).
        h.check(f.isSelected(), false);
        // Change state to selected.
        repainted = false;
        f.setSelected(true);
        h.check(repainted, true);
        // No state change.
        repainted = false;
        f.setSelected(true);
        h.check(repainted, false);
        // State change to false.
        repainted = false;
        f.setSelected(false);
        h.check(repainted, true);
        // No state change.
        repainted = false;
        f.setSelected(false);
        h.check(repainted, false);
      }
    catch (PropertyVetoException ex)
      {
        h.fail("PropertyVetoException");
View Full Code Here

   * @param h the test harness to use
   */
  private void testBoundProperty(TestHarness h)
  {
    h.checkPoint("testBoundProperty");
    JInternalFrame t = new JInternalFrame();
    t.addPropertyChangeListener(new TestPropertyChangeHandler());
    try
      {
       
        JFrame fr = new JFrame();
        fr.getContentPane().add(t);
        fr.setSize(100, 100);
        fr.setVisible(true);
        t.setVisible(true);

        t.setSelected(false);
        propertyChanged = null;
        t.setSelected(true);
        h.check(propertyChanged, "selected");
      }
    catch (PropertyVetoException ex)
      {
        h.fail(ex.getMessage());
View Full Code Here

    lastEvent = event;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    f.addPropertyChangeListener(this);
    harness.check(f.getDefaultCloseOperation(),
            JInternalFrame.DISPOSE_ON_CLOSE);
    f.setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
    harness.check(f.getDefaultCloseOperation(),
            JInternalFrame.DO_NOTHING_ON_CLOSE);
    harness.check(lastEvent, null);
    f.setDefaultCloseOperation(-999);
    harness.check(f.getDefaultCloseOperation(), -999);
  }
View Full Code Here

public class getNormalBounds implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    f.setBounds(2, 4, 6, 8);
    harness.check(f.getNormalBounds(), new Rectangle(2, 4, 6, 8));
    f.setNormalBounds(new Rectangle(1, 2, 3, 4));
    harness.check(f.getNormalBounds(), new Rectangle(1, 2, 3, 4));
    harness.check(f.getBounds(), new Rectangle(2, 4, 6, 8));
  }
View Full Code Here

    lastEvent = event;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    f.addPropertyChangeListener(this);
    JDesktopIcon icon = new JDesktopIcon(f);
    f.setDesktopIcon(icon);
    harness.check(f.getDesktopIcon(), icon);
    harness.check(lastEvent.getPropertyName(), "desktopIcon");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getNewValue(), icon);
    harness.check(lastEvent.getOldValue() != null);
   
    lastEvent = null;
    f.setDesktopIcon(null);
    harness.check(f.getDesktopIcon(), null);
    harness.check(lastEvent.getPropertyName(), "desktopIcon");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getNewValue(), null);
    harness.check(lastEvent.getOldValue(), icon);
   
    JInternalFrame f2 = new JInternalFrame("F2");
    JDesktopIcon icon2 = new JDesktopIcon(f2);
    f.setDesktopIcon(icon);
    harness.check(icon2.getInternalFrame(), f2);
  }
View Full Code Here

  }
 
  private void testConstructor1(TestHarness harness)
  {
    harness.checkPoint("()");
    JInternalFrame f = new JInternalFrame();
    harness.check(f.getTitle(), "");
    harness.check(f.getDesktopPane(), null);
    harness.check(f.getDefaultCloseOperation(),
            JInternalFrame.DISPOSE_ON_CLOSE);
    harness.check(f.getLayer(), JLayeredPane.DEFAULT_LAYER.intValue());
    harness.check(!f.isResizable());
    harness.check(!f.isClosable());
    harness.check(!f.isMaximizable());
    harness.check(!f.isIconifiable());
    f.putClientProperty(JLayeredPane.LAYER_PROPERTY,
            JLayeredPane.PALETTE_LAYER);
    harness.check(f.getLayer(), JLayeredPane.PALETTE_LAYER.intValue());
    harness.check(f.getClientProperty(JLayeredPane.LAYER_PROPERTY),
            JLayeredPane.PALETTE_LAYER);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JInternalFrame$JDesktopIconTest

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.