@ColorCodes(value={"stack.tab.border.out.selected","stack.tab.border.center.selected","stack.tab.border.out.focused","stack.tab.border.center.focused","stack.tab.border.out","stack.tab.border.center","stack.tab.border.out.disabled","stack.tab.border.center.disabled","stack.tab.border","stack.tab.background.top.selected","stack.tab.background.bottom.selected","stack.tab.background.top.focused","stack.tab.background.bottom.focused","stack.tab.background.top","stack.tab.background.bottom","stack.tab.background.top.disabled","stack.tab.background.bottom.disabled","stack.tab.background","stack.tab.foreground.selected","stack.tab.foreground.focused","stack.tab.foreground.disabled","stack.tab.foreground"}) public class FlatTab extends ConfiguredBackgroundPanel implements CombinedTab, DockableFocusListener
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
FlatTab(FlatTabPane pane,
Dockable dockable)
Constructs a new button
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMouseInputListener(MouseInputListener listener)
Adds a listener to this representative, it is not defined what to do
with that listener, but most subclasses would just add the listener
to their
component. |
void |
dockableFocused(DockableFocusEvent event)
Invoked when
dockable has gained the focus. |
JComponent |
getComponent()
Gets the
Component which is to be painted. |
Dockable |
getDockable()
Gets the element that is associated with this tab.
|
DockElement |
getElement()
Gets the element which is represented by
this. |
FontModifier |
getFontModifier()
Gets the font modifier of this tab.
|
Icon |
getIcon()
Gets the icon shown on this tab.
|
Dimension |
getMinimumSize()
Gets the minimal size this component should have
|
Dimension |
getMinimumSize(Tab[] tabs)
Gets the minimum size of this tab under the assumption that
this tab is displayed together with
tabs. |
TabPlacement |
getOrientation()
Gets the orientation of this tab.
|
Insets |
getOverlap(TabPaneComponent other)
Tells how much of this component may be overlapped by another component
other. |
Point |
getPopupLocation(Point click,
boolean popupTrigger)
Tells whether a popup menu should be opened when the user clicks
at
click with the mouse. |
Dimension |
getPreferredSize()
Gets the preferred size of this component
|
Dimension |
getPreferredSize(Tab[] tabs)
Gets the preferred size of this tab under the assumption that
this tab is displayed together with
tabs. |
TabPane |
getTabParent()
Gets the parent of this component.
|
String |
getText()
Gets the text shown on this tab.
|
int |
getZOrder()
Gets the value of the z order.
|
boolean |
isPaneVisible()
Tells whether this component is visible or not.
|
boolean |
isSelected()
Determines whether this button is selected or not.
|
boolean |
isUsedAsTitle()
Tells whether this
DockElementRepresentative is used as title.Some modules grant more rights to titles than to non-titles, i.e. |
void |
paintBackground(Graphics g)
Invokes the standard algorithm that paints the background
of the component.
|
void |
removeMouseInputListener(MouseInputListener listener)
Removes a listener from this representative.
|
void |
setConfiguration(TabConfiguration configuration)
Fine tunes this tab.
|
void |
setController(DockController controller)
Connects this tab with
controller. |
void |
setEnabled(boolean enabled)
Enables or disables this tab.
|
void |
setFontModifier(FontModifier modifier)
Sets the modifier which modifies the font of this tab, this modifier
may be replaced any time.
|
void |
setForeground(Color fg) |
void |
setIcon(Icon icon)
Sets the image of this tab.
|
void |
setOrientation(TabPlacement orientation)
Tells this component how to paint itself.
|
void |
setPaneVisible(boolean visible)
Changes the visibility state of this component.
|
void |
setText(String text)
Sets the text of this tab.
|
void |
setTooltip(String tooltip)
Sets the tooltip of this tab.
|
protected void |
setupRenderingHints(Graphics g)
Called before painting on this panel happens.
|
void |
setZOrder(int order)
Sets the z order of this component.
|
boolean |
shouldFocus()
Tells whether a click onto this component should transfer the focus either to this component or to the
Dockable. |
boolean |
shouldTransfersFocus()
Tells whether a click onto this component should transfer the focus to the
Dockable or not. |
void |
updateFonts() |
void |
updateForeground() |
configuregetBackgroundAlgorithm, getTransparency, paint, paintBorder, paintChildren, paintComponent, paintForeground, paintOverlay, setBackground, setTransparencygetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, 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, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, validateTreeaction, 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, 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBounds, getMaximumSize, setBoundspublic FlatTab(FlatTabPane pane, Dockable dockable)
pane - the owner of this tabdockable - the Dockable for which this tab is displayedpublic void setConfiguration(TabConfiguration configuration)
CombinedTabsetConfiguration in interface CombinedTabconfiguration - the new configuration to useCombinedStackDockComponent.getConfiguration(bibliothek.gui.Dockable)public void updateForeground()
public void setForeground(Color fg)
setForeground in class JComponentpublic void updateFonts()
public void setFontModifier(FontModifier modifier)
modifier - the modifierpublic FontModifier getFontModifier()
public void setIcon(Icon icon)
CombinedTabsetIcon in interface CombinedTabicon - an icon that should be shown, can be nullpublic Icon getIcon()
public void setText(String text)
CombinedTabsetText in interface CombinedTabtext - the text to displaypublic String getText()
public void setController(DockController controller)
controller.controller - the controller in whose realm this tab is used,
can be nullpublic Point getPopupLocation(Point click, boolean popupTrigger)
DockElementRepresentativeclick with the mouse. If yes, then the top left edge
of the popup should be returned, otherwise null should be
returned.getPopupLocation in interface DockElementRepresentativeclick - the location where the user clicked with the mousepopupTrigger - whether the invocation is the systems popup trigger
or not. Many implementations of this method will return click
in case of true, and null in case of falsenull if no
popup-menu should be openedpublic void dockableFocused(DockableFocusEvent event)
DockableFocusListenerdockable has gained the focus.dockableFocused in interface DockableFocusListenerevent - an event that contains the new owner of the focuspublic TabPane getTabParent()
TabPaneComponentgetTabParent in interface TabPaneComponentpublic Dockable getDockable()
TabgetDockable in interface Tabpublic JComponent getComponent()
PaintableComponentComponent which is to be painted.getComponent in interface DockElementRepresentativegetComponent in interface CombinedTabgetComponent in interface PaintableComponentgetComponent in class BackgroundPanelpublic DockElement getElement()
DockElementRepresentativethis.
The result of this method must not change.getElement in interface DockElementRepresentativenullpublic boolean isUsedAsTitle()
DockElementRepresentativeDockElementRepresentative is used as title.DockRelocator can allow drag & drop only for titles.Dockable should have only one element that is a title,
so if in doubt return false.isUsedAsTitle in interface DockElementRepresentativetrue if this representative should be seen as titlepublic boolean shouldFocus()
DockElementRepresentativeDockable.shouldFocus in interface DockElementRepresentativetrue if clicking this component should influence focuspublic boolean shouldTransfersFocus()
DockElementRepresentativeDockable or not. If this
object is a Dockable, then a result of true might change the currently focused item
of itself. This property is ignored if DockElementRepresentative.shouldFocus() returns false.shouldTransfersFocus in interface DockElementRepresentativepublic void setEnabled(boolean enabled)
CombinedTabsetEnabled in interface CombinedTabsetEnabled in class JComponentenabled - whether to enable or disable this tabpublic void addMouseInputListener(MouseInputListener listener)
DockElementRepresentativecomponent. It is valid to do nothing.addMouseInputListener in interface DockElementRepresentativelistener - the new listenerpublic void removeMouseInputListener(MouseInputListener listener)
DockElementRepresentativeremoveMouseInputListener in interface DockElementRepresentativelistener - the listener to removepublic Dimension getPreferredSize(Tab[] tabs)
Tabtabs.getPreferredSize in interface Tabtabs - the displayed tabs, exactly one entry is this
and no entry is nullpublic Dimension getPreferredSize()
TabPaneComponentgetPreferredSize in interface TabPaneComponentgetPreferredSize in class JComponentpublic Dimension getMinimumSize(Tab[] tabs)
Tabtabs.getMinimumSize in interface Tabtabs - the displayed tabs, exactly one entry is this
and no entry is nullpublic Dimension getMinimumSize()
TabPaneComponentgetMinimumSize in interface TabPaneComponentgetMinimumSize in class JComponentpublic void setTooltip(String tooltip)
CombinedTabsetTooltip in interface CombinedTabtooltip - the tooltip text, can be nullpublic void setPaneVisible(boolean visible)
TabPaneComponentsetPaneVisible in interface TabPaneComponentvisible - the new statepublic boolean isPaneVisible()
TabPaneComponentisPaneVisible in interface TabPaneComponenttrue if visible, false otherwisepublic boolean isSelected()
true if the button is selectedpublic void setZOrder(int order)
TabPaneComponentTabPaneComponents
on the parent TabPane. The implementation may increase or
decrease z-orders to prevent collisions between components with the same
order.setZOrder in interface TabPaneComponentorder - the order, can be any integer.public int getZOrder()
TabPaneComponentgetZOrder in interface TabPaneComponentTabPaneComponent.setZOrder(int)public Insets getOverlap(TabPaneComponent other)
TabPaneComponentother.getOverlap in interface TabPaneComponentother - another component which may be painted over this componentnullpublic void setOrientation(TabPlacement orientation)
TabPaneComponentsetOrientation in interface TabPaneComponentorientation - the orientation, not nullpublic TabPlacement getOrientation()
nullprotected void setupRenderingHints(Graphics g)
BackgroundPanelg.setupRenderingHints in class ConfiguredBackgroundPanelg - the painting contextpublic void paintBackground(Graphics g)
PaintableComponentpaintBackground in interface PaintableComponentpaintBackground in class BackgroundPanelg - the graphics context to use, null to just inform
this component that the background should not be painted automaticallyCopyright © 2017 Docking Frames. All rights reserved.