- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.plaf.basic.BasicInternalFrameTitlePane
-
- All Implemented Interfaces:
-
ImageObserver
,MenuContainer
,Serializable
- 已知直接子类:
-
MetalInternalFrameTitlePane
public class BasicInternalFrameTitlePane extends JComponent
管理基本标题栏的类警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已被添加到
java.beans
包中。 请参阅XMLEncoder
。- 另请参见:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 描述 class
BasicInternalFrameTitlePane.CloseAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.IconifyAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.MaximizeAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.MoveAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.PropertyChangeHandler
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.RestoreAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.SizeAction
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.SystemMenuBar
这个类应该被视为一个“受保护”的内部类。class
BasicInternalFrameTitlePane.TitlePaneLayout
这个类应该被视为一个“受保护”的内部类。-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field 描述 protected static String
CLOSE_CMD
关闭按钮文本属性。protected Action
closeAction
一个CloseAction
的实例。protected JButton
closeButton
关闭按钮。protected Icon
closeIcon
关闭图标。protected JInternalFrame
frame
实例JInternalFrame
。protected JButton
iconButton
图标按钮。protected Icon
iconIcon
图标图标。protected static String
ICONIFY_CMD
最小化按钮文本属性。protected Action
iconifyAction
一个IconifyAction
的实例。protected JButton
maxButton
最大化按钮。protected Icon
maxIcon
最大化图标。protected static String
MAXIMIZE_CMD
最大化按钮文本属性。protected Action
maximizeAction
一个MaximizeAction
。protected JMenuBar
menuBar
实例JMenuBar
。protected Icon
minIcon
最小化图标。protected static String
MOVE_CMD
移动按钮文本属性。protected Action
moveAction
一个MoveAction
的实例。protected Color
notSelectedTextColor
未选择文字的颜色。protected Color
notSelectedTitleColor
未选择标题的颜色。protected PropertyChangeListener
propertyChangeListener
一个PropertyChangeListener
的实例。protected static String
RESTORE_CMD
还原按钮文本属性。protected Action
restoreAction
一个RestoreAction
。protected Color
selectedTextColor
所选文字的颜色。protected Color
selectedTitleColor
所选标题的颜色。protected static String
SIZE_CMD
大小按钮文本属性。protected Action
sizeAction
一个SizeAction
的实例。protected JMenu
windowMenu
实例JMenu
。-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
构造方法摘要
构造方法 Constructor 描述 BasicInternalFrameTitlePane(JInternalFrame f)
构造一个新的实例BasicInternalFrameTitlePane
。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected void
addSubComponents()
添加子组件。protected void
addSystemMenuItems(JMenu systemMenu)
将系统菜单项添加到systemMenu
。protected void
assembleSystemMenu()
组装系统菜单。protected void
createActions()
创建动作。protected void
createButtons()
创建按钮。protected LayoutManager
createLayout()
返回布局管理器。protected PropertyChangeListener
createPropertyChangeListener()
返回一个PropertyChangeListener
的实例。protected JMenu
createSystemMenu()
返回一个新的实例JMenu
。protected JMenuBar
createSystemMenuBar()
返回一个新的实例JMenuBar
。protected void
enableActions()
启用动作。protected String
getTitle(String text, FontMetrics fm, int availTextWidth)
返回标题。protected void
installDefaults()
安装默认属性。protected void
installListeners()
注册听众。protected void
installTitlePane()
安装标题窗格。void
paintComponent(Graphics g)
调用UInull
的paint方法,如果UInull
。protected void
paintTitleBackground(Graphics g)
从paintComponent调用。protected void
postClosingEvent(JInternalFrame frame)
发布类似WINDOW_CLOSING的事件到框架,这样它可以像普通的Frame
一样Frame
。protected void
setButtonIcons()
设置按钮图标。protected void
showSystemMenu()
显示系统菜单。protected void
uninstallDefaults()
卸载默认属性。protected void
uninstallListeners()
取消注册听众。-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
-
-
-
字段详细信息
-
menuBar
protected JMenuBar menuBar
实例JMenuBar
。
-
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
调用UInull
的paint方法,如果UInull
。 我们通过委托一份Graphics
对象的副本,以保护其他油漆代码免受不可撤销的更改(例如,Graphics.translate
)。如果你在一个子类中重写这个,你不应该对
Graphics
的传递进行永久的更改。 例如,您不应该更改剪辑Rectangle
或修改转换。 如果您需要执行这些操作,您可能会发现从Graphics
中传递的操作更容易创建一个新的Graphics
并进行操作。 此外,如果您不调用super的实现,则必须遵守不透明属性,即如果此组件不透明,则必须以非不透明颜色完全填写背景。 如果您不遵守不透明属性,您将可能会看到视觉工件。在
Graphics
对象中传递的对象可能具有除了安装在其上的标识变换之外的变换。 在这种情况下,如果累积应用另一个变换,您可能会得到意想不到的结果。- 重写:
-
paintComponent
在JComponent
- 参数
-
g
- 要保护的Graphics
对象 - 另请参见:
-
JComponent.paint(java.awt.Graphics)
,ComponentUI
-
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
。- 参数
-
frame
-实例JInternalFrame
-
enableActions
protected void enableActions()
启用动作。
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
返回一个PropertyChangeListener
的实例。- 结果
-
一个
PropertyChangeListener
-
createLayout
protected LayoutManager createLayout()
返回布局管理器。- 结果
- 布局管理器
-
-