Package javax.swing

Examples of javax.swing.JInternalFrame$FocusPropertyChangeListener


public class getMinimumAccessibleValue implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    AccessibleContext ac = f.getAccessibleContext();
    AccessibleValue av = ac.getAccessibleValue();
    harness.check(av.getMinimumAccessibleValue(),
            new Integer(Integer.MIN_VALUE))// not specified, but the ref
                                              // impl returns this
  }
View Full Code Here


    lastVetoableEvent = event;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    harness.check(!f.isSelected());

    // setSelected() only has an effect if the internal frame
    // is showing.
    JFrame fr = new JFrame();
    fr.getContentPane().add(f);
    f.setVisible(true);
    fr.pack();
    fr.setVisible(true);

    f.addVetoableChangeListener(this);
    f.addPropertyChangeListener(this);
    f.addInternalFrameListener(this);
    try
      {
        f.setSelected(true);
      }
    catch (PropertyVetoException e)
      {
        e.printStackTrace();
      }
    harness.check(f.isSelected());
   
    // check the vetoable event
    harness.check(lastVetoableEvent.getPropertyName(),
            JInternalFrame.IS_SELECTED_PROPERTY);
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), Boolean.FALSE);
    harness.check(lastEvent.getNewValue(), Boolean.TRUE);
   
    harness.check(lastEvent.getPropertyName(),
            JInternalFrame.IS_SELECTED_PROPERTY);
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), Boolean.FALSE);
    harness.check(lastEvent.getNewValue(), Boolean.TRUE);
   
    harness.check(events.size(), 1);
    InternalFrameEvent event = (InternalFrameEvent) events.get(0);
    harness.check(event.getSource(), f);
    harness.check(event.getID(), InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
   
    // set selected to true
    events.clear();
    try
      {
        f.setSelected(true);
      }
    catch (PropertyVetoException e)
      {
        // ignore 
      }
    harness.check(f.isSelected());
    harness.check(events.size(), 0);

  }
View Full Code Here

  }
   
  public void testMethod1(TestHarness harness)
  {
    harness.checkPoint("()");
    JInternalFrame f = new JInternalFrame();
    InputMap m1 = f.getInputMap();
    InputMap m2 = f.getInputMap(JComponent.WHEN_FOCUSED);  
    harness.check(m1 == m2);
  }
View Full Code Here

  }
   
  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    JInternalFrame f = new JInternalFrame();
    InputMap m1 = f.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = f.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = f.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
  }
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());
    t.setMaximizable(false);
    propertyChanged = null;
    t.setMaximizable(true);
    h.check(propertyChanged, "maximizable");
  }
View Full Code Here

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

    lastEvent = e;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    harness.check(!f.isIconifiable());
    f.addPropertyChangeListener(this);
    f.setIconifiable(true);
    harness.check(f.isIconifiable());
    harness.check(lastEvent.getPropertyName(), "iconable");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), Boolean.FALSE);
    harness.check(lastEvent.getNewValue(), Boolean.TRUE);
  }
View Full Code Here

{
  List events = new java.util.ArrayList();
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    f.addInternalFrameListener(this);
    f.dispose();
    harness.check(f.isClosed());
    harness.check(!f.isSelected());
    harness.check(!f.isVisible());
    harness.check(events.size(), 1);
    InternalFrameEvent event = (InternalFrameEvent) events.get(0);
    harness.check(event.getSource(), f);
    harness.check(event.getID(), InternalFrameEvent.INTERNAL_FRAME_CLOSED);
  }
View Full Code Here

    lastEvent = event;
  }
  public void test(TestHarness harness)
  {
    JDesktopPane desktop = new JDesktopPane();
    JInternalFrame f = new JInternalFrame("Title");
    desktop.add(f);
    f.addPropertyChangeListener(this);
    harness.check(f.getNormalBounds(), new Rectangle());
    f.setBounds(4, 3, 2, 1);
    harness.check(f.getNormalBounds(), new Rectangle(4, 3, 2, 1));
   
    Rectangle normalBounds = new Rectangle(1, 2, 3, 4);
    f.setNormalBounds(normalBounds);
    harness.check(f.getNormalBounds(), new Rectangle(1, 2, 3, 4));
    harness.check(f.getNormalBounds() == normalBounds);
    harness.check(f.getBounds(), new Rectangle(4, 3, 2, 1));
    harness.check(lastEvent, null);
   
    // after setting to null, getNormalBounds() reverts to the component bounds
    f.setNormalBounds(null);
    harness.check(f.getNormalBounds(), new Rectangle(4, 3, 2, 1));
  }
View Full Code Here

    lastEvent = e;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    harness.check(!f.isResizable());
    f.addPropertyChangeListener(this);
    f.setResizable(true);
    harness.check(f.isResizable());
    harness.check(lastEvent.getPropertyName(), "resizable");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), Boolean.FALSE);
    harness.check(lastEvent.getNewValue(), Boolean.TRUE);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JInternalFrame$FocusPropertyChangeListener

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.