Class FlatTitlePane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.formdev.flatlaf.ui.FlatTitlePane
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Provides the Flat LaF title bar.
- See Also:
- UiDefault:
- TitlePane.font Font, TitlePane.background Color, TitlePane.inactiveBackground Color, TitlePane.foreground Color, TitlePane.inactiveForeground Color, TitlePane.embeddedForeground Color, TitlePane.borderColor Color optional, TitlePane.unifiedBackground boolean, TitlePane.showIcon boolean, TitlePane.showIconInDialogs boolean, TitlePane.noIconLeftGap int, TitlePane.iconSize Dimension, TitlePane.iconMargins Insets, TitlePane.titleMargins Insets, TitlePane.titleMinimumWidth int, TitlePane.buttonMinimumWidth int, TitlePane.buttonMaximizedHeight int, TitlePane.buttonsGap int, TitlePane.buttonsMargins Insets, TitlePane.buttonsFillVertically boolean, TitlePane.centerTitle boolean, TitlePane.centerTitleIfMenuBarEmbedded boolean, TitlePane.showIconBesideTitle boolean, TitlePane.menuBarEmbedded boolean, TitlePane.menuBarTitleGap int, TitlePane.menuBarTitleMinimumGap int, TitlePane.closeIcon Icon, TitlePane.iconifyIcon Icon, TitlePane.maximizeIcon Icon, TitlePane.restoreIcon Icon
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classstatic interfaceFor custom components useFlatClientProperties.COMPONENT_TITLE_BAR_CAPTIONinstead of this interface.Nested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Colorprotected final Colorprotected final Colorprotected final intprotected final intprotected JPanelprotected final booleanprotected final intprotected final Insetsprotected final booleanprotected final booleanprotected JButtonprotected final Colorprotected JButtonprotected JLabelprotected final Insetsprotected final Dimensionprotected final Colorprotected final Colorprotected JPanelprotected JButtonprotected JComponentprotected final intprotected final intprotected final intprotected JButtonprotected final JRootPaneprotected final booleanprotected final booleanprotected final booleanprotected final Fontprotected JLabelprotected final Insetsprotected final intprotected Windowprotected final StringFields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactiveChanged(boolean active) voidprotected voidprotected voidclose()Closes the window.protected JButtoncreateButton(String iconKey, String accessibleName, ActionListener action) protected voidprotected FlatTitlePane.Handlerprotected FlatTitlePane.FlatTitlePaneBorderprotected ComponentfindHorizontalGlue(JMenuBar menuBar) protected voidprotected Rectangleprotected Stringprotected booleanReturns whether windows uses native window border and has custom decorations enabled.protected booleanhasVisibleEmbeddedMenuBar(JMenuBar menuBar) Returns whether this title pane currently has a visible and embedded menubar.protected voidiconify()Iconifies the window.protected voidprotected booleanprotected booleanReturns whether the menubar should be embedded into the title pane.protected booleanprotected voidmaximize()Maximizes the window.protected voidprotected voidvoidprotected voidvoidprotected voidrestore()Restores the window size.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidMethods inherited from class JComponent
addAncestorListener, 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, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, updateUIMethods inherited from class 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, validateTreeMethods inherited from class 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, 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
-
titleFont
- Since:
- 2.5
-
activeBackground
-
inactiveBackground
-
activeForeground
-
inactiveForeground
-
embeddedForeground
-
borderColor
-
showIcon
protected final boolean showIcon- Since:
- 2
-
showIconInDialogs
protected final boolean showIconInDialogs- Since:
- 2.5
-
noIconLeftGap
protected final int noIconLeftGap- Since:
- 2
-
iconSize
-
iconMargins
- Since:
- 3.6
-
titleMargins
- Since:
- 3.6
-
titleMinimumWidth
protected final int titleMinimumWidth- Since:
- 2.4
-
buttonMinimumWidth
protected final int buttonMinimumWidth- Since:
- 2.4
-
buttonMaximizedHeight
protected final int buttonMaximizedHeight -
buttonsGap
protected final int buttonsGap- Since:
- 3.6
-
buttonsMargins
- Since:
- 3.6
-
buttonsFillVertically
protected final boolean buttonsFillVertically- Since:
- 3.6
-
centerTitle
protected final boolean centerTitle -
centerTitleIfMenuBarEmbedded
protected final boolean centerTitleIfMenuBarEmbedded -
showIconBesideTitle
protected final boolean showIconBesideTitle- Since:
- 2.4
-
rootPane
-
windowStyle
-
leftPanel
-
iconLabel
-
titleLabel
-
buttonPanel
-
iconifyButton
-
maximizeButton
-
restoreButton
-
closeButton
-
window
-
-
Constructor Details
-
FlatTitlePane
-
-
Method Details
-
createTitlePaneBorder
-
createHandler
-
addSubComponents
protected void addSubComponents() -
createButtons
protected void createButtons() -
createButton
-
activeChanged
protected void activeChanged(boolean active) -
frameStateChanged
protected void frameStateChanged() -
updateVisibility
protected void updateVisibility()- Since:
- 3
-
updateIcon
protected void updateIcon() -
addNotify
public void addNotify()- Overrides:
addNotifyin classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classJComponent
-
getWindowTitle
-
installWindowListeners
protected void installWindowListeners() -
uninstallWindowListeners
protected void uninstallWindowListeners() -
isFullWindowContent
protected boolean isFullWindowContent()- Since:
- 3.4
-
hasVisibleEmbeddedMenuBar
Returns whether this title pane currently has a visible and embedded menubar. -
isMenuBarEmbedded
protected boolean isMenuBarEmbedded()Returns whether the menubar should be embedded into the title pane. -
getMenuBarBounds
-
findHorizontalGlue
-
titleBarColorsChanged
protected void titleBarColorsChanged() -
paint
- Overrides:
paintin classJComponent
-
paintComponent
- Overrides:
paintComponentin classJComponent
-
getBackground
- Overrides:
getBackgroundin classComponent
-
iconify
protected void iconify()Iconifies the window. -
isWindowMaximized
protected boolean isWindowMaximized()- Since:
- 2.4
-
maximize
protected void maximize()Maximizes the window. -
updateMaximizedBounds
protected void updateMaximizedBounds() -
restore
protected void restore()Restores the window size. -
close
protected void close()Closes the window. -
hasNativeCustomDecoration
protected boolean hasNativeCustomDecoration()Returns whether windows uses native window border and has custom decorations enabled. -
updateNativeTitleBarHeightAndHitTestSpotsLater
protected void updateNativeTitleBarHeightAndHitTestSpotsLater() -
updateNativeTitleBarHeightAndHitTestSpots
protected void updateNativeTitleBarHeightAndHitTestSpots()
-