Examples of JDesktopIcon


Examples of javax.swing.JInternalFrame.JDesktopIcon

* @author Yvonne Wang
*/
final class JInternalFrameDesktopPaneQuery {
  @RunsInCurrentThread
  static @Nullable JDesktopPane desktopPaneOf(@Nonnull JInternalFrame internalFrame) {
    JDesktopIcon icon = internalFrame.getDesktopIcon();
    if (icon != null) {
      return icon.getDesktopPane();
    }
    return null;
  }
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

    return Triple.of(deiconified, desktopIcon, iconifyButtonLocation(desktopIcon));
  }

  @RunsInCurrentThread
  private static @Nonnull Point findIconifyLocation(JInternalFrame internalFrame) {
    JDesktopIcon desktopIcon = checkNotNull(internalFrame.getDesktopIcon());
    return iconifyButtonLocation(desktopIcon);
  }
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

 
  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

Examples of javax.swing.JInternalFrame.JDesktopIcon

  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    JDesktopIcon icon = f.getDesktopIcon();
    AccessibleContext ac = icon.getAccessibleContext();
    AccessibleValue av = ac.getAccessibleValue();
   
    // by trial and error, I determined that the "value" is the frame's layer
    harness.check(av.getCurrentAccessibleValue(), JLayeredPane.DEFAULT_LAYER);
    ac.addPropertyChangeListener(this);
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

public class getDesktopIcon implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    JDesktopIcon icon = new JDesktopIcon(f);
    f.setDesktopIcon(icon);
    harness.check(f.getDesktopIcon(), icon);

    f.setDesktopIcon(null);
    harness.check(f.getDesktopIcon(), null);
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

              .equals(jrp
                  .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED));
          break;
        }
        if (comp instanceof JDesktopIcon) {
          JDesktopIcon jdi = (JDesktopIcon) comp;
          JInternalFrame jif = jdi.getInternalFrame();
          isWindowModified = Boolean.TRUE
              .equals(jif
                  .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED));
          break;
        }
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

    this.substancePropertyListener = new PropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent evt) {
        if (JInternalFrame.IS_CLOSED_PROPERTY.equals(evt
            .getPropertyName())) {
          titlePane.uninstall();
          JDesktopIcon jdi = frame.getDesktopIcon();
          SubstanceDesktopIconUI ui = (SubstanceDesktopIconUI) jdi
              .getUI();
          ui.uninstallIfNecessary(jdi);
        }

        if ("background".equals(evt.getPropertyName())) {
          Color newBackgr = (Color) evt.getNewValue();
          if (!(newBackgr instanceof UIResource)) {
            getTitlePane().setBackground(newBackgr);
            frame.getDesktopIcon().setBackground(newBackgr);
          }
        }

        if ("ancestor".equals(evt.getPropertyName())) {
          // fix for issue 344 - reopening an internal frame
          // that has been closed.
          JDesktopIcon jdi = frame.getDesktopIcon();
          SubstanceDesktopIconUI ui = (SubstanceDesktopIconUI) jdi
              .getUI();
          ui.installIfNecessary(jdi);
        }
      }
    };
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

    JInternalFrame hostFrame = (JInternalFrame) SwingUtilities
        .getAncestorOfClass(JInternalFrame.class, this);
    JComponent hostForColorization = hostFrame;
    if (hostFrame == null) {
      // try desktop icon
      JDesktopIcon desktopIcon = (JDesktopIcon) SwingUtilities
          .getAncestorOfClass(JDesktopIcon.class, this);
      if (desktopIcon != null)
        hostFrame = desktopIcon.getInternalFrame();
      hostForColorization = desktopIcon;
    }
    // if ((hostFrame != null) && SubstanceCoreUtilities.hasColorization(
    // this)) {
    Color backgr = hostFrame.getBackground();
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

*/
final class JInternalFrameDesktopPaneQuery {

  @RunsInCurrentThread
  static JDesktopPane desktopPaneOf(final JInternalFrame internalFrame) {
    JDesktopIcon icon = internalFrame.getDesktopIcon();
    if (icon != null) return icon.getDesktopPane();
    return null;
  }
View Full Code Here

Examples of javax.swing.JInternalFrame.JDesktopIcon

  @RunsInCurrentThread
  private static Triple<Boolean, Container, Point> deiconifyInfo(JInternalFrame internalFrame) {
    boolean deiconified = !isIconified(internalFrame);
    if (deiconified) return new Triple<Boolean, Container, Point>(true, null, null);
    JDesktopIcon desktopIcon = internalFrame.getDesktopIcon();
    return new Triple<Boolean, Container, Point>(deiconified, desktopIcon, iconifyLocationOf(desktopIcon));
  }
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.