模块 java.desktop

类 BasicInternalFrameTitlePane

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.plaf.basic.BasicInternalFrameTitlePane
所有已实现的接口:
ImageObserver , MenuContainer , Serializable
已知子类:
MetalInternalFrameTitlePane

public class BasicInternalFrameTitlePane extends JComponent
管理基本标题栏的类

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

  • 字段详细信息

    • iconButton

      protected JButton  iconButton
      图标化按钮。
    • maxButton

      protected JButton  maxButton
      最大化按钮。
    • closeButton

      protected JButton  closeButton
      关闭按钮。
    • windowMenu

      protected JMenu  windowMenu
      JMenu 的实例。
    • frame

      protected JInternalFrame  frame
      JInternalFrame 的实例。
    • selectedTitleColor

      protected Color  selectedTitleColor
      所选标题的颜色。
    • selectedTextColor

      protected Color  selectedTextColor
      所选文本的颜色。
    • notSelectedTitleColor

      protected Color  notSelectedTitleColor
      未选中标题的颜色。
    • notSelectedTextColor

      protected Color  notSelectedTextColor
      未选中文本的颜色。
    • maxIcon

      protected Icon  maxIcon
      最大化图标。
    • minIcon

      protected Icon  minIcon
      最小化图标。
    • iconIcon

      protected Icon  iconIcon
      图标化图标。
    • closeIcon

      protected Icon  closeIcon
      关闭图标。
    • propertyChangeListener

      protected PropertyChangeListener  propertyChangeListener
      PropertyChangeListener 的实例。
    • closeAction

      protected Action  closeAction
      CloseAction 的实例。
    • maximizeAction

      protected Action  maximizeAction
      MaximizeAction 的实例。
    • iconifyAction

      protected Action  iconifyAction
      IconifyAction 的实例。
    • restoreAction

      protected Action  restoreAction
      RestoreAction 的实例。
    • moveAction

      protected Action  moveAction
      MoveAction 的实例。
    • sizeAction

      protected Action  sizeAction
      SizeAction 的实例。
    • CLOSE_CMD

      protected static final String  CLOSE_CMD
      关闭按钮文本属性。
    • ICONIFY_CMD

      protected static final String  ICONIFY_CMD
      最小化按钮文本属性。
    • RESTORE_CMD

      protected static final String  RESTORE_CMD
      恢复按钮文本属性。
    • MAXIMIZE_CMD

      protected static final String  MAXIMIZE_CMD
      最大化按钮文本属性。
    • MOVE_CMD

      protected static final String  MOVE_CMD
      移动按钮文本属性。
    • SIZE_CMD

      protected static final String  SIZE_CMD
      大小按钮文本属性。
  • 构造方法详细信息

    • BasicInternalFrameTitlePane

      public BasicInternalFrameTitlePane(JInternalFrame  f)
      构造一个 BasicInternalFrameTitlePane 新实例
      参数:
      f - JInternalFrame 的实例
  • 方法详情

    • installTitlePane

      protected void installTitlePane()
      安装标题窗格。
    • addSubComponents

      protected void addSubComponents()
      添加子组件。
    • createActions

      protected void createActions()
      创建动作。
    • installListeners

      protected void installListeners()
      注册听众。
    • uninstallListeners

      protected void uninstallListeners()
      注销听众。
    • installDefaults

      protected void installDefaults()
      安装默认属性。
    • uninstallDefaults

      protected void uninstallDefaults()
      卸载默认属性。
    • createButtons

      protected void createButtons()
      创建按钮。
    • setButtonIcons

      protected void setButtonIcons()
      设置按钮图标。
    • assembleSystemMenu

      protected void assembleSystemMenu()
      组装系统菜单。
    • addSystemMenuItems

      protected void addSystemMenuItems(JMenu  systemMenu)
      将系统菜单项添加到 systemMenu
      参数:
      systemMenu - JMenu 的实例
    • createSystemMenu

      protected JMenu  createSystemMenu()
      返回 JMenu 的新实例。
      返回:
      JMenu 的新实例
    • createSystemMenuBar

      protected JMenuBar  createSystemMenuBar()
      返回 JMenuBar 的新实例。
      返回:
      JMenuBar 的新实例
    • showSystemMenu

      protected void showSystemMenu()
      显示系统菜单。
    • paintComponent

      public void paintComponent(Graphics  g)
      从类复制的描述:JComponent
      如果 UI 委托是非 null ,则调用 UI 委托的绘制方法。我们将 Graphics 对象的副本传递给委托,以保护其余的绘制代码免受不可撤销的更改(例如, Graphics.translate )。

      如果您在子类中重写它,则不应对传入的 Graphics 进行永久更改。例如,您不应更改剪辑 Rectangle 或修改变换。如果您需要执行这些操作,您可能会发现从传入的 Graphics 创建一个新的 Graphics 并对其进行操作会更容易。此外,如果您不调用 super 的实现,则必须遵守不透明属性,也就是说,如果此组件是不透明的,则必须用不透明的颜色完全填充背景。如果您不尊重不透明属性,您可能会看到视觉伪影。

      传入的 Graphics 对象可能具有安装在其上的识别转换以外的转换。在这种情况下,如果您累积应用另一个转换,您可能会得到意想不到的结果。

      重写:
      paintComponent 在类 JComponent
      参数:
      g - 要保护的 Graphics 对象
      参见:
    • paintTitleBackground

      protected void paintTitleBackground(Graphics  g)
      从 paintComponent 调用。绘制标题窗格的背景。然后所有文本和图标都将在此背景之上呈现。
      参数:
      g - 用于渲染背景的图形
      自从:
      1.4
    • getTitle

      protected String  getTitle(String  text, FontMetrics  fm, int availTextWidth)
      返回标题。
      参数:
      text - 一段文字
      fm - FontMetrics 的实例
      availTextWidth - 可用的文本宽度
      返回:
      标题。
    • postClosingEvent

      protected void postClosingEvent(JInternalFrame  frame)
      将类似 WINDOW_CLOSING 的事件发布到框架,以便可以将其视为常规 Frame
      参数:
      frame - JInternalFrame 的实例
    • enableActions

      protected void enableActions()
      启用操作。
    • createPropertyChangeListener

      protected PropertyChangeListener  createPropertyChangeListener()
      返回 PropertyChangeListener 的实例。
      返回:
      PropertyChangeListener 的实例
    • createLayout

      protected LayoutManager  createLayout()
      返回布局管理器。
      返回:
      布局管理器