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, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

@ColorCodes(value={"glass.selected.light","glass.selected.boundary","glass.selected.center","glass.focused.light","glass.focused.boundary","glass.focused.center","stack.tab.border.glass","stack.tab.border.selected.glass","stack.tab.border.selected.focused.glass","stack.tab.border.selected.focuslost.glass","stack.tab.top.glass","stack.tab.top.selected.glass","stack.tab.top.selected.focused.glass","stack.tab.top.selected.focuslost.glass","stack.tab.bottom.glass","stack.tab.bottom.selected.glass","stack.tab.bottom.selected.focused.glass","stack.tab.bottom.selected.focuslost.glass","stack.tab.text.glass","stack.tab.text.selected.glass","stack.tab.text.selected.focused.glass","stack.tab.text.selected.focuslost.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
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  bibliothek.gui.dock.themes.color.TabColor colGlassBoundaryFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassBoundarySelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassCenterSelected
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightFocused
           
protected  bibliothek.gui.dock.themes.color.TabColor colGlassLightSelected
           
static int CORNER_RADIUS
           
static CGlassEclipseTabPainter.CTabPainter FACTORY
          This factory creates instances of CGlassEclipseTabPainter.
static CGlassEclipseTabPainter.CTabPainter FACTORY_SMALL
          This factory creates instances of CGlassEclipseTabPainter.
 kux.glass.IGlassFactory.SGlassParameter glassFocused
          Glass parameter for focused tab background.
 kux.glass.IGlassFactory.SGlassParameter glassSelected
          Glass parameter for selected tab background.
static kux.glass.IGlassFactory.SGlassParameter VALUE_PLAIN
          Glass parameters for inactive tabs and tab strip background.
 
Fields inherited from class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent
colorStackBorder, colorStackTabBorder, colorStackTabBorderSelected, colorStackTabBorderSelectedFocused, colorStackTabBorderSelectedFocusLost, colorStackTabBottom, colorStackTabBottomSelected, colorStackTabBottomSelectedFocused, colorStackTabBottomSelectedFocusLost, colorStackTabText, colorStackTabTextSelected, colorStackTabTextSelectedFocused, colorStackTabTextSelectedFocusLost, colorStackTabTop, 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, boolean bSmallerTabs)
          Creates a new painter.
 
Method Summary
 boolean contains(int x, int y)
           
protected  java.awt.Shape createSelectedTabShape(int w, int h, boolean bFirst)
          Creates the tab outline for the selected tab.
protected  java.awt.Shape createUnSelectedTabShape(int w, int h, boolean bFirst, boolean forClip)
          Creates the tab outline for an unselected tab.
 java.awt.Dimension getMinimumSize()
           
 java.awt.Insets getOverlap(bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent other)
           
 java.awt.Dimension getPreferredSize()
           
protected  int getSelectedIndex()
           
protected  void initAdditionalColors()
          Inits additional colors for painting the glass effect.
protected  boolean isHorizontal()
           
 void paintBackground(java.awt.Graphics g)
           
protected  void paintSelected(java.awt.Graphics g, boolean bActive)
          Paints the selected or focused tab (with round edges)
protected  void paintUnselected(java.awt.Graphics g)
          Paints a unselected / unfocused tab.
protected  void update()
          Updates the layout information of this painter.
 void updateBorder()
           
protected  void updateColors()
           
 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, doLayout, 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, setFocused, setIcon, setLabelInsets, setNextTabSelected, setOrientation, setPaintIconWhenInactive, setPreviousTabSelected, setSelected, setTab, setText, setTooltip, shouldFocus, shouldTransfersFocus, unbind, 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, setEnabled, 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, 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

VALUE_PLAIN

public static kux.glass.IGlassFactory.SGlassParameter VALUE_PLAIN
Glass parameters for inactive tabs and tab strip background.


glassSelected

public kux.glass.IGlassFactory.SGlassParameter glassSelected
Glass parameter for selected tab background.


glassFocused

public kux.glass.IGlassFactory.SGlassParameter glassFocused
Glass parameter for focused tab background.


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

FACTORY

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


FACTORY_SMALL

public static final CGlassEclipseTabPainter.CTabPainter FACTORY_SMALL
This factory creates instances of CGlassEclipseTabPainter. Smaller tab size.

Constructor Detail

CGlassEclipseTabPainter

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

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

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 java.awt.Insets getOverlap(bibliothek.extension.gui.dock.theme.eclipse.stack.tab.TabComponent other)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BaseTabComponent

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

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 javax.swing.JComponent

paintBackground

public void paintBackground(java.awt.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(java.awt.Graphics g)
Paints a unselected / unfocused tab.

Parameters:
g -

paintSelected

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

Parameters:
g -
bActive -

createUnSelectedTabShape

protected java.awt.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 java.awt.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: