@ColorCodes(value={"stack.tab.background.top.mouse","stack.tab.background.bottom.mouse","stack.tab.border.mouse","stack.tab.foreground.mouse","stack.tab.background.top","stack.tab.background.bottom","stack.tab.border","stack.tab.foreground","stack.tab.background.top.selected.mouse","stack.tab.background.bottom.selected.mouse","stack.tab.border.selected.mouse","stack.tab.foreground.selected.mouse","stack.tab.background.top.selected","stack.tab.background.bottom.selected","stack.tab.border.selected","stack.tab.foreground.selected","stack.tab.background.top.focused.mouse","stack.tab.background.bottom.focused.mouse","stack.tab.border.focused.mouse","stack.tab.foreground.focused.mouse","stack.tab.background.top.focused","stack.tab.background.bottom.focused","stack.tab.border.focused","stack.tab.foreground.focused","stack.tab.background.top.disabled","stack.tab.background.bottom.disabled","stack.tab.border.disabled","stack.tab.foreground.disabled"}) public class BubbleTab extends ConfiguredBackgroundPanel implements CombinedTab, StackDockComponentListener, Runnable, DockableFocusListener
Tab
used by the BubbleStackDockComponent
.Modifier and Type | Class and Description |
---|---|
protected class |
BubbleTab.BubbleTabColor
Some color needed on a
Tab . |
protected class |
BubbleTab.BubbleTabFont
Some font needed on a
Tab |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
BubbleTab(BubbleStackDockComponent parent,
Dockable dockable)
Creates a new tab
|
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 . |
Dimension |
getMinimumSize(Tab[] tabs)
Gets the minimum size of this tab under the assumption that
this tab is displayed together with
tabs . |
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(Tab[] tabs)
Gets the preferred size of this tab under the assumption that
this tab is displayed together with
tabs . |
int |
getState() |
TabPane |
getTabParent()
Gets the parent of this component.
|
int |
getZOrder()
Gets the value of the z order.
|
boolean |
isPaneVisible()
Tells whether this component is visible 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 |
paintForeground(Graphics g)
Invokes the standard algorithm that paints the foreground
of the component.
|
void |
paintOverlay(Graphics g)
Invokes the standard algorithm that paints an overlay over the children
of the component.
|
void |
removeMouseInputListener(MouseInputListener listener)
Removes a listener from this representative.
|
void |
run() |
void |
selectionChanged(StackDockComponent stack)
Called if the current selection on
stack changed. |
void |
setConfiguration(TabConfiguration configuration)
Fine tunes this tab.
|
void |
setController(DockController controller) |
void |
setEnabled(boolean enabled)
Enables or disables this tab.
|
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 |
stopAnimation()
Stops the
animation of this tab. |
void |
tabChanged(StackDockComponent stack,
Dockable dockable)
Called if the result of
StackDockComponent.getTabAt(int) changed
for any index associated with dockable |
void |
updateFonts()
Ensures that the correct font modifier is used.
|
configure
getBackgroundAlgorithm, getTransparency, paint, paintBorder, paintChildren, paintComponent, setBackground, setTransparency
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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
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, 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, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBounds, getMaximumSize, getMinimumSize, getPreferredSize, setBounds
public BubbleTab(BubbleStackDockComponent parent, Dockable dockable)
parent
- the owner of this tabdockable
- the element whose title will be shown on this tabpublic void setConfiguration(TabConfiguration configuration)
CombinedTab
setConfiguration
in interface CombinedTab
configuration
- the new configuration to useCombinedStackDockComponent.getConfiguration(bibliothek.gui.Dockable)
public TabPane getTabParent()
TabPaneComponent
getTabParent
in interface TabPaneComponent
public Dockable getDockable()
Tab
getDockable
in interface Tab
public Point getPopupLocation(Point click, boolean popupTrigger)
DockElementRepresentative
click
with the mouse. If yes, then the top left edge
of the popup should be returned, otherwise null
should be
returned.getPopupLocation
in interface DockElementRepresentative
click
- 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 false
null
if no
popup-menu should be openedpublic void setTooltip(String tooltip)
CombinedTab
setTooltip
in interface CombinedTab
tooltip
- the tooltip text, can be null
public void setPaneVisible(boolean visible)
TabPaneComponent
setPaneVisible
in interface TabPaneComponent
visible
- the new statepublic void setEnabled(boolean enabled)
CombinedTab
setEnabled
in interface CombinedTab
setEnabled
in class JComponent
enabled
- whether to enable or disable this tabpublic boolean isPaneVisible()
TabPaneComponent
isPaneVisible
in interface TabPaneComponent
true
if visible, false
otherwisepublic void setOrientation(TabPlacement orientation)
TabPaneComponent
setOrientation
in interface TabPaneComponent
orientation
- the orientation, not null
public int getState()
public void setController(DockController controller)
public void setZOrder(int order)
TabPaneComponent
TabPaneComponent
s
on the parent TabPane
. The implementation may increase or
decrease z-orders to prevent collisions between components with the same
order.setZOrder
in interface TabPaneComponent
order
- the order, can be any integer.public int getZOrder()
TabPaneComponent
getZOrder
in interface TabPaneComponent
TabPaneComponent.setZOrder(int)
public Insets getOverlap(TabPaneComponent other)
TabPaneComponent
other
.getOverlap
in interface TabPaneComponent
other
- another component which may be painted over this componentnull
public void dockableFocused(DockableFocusEvent event)
DockableFocusListener
dockable
has gained the focus.dockableFocused
in interface DockableFocusListener
event
- an event that contains the new owner of the focuspublic Dimension getPreferredSize(Tab[] tabs)
Tab
tabs
.getPreferredSize
in interface Tab
tabs
- the displayed tabs, exactly one entry is this
and no entry is null
public Dimension getMinimumSize(Tab[] tabs)
Tab
tabs
.getMinimumSize
in interface Tab
tabs
- the displayed tabs, exactly one entry is this
and no entry is null
protected void setupRenderingHints(Graphics g)
BackgroundPanel
g
.setupRenderingHints
in class ConfiguredBackgroundPanel
g
- the painting contextpublic void paintBackground(Graphics g)
PaintableComponent
paintBackground
in interface PaintableComponent
paintBackground
in class BackgroundPanel
g
- the graphics context to use, null
to just inform
this component that the background should not be painted automaticallypublic void paintForeground(Graphics g)
PaintableComponent
paintForeground
in interface PaintableComponent
paintForeground
in class BackgroundPanel
g
- the graphics context to use, null
to just inform
this component that the foreground should not be painted automaticallypublic void paintOverlay(Graphics g)
PaintableComponent
paintOverlay
in interface PaintableComponent
paintOverlay
in class BackgroundPanel
g
- the graphics context to use, null
to just inform
this component that the background should not be painted automaticallypublic JComponent getComponent()
PaintableComponent
Component
which is to be painted.getComponent
in interface DockElementRepresentative
getComponent
in interface CombinedTab
getComponent
in interface PaintableComponent
getComponent
in class BackgroundPanel
public DockElement getElement()
DockElementRepresentative
this
.
The result of this method must not change.getElement
in interface DockElementRepresentative
null
public boolean isUsedAsTitle()
DockElementRepresentative
DockElementRepresentative
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 DockElementRepresentative
true
if this representative should be seen as titlepublic boolean shouldFocus()
DockElementRepresentative
Dockable
.shouldFocus
in interface DockElementRepresentative
true
if clicking this component should influence focuspublic boolean shouldTransfersFocus()
DockElementRepresentative
Dockable
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 DockElementRepresentative
public void addMouseInputListener(MouseInputListener listener)
DockElementRepresentative
component
. It is valid to do nothing.addMouseInputListener
in interface DockElementRepresentative
listener
- the new listenerpublic void removeMouseInputListener(MouseInputListener listener)
DockElementRepresentative
removeMouseInputListener
in interface DockElementRepresentative
listener
- the listener to removepublic void selectionChanged(StackDockComponent stack)
StackDockComponentListener
stack
changed.selectionChanged
in interface StackDockComponentListener
stack
- the source of the eventpublic void tabChanged(StackDockComponent stack, Dockable dockable)
StackDockComponentListener
StackDockComponent.getTabAt(int)
changed
for any index associated with dockable
tabChanged
in interface StackDockComponentListener
stack
- the source of the eventdockable
- the element with a new valuepublic void updateFonts()
public void setIcon(Icon icon)
CombinedTab
setIcon
in interface CombinedTab
icon
- an icon that should be shown, can be null
public void setText(String text)
CombinedTab
setText
in interface CombinedTab
text
- the text to displaypublic void stopAnimation()
animation
of this tab.