ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.gui.util
Class BannerPainter<T>

java.lang.Object
  extended by com.ehsbe.commons.gui.util.BannerPainter<T>
Type Parameters:
T - inrelevant
All Implemented Interfaces:
org.jdesktop.swingx.painter.Painter<T>

public class BannerPainter<T>
extends Object
implements org.jdesktop.swingx.painter.Painter<T>

Paints banner at the given Graphics2D context.

Version:
$Revision: 450 $
Author:
Jens Elkner

Constructor Summary
BannerPainter()
          Create a default painter.
BannerPainter(String banner)
          Create a default painter.
BannerPainter(String banner, Font font, Color foreground, Color background, Color backgroundLight)
          Create a customized painter.
 
Method Summary
 Color getBackground()
          Get the (dark) background color.
 Color getBackgroundLight()
          Get the lighter background color.
 String getBanner()
          Get the banner text to draw.
 Font getFont()
          Get the font used to draw the banner.
 Color getForeground()
          Get the foreground used to draw the banner text.
 void paint(Graphics2D g2, T panel, int width, int height)
          
 void setBackground(Color background)
          Set the (dark) background color.
 void setBackgroundLight(Color backgroundLight)
          Set the lighter background color.
 void setBanner(String banner)
          Set the banner text to draw.
 void setFont(Font font)
          Set the font used to draw the banner.
 void setForeground(Color foreground)
          Set the foreground used to draw the banner text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BannerPainter

public BannerPainter()
Create a default painter.


BannerPainter

public BannerPainter(String banner)
Create a default painter.

Parameters:
banner - see setBanner(String)

BannerPainter

public BannerPainter(String banner,
                     Font font,
                     Color foreground,
                     Color background,
                     Color backgroundLight)
Create a customized painter.

Parameters:
banner - see setBanner(String)
font - see setFont(Font)
foreground - see setForeground(Color)
background - see setBackground(Color)
backgroundLight - see setBackgroundLight(Color)
Method Detail

getFont

public Font getFont()
Get the font used to draw the banner.

Returns:
the font.

setFont

public void setFont(Font font)
Set the font used to draw the banner.

Parameters:
font - if null a default font will be used.

getBanner

public String getBanner()
Get the banner text to draw.

Returns:
null if not set, the text otherwise.

setBanner

public void setBanner(String banner)
Set the banner text to draw.

Parameters:
banner - if null no banner gets drawn, the text otherwise.

getForeground

public Color getForeground()
Get the foreground used to draw the banner text.

Returns:
the banner text color.

setForeground

public void setForeground(Color foreground)
Set the foreground used to draw the banner text.

Parameters:
foreground - the banner text color to use. If null the default color will be used.

getBackground

public Color getBackground()
Get the (dark) background color. This is also the start color for the gradient.

Returns:
the background color.

setBackground

public void setBackground(Color background)
Set the (dark) background color. This is also the start color for the gradient.

Parameters:
background - the background color. If null the default color will be used.

getBackgroundLight

public Color getBackgroundLight()
Get the lighter background color. This is also the stop color for the gradient.

Returns:
the lighter background color.

setBackgroundLight

public void setBackgroundLight(Color backgroundLight)
Set the lighter background color. This is also the stop color for the gradient.

Parameters:
backgroundLight - the lighter background color. If null the default color will be used.

paint

public void paint(Graphics2D g2,
                  T panel,
                  int width,
                  int height)

Specified by:
paint in interface org.jdesktop.swingx.painter.Painter<T>

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.