bibliothek.extension.gui.dock.theme.eclipse.stack.tab
Class BaseTabComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by bibliothek.gui.dock.util.BackgroundPanel
                      extended by bibliothek.gui.dock.util.ConfiguredBackgroundPanel
                          extended by bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent
All Implemented Interfaces:
EclipseTabStateInfo, TabComponent, DockElementRepresentative, PaintableComponent, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ArchGradientPainter, RectGradientPainter

@ColorCodes(value={"stack.tab.border","stack.tab.border.selected","stack.tab.border.selected.focused","stack.tab.border.selected.focuslost","stack.tab.border.disabled","stack.tab.top","stack.tab.top.selected","stack.tab.top.selected.focused","stack.tab.top.selected.focuslost","stack.tab.top.disabled","stack.tab.bottom","stack.tab.bottom.selected","stack.tab.bottom.selected.focused","stack.tab.bottom.selected.focuslost","stack.tab.bottom.disabled","stack.tab.text","stack.tab.text.selected","stack.tab.text.selected.focused","stack.tab.text.selected.focuslost","stack.tab.text.disabled","stack.border"})
public abstract class BaseTabComponent
extends ConfiguredBackgroundPanel
implements TabComponent, EclipseTabStateInfo

A base implementation of TabComponent. This component contains an OrientedLabel which is used to paint icon and text, also a ButtonPanel is present to paint additional buttons.

Author:
Benjamin Sigg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  TabColor colorStackBorder
           
protected  TabColor colorStackTabBorder
           
protected  TabColor colorStackTabBorderDisabled
           
protected  TabColor colorStackTabBorderSelected
           
protected  TabColor colorStackTabBorderSelectedFocused
           
protected  TabColor colorStackTabBorderSelectedFocusLost
           
protected  TabColor colorStackTabBottom
           
protected  TabColor colorStackTabBottomDisabled
           
protected  TabColor colorStackTabBottomSelected
           
protected  TabColor colorStackTabBottomSelectedFocused
           
protected  TabColor colorStackTabBottomSelectedFocusLost
           
protected  TabColor colorStackTabText
           
protected  TabColor colorStackTabTextDisabled
           
protected  TabColor colorStackTabTextSelected
           
protected  TabColor colorStackTabTextSelectedFocused
           
protected  TabColor colorStackTabTextSelectedFocusLost
           
protected  TabColor colorStackTabTop
           
protected  TabColor colorStackTabTopDisabled
           
protected  TabColor colorStackTabTopSelected
           
protected  TabColor colorStackTabTopSelectedFocused
           
protected  TabColor colorStackTabTopSelectedFocusLost
           
protected  TabFont fontFocused
           
protected  TabFont fontSelected
           
protected  TabFont fontUnselected
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
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
 
Constructor Summary
BaseTabComponent(EclipseTabPane pane, Dockable dockable)
          Creates a new TabComponent
BaseTabComponent(EclipseTabPane pane, Dockable dockable, String colorPostfix)
          Creates a new TabComponent
 
Method Summary
protected  void addAdditionalColors(TabColor... colors)
          Adds an additional set of colors to this tab.
 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 addMouseListener(MouseListener l)
           
 void addMouseMotionListener(MouseMotionListener l)
           
 void bind()
          Informs this tab that it will be shown soon
protected  void cleanNextTabSelected()
          Cleans the state set by setNextTabSelected(boolean)
protected  void cleanPreviousTabSelected()
          Cleans the state set by setPreviousTabSelected(boolean)
protected  boolean containsButton(int x, int y)
          Tells whether the buttons contain the position x/y.
 boolean doPaintIconWhenInactive()
           
 Insets getButtonInsets()
          Gets the space that is to be left free around the buttons.
 ButtonPanel getButtons()
          Gets the panel which shows a set of DockActions.
 Component getComponent()
          Gets the Component which is to be painted.
 DockController getController()
           
 Dockable getDockable()
          Gets the Dockable which is represented by this tab.
 int getDockableIndex()
          Tells which index the dockable of this tab has on the owner.
 EclipseTabStateInfo getEclipseTabStateInfo()
          Gets information about the state of this tab.
 DockElement getElement()
          Gets the element which is represented by this.
 Icon getIcon()
          Gets the icon that is painted on this component.
protected  OrientedLabel getLabel()
          Gets the label which is used to paint icon and text.
 Insets getLabelInsets()
          Gets the space that is left free around the label.
 Dimension getMinimumSize(TabComponent[] tabs)
          Gets the minimum size of this tab under the assumption that this tab is displayed together with tabs.
 TabPlacement getOrientation()
          Gets the current orientation of this tab, see setOrientation(TabPlacement).
 EclipseTabPane getPane()
          Gets the parent of this component.
 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(TabComponent[] tabs)
          Gets the preferred size of this tab under the assumption that this tab is displayed together with tabs.
 DockStation getStation()
           
 int getTabIndex()
           
 String getText()
          Gets the text of this component.
 boolean isBound()
          Tells whether the bind() method has been called.
 boolean isFocused()
          Whether the tab is currently focused.
 boolean isFocusTemporarilyLost()
          Tells whether the focus of this component is currently lost, but will be retrieved as soon as the underlying frame gets activated.
protected  boolean isNextTabSelected()
          Tells whether the tab after this one is selected.
protected  boolean isPreviousTabSelected()
          Tells whether the tab before this one is selected.
 boolean isSelected()
          Whether the tab is currently selected.
 boolean isUsedAsTitle()
          Tells whether this DockElementRepresentative is used as title.
Some modules grant more rights to titles than to non-titles, i.e.
protected  void refreshActions()
          Recalculates which actions to show on this component.
 void removeMouseInputListener(MouseInputListener listener)
          Removes a listener from this representative.
 void removeMouseListener(MouseListener l)
           
 void removeMouseMotionListener(MouseMotionListener l)
           
 void setButtonInsets(Insets buttonInsets)
          Sets the insets to be left free around the buttons.
 void setConfiguration(TabConfiguration configuration)
          Fine tunes the look and behavior of this tab.
 void setEnabled(boolean enabled)
          Enables or disables this component.
 void setFocused(boolean focused)
          Tells this component that its Dockable gained or lost focus.
 void setIcon(Icon icon)
          Sets the icon that is painted on this component.
 void setLabelInsets(Insets labelInsets)
          Sets the insets to be left free around the label.
protected  void setNextTabSelected(boolean selected)
          Overrides the result of isNextTabSelected(), the method will from now on only return selected until cleanNextTabSelected() is called which reinstates the original behavior.
 void setOrientation(TabPlacement orientation)
          Sets the placement of the tabs and as a result the orientation of this component.
 void setPaintIconWhenInactive(boolean paintIconWhenInactive)
          Tells this component whether to paint an icon if not selected.
protected  void setPreviousTabSelected(boolean selected)
          Overrides the result of isPreviousTabSelected(), the method will from now on only return selected until cleanPreviousTabSelected() is called which reinstates the original behavior.
 void setSelected(boolean selected)
          Tells this component whether it has to be painted selected or not.
 void setTab(EclipseTab tab)
          Informs this TabComponent by which tab is is used.
 void setText(String text)
          Sets the text that is to be painted on this component.
 void setTooltip(String tooltip)
          Sets the tooltip that should be displayed on this tab.
protected  void setupRenderingHints(Graphics g)
          Called before painting on this panel happens.
 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 unbind()
          Informs this tab that it is invisible and must not have any connections to other resources
abstract  void updateBorder()
          Called when one of the border colors changed
protected abstract  void updateColors()
          Called when the colors of this tab changed.
protected abstract  void updateEnabled()
          Called when the enabled state of this tab changed.
abstract  void updateFocus()
          Called when the focus state of this component changed.
protected  void updateFont()
          Called when the font of this component has to be updated
protected abstract  void updateOrientation()
          Called when the tab placement of this tab changed.
protected  void updatePaintIcon()
          Called when the paint icon property of this component changed.
protected abstract  void updateSelected()
          Called when the selection state of this tab changed.
 
Methods inherited from class bibliothek.gui.dock.util.ConfiguredBackgroundPanel
configure
 
Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel
getBackgroundAlgorithm, getTransparency, paint, paintBackground, paintBorder, paintChildren, paintComponent, paintForeground, paintOverlay, setBackground, setTransparency
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, 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, hide, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent
getOverlap
 

Field Detail

colorStackTabBorder

protected final TabColor colorStackTabBorder

colorStackTabBorderSelected

protected final TabColor colorStackTabBorderSelected

colorStackTabBorderSelectedFocused

protected final TabColor colorStackTabBorderSelectedFocused

colorStackTabBorderSelectedFocusLost

protected final TabColor colorStackTabBorderSelectedFocusLost

colorStackTabBorderDisabled

protected final TabColor colorStackTabBorderDisabled

colorStackTabTop

protected final TabColor colorStackTabTop

colorStackTabTopSelected

protected final TabColor colorStackTabTopSelected

colorStackTabTopSelectedFocused

protected final TabColor colorStackTabTopSelectedFocused

colorStackTabTopSelectedFocusLost

protected final TabColor colorStackTabTopSelectedFocusLost

colorStackTabTopDisabled

protected final TabColor colorStackTabTopDisabled

colorStackTabBottom

protected final TabColor colorStackTabBottom

colorStackTabBottomSelected

protected final TabColor colorStackTabBottomSelected

colorStackTabBottomSelectedFocused

protected final TabColor colorStackTabBottomSelectedFocused

colorStackTabBottomSelectedFocusLost

protected final TabColor colorStackTabBottomSelectedFocusLost

colorStackTabBottomDisabled

protected final TabColor colorStackTabBottomDisabled

colorStackTabText

protected final TabColor colorStackTabText

colorStackTabTextSelected

protected final TabColor colorStackTabTextSelected

colorStackTabTextSelectedFocused

protected final TabColor colorStackTabTextSelectedFocused

colorStackTabTextSelectedFocusLost

protected final TabColor colorStackTabTextSelectedFocusLost

colorStackTabTextDisabled

protected final TabColor colorStackTabTextDisabled

colorStackBorder

protected final TabColor colorStackBorder

fontSelected

protected final TabFont fontSelected

fontFocused

protected final TabFont fontFocused

fontUnselected

protected final TabFont fontUnselected
Constructor Detail

BaseTabComponent

public BaseTabComponent(EclipseTabPane pane,
                        Dockable dockable)
Creates a new TabComponent

Parameters:
pane - the owner of this tab, not null
dockable - the element which is represented by this component, not null

BaseTabComponent

public BaseTabComponent(EclipseTabPane pane,
                        Dockable dockable,
                        String colorPostfix)
Creates a new TabComponent

Parameters:
pane - the owner of this tab, not null
dockable - the element which is represented by this component, not null
colorPostfix - a string that will be added to any key for a color, can be null
Method Detail

getEclipseTabStateInfo

public EclipseTabStateInfo getEclipseTabStateInfo()
Description copied from interface: TabComponent
Gets information about the state of this tab.

Specified by:
getEclipseTabStateInfo in interface TabComponent
Returns:
information about the state, updates itself.

addAdditionalColors

protected void addAdditionalColors(TabColor... colors)
Adds an additional set of colors to this tab. This method should be called before this tab is bound.

Parameters:
colors - the additional set of colors

setConfiguration

public void setConfiguration(TabConfiguration configuration)
Description copied from interface: TabComponent
Fine tunes the look and behavior of this tab.

Specified by:
setConfiguration in interface TabComponent
Parameters:
configuration - the new configuration to use, not null

updateBorder

public abstract void updateBorder()
Called when one of the border colors changed


updateFont

protected void updateFont()
Called when the font of this component has to be updated


refreshActions

protected void refreshActions()
Recalculates which actions to show on this component.


updateFocus

public abstract void updateFocus()
Called when the focus state of this component changed.


updateSelected

protected abstract void updateSelected()
Called when the selection state of this tab changed.


updateColors

protected abstract void updateColors()
Called when the colors of this tab changed.


updateEnabled

protected abstract void updateEnabled()
Called when the enabled state of this tab changed.


updatePaintIcon

protected void updatePaintIcon()
Called when the paint icon property of this component changed.


updateOrientation

protected abstract void updateOrientation()
Called when the tab placement of this tab changed.


setTab

public void setTab(EclipseTab tab)
Description copied from interface: TabComponent
Informs this TabComponent by which tab is is used.

Specified by:
setTab in interface TabComponent
Parameters:
tab - the owner of this TabComponent

bind

public void bind()
Description copied from interface: TabComponent
Informs this tab that it will be shown soon

Specified by:
bind in interface TabComponent

unbind

public void unbind()
Description copied from interface: TabComponent
Informs this tab that it is invisible and must not have any connections to other resources

Specified by:
unbind in interface TabComponent

isBound

public boolean isBound()
Tells whether the bind() method has been called.

Returns:
true if this tab is bound to its owner

getDockable

public Dockable getDockable()
Description copied from interface: EclipseTabStateInfo
Gets the Dockable which is represented by this tab.

Specified by:
getDockable in interface EclipseTabStateInfo
Returns:
the dockable, may not be null

getElement

public DockElement getElement()
Description copied from interface: DockElementRepresentative
Gets the element which is represented by this. The result of this method must not change.

Specified by:
getElement in interface DockElementRepresentative
Returns:
the element, never null

isUsedAsTitle

public boolean isUsedAsTitle()
Description copied from interface: DockElementRepresentative
Tells whether this DockElementRepresentative is used as title.
Some modules grant more rights to titles than to non-titles, i.e. a DockRelocator can allow drag & drop only for titles.
Normally a Dockable should have only one element that is a title, so if in doubt return false.

Specified by:
isUsedAsTitle in interface DockElementRepresentative
Returns:
true if this representative should be seen as title

shouldTransfersFocus

public boolean shouldTransfersFocus()
Description copied from interface: DockElementRepresentative
Tells whether a click onto this component should transfer the focus to the 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.

Specified by:
shouldTransfersFocus in interface DockElementRepresentative
Returns:
whether to change the focused component or not

shouldFocus

public boolean shouldFocus()
Description copied from interface: DockElementRepresentative
Tells whether a click onto this component should transfer the focus either to this component or to the Dockable.

Specified by:
shouldFocus in interface DockElementRepresentative
Returns:
true if clicking this component should influence focus

addMouseInputListener

public void addMouseInputListener(MouseInputListener listener)
Description copied from interface: DockElementRepresentative
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. It is valid to do nothing.

Specified by:
addMouseInputListener in interface DockElementRepresentative
Parameters:
listener - the new listener

removeMouseInputListener

public void removeMouseInputListener(MouseInputListener listener)
Description copied from interface: DockElementRepresentative
Removes a listener from this representative.

Specified by:
removeMouseInputListener in interface DockElementRepresentative
Parameters:
listener - the listener to remove

addMouseListener

public void addMouseListener(MouseListener l)
Overrides:
addMouseListener in class Component

removeMouseListener

public void removeMouseListener(MouseListener l)
Overrides:
removeMouseListener in class Component

addMouseMotionListener

public void addMouseMotionListener(MouseMotionListener l)
Overrides:
addMouseMotionListener in class Component

removeMouseMotionListener

public void removeMouseMotionListener(MouseMotionListener l)
Overrides:
removeMouseMotionListener in class Component

getPopupLocation

public Point getPopupLocation(Point click,
                              boolean popupTrigger)
Description copied from interface: DockElementRepresentative
Tells whether a popup menu should be opened when the user clicks at click with the mouse. If yes, then the top left edge of the popup should be returned, otherwise null should be returned.

Specified by:
getPopupLocation in interface DockElementRepresentative
Parameters:
click - the location where the user clicked with the mouse
popupTrigger - 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
Returns:
the preferred location of a popup or null if no popup-menu should be opened

getController

public DockController getController()

getStation

public DockStation getStation()

setupRenderingHints

protected void setupRenderingHints(Graphics g)
Description copied from class: BackgroundPanel
Called before painting on this panel happens. Allows to apply rendering hints (or other settings) to g.

Overrides:
setupRenderingHints in class ConfiguredBackgroundPanel
Parameters:
g - the painting context

getPane

public EclipseTabPane getPane()
Gets the parent of this component.

Returns:
the owner

getComponent

public Component getComponent()
Description copied from interface: PaintableComponent
Gets the Component which is to be painted.

Specified by:
getComponent in interface TabComponent
Specified by:
getComponent in interface DockElementRepresentative
Specified by:
getComponent in interface PaintableComponent
Overrides:
getComponent in class BackgroundPanel
Returns:
the item to paint

setFocused

public void setFocused(boolean focused)
Description copied from interface: TabComponent
Tells this component that its Dockable gained or lost focus.

Specified by:
setFocused in interface TabComponent
Parameters:
focused - the state of its dockable.

isFocused

public boolean isFocused()
Description copied from interface: EclipseTabStateInfo
Whether the tab is currently focused.

Specified by:
isFocused in interface EclipseTabStateInfo
Returns:
whether the tab is focused

isFocusTemporarilyLost

public boolean isFocusTemporarilyLost()
Tells whether the focus of this component is currently lost, but will be retrieved as soon as the underlying frame gets activated.

Returns:
true if the focus is only temporarily lost

setSelected

public void setSelected(boolean selected)
Description copied from interface: TabComponent
Tells this component whether it has to be painted selected or not.

Specified by:
setSelected in interface TabComponent
Parameters:
selected - the selection state of this tab

isSelected

public boolean isSelected()
Description copied from interface: EclipseTabStateInfo
Whether the tab is currently selected.

Specified by:
isSelected in interface EclipseTabStateInfo
Returns:
whether the tab is selected

setPreviousTabSelected

protected void setPreviousTabSelected(boolean selected)
Overrides the result of isPreviousTabSelected(), the method will from now on only return selected until cleanPreviousTabSelected() is called which reinstates the original behavior.

Parameters:
selected - the future result of isPreviousTabSelected()

cleanPreviousTabSelected

protected void cleanPreviousTabSelected()
Cleans the state set by setPreviousTabSelected(boolean)


isPreviousTabSelected

protected boolean isPreviousTabSelected()
Tells whether the tab before this one is selected. This method only checks visible tabs.

Returns:
true if the tab before is selected

setNextTabSelected

protected void setNextTabSelected(boolean selected)
Overrides the result of isNextTabSelected(), the method will from now on only return selected until cleanNextTabSelected() is called which reinstates the original behavior.

Parameters:
selected - the future result of isNextTabSelected()

cleanNextTabSelected

protected void cleanNextTabSelected()
Cleans the state set by setNextTabSelected(boolean)


isNextTabSelected

protected boolean isNextTabSelected()
Tells whether the tab after this one is selected. This method only checks visible tabs.

Returns:
true if the tab before is selected

getDockableIndex

public int getDockableIndex()
Tells which index the dockable of this tab has on the owner.

Returns:
the index of the dockable on the owner, -1 if the owner is unknown or the dockable is no longer child of the owner

getTabIndex

public int getTabIndex()

doPaintIconWhenInactive

public boolean doPaintIconWhenInactive()

setPaintIconWhenInactive

public void setPaintIconWhenInactive(boolean paintIconWhenInactive)
Tells this component whether to paint an icon if not selected. Please note that this method only stores the value, but BaseTabComponent itself never checks this property.

Specified by:
setPaintIconWhenInactive in interface TabComponent
Parameters:
paintIconWhenInactive - true if an icon is always to be painted, false if icons should only appear on selected tabs.

setIcon

public void setIcon(Icon icon)
Sets the icon that is painted on this component. Please note that the icon is not painted if this tab is not selected and setPaintIconWhenInactive(boolean) is false.

Specified by:
setIcon in interface TabComponent
Parameters:
icon - the icon to paint, can be null

getIcon

public Icon getIcon()
Gets the icon that is painted on this component.

Returns:
the icon, can be null

setText

public void setText(String text)
Sets the text that is to be painted on this component.

Specified by:
setText in interface TabComponent
Parameters:
text - the text, can be null

setTooltip

public void setTooltip(String tooltip)
Description copied from interface: TabComponent
Sets the tooltip that should be displayed on this tab.

Specified by:
setTooltip in interface TabComponent
Parameters:
tooltip - the new tooltip, can be null

getText

public String getText()
Gets the text of this component.

Returns:
the text, may be null

setLabelInsets

public void setLabelInsets(Insets labelInsets)
Sets the insets to be left free around the label.

Parameters:
labelInsets - the free space, not null

getLabelInsets

public Insets getLabelInsets()
Gets the space that is left free around the label.

Returns:
the free space, not null

setButtonInsets

public void setButtonInsets(Insets buttonInsets)
Sets the insets to be left free around the buttons.

Parameters:
buttonInsets - the free space, not null

getButtonInsets

public Insets getButtonInsets()
Gets the space that is to be left free around the buttons.

Returns:
the free space

getLabel

protected OrientedLabel getLabel()
Gets the label which is used to paint icon and text.

Returns:
the label

getButtons

public ButtonPanel getButtons()
Gets the panel which shows a set of DockActions.

Returns:
the panel, not null

containsButton

protected boolean containsButton(int x,
                                 int y)
Tells whether the buttons contain the position x/y.

Parameters:
x - x coordinate
y - y coordinate
Returns:
true if the buttons contains this location

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: TabComponent
Enables or disables this component. A disabled component should be visually distinct from an enabled one. Note that EclipseTab automatically removes all MouseInputListeners from a TabComponent that is not enabled.

Specified by:
setEnabled in interface TabComponent
Overrides:
setEnabled in class JComponent
Parameters:
enabled - whether this component is enabled or not

setOrientation

public void setOrientation(TabPlacement orientation)
Description copied from interface: TabComponent
Sets the placement of the tabs and as a result the orientation of this component.

Specified by:
setOrientation in interface TabComponent
Parameters:
orientation - the orientation, not null

getOrientation

public TabPlacement getOrientation()
Gets the current orientation of this tab, see setOrientation(TabPlacement).

Returns:
the placement

getMinimumSize

public Dimension getMinimumSize(TabComponent[] tabs)
Description copied from interface: TabComponent
Gets the minimum size of this tab under the assumption that this tab is displayed together with tabs.

Specified by:
getMinimumSize in interface TabComponent
Parameters:
tabs - the displayed tabs, exactly one entry is this and may contain null entries.
Returns:
the minimum size of this tab

getPreferredSize

public Dimension getPreferredSize(TabComponent[] tabs)
Description copied from interface: TabComponent
Gets the preferred size of this tab under the assumption that this tab is displayed together with tabs.

Specified by:
getPreferredSize in interface TabComponent
Parameters:
tabs - the displayed tabs, exactly one entry is this and may contain null entries.
Returns:
the preferred size of this tab