javax.swing.JInternalFrame.getDesktopIcon()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中javax.swing.JInternalFrame.getDesktopIcon()方法的一些代码示例,展示了JInternalFrame.getDesktopIcon()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JInternalFrame.getDesktopIcon()方法的具体详情如下:
包路径:javax.swing.JInternalFrame
类名称:JInternalFrame
方法名:getDesktopIcon

JInternalFrame.getDesktopIcon介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

@Override
public void iconifyFrame(JInternalFrame f) {
  super.iconifyFrame(f);
  if (f instanceof CardInfoWindowDialog) {
    JInternalFrame.JDesktopIcon icon = f.getDesktopIcon();
    icon.setBounds(f.getX() + (f.getWidth() - DESKTOP_ICON_WIDTH), f.getY(), DESKTOP_ICON_WIDTH, icon.getHeight());
  }
}

代码示例来源:origin: magefree/mage

@Override
public void deiconifyFrame(JInternalFrame f) {
  super.deiconifyFrame(f);
  if (f instanceof CardInfoWindowDialog) {
    JInternalFrame.JDesktopIcon icon = f.getDesktopIcon();
    f.setBounds(icon.getX() + (DESKTOP_ICON_WIDTH - f.getWidth()), icon.getY(), f.getWidth(), f.getHeight());
  }
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void openFrame(JInternalFrame f) {
  if (f.getDesktopIcon().getParent() != null) {
    f.getDesktopIcon().getParent().add(f);
    removeIconFor(f);
  }
}

代码示例来源:origin: abbot/abbot

public Container getParent(Component c) {
    // This call appears to be fairly thread safe
    Container p = c.getParent();
    if (p == null && c instanceof JInternalFrame) {
      // workaround for bug in JInternalFrame: COMPONENT_HIDDEN is sent
      // before the desktop icon is set, so
      // JInternalFrame.getDesktopPane will throw a NPE if called while
      // dispatching that event.  Reported against 1.4.x.
      JInternalFrame.JDesktopIcon icon =
        ((JInternalFrame)c).getDesktopIcon();
      if (icon != null) {
        p = icon.getDesktopPane();
      }
      // p = ((JInternalFrame)c).getDesktopPane();
    }
    return p;
  }
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
static @Nullable JDesktopPane desktopPaneOf(@Nonnull JInternalFrame internalFrame) {
 JDesktopIcon icon = internalFrame.getDesktopIcon();
 if (icon != null) {
  return icon.getDesktopPane();
 }
 return null;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void openFrame(JInternalFrame _f)
{
 if(DEBUG) FuLog.debug("BDM: openFrame()");
 desktop_.add(_f);
 desktop_.remove(_f.getDesktopIcon());
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

public boolean isInternalFrameVisible() {
  return surface instanceof JInternalFrame && (surface.isVisible() || ((JInternalFrame) surface).getDesktopIcon().isVisible());
}

代码示例来源:origin: joel-costigliola/assertj-swing

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

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void deiconifyFrame(JInternalFrame _f)
{
 if(DEBUG) FuLog.debug("BDM: deiconifyFrame()");
 desktop_.remove(_f.getDesktopIcon());
 desktop_.add(_f);
 //if(_f.isSelected()) _f.moveToFront();
 //try { _f.setSelected(true); }
 //catch (PropertyVetoException ex) { }
 activateFrame(_f);
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
@Nonnull private static Pair<Container, Point> findMaximizeLocation(@Nonnull JInternalFrame internalFrame) {
 Container clickTarget = internalFrame.isIcon() ? internalFrame.getDesktopIcon() : internalFrame;
 Point location = maximizeButtonLocation(checkNotNull(clickTarget));
 return Pair.of(clickTarget, location);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

protected Rectangle getBoundsForIconOf(JInternalFrame _f)
{
 JInternalFrame.JDesktopIcon icon=_f.getDesktopIcon();
 Dimension                   ps  =icon.getPreferredSize();
 return new Rectangle
  (_f.getX()+_f.getWidth()-ps.width,_f.getY(),ps.width,ps.height);
}

代码示例来源:origin: org.java.net.substance/substance

void setWindowModified(boolean isWindowModified) {
    titlePane.getCloseButton().putClientProperty(
        SubstanceLookAndFeel.WINDOW_MODIFIED,
        Boolean.valueOf(isWindowModified));

    SubstanceDesktopIconUI desktopIconUi = (SubstanceDesktopIconUI) this.frame
        .getDesktopIcon().getUI();
    desktopIconUi.setWindowModified(isWindowModified);
  }
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
@Nonnull private static Triple<Boolean, Container, Point> deiconifyInfo(@Nonnull JInternalFrame internalFrame) {
 boolean deiconified = !isIconified(internalFrame);
 if (deiconified) {
  return Triple.of(true, null, null);
 }
 Container desktopIcon = checkNotNull(internalFrame.getDesktopIcon());
 return Triple.of(deiconified, desktopIcon, iconifyButtonLocation(desktopIcon));
}

代码示例来源:origin: khuxtable/seaglass

public void componentHidden(ComponentEvent e) {
  if (e.getSource() instanceof JInternalFrame) {
    ((JInternalFrame) e.getSource()).getDesktopIcon().setVisible(false);
    revalidate();
  }
}

代码示例来源:origin: com.github.insubstantial/substance

void setWindowModified(boolean isWindowModified) {
    titlePane.getCloseButton().putClientProperty(
        SubstanceLookAndFeel.WINDOW_MODIFIED,
        isWindowModified);

    SubstanceDesktopIconUI desktopIconUi = (SubstanceDesktopIconUI) this.frame
        .getDesktopIcon().getUI();
    desktopIconUi.setWindowModified(isWindowModified);
  }
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void removeIconFor(JInternalFrame f) {
  JInternalFrame.JDesktopIcon di = f.getDesktopIcon();
  Container c = di.getParent();
  if (c != null) {
    c.remove(di);
    c.repaint(di.getX(), di.getY(), di.getWidth(), di.getHeight());
  }
}

代码示例来源:origin: khuxtable/seaglass

/**
 * Uninstall the defaults.
 */
public void uninstallDefaults() {
  SeaGlassContext context = getContext(this, ENABLED);
  style.uninstallDefaults(context);
  context.dispose();
  style = null;
  JInternalFrame.JDesktopIcon di = frame.getDesktopIcon();
  if (di != null && di.getComponentPopupMenu() == systemPopupMenu) {
    // Release link to systemMenu from the JInternalFrame
    di.setComponentPopupMenu(null);
  }
}

代码示例来源:origin: khuxtable/seaglass

public void componentRemoved(ContainerEvent e) {
    if (e.getChild() instanceof JInternalFrame) {
      JInternalFrame f = (JInternalFrame) e.getChild();
      if (!f.isIcon()) {
        // Frame was removed without using setClosed(true)
        remove(f.getDesktopIcon());
        f.removeComponentListener(this);
        revalidate();
        repaint();
      }
    }
  }
}

代码示例来源:origin: khuxtable/seaglass

public void componentAdded(ContainerEvent e) {
  if (e.getChild() instanceof JInternalFrame) {
    JInternalFrame f = (JInternalFrame) e.getChild();
    JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon();
    for (Component comp : getComponents()) {
      if (comp == desktopIcon) {
        // We have it already
        return;
      }
    }
    add(desktopIcon);
    f.addComponentListener(this);
    if (getComponentCount() == 1) {
      adjustSize();
    }
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void closeFrame(JInternalFrame _f)
{
 if(DEBUG) FuLog.debug("BDM: closeFrame()");
 //if(DEBUG) FuLog.printStackTrace();
 boolean selected=_f.isSelected();
 if(selected)
 {
  try { _f.setSelected(false); }
  catch (PropertyVetoException ex) { }
 }
 desktop_.remove(_f);
 desktop_.remove(_f.getDesktopIcon());
 /*GCJ-BEGIN*/
 if(BuLib.swing()>=1.2)
 {
  if(_f.getNormalBounds()!=null)
   _f.setNormalBounds(null);
 }
 /*GCJ-END*/
 if(wasIcon(_f))
  setWasIcon(_f,null);
 if(selected) activateNextFrame();
}

相关文章

JInternalFrame类方法