NetCharts Pro

netcharts.pro.common
Class NFSymbol

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

public abstract class NFSymbol
extends NFBaseClass
implements NFCDLGenerator

The abstract NFSymbol class provides support for objects requiring drawing symbol properties.


Field Summary
static int BOTH
          Filled and Outlined symbol style
static int CIRCLE
          Circle Symbol type
static int CROSS
          Cross Symbol type
static int DIAMOND
          Diamond Symbol type
static int FILLED
          Fill the symbol style
static int HRECTANGLE
          Horizontal Rectangle type
static int NONE
          No Symbol type
static int OUTLINED
          Draw the symbol outline style
static int SQUARE
          Square Symbol type
static java.util.Hashtable styleMap
          The set of allowed symbol styles.
static int TARGET
          Target Symbol type
static int TRIANGLEDOWN
          Triangle Down Symbol type
static int TRIANGLEUP
          Triangle Up Symbol type
static java.util.Hashtable typeMap
          The set of allowed symbol types.
static int VRECTANGLE
          Vertical Rectangle type
 
Constructor Summary
NFSymbol()
          Constructs a default symbol object
NFSymbol(int type, int size, int style)
          Constructs a symbol object with the specified symbol type, size, and style.
 
Method Summary
 java.lang.String getCDL()
          Generate CDL parameters representing this symbol
 java.lang.String getCDL(java.lang.StringBuffer sb, boolean includeParens)
          Append CDL parameters representing this symbol to the given StringBuffer.
 int getSize()
          Gets the current data symbol size.
 int getStyle()
          Gets the current data symbol style.
 int getType()
          Gets the current data symbol type.
 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.
 int setCDL(java.lang.String[] elements, int offset)
          Configures this object from a CDL parameter representation.
 void setSize(int size)
          Sets the data symbol size in pixels.
 void setStyle(int style)
          Sets the style to use for the data symbol.
 void setType(int type)
          Sets the symbol type to use for the data.
 java.lang.String toString()
          Returns a new String object representing this symbol.
 
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

typeMap

public static java.util.Hashtable typeMap
The set of allowed symbol types. Consists of NONE, CIRCLE, SQUARE, DIAMOND, TRIANGLEUP, TRIANGLEDOWN, CROSS, VRECTANGLE, HRECTANGLE, TARGET


styleMap

public static java.util.Hashtable styleMap
The set of allowed symbol styles. Consists of OUTLINED, FILLED, BOTH


NONE

public static final int NONE
No Symbol type


CIRCLE

public static final int CIRCLE
Circle Symbol type


SQUARE

public static final int SQUARE
Square Symbol type


DIAMOND

public static final int DIAMOND
Diamond Symbol type


TRIANGLEUP

public static final int TRIANGLEUP
Triangle Up Symbol type


TRIANGLEDOWN

public static final int TRIANGLEDOWN
Triangle Down Symbol type


CROSS

public static final int CROSS
Cross Symbol type


VRECTANGLE

public static final int VRECTANGLE
Vertical Rectangle type


HRECTANGLE

public static final int HRECTANGLE
Horizontal Rectangle type


TARGET

public static final int TARGET
Target Symbol type


FILLED

public static final int FILLED
Fill the symbol style

See Also:
Constant Field Values

OUTLINED

public static final int OUTLINED
Draw the symbol outline style

See Also:
Constant Field Values

BOTH

public static final int BOTH
Filled and Outlined symbol style

See Also:
Constant Field Values
Constructor Detail

NFSymbol

public NFSymbol()
Constructs a default symbol object


NFSymbol

public NFSymbol(int type,
                int size,
                int style)
Constructs a symbol object with the specified symbol type, size, and style.

Parameters:
type - One of CIRCLE, SQUARE, DIAMOND, TRIANGLEUP, TRIANGLEDOWN, CROSS, VRECTANGLE, HRECTANGLE, TARGET.
size - Symbol size in pixels
style - One of FILLED, OUTLINED, BOTH
Method Detail

setStyle

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

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

Parameters:
style - One of FILLED, OUTLINED, BOTH

getStyle

public int getStyle()
Gets the current data symbol style.

Returns:
the data symbol style or FILLED if not defined.

setType

public void setType(int type)
Sets the symbol type to use for the data.

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

Parameters:
type - One of NONE, CIRCLE, SQUARE, DIAMOND, TRIANGLEUP, TRIANGLEDOWN, CROSS, VRECTANGLE, HRECTANGLE, TARGET.

getType

public int getType()
Gets the current data symbol type.

Returns:
the data symbol type or NONE if not defined.

setSize

public void setSize(int size)
Sets the data symbol size in pixels.

Parameters:
size - Symbol size in pixels.

getSize

public int getSize()
Gets the current data symbol size.

Returns:
the data symbol size or 10 if not defined.

toString

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

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 symbol

Specified by:
getCDL in interface NFCDLGenerator
Returns:
CDL in the form: (symbolType, symbolSize, symbolStyle)

getCDL

public java.lang.String getCDL(java.lang.StringBuffer sb,
                               boolean includeParens)
Append CDL parameters representing this symbol 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.String cdl)
Configures this object from a CDL parameter representation.

Specified by:
setCDL in interface NFCDLGenerator
Parameters:
cdl - CDL in the form: (symbolType, symbolSize, symbolStyle)

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 symbolType, symbolSize, and symbolStyle information.
offset - Offset into the elements array.

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.

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