EchoPoint
1.0

echopoint.tabbedpane
Class DefaultTabImageRenderer

java.lang.Object
  extended byechopoint.tabbedpane.DefaultTabImageRenderer
All Implemented Interfaces:
java.io.Serializable, TabImageRenderer

public class DefaultTabImageRenderer
extends java.lang.Object
implements TabImageRenderer, java.io.Serializable

DefaultTabImageRenderer is a default implementation of TabImageRenderer that uses a "background template image" and TextImageReference to return "dynamic" tab image representations.

See Also:
Serialized Form

Field Summary
static nextapp.echo.Insets DEFAULT_INSETS
          The default insets used by the DefaultTabImageRenderer
 
Constructor Summary
DefaultTabImageRenderer()
          Constructs a DefaultTabImageRenderer with default background tab images.
DefaultTabImageRenderer(java.awt.Image activeTabImage, java.awt.Image inactiveTabImage)
          Constructs a DefaultTabImageRenderer with the specified background tab images.
 
Method Summary
 java.awt.Image getActiveTabImage()
          Returns the current active tab java.awt.Image
 nextapp.echo.Color getImageBorderColor()
          This is called the indicate the color of any border around the image.
 int getImageBorderWidth()
          This is called the indicate the width of any border around the image.
 java.awt.Image getInactiveTabImage()
          Returns the current inactive tab java.awt.Image
 nextapp.echo.Insets getInsets()
          Returns the image insets that will be appplied to any TextImageReferences returned.
static DefaultTabImageRenderer getInstance()
          This helper method will construct a DefaultTabImageRenderer with default colors of 0xC0C0C0 for the active tabs, 0xE0E0E0 for the inactive tabs and a border color of 0x000000 and a tab placement of EchoConstants.TOP
static DefaultTabImageRenderer getInstance(nextapp.echo.Color activeTabColor, nextapp.echo.Color inactiveTabColor, nextapp.echo.Color borderColor, int tabPlacement)
          This helper method will construct a DefaultTabImageRenderer using some template background images.
static DefaultTabImageRenderer getInstance(int tabPlacement)
          This helper method will construct a DefaultTabImageRenderer with default colors of 0xC0C0C0 for the active tabs, 0xE0E0E0 for the inactive tabs and a border color of 0x000000.
 nextapp.echo.ImageReference getLeadInImage()
          Returns the current lead in ImageReference
 nextapp.echo.ImageReference getLeadInImage(TabbedPane tp)
          This returns a "lead in" image that will be place to the left of all tab images.
 nextapp.echo.ImageReference getLeadOutImage()
          Returns the current lead out ImageReference
 nextapp.echo.ImageReference getLeadOutImage(TabbedPane tp)
          This returns a "lead out" image that will be place to the right of all tab images.
 nextapp.echo.ImageReference getTabImage(TabbedPane tp, int tabIndex, java.lang.String tabText, boolean isActive)
          This returns an ImageReference to be used as the tab's representation.
 void prime(TabbedPane tp)
          This will set properties in the TabbedPane that are sutiable for this TabImageRenderer.
 void setActiveTabImage(java.awt.Image image)
          Sets the java.awt.Image to be used as a background for active tabs.
 void setBorderColor(nextapp.echo.Color color)
          Sets the border color that may be around any of the tab images
 void setBorderWidth(int i)
          Sets the border width that may be around any of the tab images
 void setInactiveTabImage(java.awt.Image image)
          Sets the java.awt.Image to be used as a background for inactive tabs.
 void setInsets(nextapp.echo.Insets insets)
          Sets the image insets that will be appplied to aby TextImageReferences returned.
 void setLeadInImage(nextapp.echo.ImageReference reference)
          Sets the ImageReference to be used for the lead in image
 void setLeadOutImage(nextapp.echo.ImageReference reference)
          Sets the ImageReference to be used for the lead out image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INSETS

public static final nextapp.echo.Insets DEFAULT_INSETS
The default insets used by the DefaultTabImageRenderer

Constructor Detail

DefaultTabImageRenderer

public DefaultTabImageRenderer()
Constructs a DefaultTabImageRenderer with default background tab images.


DefaultTabImageRenderer

public DefaultTabImageRenderer(java.awt.Image activeTabImage,
                               java.awt.Image inactiveTabImage)
Constructs a DefaultTabImageRenderer with the specified background tab images. The leadIn andleadOut ImageReferences will be null.

Parameters:
activeTabImage - - the java.awt.Image to be used for active tabs
inactiveTabImage - - the java.awt.Image to be used for inactive tabs
Method Detail

getLeadInImage

public nextapp.echo.ImageReference getLeadInImage(TabbedPane tp)
Description copied from interface: TabImageRenderer
This returns a "lead in" image that will be place to the left of all tab images. If there is no lead in image, then this method should return null.

Specified by:
getLeadInImage in interface TabImageRenderer
Parameters:
tp - the TabbedPane in question
Returns:
the lead in image or null if there isnt one
See Also:
TabImageRenderer.getLeadInImage(echopoint.TabbedPane)

getLeadOutImage

public nextapp.echo.ImageReference getLeadOutImage(TabbedPane tp)
Description copied from interface: TabImageRenderer
This returns a "lead out" image that will be place to the right of all tab images. If there is no lead out image, then this method should return null.

Specified by:
getLeadOutImage in interface TabImageRenderer
Parameters:
tp - the TabbedPane in question
Returns:
the lead out image or null if there isnt one
See Also:
TabImageRenderer.getLeadOutImage(echopoint.TabbedPane)

getTabImage

public nextapp.echo.ImageReference getTabImage(TabbedPane tp,
                                               int tabIndex,
                                               java.lang.String tabText,
                                               boolean isActive)
Description copied from interface: TabImageRenderer
This returns an ImageReference to be used as the tab's representation. This MUST NOT be null since the TabbedPane requires in image if a TabImageRenderer is in use.

Specified by:
getTabImage in interface TabImageRenderer
Parameters:
tp - the TabbedPane in question
tabIndex - - the index of the current tab
isActive - - true if the tab is active
Returns:
the image reference to use as the tab image
See Also:
TabImageRenderer.getTabImage(TabbedPane, int, String, boolean)

getImageBorderWidth

public int getImageBorderWidth()
Description copied from interface: TabImageRenderer
This is called the indicate the width of any border around the image. This is used by the TabbedPane to decide whether to place a 3 sided border under the provided images.

Specified by:
getImageBorderWidth in interface TabImageRenderer
Returns:
the width of any border around the images. Can be zero!
See Also:
TabImageRenderer.getImageBorderWidth()

getImageBorderColor

public nextapp.echo.Color getImageBorderColor()
Description copied from interface: TabImageRenderer
This is called the indicate the color of any border around the image. This is used by the TabbedPane to decide whether to place a 3 sided border under the provided images.

Specified by:
getImageBorderColor in interface TabImageRenderer
Returns:
the color of any border around the images. Can be null!
See Also:
TabImageRenderer.getImageBorderColor()

getActiveTabImage

public java.awt.Image getActiveTabImage()
Returns the current active tab java.awt.Image

Returns:
the current active tab java.awt.Image

getInactiveTabImage

public java.awt.Image getInactiveTabImage()
Returns the current inactive tab java.awt.Image

Returns:
the current inactive tab java.awt.Image

getLeadInImage

public nextapp.echo.ImageReference getLeadInImage()
Returns the current lead in ImageReference

Returns:
the current lead in ImageReference

getLeadOutImage

public nextapp.echo.ImageReference getLeadOutImage()
Returns the current lead out ImageReference

Returns:
the current lead out ImageReference

setActiveTabImage

public void setActiveTabImage(java.awt.Image image)
Sets the java.awt.Image to be used as a background for active tabs.

Parameters:
image - - the java.awt.Image to be used as a background for active tabs

setInactiveTabImage

public void setInactiveTabImage(java.awt.Image image)
Sets the java.awt.Image to be used as a background for inactive tabs.

Parameters:
image - - the java.awt.Image to be used as a background for inactive tabs

setLeadInImage

public void setLeadInImage(nextapp.echo.ImageReference reference)
Sets the ImageReference to be used for the lead in image

Parameters:
reference - the ImageReference to be used for the lead in image

setLeadOutImage

public void setLeadOutImage(nextapp.echo.ImageReference reference)
Sets the ImageReference to be used for the lead out image

Parameters:
reference - the ImageReference to be used for the lead out image

getInsets

public nextapp.echo.Insets getInsets()
Returns the image insets that will be appplied to any TextImageReferences returned.

Returns:
the image insets

setInsets

public void setInsets(nextapp.echo.Insets insets)
Sets the image insets that will be appplied to aby TextImageReferences returned.

Parameters:
insets -

setBorderColor

public void setBorderColor(nextapp.echo.Color color)
Sets the border color that may be around any of the tab images

Parameters:
color - - the border color that may be around any of the tab images

setBorderWidth

public void setBorderWidth(int i)
Sets the border width that may be around any of the tab images

Parameters:
i - - the border width that may be around any of the tab images

prime

public void prime(TabbedPane tp)
This will set properties in the TabbedPane that are sutiable for this TabImageRenderer. This can include things like border color, active background and inactive background colors, and tab placement.

This method is best used if you created the DefaultTabImageRenderer with the getInstance() methods.

Parameters:
tp - the TabbedPane tgo be primed with values

getInstance

public static DefaultTabImageRenderer getInstance()
This helper method will construct a DefaultTabImageRenderer with default colors of 0xC0C0C0 for the active tabs, 0xE0E0E0 for the inactive tabs and a border color of 0x000000 and a tab placement of EchoConstants.TOP

Returns:
a primed DefaultTabImageRenderer

getInstance

public static DefaultTabImageRenderer getInstance(int tabPlacement)
This helper method will construct a DefaultTabImageRenderer with default colors of 0xC0C0C0 for the active tabs, 0xE0E0E0 for the inactive tabs and a border color of 0x000000. You need to specifiy the tab placement.

Parameters:
tabPlacement - - can be EchoConstants.TOP or EchoConstants.BOTTOM
Returns:
a primed DefaultTabImageRenderer

getInstance

public static DefaultTabImageRenderer getInstance(nextapp.echo.Color activeTabColor,
                                                  nextapp.echo.Color inactiveTabColor,
                                                  nextapp.echo.Color borderColor,
                                                  int tabPlacement)
This helper method will construct a DefaultTabImageRenderer using some template background images. The template images have a 1 pixel border, rounded edges and a transparent side. This method will "transform" the default template images to match the colors provided.

Parameters:
activeTabColor - - the desired active tab color
inactiveTabColor - - the desired inactive tab color
borderColor - - the desired border color
tabPlacement - - can be EchoConstants.TOP or EchoConstants.BOTTOM
Returns:
a primed DefaultTabImageRenderer

EchoPoint
1.0