NetCharts Pro

netcharts.pro.common
Class NFLine

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFLine
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator
Direct Known Subclasses:
NFArrowLine, NFGridLine, NFLineSetLine, NFRadialGrid

public class NFLine
extends NFBaseClass
implements NFCDLGenerator

The NFLine object describes a line's color, thickness, and style. In NetCharts, lines are used to show data, highlight areas using arrows, and to define symbol characteristics. This class has the fundamental methods and variables to support most line drawing in the NetCharts package.


Field Summary
static int DASHED
          Dashed line style
static int DOTDASH
          DotDash line style
static int DOTTED
          Dotted line style
static java.util.Hashtable lineTypeMap
          lineTypeMap hashtable
static int NONE
          No line style
static int SOLID
          Solid line style
 
Constructor Summary
NFLine()
          Constructs a default line object
NFLine(int style, int thickness, java.awt.Color color)
          Constructs a line with the given style thickness and color.
 
Method Summary
 java.lang.String getCDL()
          Generate CDL parameters representing this line
 void getCDL(java.lang.StringBuffer sb, boolean includeParens)
          Append CDL parameters representing this line to the given StringBuffer.
 java.awt.Color getColor()
          Return the line color
 int getStyle()
          Gets the current line style.
 int getThickness()
          Gets the current line thickness.
 void setCDL(java.lang.Object cdlObject)
          Configures this line from a CDL parameter object.
 void setCDL(java.lang.String s)
          Configures this object from a CDL parameter representation.
 int setCDL(java.lang.String[] elements, int offset)
          Configures this object from a CDL parameter representation.
 void setColor(java.awt.Color color)
          Set the line color
 void setStyle(int style)
          Sets the style to use for the line.
 void setThickness(int thickness)
          Sets the line thickness
 java.lang.String toString()
          Returns a new String object representing this line.
 
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 line style


SOLID

public static final int SOLID
Solid line style


DOTTED

public static final int DOTTED
Dotted line style


DASHED

public static final int DASHED
Dashed line style


DOTDASH

public static final int DOTDASH
DotDash line style


lineTypeMap

public static java.util.Hashtable lineTypeMap
lineTypeMap hashtable

Constructor Detail

NFLine

public NFLine()
Constructs a default line object


NFLine

public NFLine(int style,
              int thickness,
              java.awt.Color color)
Constructs a line with the given style thickness and color.

Parameters:
style - One of NONE, SOLID, DOTTED, DASHED, DOTDASH.
thickness - Line thickness (in pixels)
color - Line color
Method Detail

setThickness

public void setThickness(int thickness)
Sets the line thickness

Parameters:
thickness - Thickness (in pixels) of the line.

getThickness

public int getThickness()
Gets the current line thickness.

Returns:
the line thickness or 1 if not defined.

setStyle

public void setStyle(int style)
Sets the style to use for the line.

Parameters:
style - One of NONE, SOLID, DOTTED, DASHED, DOTDASH

getStyle

public int getStyle()
Gets the current line style.

Returns:
the line style or NONE if not defined.

setColor

public void setColor(java.awt.Color color)
Set the line color

Parameters:
color - Color object

getColor

public java.awt.Color getColor()
Return the line color

Returns:
the line color or null if not defined.

toString

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

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().

getCDL

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

Specified by:
getCDL in interface NFCDLGenerator
Returns:
CDL in the form: (style, thickness, color)

getCDL

public void getCDL(java.lang.StringBuffer sb,
                   boolean includeParens)
Append CDL parameters representing this line 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.

setCDL

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

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

setCDL

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

Specified by:
setCDL in interface NFCDLGenerator
Parameters:
cdl - CDL in the form: (style, thickness, color)

setCDL

public int 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 style, thickness, and color information.
offset - Offset into the elements array.

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 - 2018
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: Jan 7, 2018