- 所有已实现的接口:
-
ImageObserver
,MenuContainer
,Serializable
- 直接已知的子类:
-
MetalInternalFrameTitlePane
警告: 该类的序列化对象将不兼容未来的Swing版本。当前的序列化支持适用于短期存储或在运行相同Swing版本的应用程序之间的RMI。从1.4开始,已向java.beans
包添加了对所有JavaBeans的长期存储支持。请参阅XMLEncoder
。
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。class
应将此类视为“protected”内部类。Nested classes/interfaces declared in class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces declared in class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces declared in class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
关闭按钮文本属性。protected Action
CloseAction
的实例。protected JButton
关闭按钮。protected Icon
关闭图标。protected JInternalFrame
JInternalFrame
的实例。protected JButton
最小化按钮。protected Icon
最小化图标。protected static final String
最小化按钮文本属性。protected Action
IconifyAction
的实例。protected JButton
最大化按钮。protected Icon
最大化图标。protected static final String
最大化按钮文本属性。protected Action
MaximizeAction
的实例。protected JMenuBar
JMenuBar
的实例。protected Icon
最小化图标。protected static final String
移动按钮文本属性。protected Action
MoveAction
的实例。protected Color
未选中文本的颜色。protected Color
未选中标题的颜色。protected PropertyChangeListener
PropertyChangeListener
的实例。protected static final String
还原按钮文本属性。protected Action
RestoreAction
的实例。protected Color
选中文本的颜色。protected Color
选中标题的颜色。protected static final String
大小按钮文本属性。protected Action
SizeAction
的实例。protected JMenu
JMenu
的实例。Fields declared in class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields declared in class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields declared in interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorDescription构造一个新的BasicInternalFrameTitlePane
实例。 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
添加子组件。protected void
addSystemMenuItems
(JMenu systemMenu) 将系统菜单项添加到systemMenu
。protected void
组装系统菜单。protected void
创建操作。protected void
创建按钮。protected LayoutManager
返回布局管理器。protected PropertyChangeListener
返回PropertyChangeListener
的实例。protected JMenu
返回一个新的JMenu
实例。protected JMenuBar
返回一个新的JMenuBar
实例。protected void
启用操作。protected String
getTitle
(String text, FontMetrics fm, int availTextWidth) 返回标题。protected void
安装默认属性。protected void
注册监听器。protected void
安装标题栏。void
调用UI代理的绘制方法,如果UI代理不为非null
。如果您在子类中重写此方法,不应对传入的Graphics
进行永久更改。例如,不应更改剪辑Rectangle
或修改变换。如果需要执行这些操作,可能更容易创建一个新的Graphics
,并从传入的Graphics
进行操作。此外,如果不调用super的实现,则必须遵守opaque属性,即如果此组件是不透明的,则必须完全用不透明颜色填充背景。如果不遵守opaque属性,可能会看到视觉伪影。传入的
Graphics
对象可能具有除标识变换之外的其他变换。在这种情况下,如果累积应用另一个变换,则可能会得到意外结果。protected void
Invoked from paintComponent.protected void
postClosingEvent
(JInternalFrame frame) Post a WINDOW_CLOSING-like event to the frame, so that it can be treated like a regularFrame
.protected void
Sets the button icons.protected void
Shows system menu.protected void
Uninstalls default properties.protected void
Unregisters listeners.Methods declared in class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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
Methods declared in 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 declared in 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, 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
-
Field Details
-
iconButton
The iconify button. -
maxButton
The maximize button. -
closeButton
The close button. -
windowMenu
The instance ofJMenu
. -
frame
The instance ofJInternalFrame
. -
selectedTitleColor
The color of a selected title. -
selectedTextColor
The color of a selected text. -
notSelectedTitleColor
The color of a not selected title. -
notSelectedTextColor
The color of a not selected text. -
maxIcon
The maximize icon. -
minIcon
The minimize icon. -
iconIcon
The iconify icon. -
closeIcon
The close icon. -
propertyChangeListener
The instance of aPropertyChangeListener
. -
closeAction
The instance of aCloseAction
. -
maximizeAction
The instance of aMaximizeAction
. -
iconifyAction
The instance of anIconifyAction
. -
restoreAction
The instance of aRestoreAction
. -
moveAction
The instance of aMoveAction
. -
sizeAction
The instance of aSizeAction
. -
CLOSE_CMD
The close button text property. -
ICONIFY_CMD
The minimize button text property. -
RESTORE_CMD
The restore button text property. -
MAXIMIZE_CMD
The maximize button text property. -
MOVE_CMD
The move button text property. -
SIZE_CMD
The size button text property.
-
Constructor Details
-
BasicInternalFrameTitlePane
Constructs a new instance ofBasicInternalFrameTitlePane
.- Parameters:
-
f
- an instance ofJInternalFrame
-
-
Method Details
-
installTitlePane
protected void installTitlePane()Installs the title pane. -
addSubComponents
protected void addSubComponents()Adds subcomponents. -
createActions
protected void createActions()Creates actions. -
installListeners
protected void installListeners()Registers listeners. -
uninstallListeners
protected void uninstallListeners()Unregisters listeners. -
installDefaults
protected void installDefaults()Installs default properties. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls default properties. -
createButtons
protected void createButtons()Creates buttons. -
setButtonIcons
protected void setButtonIcons()Sets the button icons. -
assembleSystemMenu
protected void assembleSystemMenu()Assembles system menu. -
addSystemMenuItems
Adds system menu items tosystemMenu
.- Parameters:
-
systemMenu
- an instance ofJMenu
-
createSystemMenu
Returns a new instance ofJMenu
.- Returns:
-
a new instance of
JMenu
-
createSystemMenuBar
Returns a new instance ofJMenuBar
.- Returns:
-
a new instance of
JMenuBar
-
showSystemMenu
protected void showSystemMenu()Shows system menu. -
paintComponent
Description copied from class:JComponent
Calls the UI delegate's paint method, if the UI delegate is non-null
. We pass the delegate a copy of theGraphics
object to protect the rest of the paint code from irrevocable changes (for example,Graphics.translate
).If you override this in a subclass you should not make permanent changes to the passed in
Graphics
. For example, you should not alter the clipRectangle
or modify the transform. If you need to do these operations you may find it easier to create a newGraphics
from the passed inGraphics
and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.The passed in
Graphics
object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.- 覆盖:
-
paintComponent
在类JComponent
中 - 参数:
-
g
- 要保护的Graphics
对象 - 参见:
-
paintTitleBackground
从paintComponent调用。绘制标题栏的背景。然后所有文本和图标将在此背景上渲染。- 参数:
-
g
- 用于渲染背景的图形 - 自1.4起:
- 1.4
-
getTitle
返回标题。- 参数:
-
text
- 一个文本 -
fm
-FontMetrics
的实例 -
availTextWidth
- 可用文本宽度 - 返回:
- 标题。
-
postClosingEvent
发送类似WINDOW_CLOSING的事件到框架,以便它可以像常规Frame
一样处理。- 参数:
-
frame
-JInternalFrame
的实例
-
enableActions
protected void enableActions()启用操作。 -
createPropertyChangeListener
返回PropertyChangeListener
的实例。- 返回:
-
PropertyChangeListener
的实例
-
createLayout
返回布局管理器。- 返回:
- 一个布局管理器
-