• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JDesktopIcon类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.swing.JInternalFrame.JDesktopIcon的典型用法代码示例。如果您正苦于以下问题:Java JDesktopIcon类的具体用法?Java JDesktopIcon怎么用?Java JDesktopIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JDesktopIcon类属于javax.swing.JInternalFrame包,在下文中一共展示了JDesktopIcon类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkComponent

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof JInternalFrame || comp instanceof JInternalFrame.JDesktopIcon) {
        JInternalFrame frame = null;
        if (comp instanceof JInternalFrame) {
            frame = (JInternalFrame) comp;
        } else {
            JDesktopIconOperator io = new JDesktopIconOperator((JInternalFrame.JDesktopIcon) comp);
            frame = io.getInternalFrame();
        }
        if (frame.getTitle() != null) {
            return (comparator.equals(frame.getTitle(),
                    label));
        }
    }
    return false;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:18,代码来源:JInternalFrameOperator.java


示例2: beginDraggingFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This method is called to indicate that the DesktopManager should prepare
 * to drag the JInternalFrame. Any state information needed to drag the
 * frame will be prepared now.
 *
 * @param component The JComponent to drag, usually a JInternalFrame.
 */
public void beginDraggingFrame(JComponent component)
{
  if (component instanceof JDesktopIcon)
    pane = ((JDesktopIcon) component).getInternalFrame().getDesktopPane();
  else
    pane = ((JInternalFrame) component).getDesktopPane();
  if (pane == null)
    return;

  dragCache = component.getBounds();

  if (! (pane instanceof JDesktopPane))
    currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
  else
    currentDragMode = ((JDesktopPane) pane).getDragMode();
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:DefaultDesktopManager.java


示例3: dragFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This method is called to drag the JInternalFrame to a new location.
 *
 * @param component The JComponent to drag, usually a JInternalFrame.
 *
 * @param newX The new x coordinate.
 * @param newY The new y coordinate.
 */
public void dragFrame(JComponent component, int newX, int newY)
{
  if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE)
    {
      // FIXME: Do outline drag mode painting.
    }
  else
    {
      Rectangle b = component.getBounds();
      if (component instanceof JDesktopIcon)
        component.setBounds(newX, newY, b.width, b.height);
      else
        setBoundsForFrame((JInternalFrame) component, newX, newY, b.width,
                          b.height);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:25,代码来源:DefaultDesktopManager.java


示例4: installUI

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This method installs the UI for the given JComponent.
 *
 * @param c The JComponent to install this UI for.
 */
public void installUI(JComponent c)
{
  if (c instanceof JDesktopIcon)
    {
      desktopIcon = (JDesktopIcon) c;
      desktopIcon.setLayout(new BorderLayout());
      frame = desktopIcon.getInternalFrame();

      installDefaults();
      installComponents();
      installListeners();

      desktopIcon.setOpaque(true);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:21,代码来源:BasicDesktopIconUI.java


示例5: installUI

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
  * This method installs the UI for the given JComponent.
  *
  * @param c The JComponent to install this UI for.
  */
 public void installUI(JComponent c)
 {
   if (c instanceof JDesktopIcon)
     {
desktopIcon = (JDesktopIcon) c;
desktopIcon.setLayout(new BorderLayout());
frame = desktopIcon.getInternalFrame();

installDefaults();
installComponents();
installListeners();

desktopIcon.setOpaque(true);
     }
 }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:21,代码来源:BasicDesktopIconUI.java


示例6: isInState

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public boolean isInState(JComponent c) {
    Component parent = c;

    while (parent.getParent() != null) {

        if (parent instanceof JInternalFrame || parent instanceof JDesktopIcon) {
            break;
        }

        parent = parent.getParent();
    }

    if (parent instanceof JInternalFrame) {
        return ((JInternalFrame) parent).isIcon();
    } else if (parent instanceof JDesktopIcon) {
        return true;
    }

    return false;
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:24,代码来源:TitlePaneIconifyButtonWindowMinimizedState.java


示例7: findJInternalFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Searches JInternalframe in container.
 *
 * @param cont Container to search component in.
 * @param chooser a component chooser specifying searching criteria.
 * @param index Ordinal component index.
 * @return JInternalframe instance or null if component was not found.
 */
public static JInternalFrame findJInternalFrame(Container cont, ComponentChooser chooser, int index) {
    Component res = findComponent(cont, new JInternalFrameFinder(chooser), index);
    if (res instanceof JInternalFrame) {
        return (JInternalFrame) res;
    } else if (res instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) res).getInternalFrame();
    } else {
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:JInternalFrameOperator.java


示例8: waitJInternalFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Waits JInternalframe in container.
 *
 * @param cont Container to search component in.
 * @param chooser a component chooser specifying searching criteria.
 * @param index Ordinal component index.
 * @return JInternalframe instance.
 *
 */
public static JInternalFrame waitJInternalFrame(final Container cont, final ComponentChooser chooser, final int index) {
    Component res = waitComponent(cont, new JInternalFrameFinder(chooser), index);
    if (res instanceof JInternalFrame) {
        return (JInternalFrame) res;
    } else if (res instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) res).getInternalFrame();
    } else {
        throw (new TimeoutExpiredException(chooser.getDescription()));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:JInternalFrameOperator.java


示例9: getDesktopIcon

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Maps {@code JInternalFrame.getDesktopIcon()} through queue
 */
public JDesktopIcon getDesktopIcon() {
    return (runMapping(new MapAction<JDesktopIcon>("getDesktopIcon") {
        @Override
        public JDesktopIcon map() {
            return ((JInternalFrame) getSource()).getDesktopIcon();
        }
    }));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JInternalFrameOperator.java


示例10: setDesktopIcon

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Maps {@code JInternalFrame.setDesktopIcon(JDesktopIcon)} through queue
 */
public void setDesktopIcon(final JDesktopIcon jDesktopIcon) {
    runMapping(new MapVoidAction("setDesktopIcon") {
        @Override
        public void map() {
            ((JInternalFrame) getSource()).setDesktopIcon(jDesktopIcon);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JInternalFrameOperator.java


示例11: findOne

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
private static JInternalFrame findOne(ContainerOperator<?> cont, String text, int index) {
    Component source = waitComponent(cont,
            new JInternalFrameByTitleFinder(text,
                    cont.getComparator()),
            index);
    if (source instanceof JInternalFrame) {
        return (JInternalFrame) source;
    } else if (source instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) source).getInternalFrame();
    } else {
        throw (new TimeoutExpiredException("No internal frame was found"));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JInternalFrameOperator.java


示例12: iconifyFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This method removes the JInternalFrame from its parent and adds its
 * JDesktopIcon representation.
 *
 * @param frame The JInternalFrame to iconify.
 */
public void iconifyFrame(JInternalFrame frame)
{
  JDesktopPane p = frame.getDesktopPane();
  JDesktopIcon icon = frame.getDesktopIcon();
  if (p != null && p.getSelectedFrame() == frame)
    p.setSelectedFrame(null);
  else
    {
      try
        {
          frame.setSelected(false);
        }
      catch (PropertyVetoException e)
        {
          // Do nothing if attempt is vetoed.
        }
    }

  Container c = frame.getParent();

  if (!wasIcon(frame))
    {
      Rectangle r = getBoundsForIconOf(frame);
      icon.setBounds(r);
      setWasIcon(frame, Boolean.TRUE);
    }

  if (c != null)
    {
      if (icon != null)
        {
          c.add(icon);
          icon.setVisible(true);
        }
      Rectangle b = frame.getBounds();
      c.remove(frame);
      c.repaint(b.x, b.y, b.width, b.height);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:46,代码来源:DefaultDesktopManager.java


示例13: deiconifyFrame

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This method removes the JInternalFrame's JDesktopIcon representation and
 * adds the JInternalFrame back to its parent.
 *
 * @param frame The JInternalFrame to deiconify.
 */
public void deiconifyFrame(JInternalFrame frame)
{
  JDesktopIcon icon = frame.getDesktopIcon();
  Container c = icon.getParent();

  removeIconFor(frame);
  c.add(frame);
  frame.setVisible(true);

  if (!frame.isSelected())
    {
      JDesktopPane p = frame.getDesktopPane();
      if (p != null)
        p.setSelectedFrame(frame);
      else
        {
          try
            {
              frame.setSelected(true);
            }
          catch (PropertyVetoException e)
            {
              // Do nothing.
            }
        }
    }

  c.invalidate();
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:DefaultDesktopManager.java


示例14: removeIconFor

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * This is a helper method that removes the JDesktopIcon of the given
 * JInternalFrame from the parent.
 *
 * @param frame The JInternalFrame to remove an icon for.
 */
protected void removeIconFor(JInternalFrame frame)
{
  JDesktopIcon icon = frame.getDesktopIcon();
  Container c = icon.getParent();
  if (c != null && icon != null)
    {
      Rectangle b = icon.getBounds();
      c.remove(icon);
      c.repaint(b.x, b.y, b.width, b.height);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:18,代码来源:DefaultDesktopManager.java


示例15: iifDesktopIcon

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
protected JDesktopIcon iifDesktopIcon(Object aSource) {
    Component lparent = null;
    if (aSource instanceof Component) {
        lparent = (Component) aSource;
        while (lparent != null && !(lparent instanceof JDesktopIcon)) {
            lparent = lparent.getParent();
        }
        if (lparent != null) {
            return (JDesktopIcon) lparent;
        }
    }
    return null;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:14,代码来源:JScalablePanel.java


示例16: installIfNecessary

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Installs the UI delegate on the desktop icon if necessary.
 * 
 * @param jdi
 *            Desktop icon.
 */
public void installIfNecessary(JDesktopIcon jdi) {
	// fix for issue 344 - reopening an internal frame
	// that has been closed.
	if (this.desktopIcon == null) {
		this.installUI(jdi);
	}
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:14,代码来源:SubstanceDesktopIconUI.java


示例17: uninstallIfNecessary

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
/**
 * Uninstalls the UI delegate from the desktop icon if necessary.
 * 
 * @param jdi
 *            Desktop icon.
 */
public void uninstallIfNecessary(JDesktopIcon jdi) {
	// fix for issue 345 - an internal frame used in inner option pane
	// gets closed twice
	if (this.desktopIcon == jdi) {
		this.uninstallUI(jdi);
	}
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:14,代码来源:SubstanceDesktopIconUI.java


示例18: installListeners

import javax.swing.JInternalFrame.JDesktopIcon; //导入依赖的package包/类
@Override
protected void installListeners() {
	super.installListeners();
	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);
			}
		}
	};
	this.frame.addPropertyChangeListener(this.substancePropertyListener);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:35,代码来源:SubstanceInternalFrameUI.java



注:本文中的javax.swing.JInternalFrame.JDesktopIcon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockReceivedAndDeletedResponseProto类代码示例发布时间:2022-05-22
下一篇:
Java SheepDyeWoolEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap