org.flexdock.plaf.theme
Class TitlebarUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.flexdock.plaf.FlexViewComponentUI
          extended by org.flexdock.plaf.theme.TitlebarUI
All Implemented Interfaces:
IFlexViewComponentUI, XMLConstants
Direct Known Subclasses:
MetalTitlebarUI, SkinLFTitlebarUI

public class TitlebarUI
extends FlexViewComponentUI

Author:
Christopher Butler

Field Summary
protected  java.awt.Color activeBackground
           
protected  javax.swing.border.Border activeBorder
           
protected  java.awt.Color activeFont
           
protected  java.lang.Object antialiasing
           
static java.lang.String ANTIALIASING
           
static java.lang.String BACKGROUND_COLOR
           
static java.lang.String BACKGROUND_COLOR_ACTIVE
           
static java.lang.String BORDER
           
static java.lang.String BORDER_ACTIVE
           
protected  int buttonMargin
           
static java.lang.String DEFAULT_HEIGHT
           
protected  int defaultHeight
           
protected  IconMap defaultIcons
           
protected  java.awt.Font font
           
static java.lang.String FONT
           
static java.lang.String FONT_COLOR
           
static java.lang.String FONT_COLOR_ACTIVE
           
static java.lang.String ICON_INSETS
           
protected  java.awt.Insets iconInsets
           
protected  java.awt.Color inactiveBackground
           
protected  javax.swing.border.Border inactiveBorder
           
protected  java.awt.Color inactiveFont
           
protected  java.awt.Insets insets
           
static java.lang.String INSETS
           
static int MINIMUM_HEIGHT
           
protected  Painter painter
           
static java.lang.String PAINTER
           
 
Fields inherited from class org.flexdock.plaf.FlexViewComponentUI
creationParameters
 
Fields inherited from interface org.flexdock.plaf.IFlexViewComponentUI
ICON_RESOURCE
 
Fields inherited from interface org.flexdock.plaf.XMLConstants
ATTRIBUTE_KEY, CLASSNAME_KEY, CONSTRUCTOR_KEY, DESC_KEY, EXTENDS_KEY, HANDLER_KEY, INHERITS_KEY, NAME_KEY, OVERRIDDEN_KEY, PROP_HANDLER_KEY, PROPERTY_KEY, REFERENCE_KEY, VALUE_KEY
 
Constructor Summary
TitlebarUI()
           
 
Method Summary
 void configureAction(javax.swing.Action action)
           
 javax.swing.Action getAction(java.lang.String actionKey)
           
 java.awt.Color getActiveBackground()
           
 javax.swing.border.Border getActiveBorder()
           
 java.awt.Color getActiveFont()
           
protected  java.awt.Color getBackgroundColor(boolean active)
           
protected  javax.swing.border.Border getBorder(Titlebar titlebar)
           
 int getButtonMargin()
           
 int getDefaultHeight()
           
 IconMap getDefaultIcons()
           
 java.awt.Font getFont()
           
protected  java.awt.Color getFontColor(boolean active)
           
 java.awt.Insets getIconInsets()
           
protected  java.awt.Rectangle getIconRect(Titlebar titlebar)
           
 IconResource getIcons(javax.swing.Action action)
           
 IconResource getIcons(java.lang.String key)
           
 java.awt.Color getInactiveBackground()
           
 javax.swing.border.Border getInactiveBorder()
           
 java.awt.Color getInactiveFont()
           
 java.awt.Insets getInsets()
           
protected  int getLeftIconMargin()
           
 Painter getPainter()
           
protected  java.awt.Rectangle getPaintRect(Titlebar titlebar)
           
 java.lang.String getPreferredButtonUI()
           
 java.awt.Dimension getPreferredSize()
           
protected  int getRightIconMargin()
           
protected  int getTextLocation(java.awt.Rectangle iconRect)
           
 void initializeCreationParameters()
           
 void installUI(javax.swing.JComponent c)
           
 boolean isAntialiasing()
           
 void layoutComponents(Titlebar titlebar)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent jc)
           
protected  void paintBackground(java.awt.Graphics g, Titlebar titlebar)
           
protected  void paintBorder(java.awt.Graphics g, Titlebar titlebar)
           
protected  void paintIcon(java.awt.Graphics g, Titlebar titlebar)
           
protected  void paintTitle(java.awt.Graphics g, Titlebar titlebar)
           
 void setActiveBackground(java.awt.Color activeBackground)
           
 void setActiveBorder(javax.swing.border.Border activeBorder)
           
 void setActiveFont(java.awt.Color activeFont)
           
 void setAntialiasing(boolean antialias)
           
 void setButtonMargin(int buttonMargin)
           
 void setDefaultHeight(int defaultHeight)
           
 void setDefaultIcons(IconMap defaultIcons)
           
 void setDefaultIcons(java.lang.String iconMapName)
           
 void setFont(java.awt.Font font)
           
 void setIconInsets(java.awt.Insets iconInsets)
           
 void setInactiveBackground(java.awt.Color inactiveBackground)
           
 void setInactiveBorder(javax.swing.border.Border inactiveBorder)
           
 void setInactiveFont(java.awt.Color inactiveFont)
           
 void setInsets(java.awt.Insets insets)
           
 void setPainter(Painter painter)
           
 void uninstallUI(javax.swing.JComponent c)
           
 
Methods inherited from class org.flexdock.plaf.FlexViewComponentUI
getCreationParameters, setCreationParameters
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HEIGHT

public static final java.lang.String DEFAULT_HEIGHT
See Also:
Constant Field Values

FONT

public static final java.lang.String FONT
See Also:
Constant Field Values

FONT_COLOR

public static final java.lang.String FONT_COLOR
See Also:
Constant Field Values

FONT_COLOR_ACTIVE

public static final java.lang.String FONT_COLOR_ACTIVE
See Also:
Constant Field Values

BACKGROUND_COLOR

public static final java.lang.String BACKGROUND_COLOR
See Also:
Constant Field Values

BACKGROUND_COLOR_ACTIVE

public static final java.lang.String BACKGROUND_COLOR_ACTIVE
See Also:
Constant Field Values

BORDER

public static final java.lang.String BORDER
See Also:
Constant Field Values

BORDER_ACTIVE

public static final java.lang.String BORDER_ACTIVE
See Also:
Constant Field Values

PAINTER

public static final java.lang.String PAINTER
See Also:
Constant Field Values

INSETS

public static final java.lang.String INSETS
See Also:
Constant Field Values

ICON_INSETS

public static final java.lang.String ICON_INSETS
See Also:
Constant Field Values

ANTIALIASING

public static final java.lang.String ANTIALIASING
See Also:
Constant Field Values

MINIMUM_HEIGHT

public static final int MINIMUM_HEIGHT
See Also:
Constant Field Values

font

protected java.awt.Font font

activeFont

protected java.awt.Color activeFont

inactiveFont

protected java.awt.Color inactiveFont

activeBackground

protected java.awt.Color activeBackground

inactiveBackground

protected java.awt.Color inactiveBackground

activeBorder

protected javax.swing.border.Border activeBorder

inactiveBorder

protected javax.swing.border.Border inactiveBorder

defaultIcons

protected IconMap defaultIcons

painter

protected Painter painter

insets

protected java.awt.Insets insets

buttonMargin

protected int buttonMargin

iconInsets

protected java.awt.Insets iconInsets

antialiasing

protected java.lang.Object antialiasing

defaultHeight

protected int defaultHeight
Constructor Detail

TitlebarUI

public TitlebarUI()
Method Detail

installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.ComponentUI

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent jc)
Overrides:
paint in class javax.swing.plaf.ComponentUI

paintBackground

protected void paintBackground(java.awt.Graphics g,
                               Titlebar titlebar)

getPaintRect

protected java.awt.Rectangle getPaintRect(Titlebar titlebar)

paintTitle

protected void paintTitle(java.awt.Graphics g,
                          Titlebar titlebar)

getTextLocation

protected int getTextLocation(java.awt.Rectangle iconRect)

paintIcon

protected void paintIcon(java.awt.Graphics g,
                         Titlebar titlebar)

getIconRect

protected java.awt.Rectangle getIconRect(Titlebar titlebar)

getLeftIconMargin

protected int getLeftIconMargin()

getRightIconMargin

protected int getRightIconMargin()

paintBorder

protected void paintBorder(java.awt.Graphics g,
                           Titlebar titlebar)

layoutComponents

public void layoutComponents(Titlebar titlebar)

configureAction

public void configureAction(javax.swing.Action action)

getFontColor

protected java.awt.Color getFontColor(boolean active)

getBackgroundColor

protected java.awt.Color getBackgroundColor(boolean active)

getBorder

protected javax.swing.border.Border getBorder(Titlebar titlebar)

getDefaultHeight

public int getDefaultHeight()

setDefaultHeight

public void setDefaultHeight(int defaultHeight)

getPreferredSize

public java.awt.Dimension getPreferredSize()

getActiveBackground

public java.awt.Color getActiveBackground()
Returns:
Returns the activeBackground.

setActiveBackground

public void setActiveBackground(java.awt.Color activeBackground)
Parameters:
activeBackground - The activeBackground to set.

getActiveFont

public java.awt.Color getActiveFont()
Returns:
Returns the activeFont.

setActiveFont

public void setActiveFont(java.awt.Color activeFont)
Parameters:
activeFont - The activeFont to set.

getInactiveBackground

public java.awt.Color getInactiveBackground()
Returns:
Returns the inactiveBackground.

setInactiveBackground

public void setInactiveBackground(java.awt.Color inactiveBackground)
Parameters:
inactiveBackground - The inactiveBackground to set.

getInactiveFont

public java.awt.Color getInactiveFont()
Returns:
Returns the inactiveFont.

setInactiveFont

public void setInactiveFont(java.awt.Color inactiveFont)
Parameters:
inactiveFont - The inactiveFont to set.

getFont

public java.awt.Font getFont()
Returns:
Returns the font.

setFont

public void setFont(java.awt.Font font)
Parameters:
font - The font to set.

getDefaultIcons

public IconMap getDefaultIcons()

setDefaultIcons

public void setDefaultIcons(IconMap defaultIcons)

setDefaultIcons

public void setDefaultIcons(java.lang.String iconMapName)

getIcons

public IconResource getIcons(javax.swing.Action action)

getIcons

public IconResource getIcons(java.lang.String key)

getAction

public javax.swing.Action getAction(java.lang.String actionKey)

getInactiveBorder

public javax.swing.border.Border getInactiveBorder()
Returns:
Returns the inactiveBorder.

setInactiveBorder

public void setInactiveBorder(javax.swing.border.Border inactiveBorder)
Parameters:
inactiveBorder - The inactiveBorder to set.

getActiveBorder

public javax.swing.border.Border getActiveBorder()
Returns:
Returns the activeBorder.

setActiveBorder

public void setActiveBorder(javax.swing.border.Border activeBorder)
Parameters:
activeBorder - The activeBorder to set.

getIconInsets

public java.awt.Insets getIconInsets()
Returns:
Returns the iconInsets.

setIconInsets

public void setIconInsets(java.awt.Insets iconInsets)
Parameters:
iconInsets - The iconInsets to set.

getButtonMargin

public int getButtonMargin()
Returns:
Returns the buttonMargin.

setButtonMargin

public void setButtonMargin(int buttonMargin)
Parameters:
buttonMargin - The buttonMargin to set.

getPainter

public Painter getPainter()
Returns:
Returns the painterResource.

setPainter

public void setPainter(Painter painter)
Parameters:
painter - The painter to set.

getInsets

public java.awt.Insets getInsets()
Returns:
Returns the insets.

setInsets

public void setInsets(java.awt.Insets insets)
Parameters:
insets - The insets to set.

isAntialiasing

public boolean isAntialiasing()
Returns:
Returns the antialiasing.

setAntialiasing

public void setAntialiasing(boolean antialias)
Parameters:
antialias - The antialias to set.

initializeCreationParameters

public void initializeCreationParameters()
Specified by:
initializeCreationParameters in interface IFlexViewComponentUI
Specified by:
initializeCreationParameters in class FlexViewComponentUI

getPreferredButtonUI

public java.lang.String getPreferredButtonUI()