Overview | Package | Class | Tree | Index | Help NetCharts Pro (Applets) 7.0
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

netcharts.graphics
Class NFRegion

java.lang.Object
  |
  +--netcharts.graphics.NFRegion

public class NFRegion
Creates a rectangular region, with or without a border.

Within an HTML file, the following parameters (as supported by NFParam) can be used to specify the attributes of a label:


Field Summary
static int BOX
          Box border
static int ETCHED
          Deprecated. Etched border
static int NONE
          No border
static int RAISED
          Raised border
static int RECESS
          Recessed border
static int SHADOW
          Shadow border
static int SIZE
          Size image to fit area
static int TILE
          Tile image in area
 
Constructor Summary
NFRegion()
          Create a new region, using all defaults.
NFRegion(java.awt.Graphics g)
          Create a new region, using default attributes and position.
NFRegion(java.awt.Graphics g, int x, int y, int width, int height)
          Create a new region, using default attributes.
NFRegion(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int borderType, int borderWidth, java.awt.Color borderColor)
          Create a new region, specifying all attributes.
NFRegion(NFRegion region)
          Create a new region, specifying all attributes.
 
Method Summary
void draw()
          Draw a region using the current attributes.
void draw(java.awt.Graphics g)
          Draw a region in the given graphics context, using the current attributes.
void draw(java.awt.Graphics g, int x, int y)
          Draw a region at the given location, using the current attributes.
void draw(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a region at the given location and size, using the current attributes.
void draw(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int borderType, int borderWidth, java.awt.Color borderColor, java.awt.Image im)
          Draw a region at the given location and size, using the current attributes.
static void draw(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int borderType, int borderWidth, java.awt.Color borderColor, java.awt.Image im, int imageType)
          Draw a region given all of the attributes, using a scale factor of 0.
static void draw(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int borderType, int borderWidth, java.awt.Color borderColor, java.awt.Image im, int imageType, double scale)
          Draw a region given all of the attributes.
static void draw(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int borderType, int borderWidth, java.awt.Color borderColor, java.awt.Image im, int imageType, double scale, java.lang.String label, int justify, int labelMargin, java.awt.Font labelFont, java.awt.Color labelColor)
          Draw a region given all of the attributes.
NFRegionBorder getBorder()
          Get the amount of space used by the border on all four sides of the region, based on the current border style and width.
static NFRegionBorder getBorder(int borderType, int borderWidth)
          Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
static NFRegionBorder getBorder(int borderType, int borderWidth, NFRegionBorder b, double scale)
          Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
static NFRegionBorder getBorder(int borderType, int borderWidth, NFRegionBorder b, double scale, java.lang.String label, java.awt.Font labelFont)
          Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
static NFRegionBorder getBorder(int borderType, int borderWidth, java.lang.String label, java.awt.Font labelFont)
          Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
static NFRegionBorder getBorder(int borderType, int borderWidth, java.lang.String label, java.awt.Font labelFont, NFRegionBorder b)
          Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
NFRegionBorder getBorder(NFRegionBorder b)
          Get the amount of space used by the border on all four sides of the region, based on the current border style and width.
java.awt.Color getBorderColor()
          Get the border color.
int getBorderType()
          Returns the current border type
int getBorderWidth()
          Returns the current border type
java.awt.Color getColor()
          Get the color.
void getHashID(java.lang.StringBuffer buf)
          Appends a string that represents the value of all key properties to the given buffer
java.awt.Image getImage()
          Return the currently assigned image or null
int getImageType()
          Get the image type
java.lang.String getLabel()
          Get the label of this region.
java.awt.Color getLabelColor()
          Get the color of the label.
java.awt.Font getLabelFont()
          Get the label font.
static NFRegion loadParams(NFParam p, java.lang.Object val)
          Build a new region, given a vector of values from the parser.
static NFRegion loadParams(NFParam p, java.lang.Object val, int offset)
          Build a new region, given a vector of values from the parser, starting at the given offset.
static void loadParams(NFRegion region, java.util.Vector v, int offset)
          Load the given region using the values in the given vector starting at the given offset.
void setBorder(int type)
          Set the border type.
void setBorder(int type, int width, java.awt.Color color)
          Set the border attributes.
void setBorderColor(java.awt.Color color)
          Set the border color.
void setBorderCornerStyle(int topLeftCornerType, int topRightCornerType, int bottomRightCornerType, int bottomLeftCornerType)
          Set the border corner attributes.
void setBorderType(int type)
          Set the border type.
void setBorderWidth(int width)
          Set the border width.
void setColor(java.awt.Color color)
          Set the color.
void setCornerOverhangColor(java.awt.Color color)
          Set the corner overhang color.
void setGraphics(java.awt.Graphics g)
          Set the graphics context.
void setImage(java.awt.Image im)
          Set the background image.
void setImageType(int type)
          Set the image type
void setJustify(int justify)
          Set the justification of the Region label.
void setLabel(java.lang.String label)
          Set the text of the label.
void setLabelColor(java.awt.Color labelColor)
          Set the color of the label.
void setLabelFont(java.awt.Font labelFont)
          Set the font of the label.
void setLabelMargin(int width)
          Set the margin used in right and left justification of the Region label.
void setPos(int x, int y)
          Set the upper left position for the region.
void setScale(double scale)
          Set the scale factor for this region
void setSize(int width, int height)
          Set the size of the region.
 

Field Detail

NONE

public static final int NONE
No border

BOX

public static final int BOX
Box border

SHADOW

public static final int SHADOW
Shadow border

RAISED

public static final int RAISED
Raised border

RECESS

public static final int RECESS
Recessed border

ETCHED

public static final int ETCHED
Deprecated.  
Etched border

TILE

public static final int TILE
Tile image in area

SIZE

public static final int SIZE
Size image to fit area
Constructor Detail

NFRegion

public NFRegion(java.awt.Graphics g,
                int x,
                int y,
                int width,
                int height,
                java.awt.Color color,
                int borderType,
                int borderWidth,
                java.awt.Color borderColor)
Create a new region, specifying all attributes.
Parameters:
g - The Graphics to draw on.
x - The X coordinate of the Region.
y - The Y coordinate of the Region.
width - The width of the Region.
height - The height of the Region.
color - The background color.
borderType - The border type.
borderWidth - The border width.
borderColor - The border color.

NFRegion

public NFRegion(java.awt.Graphics g,
                int x,
                int y,
                int width,
                int height)
Create a new region, using default attributes.
Parameters:
g - The Graphics to draw on.
x - The X coordinate of the Region.
y - The Y coordinate of the Region.
width - The width of the Region.
height - The height of the Region.

NFRegion

public NFRegion(java.awt.Graphics g)
Create a new region, using default attributes and position.
Parameters:
g - The Graphics to draw on.

NFRegion

public NFRegion()
Create a new region, using all defaults.

NFRegion

public NFRegion(NFRegion region)
Create a new region, specifying all attributes.
Parameters:
region - The Region to copy attributes from.
Method Detail

setLabelMargin

public void setLabelMargin(int width)
Set the margin used in right and left justification of the Region label. The margin is between the border and the label.
Parameters:
width - The new label margin.

setJustify

public void setJustify(int justify)
Set the justification of the Region label.
Parameters:
justify - The justification.

getLabelColor

public java.awt.Color getLabelColor()
Get the color of the label.
Returns:
The label color.

setLabelColor

public void setLabelColor(java.awt.Color labelColor)
Set the color of the label.
Parameters:
labelColor - The label color.

getLabel

public java.lang.String getLabel()
Get the label of this region.
Returns:
The label text.

setLabel

public void setLabel(java.lang.String label)
Set the text of the label.
Parameters:
label - The label text.

getLabelFont

public java.awt.Font getLabelFont()
Get the label font.
Returns:
The label font.

setLabelFont

public void setLabelFont(java.awt.Font labelFont)
Set the font of the label.
Parameters:
labelFont - The label font.

loadParams

public static NFRegion loadParams(NFParam p,
                                  java.lang.Object val)
Build a new region, given a vector of values from the parser.
Parameters:
p - The NFParam object to load parameters from.
val - The value of the parameter to load.
Returns:
The resulting NFRegion object.

loadParams

public static NFRegion loadParams(NFParam p,
                                  java.lang.Object val,
                                  int offset)
Build a new region, given a vector of values from the parser, starting at the given offset.
Parameters:
p - The NFParam object to load parameters from.
val - The value of the parameter to load.
offset - The offset of the region parameters in the given value.
Returns:
The resulting NFRegion object.

loadParams

public static void loadParams(NFRegion region,
                              java.util.Vector v,
                              int offset)
Load the given region using the values in the given vector starting at the given offset.
Parameters:
region - The NFRegion to modify.
v - The value of the parameter to load.
offset - The offset of the region parameters in the given value.

setGraphics

public void setGraphics(java.awt.Graphics g)
Set the graphics context.
Parameters:
g - The Graphics.

setImage

public void setImage(java.awt.Image im)
Set the background image.
Parameters:
im - The background Image.

getImage

public java.awt.Image getImage()
Return the currently assigned image or null
Returns:
The background image.

setCornerOverhangColor

public void setCornerOverhangColor(java.awt.Color color)
Set the corner overhang color.
Parameters:
color - The corner overhang background color.

setColor

public void setColor(java.awt.Color color)
Set the color.
Parameters:
color - The background color.

getColor

public java.awt.Color getColor()
Get the color.
Returns:
The background color.

setPos

public void setPos(int x,
                   int y)
Set the upper left position for the region.
Parameters:
x - The X coordinate of the region.
y - The Y coordinate of the region.

setSize

public void setSize(int width,
                    int height)
Set the size of the region.
Parameters:
width - The width of the region.
height - The height of the region.

setBorder

public void setBorder(int type)
Set the border type.
Parameters:
type - The border type.

setBorderCornerStyle

public void setBorderCornerStyle(int topLeftCornerType,
                                 int topRightCornerType,
                                 int bottomRightCornerType,
                                 int bottomLeftCornerType)
Set the border corner attributes.
Parameters:
topLeftCornerType - The top left corner type.
topRightCornerType - The top right corner type.
bottomRightCornerType - The bottom right corner type.
bottomLeftCornerType - The bottom left corner type.

setBorder

public void setBorder(int type,
                      int width,
                      java.awt.Color color)
Set the border attributes.
Parameters:
type - The border type.
width - The border width.
color - The border color.

setBorderColor

public void setBorderColor(java.awt.Color color)
Set the border color.
Parameters:
color - The border color.

setScale

public void setScale(double scale)
Set the scale factor for this region
Parameters:
scale - The scale factor.

getBorderColor

public java.awt.Color getBorderColor()
Get the border color.
Returns:
The border color.

setBorderType

public void setBorderType(int type)
Set the border type.
Parameters:
type - The border type.

setBorderWidth

public void setBorderWidth(int width)
Set the border width.
Parameters:
width - The border width.

setImageType

public void setImageType(int type)
Set the image type
Parameters:
type - The image type.

getImageType

public int getImageType()
Get the image type
Returns:
The image type.

getBorderWidth

public int getBorderWidth()
Returns the current border type
Returns:
The border type.

getBorderType

public int getBorderType()
Returns the current border type
Returns:
The border type.

getBorder

public NFRegionBorder getBorder()
Get the amount of space used by the border on all four sides of the region, based on the current border style and width.
Returns:
The border of this region.

getBorder

public NFRegionBorder getBorder(NFRegionBorder b)
Get the amount of space used by the border on all four sides of the region, based on the current border style and width.

If the given object is non-null, the values will be returned in it, otherwise a new object will be created.

Parameters:
b - Where to store the border.
Returns:
The border of this region.

getBorder

public static NFRegionBorder getBorder(int borderType,
                                       int borderWidth)
Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
Parameters:
borderType - The border type.
borderWidth - The border width.
Returns:
The border of this region.

getBorder

public static NFRegionBorder getBorder(int borderType,
                                       int borderWidth,
                                       java.lang.String label,
                                       java.awt.Font labelFont)
Get the amount of space used by the border on all four sides of the region, based on the given border style and width.
Parameters:
borderType - The border type.
borderWidth - The border width.
label - The region label.
labelFont - The region label font.
Returns:
The border of this region.

getBorder

public static NFRegionBorder getBorder(int borderType,
                                       int borderWidth,
                                       java.lang.String label,
                                       java.awt.Font labelFont,
                                       NFRegionBorder b)
Get the amount of space used by the border on all four sides of the region, based on the given border style and width.

If the given object is non-null, the values will be returned in it, otherwise a new object will be created.

Parameters:
borderType - The border type.
borderWidth - The border width.
label - The region label.
labelFont - The region label font.
b - Where to store the border.
Returns:
The border of this region.

getBorder

public static NFRegionBorder getBorder(int borderType,
                                       int borderWidth,
                                       NFRegionBorder b,
                                       double scale)
Get the amount of space used by the border on all four sides of the region, based on the given border style and width.

If the given object is non-null, the values will be returned in it, otherwise a new object will be created.

Parameters:
borderType - The border type.
borderWidth - The border width.
b - Where to store the border.
scale - The scale factor.

getBorder

public static NFRegionBorder getBorder(int borderType,
                                       int borderWidth,
                                       NFRegionBorder b,
                                       double scale,
                                       java.lang.String label,
                                       java.awt.Font labelFont)
Get the amount of space used by the border on all four sides of the region, based on the given border style and width.

If the given object is non-null, the values will be returned in it, otherwise a new object will be created.

Parameters:
borderType - The border type.
borderWidth - The border width.
b - Where to store the border.
scale - The scale factor.
label - The region label.
labelFont - The region label font.

getHashID

public void getHashID(java.lang.StringBuffer buf)
Appends a string that represents the value of all key properties to the given buffer
Parameters:
buf - The buffer to append the hash id to.

draw

public void draw()
Draw a region using the current attributes.

draw

public void draw(java.awt.Graphics g)
Draw a region in the given graphics context, using the current attributes.
Parameters:
g - The Graphics.

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y)
Draw a region at the given location, using the current attributes.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 int width,
                 int height)
Draw a region at the given location and size, using the current attributes.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.
width - The width of the region.
height - The height of the region.

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 int width,
                 int height,
                 java.awt.Color color,
                 int borderType,
                 int borderWidth,
                 java.awt.Color borderColor,
                 java.awt.Image im)
Draw a region at the given location and size, using the current attributes.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.
width - The width of the region.
height - The height of the region.
color - The background color.
borderType - The border type.
borderWidth - The border width.
borderColor - The border color.
im - The background Image.

draw

public static void draw(java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height,
                        java.awt.Color color,
                        int borderType,
                        int borderWidth,
                        java.awt.Color borderColor,
                        java.awt.Image im,
                        int imageType)
Draw a region given all of the attributes, using a scale factor of 0.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.
width - The width of the region.
height - The height of the region.
color - The background color.
borderType - The border type.
borderWidth - The border width.
borderColor - The border color.
im - The background Image.
imageType - The image type.

draw

public static void draw(java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height,
                        java.awt.Color color,
                        int borderType,
                        int borderWidth,
                        java.awt.Color borderColor,
                        java.awt.Image im,
                        int imageType,
                        double scale)
Draw a region given all of the attributes.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.
width - The width of the region.
height - The height of the region.
color - The background color.
borderType - The border type.
borderWidth - The border width.
borderColor - The border color.
im - The background Image.
imageType - The image type.
scale - The scale factor.

draw

public static void draw(java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height,
                        java.awt.Color color,
                        int borderType,
                        int borderWidth,
                        java.awt.Color borderColor,
                        java.awt.Image im,
                        int imageType,
                        double scale,
                        java.lang.String label,
                        int justify,
                        int labelMargin,
                        java.awt.Font labelFont,
                        java.awt.Color labelColor)
Draw a region given all of the attributes.
Parameters:
g - The Graphics.
x - The X coordinate of the region.
y - The Y coordinate of the region.
width - The width of the region.
height - The height of the region.
color - The background color.
borderType - The border type.
borderWidth - The border width.
borderColor - The border color.
im - The background Image.
imageType - The image type.
scale - The scale factor.
label - The region label.
justify - The region label justification.
labelMargin - The region label margin.
labelFont - The region label font.
labelColor - The label color.

Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD


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

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

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

Last Modified: Jun 29, 2010