NetCharts Pro

netcharts.pro.common
Class NFArrowLine

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

public class NFArrowLine
extends NFLine
implements NFCDLGenerator

The NFArrowLine object is used to define lines and shapes used to highlight data items or areas within a chart. It consists of basic line parameters inherited from NFLine and the ability to specify an endPointStyle and arrow shape.


Field Summary
static java.util.Hashtable arrowShapeMap
          arrowShape hashtable
static int BLOCK
          Block Arrow Shape
static int BOTH
          <--> Arrow Endpoint Style
static int ELLIPSE
          Ellipse Endpoint Style Causes a ellipse to be drawn in the given line style.
static java.util.Hashtable endPointStyleMap
          endPointStyle hashtable
static int FROMTO
          ---> Arrow Endpoint Style
static int LINE
          Line Arrow Shape
static int NONE
          No Shape/Style
static int RECTANGLE
          Rectangle Endpoint Style.
static int ROUND
          Round End Point Shape
static int SHARP
          Sharp Arrow Shape
static int TOFROM
          <--- Arrow Endpoint Style
 
Fields inherited from class netcharts.pro.common.NFLine
DASHED, DOTDASH, DOTTED, lineTypeMap, SOLID
 
Constructor Summary
NFArrowLine()
          Constructs a default arrow line.
NFArrowLine(int style, int thickness, java.awt.Color color, int endPointStyle)
          Constructs a arrow line with the given style, color, and thickness.
 
Method Summary
 int getArrowShape()
          Get the shape of the end point arrow.
 java.awt.Dimension getArrowSize()
          Get the size of the end point arrow.
 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.
 int getEndPointStyle()
          Get the line's end point style.
 void setArrowShape(int arrowShape)
          Set the line's arrow shape using a constant.
 void setArrowSize(java.awt.Dimension arrowSize)
          Set the line's arrow size.
 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 setEndPointStyle(int endPointStyle)
          Set the line's end point style using a constant.
 java.lang.String toString()
          Returns a new String object representing this line.
 
Methods inherited from class netcharts.pro.common.NFLine
getColor, getStyle, getThickness, setCDL, setColor, setStyle, setThickness
 
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

FROMTO

public static final int FROMTO
---> Arrow Endpoint Style


TOFROM

public static final int TOFROM
<--- Arrow Endpoint Style


BOTH

public static final int BOTH
<--> Arrow Endpoint Style


NONE

public static final int NONE
No Shape/Style


RECTANGLE

public static final int RECTANGLE
Rectangle Endpoint Style. Causes a rectangle to be drawn in the given line style. Currently the NFNote object supplies the coordinates for the upper left and lower right corners of the rectangle.


ELLIPSE

public static final int ELLIPSE
Ellipse Endpoint Style Causes a ellipse to be drawn in the given line style. Currently the NFNote object supplies the coordinates for the upper left and lower right corners of the bounding rectangle.


LINE

public static final int LINE
Line Arrow Shape


BLOCK

public static final int BLOCK
Block Arrow Shape


SHARP

public static final int SHARP
Sharp Arrow Shape


ROUND

public static final int ROUND
Round End Point Shape


endPointStyleMap

public static java.util.Hashtable endPointStyleMap
endPointStyle hashtable


arrowShapeMap

public static java.util.Hashtable arrowShapeMap
arrowShape hashtable

Constructor Detail

NFArrowLine

public NFArrowLine()
Constructs a default arrow line.


NFArrowLine

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

Parameters:
style - One of NONE, SOLID, DOTTED, DASHED, DOTDASH
color - Line color.
thickness - Line thickness in pixels.
endPointStyle - One of NONE, FROMTO, TOFROM, BOTH, RECTANGLE, ELLIPSE.
Method Detail

setEndPointStyle

public void setEndPointStyle(int endPointStyle)
Set the line's end point style using a constant.

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

Parameters:
endPointStyle - One of NONE, FROMTO, TOFROM, BOTH, RECTANGLE, ELLIPSE

getEndPointStyle

public int getEndPointStyle()
Get the line's end point style.

Returns:
the style of end points.or FROMTO if not defined.

setArrowShape

public void setArrowShape(int arrowShape)
Set the line's arrow shape using a constant. This will have no effect if the endPointStyle is NONE, RECTANGLE, or ELLIPSE.

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

Parameters:
arrowShape - One of NONE, SHARP, LINE, BLOCK, ROUND

getArrowShape

public int getArrowShape()
Get the shape of the end point arrow.

Returns:
the shape of end point arrow or BLOCK if not defined.

setArrowSize

public void setArrowSize(java.awt.Dimension arrowSize)
Set the line's arrow size. This will have no effect if the endPointStyle is NONE, RECTANGLE, or ELLIPSE.

Parameters:
arrowSize - Dimension object representing the end point size.

getArrowSize

public java.awt.Dimension getArrowSize()
Get the size of the end point arrow.

Returns:
the size of end point arrow Dimension(6,6) 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 NFLine
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
Overrides:
getCDL in class NFLine
Returns:
CDL in the form: (style, thickness, color, arrowEndStyle, arrowShape, arrowWidth, arrowLength)

getCDL

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

Overrides:
getCDL in class NFLine
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.String s)
Configures this object from a CDL parameter representation.

Specified by:
setCDL in interface NFCDLGenerator
Overrides:
setCDL in class NFLine
Parameters:
cdl - CDL in the form: (style, thickness, color, endPointStyle, arrowShape, arrowWidth, arrowLength)

setCDL

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

Overrides:
setCDL in class NFLine
Parameters:
elements - Array of parameter elements. This array is expected to contain consecutive elements containing style, thickness, color, endpointStyle, arrowShape, arrowWidth, and arrowLength 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 - 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