NetCharts Pro

netcharts.pro.common
Class NFRegion

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFRegion
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator
Direct Known Subclasses:
NFGridBackground

public class NFRegion
extends NFBaseClass
implements NFCDLGenerator

The NFRegion object defines the characteristics of a rectangular area in a chart. Typically, the region is used to present a background to the chart, titles, legends, annotations, and more. It contains information on the background color, border style, and border width. Users may optionally use an image background.


Field Summary
static java.util.Hashtable borderTypeMap
          borderTypeMap hashtable
static int BOX
          Box border style
static int CENTER
          Centered image layout.
static int CORNER_ROUND
          Round border corner style
static int CORNER_SNIP
          Snip border corner style
static int CORNER_SQUARE
          Square border corner style
static java.util.Hashtable cornerTypeMap
          cornerTypeMap hashtable
static java.util.Hashtable imageLayoutMap
          imageLayoutMap hashtable
static int NONE
          No border style
static int RAISED
          Raised border style
static int RECESS
          Recessed border style
static int SHADOW
          Shadow border style
static int SIZE
          Size-to-fit image layout.
static int TILE
          Tiled image layout.
 
Constructor Summary
NFRegion()
          Constructs a default region
NFRegion(java.awt.Color fillColor, int borderType, int borderWidth)
          Constructs a region with color, border type, and border width.
 
Method Summary
 java.awt.Color getBorderColor()
          Get the regions's border color
 int getBorderType()
          Get the regions's border type
 int getBorderWidth()
          Get the regions's border width
 int getBottomLeftCornerType()
          Get the regions's bottom left corner type
 int getBottomRightCornerType()
          Get the regions's bottom right corner type
 java.lang.String getCDL()
          Generate CDL parameters representing this region
 void getCDL(java.lang.StringBuffer sb, boolean includeParens)
          Append CDL parameters representing this region to the given StringBuffer.
 java.awt.Color getCornerOverhangColor()
          Get the regions's corner overlap color
 java.awt.Color getFillColor()
          Get the regions's background color
 java.awt.Image getImage()
          Returns the Image instance specified to use for the region or null if not specified.
 int getImageFormat()
          Get the regions's image format.
 java.lang.String getImageURL()
          Get the regions's image url string.
 java.util.Vector getObjects()
          Returns object vector of region elements
 int getTopLeftCornerType()
          Get the regions's top left corner type
 int getTopRightCornerType()
          Get the regions's top right corner type
 void setBorderColor(java.awt.Color borderColor)
          Set the regions's border color.
 void setBorderType(int borderType)
          Set the regions's border type using a constant.
 void setBorderWidth(int borderWidth)
          Set the regions's border width.
 void setBottomLeftCornerType(int bottomLeftCornerType)
          Set the regions's bottom left corner type using a constant.
 void setBottomRightCornerType(int bottomRightCornerType)
          Set the regions's bottom right corner type using a constant.
 void setCDL(java.lang.Object cdlObject)
          Configures this label from a CDL parameter object.
 void setCDL(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDL(java.lang.String[] elements, int offset)
          Configures this object from a CDL parameter representation.
 void setCornerOverhangColor(java.awt.Color color)
          Set the regions's corner overhang color.
 void setFillColor(java.awt.Color color)
          Set the regions's background color.
 void setImage(java.awt.Image image)
          Sets the Image instance specified to use for the region or null to remove.
 void setImageFormat(int imageFormat)
          Set the regions's image format.
 void setImageURL(java.lang.String imageURL)
          Set the regions's image url.
 void setTopLeftCornerType(int topLeftCornerType)
          Set the regions's top left corner type using a constant.
 void setTopRightCornerType(int topRightCornerType)
          Set the regions's top right corner type using a constant.
 java.lang.String toString()
          Returns a new String object representing this region.
 
Methods inherited from class netcharts.pro.common.NFBaseClass
clone, getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
No border style


BOX

public static final int BOX
Box border style


SHADOW

public static final int SHADOW
Shadow border style


RAISED

public static final int RAISED
Raised border style


RECESS

public static final int RECESS
Recessed border style


CORNER_SQUARE

public static final int CORNER_SQUARE
Square border corner style


CORNER_ROUND

public static final int CORNER_ROUND
Round border corner style


CORNER_SNIP

public static final int CORNER_SNIP
Snip border corner style


TILE

public static final int TILE
Tiled image layout. "Tiles" the image from left to right and top to bottom.


SIZE

public static final int SIZE
Size-to-fit image layout. Sizes the images to fit the bounds of the encapsulating region.


CENTER

public static final int CENTER
Centered image layout. Does not alter the size of the image, centers it within the given region.


borderTypeMap

public static java.util.Hashtable borderTypeMap
borderTypeMap hashtable


imageLayoutMap

public static java.util.Hashtable imageLayoutMap
imageLayoutMap hashtable


cornerTypeMap

public static java.util.Hashtable cornerTypeMap
cornerTypeMap hashtable

Constructor Detail

NFRegion

public NFRegion()
Constructs a default region


NFRegion

public NFRegion(java.awt.Color fillColor,
                int borderType,
                int borderWidth)
Constructs a region with color, border type, and border width. An Illegal argument exception will be thrown if the borderType is not valid.

Parameters:
fillColor - Background color
borderType - One of NONE, BOX, SHADOW, RAISED, or RECESS
borderWidth - Number of pixels on border or drop shadow.
Method Detail

getCornerOverhangColor

public java.awt.Color getCornerOverhangColor()
Get the regions's corner overlap color

Returns:
The region's corner overhang color.

setCornerOverhangColor

public void setCornerOverhangColor(java.awt.Color color)
Set the regions's corner overhang color.

Parameters:
color - The corner overhang color

getFillColor

public java.awt.Color getFillColor()
Get the regions's background color

Returns:
The background color.

setFillColor

public void setFillColor(java.awt.Color color)
Set the regions's background color.

Parameters:
color - The background color

getBorderColor

public java.awt.Color getBorderColor()
Get the regions's border color

Returns:
The border color

setBorderColor

public void setBorderColor(java.awt.Color borderColor)
Set the regions's border color.

Parameters:
borderColor -

getBorderType

public int getBorderType()
Get the regions's border type

Returns:
A constant representing the border type. One of NONE, BOX, SHADOW, RAISED, RECESS

setBorderType

public void setBorderType(int borderType)
Set the regions's border type using a constant. One of NONE, BOX, SHADOW, RAISED, RECESS

If the value passed is not a valid border type an IllegalArgumentException will be thrown.

Parameters:
borderType - One of NONE, BOX, SHADOW, RAISED, RECESS

getBorderWidth

public int getBorderWidth()
Get the regions's border width

Returns:
borderWidth

setBorderWidth

public void setBorderWidth(int borderWidth)
Set the regions's border width.

Parameters:
borderWidth -

getImageFormat

public int getImageFormat()
Get the regions's image format. One of SIZE, TILE, CENTER

Returns:
imageFormat

setImageFormat

public void setImageFormat(int imageFormat)
Set the regions's image format. One of SIZE, TILE, CENTER

Parameters:
imageFormat -

getImageURL

public java.lang.String getImageURL()
Get the regions's image url string.

Returns:
imageURL representing the location of an appropriate image. Note that in a client side application, Java security rules typically prevent an applet from requesting objects from other servers than the one downloaded from.

setImageURL

public void setImageURL(java.lang.String imageURL)
Set the regions's image url.

Parameters:
imageURL - Represents the location of an appropriate image (.gif, .png, .jpg). Note that in a client side application, Java security rules typically prevent an applet from requesting objects from other servers than the one downloaded from.

setImage

public void setImage(java.awt.Image image)
Sets the Image instance specified to use for the region or null to remove.

Parameters:
image - The Image instance to use for the region or null to remove.

getImage

public java.awt.Image getImage()
Returns the Image instance specified to use for the region or null if not specified.

Returns:
The Image instance specified to use for the region or null if not specified.

getTopLeftCornerType

public int getTopLeftCornerType()
Get the regions's top left corner type

Returns:
A constant representing the top left border corner type. One of SQUARE, ROUND, SNIP

setTopLeftCornerType

public void setTopLeftCornerType(int topLeftCornerType)
Set the regions's top left corner type using a constant. One of SQUARE, ROUND, SNIP

If the value passed is not a valid corner type an IllegalArgumentException will be thrown.

Parameters:
topLeftCornerType - One of SQUARE, ROUND, SNIP

getTopRightCornerType

public int getTopRightCornerType()
Get the regions's top right corner type

Returns:
A constant representing the top right border corner type. One of SQUARE, ROUND, SNIP

setTopRightCornerType

public void setTopRightCornerType(int topRightCornerType)
Set the regions's top right corner type using a constant. One of SQUARE, ROUND, SNIP

If the value passed is not a valid corner type an IllegalArgumentException will be thrown.

Parameters:
topRightCornerType - One of SQUARE, ROUND, SNIP

getBottomRightCornerType

public int getBottomRightCornerType()
Get the regions's bottom right corner type

Returns:
A constant representing the bottmo right border corner type. One of SQUARE, ROUND, SNIP

setBottomRightCornerType

public void setBottomRightCornerType(int bottomRightCornerType)
Set the regions's bottom right corner type using a constant. One of SQUARE, ROUND, SNIP

If the value passed is not a valid corner type an IllegalArgumentException will be thrown.

Parameters:
bottomRightCornerType - One of SQUARE, ROUND, SNIP

getBottomLeftCornerType

public int getBottomLeftCornerType()
Get the regions's bottom left corner type

Returns:
A constant representing the bottom left border corner type. One of SQUARE, ROUND, SNIP

setBottomLeftCornerType

public void setBottomLeftCornerType(int bottomLeftCornerType)
Set the regions's bottom left corner type using a constant. One of SQUARE, ROUND, SNIP

If the value passed is not a valid corner type an IllegalArgumentException will be thrown.

Parameters:
bottomLeftCornerType - One of SQUARE, ROUND, SNIP

setCDL

public void setCDL(java.lang.Object cdlObject)
Configures this label from a CDL parameter object.

Parameters:
cdlObject - CDL in a String form or in a user object.

setCDL

public void setCDL(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Specified by:
setCDL in interface NFCDLGenerator
Parameters:
cdl - CDL in the form: (color, borderType, borderWidth, "imageURL", imageFormat, borderColor)

setCDL

public void setCDL(java.lang.String[] elements,
                   int offset)
Configures this object from a CDL parameter representation.

Parameters:
elements - Array of parameter elements. This array is expected to contain consecutive elements containing color, borderType, borderWidth, imageURL, imageFormat, border color, topLeftCornerType, topRightCornerType, bottomRightCornerType, and bottomLeftCornerType information.
offset - Offset into the elements array.

getCDL

public java.lang.String getCDL()
Generate CDL parameters representing this region

Specified by:
getCDL in interface NFCDLGenerator
Returns:
CDL in the form: (color, borderType, borderWidth, "imageURL", imageFormat, borderColor, topLeftCornerType, topRightCornerType, bottomRightCornerType, bottomLeftCornerType)

toString

public java.lang.String toString()
Returns a new String object representing this region.

Specified by:
toString in interface NFCDLGenerator
Overrides:
toString in class java.lang.Object
Returns:
A new String object in the same form as that given by getCDL().

getObjects

public java.util.Vector getObjects()
Returns object vector of region elements

Returns:
objects

getCDL

public void getCDL(java.lang.StringBuffer sb,
                   boolean includeParens)
Append CDL parameters representing this region to the given StringBuffer.

Parameters:
sb - Target buffer to append the CDL parameters
includeParens - If true, this will cause the parameters to be delimited with parenthesis.

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011