glass.eclipse.theme
Class CGlassEclipseTabPainter

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
                              extended by glass.eclipse.theme.CGlassEclipseTabPainter
All Implemented Interfaces:
bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent, bibliothek.gui.dock.DockElementRepresentative, bibliothek.gui.dock.util.PaintableComponent, ImageObserver, MenuContainer, Serializable, Accessible

@ColorCodes(value={"glass.selected.light","glass.selected.boundary","glass.selected.center","glass.unselected.light","glass.unselected.boundary","glass.unselected.center","glass.focused.light","glass.focused.boundary","glass.focused.center","glass.disabled.light","glass.disabled.boundary","glass.disabled.center","stack.tab.border.glass","stack.tab.border.selected.glass","stack.tab.border.selected.focused.glass","stack.tab.border.selected.focuslost.glass","stack.tab.border.disabled.glass","stack.tab.top.glass","stack.tab.top.selected.glass","stack.tab.top.selected.focused.glass","stack.tab.top.selected.focuslost.glass","stack.tab.top.disabled.glass","stack.tab.bottom.glass","stack.tab.bottom.selected.glass","stack.tab.bottom.selected.focused.glass","stack.tab.bottom.selected.focuslost.glass","stack.tab.bottom.disabled.glass","stack.tab.text.glass","stack.tab.text.selected.glass","stack.tab.text.selected.focused.glass","stack.tab.text.selected.focuslost.glass","stack.tab.text.disabled.glass","stack.border.glass"})
public class CGlassEclipseTabPainter
extends bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

Eclipse tab painter with glass look. Based on ArchPainter of Janni Kovacs.

Author:
Thomas Hilbert
See Also:
Serialized Form

Nested Class Summary
protected  class CGlassEclipseTabPainter.CGlassColor
          Special glass color.
protected static class CGlassEclipseTabPainter.CTabPainter
           
 
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  bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryDisabled
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassBoundarySelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryUnSelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterDisabled
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterSelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterUnSelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightDisabled
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightSelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightUnSelected
           
static int CORNER_RADIUS
           
static CGlassEclipseTabPainter.CTabPainter FACTORY
          This factory creates instances of CGlassEclipseTabPainter.
 
Fields inherited from class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent
colorStackBorder, colorStackTabBorder, colorStackTabBorderDisabled, colorStackTabBorderSelected, colorStackTabBorderSelectedFocused, colorStackTabBorderSelectedFocusLost, colorStackTabBottom, colorStackTabBottomDisabled, colorStackTabBottomSelected, colorStackTabBottomSelectedFocused, colorStackTabBottomSelectedFocusLost, colorStackTabText, colorStackTabTextDisabled, colorStackTabTextSelected, colorStackTabTextSelectedFocused, colorStackTabTextSelectedFocusLost, colorStackTabTop, colorStackTabTopDisabled, colorStackTabTopSelected, colorStackTabTopSelectedFocused, colorStackTabTopSelectedFocusLost, fontFocused, fontSelected, 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
CGlassEclipseTabPainter(bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane pane, bibliothek.gui.Dockable dockable)
          Creates a new painter.
 
Method Summary
 boolean contains(int x, int y)
           
protected  Shape createSelectedTabShape(int w, int h, boolean bFirst)
          Creates the tab outline for the selected tab.
protected  Shape createUnSelectedTabShape(int w, int h, boolean bFirst, boolean forClip)
          Creates the tab outline for an unselected tab.
protected  IGlassParameterFactory getGlassParameterFactory()
           
 Dimension getMinimumSize()
           
 Insets getOverlap(bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent other)
           
 Dimension getPreferredSize()
           
protected  int getSelectedIndex()
           
protected  void initAdditionalColors()
          Inits additional colors for painting the glass effect.
protected  boolean isHorizontal()
           
 void paintBackground(Graphics g)
           
protected  void paintSelected(Graphics g, boolean bActive)
          Paints the selected or focused tab (with round edges)
protected  void paintUnselected(Graphics g)
          Paints a unselected / unfocused tab.
 void setSmallTabs(boolean smallTabs)
           
 void unbind()
           
protected  void update()
          Updates the layout information of this painter.
 void updateBorder()
           
protected  void updateColors()
           
protected  void updateEnabled()
           
 void updateFocus()
           
protected  void updateGlass()
           
protected  void updateOrientation()
           
protected  void updateSelected()
           
 
Methods inherited from class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent
addAdditionalColors, addMouseInputListener, addMouseListener, addMouseMotionListener, bind, cleanNextTabSelected, cleanPreviousTabSelected, containsButton, doPaintIconWhenInactive, getButtonInsets, getButtons, getComponent, getController, getDockable, getDockableIndex, getElement, getIcon, getLabel, getLabelInsets, getMinimumSize, getOrientation, getPane, getPopupLocation, getPreferredSize, getStation, getTabIndex, getText, isBound, isFocused, isFocusTemporarilyLost, isNextTabSelected, isPreviousTabSelected, isSelected, isUsedAsTitle, removeMouseInputListener, removeMouseListener, removeMouseMotionListener, setButtonInsets, setEnabled, setFocused, setIcon, setLabelInsets, setNextTabSelected, setOrientation, setPaintIconWhenInactive, setPreviousTabSelected, setSelected, setTab, setText, setTooltip, shouldFocus, shouldTransfersFocus, updateFont, updatePaintIcon
 
Methods inherited from class bibliothek.gui.dock.util.ConfiguredBackgroundPanel
configure
 
Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel
getBackgroundAlgorithm, isSolid, isTransparent, paint, paintBorder, paintChildren, paintComponent, paintForeground, paintOverlay, setBackground, setSolid, setTransparent
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, 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, 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
 

Field Detail

CORNER_RADIUS

public static final int CORNER_RADIUS
See Also:
Constant Field Values

colGlassCenterFocused

protected bibliothek.gui.dock.themes.color.TabColor colGlassCenterFocused

colGlassBoundaryFocused

protected bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryFocused

colGlassLightFocused

protected bibliothek.gui.dock.themes.color.TabColor colGlassLightFocused

colGlassCenterSelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassCenterSelected

colGlassBoundarySelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassBoundarySelected

colGlassLightSelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassLightSelected

colGlassCenterUnSelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassCenterUnSelected

colGlassBoundaryUnSelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryUnSelected

colGlassLightUnSelected

protected bibliothek.gui.dock.themes.color.TabColor colGlassLightUnSelected

colGlassCenterDisabled

protected bibliothek.gui.dock.themes.color.TabColor colGlassCenterDisabled

colGlassBoundaryDisabled

protected bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryDisabled

colGlassLightDisabled

protected bibliothek.gui.dock.themes.color.TabColor colGlassLightDisabled

FACTORY

public static final CGlassEclipseTabPainter.CTabPainter FACTORY
This factory creates instances of CGlassEclipseTabPainter. Normal tab size.

Constructor Detail

CGlassEclipseTabPainter

public CGlassEclipseTabPainter(bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane pane,
                               bibliothek.gui.Dockable dockable)
Creates a new painter.

Parameters:
pane - the owner of this painter
dockable - the dockable which this painter represents
Method Detail

setSmallTabs

public void setSmallTabs(boolean smallTabs)

unbind

public void unbind()
Specified by:
unbind in interface bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent
Overrides:
unbind in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

getGlassParameterFactory

protected IGlassParameterFactory getGlassParameterFactory()

initAdditionalColors

protected void initAdditionalColors()
Inits additional colors for painting the glass effect.


updateBorder

public void updateBorder()
Specified by:
updateBorder in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

getOverlap

public Insets getOverlap(bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent other)

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

updateFocus

public void updateFocus()
Specified by:
updateFocus in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

updateOrientation

protected void updateOrientation()
Specified by:
updateOrientation in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

updateSelected

protected void updateSelected()
Specified by:
updateSelected in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

updateColors

protected void updateColors()
Specified by:
updateColors in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

updateEnabled

protected void updateEnabled()
Specified by:
updateEnabled in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

update

protected void update()
Updates the layout information of this painter.


updateGlass

protected void updateGlass()

contains

public boolean contains(int x,
                        int y)
Overrides:
contains in class JComponent

paintBackground

public void paintBackground(Graphics g)
Specified by:
paintBackground in interface bibliothek.gui.dock.util.PaintableComponent
Overrides:
paintBackground in class bibliothek.gui.dock.util.BackgroundPanel

getSelectedIndex

protected int getSelectedIndex()

isHorizontal

protected boolean isHorizontal()

paintUnselected

protected void paintUnselected(Graphics g)
Paints a unselected / unfocused tab.

Parameters:
g -

paintSelected

protected void paintSelected(Graphics g,
                             boolean bActive)
Paints the selected or focused tab (with round edges)

Parameters:
g -
bActive -

createUnSelectedTabShape

protected Shape createUnSelectedTabShape(int w,
                                         int h,
                                         boolean bFirst,
                                         boolean forClip)
Creates the tab outline for an unselected tab.

Parameters:
w -
h -
bFirst -
forClip -
Returns:

createSelectedTabShape

protected Shape createSelectedTabShape(int w,
                                       int h,
                                       boolean bFirst)
Creates the tab outline for the selected tab.

Parameters:
w -
h -
bFirst - Is it the first tab.
Returns: