Module java.desktop
Package javax.swing

Class DefaultDesktopManager

java.lang.Object
javax.swing.DefaultDesktopManager
所有已实现的接口:
Serializable, DesktopManager

public class DefaultDesktopManager extends Object implements DesktopManager, Serializable
这是DesktopManager的一个实现。它目前实现了在任意父级中管理JInternalFrame的基本行为。不是JDesktop的子级的JInternalFrame将使用此组件来处理其类似桌面的操作。

此类为各种JInternalFrame方法提供了一个策略,不应直接调用它,而是各种JInternalFrame方法将调用DesktopManager。

自:
1.2
参见:
  • Constructor Details

    • DefaultDesktopManager

      public DefaultDesktopManager()
      构造一个DefaultDesktopManager
  • Method Details

    • openFrame

      public void openFrame(JInternalFrame f)
      通常不会调用此方法。如果调用了该方法,则尝试从框架的desktopIcon确定适当的父级。如果成功添加框架,则将从其父级中删除desktopIcon
      指定者:
      openFrame 在接口 DesktopManager
      参数:
      f - 要显示的JInternalFrame
    • closeFrame

      public void closeFrame(JInternalFrame f)
      从其父级中删除框架,如果需要,还会删除desktopIcon
      指定者:
      closeFrame 在接口 DesktopManager
      参数:
      f - 要移除的JInternalFrame
    • maximizeFrame

      public void maximizeFrame(JInternalFrame f)
      将框架调整大小以填充其父级的边界。
      指定者:
      maximizeFrame 在接口 DesktopManager
      参数:
      f - 要调整大小的框架
    • minimizeFrame

      public void minimizeFrame(JInternalFrame f)
      将框架恢复到调用maximizeFrame之前的大小和位置。
      指定者:
      minimizeFrame 在接口 DesktopManager
      参数:
      f - 要恢复的JInternalFrame
    • iconifyFrame

      public void iconifyFrame(JInternalFrame f)
      从其父级中删除框架并将其desktopIcon添加到父级。
      指定者:
      iconifyFrame 在接口 DesktopManager
      参数:
      f - 要图标化的JInternalFrame
    • deiconifyFrame

      public void deiconifyFrame(JInternalFrame f)
      从其父级中删除desktopIcon并将其框架添加到父级。
      指定者:
      deiconifyFrame 在接口 DesktopManager
      参数:
      f - 要取消图标化的JInternalFrame
    • activateFrame

      public void activateFrame(JInternalFrame f)
      这将激活f并将其移至最前面。它将设置当前活动框架(如果有)的IS_SELECTED_PROPERTYfalse。在所有层中只能有一个活动框架。
      指定者:
      activateFrame 在接口 DesktopManager
      参数:
      f - 要激活的JInternalFrame
    • deactivateFrame

      public void deactivateFrame(JInternalFrame f)
      从接口复制的描述: DesktopManager
      通常表示此框架已失去焦点。通常在将JInternalFrame的IS_SELECTED_PROPERTY设置为false后调用此方法。
      指定者:
      deactivateFrame 在接口 DesktopManager
      参数:
      f - 要取消激活的JInternalFrame
    • beginDraggingFrame

      public void beginDraggingFrame(JComponent f)
      从接口复制的描述: DesktopManager
      通常在用户指示将开始拖动组件时调用此方法。在调用任何dragFrame()调用之前应调用此方法,以允许DesktopManager准备任何必要的状态。通常f将是一个JInternalFrame。
      指定者:
      beginDraggingFrame 在接口 DesktopManager
      参数:
      f - 正在拖动的JComponent
    • dragFrame

      public void dragFrame(JComponent f, int newX, int newY)
      将正在拖动的框架的可见位置移动到指定位置。这发生的方式可能因使用的拖动算法而异。直到调用endDraggingFrame之前,框架的实际逻辑位置可能不会改变。
      指定者:
      dragFrame 在接口 DesktopManager
      参数:
      f - 正在拖动的JComponent
      newX - 新的x坐标
      newY - 新的y坐标
    • endDraggingFrame

      public void endDraggingFrame(JComponent f)
      从接口复制的描述: DesktopManager
      此方法表示拖动会话的结束。DesktopManager可以在此处删除任何维护的状态。通常f将是一个JInternalFrame。
      指定者:
      endDraggingFrame 在接口 DesktopManager
      参数:
      f - 正在拖动的JComponent
    • beginResizingFrame

      public void beginResizingFrame(JComponent f, int direction)
      从接口复制的描述: DesktopManager
      通常在用户指示将开始调整大小框架时调用此方法。在调用任何resizeFrame()调用之前应调用此方法,以允许DesktopManager准备任何必要的状态。通常f将是一个JInternalFrame。
      指定者:
      beginResizingFrame 在接口 DesktopManager
      参数:
      f - 正在调整大小的JComponent
      direction - 方向
    • resizeFrame

      public void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
      使用新值调用setBoundsForFrame
      指定者:
      resizeFrame 在接口 DesktopManager中指定
      参数:
      f - 要调整大小的组件
      newX - 新的x坐标
      newY - 新的y坐标
      newWidth - 新的宽度
      newHeight - 新的高度
    • endResizingFrame

      public void endResizingFrame(JComponent f)
      从接口复制的描述: DesktopManager
      此方法表示调整大小会话的结束。DesktopManager维护的任何状态都可以在此处移除。通常 f 将是一个 JInternalFrame。
      指定者:
      endResizingFrame 在接口 DesktopManager中指定
      参数:
      f - 正在调整大小的 JComponent
    • setBoundsForFrame

      public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
      移动 JComponent 并重绘受损区域。
      指定者:
      setBoundsForFrame 在接口 DesktopManager中指定
      参数:
      f - 正在移动或调整大小的 JComponent
      newX - 新的x坐标
      newY - 新的y坐标
      newWidth - 新的宽度
      newHeight - 新的高度
    • removeIconFor

      protected void removeIconFor(JInternalFrame f)
      如果需要,方便地移除 f 的 desktopIcon。
      参数:
      f - 要移除 desktopIconJInternalFrame
    • getBoundsForIconOf

      protected Rectangle getBoundsForIconOf(JInternalFrame f)
      iconifyFrame() 代码调用此方法来确定 desktopIcon 的适当边界。
      参数:
      f - 感兴趣的 JInternalFrame
      返回:
      包含 desktopIcon 边界的 Rectangle
    • setPreviousBounds

      protected void setPreviousBounds(JInternalFrame f, Rectangle r)
      存储在最大化调用之前组件的边界。
      参数:
      f - 即将调整大小的组件
      r - 要保存的正常边界
    • getPreviousBounds

      protected Rectangle getPreviousBounds(JInternalFrame f)
      获取组件在最大化之前的正常边界。
      参数:
      f - 感兴趣的 JInternalFrame
      返回:
      组件的正常边界
    • setWasIcon

      protected void setWasIcon(JInternalFrame f, Boolean value)
      设置组件已被图标化,并且 desktopIcon 的边界有效。
      参数:
      f - 感兴趣的 JInternalFrame
      value - 表示组件是否已被图标化的 Boolean
    • wasIcon

      protected boolean wasIcon(JInternalFrame f)
      如果组件已被图标化且 desktopIcon 的边界有效,则返回 true,否则返回 false
      参数:
      f - 感兴趣的 JInternalFrame
      返回:
      如果组件已被图标化,则返回 true;否则返回 false