NetCharts Pro

netcharts.pro.charts.multipie
Class NFPieLayout

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.charts.multipie.NFPieLayout
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator

public class NFPieLayout
extends NFBaseClass
implements NFCDLGenerator

The pie layout parameters specifies the layout direction (horizontal or vertical) and the number of rows and columns in the chart in which to draw each pie. If the number of rows and columns are not specified, then they will automatically be set based upon the number of pies that can fit into a square. The pie layout direction determines the direction to start with when drawing the pies.


Field Summary
static int DEFAULT_LAYOUT_DIRECTION
          Default value for the pie layout if not specified.
static int DEFAULT_NUM_COLUMNS
          Default value for the number of columns if not specified.
static int DEFAULT_NUM_ROWS
          Default value for the number of rows if not specified.
static int HORIZONTAL
          Horizontal pie layout direction.
static java.util.Hashtable layoutDirectionMap
          Pie layout direction hashtable
static int VERTICAL
          Vertical pie layout direction.
 
Constructor Summary
NFPieLayout()
          Constructs a pie layout object with default values.
NFPieLayout(int layoutDirection)
          Constructs a pie layout object from the specified layout direction and defaults for the number of rows and columns.
NFPieLayout(int numRows, int numColumns)
          Constructs a pie layout object from the specified number of rows and columns and a default layout direction.
NFPieLayout(int layoutDirection, int numRows, int numColumns)
          Constructs a pie layout object from the specified layout direction and from the specified number of rows and columns.
 
Method Summary
 java.lang.String getCDL()
          Generate CDL parameters representing this pie layout
 void getCDL(java.lang.StringBuffer sb, boolean includeParens)
          Append CDL parameters representing this pie layout to the given StringBuffer.
 int getLayoutDirection()
          Returns the pie layout direction.
 int getNumColumns()
          Returns the number of columns to draw the pies in.
 int getNumRows()
          Returns the number of rows to draw the pies in.
 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 setLayoutDirection(int layoutDirection)
          Sets the pie layout direction (VERTICAL or HORIZONTAL).
 void setNumColumns(int numColumns)
          Sets the number of columns to draw the pies in.
 void setNumRows(int numRows)
          Sets the number of rows to draw the pies in.
 java.lang.String toString()
          Returns a String object representing the pie layout.
 
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

HORIZONTAL

public static final int HORIZONTAL
Horizontal pie layout direction.


VERTICAL

public static final int VERTICAL
Vertical pie layout direction.


DEFAULT_LAYOUT_DIRECTION

public static final int DEFAULT_LAYOUT_DIRECTION
Default value for the pie layout if not specified.

See Also:
Constant Field Values

DEFAULT_NUM_ROWS

public static final int DEFAULT_NUM_ROWS
Default value for the number of rows if not specified.

See Also:
Constant Field Values

DEFAULT_NUM_COLUMNS

public static final int DEFAULT_NUM_COLUMNS
Default value for the number of columns if not specified.

See Also:
Constant Field Values

layoutDirectionMap

public static java.util.Hashtable layoutDirectionMap
Pie layout direction hashtable

Constructor Detail

NFPieLayout

public NFPieLayout()
Constructs a pie layout object with default values.


NFPieLayout

public NFPieLayout(int layoutDirection)
Constructs a pie layout object from the specified layout direction and defaults for the number of rows and columns.


NFPieLayout

public NFPieLayout(int numRows,
                   int numColumns)
Constructs a pie layout object from the specified number of rows and columns and a default layout direction.


NFPieLayout

public NFPieLayout(int layoutDirection,
                   int numRows,
                   int numColumns)
Constructs a pie layout object from the specified layout direction and from the specified number of rows and columns.

Method Detail

getLayoutDirection

public int getLayoutDirection()
Returns the pie layout direction. This is the direction to start with when drawing the pies.

Returns:
pie layout direction or DEFAULT_LAYOUT_DIRECTION if not set

setLayoutDirection

public void setLayoutDirection(int layoutDirection)
Sets the pie layout direction (VERTICAL or HORIZONTAL). This is the direction to start with when drawing the pies.

If the specified layout direction is not valid then an IllegalArgumentException will be thrown.

Parameters:
pie - layout direction

getNumRows

public int getNumRows()
Returns the number of rows to draw the pies in.

Returns:
number of rows or DEFAULT_NUM_ROWS if not set

setNumRows

public void setNumRows(int numRows)
Sets the number of rows to draw the pies in. If the number of rows is less than or equal to 0, then the default value DEFAULT_NUM_ROWS is used.

Parameters:
numRows - number of rows to draw the pies in

getNumColumns

public int getNumColumns()
Returns the number of columns to draw the pies in.

Returns:
number of columns or DEFAULT_NUM_COLUMNS if not set

setNumColumns

public void setNumColumns(int numColumns)
Sets the number of columns to draw the pies in. If the number of columns is less than or equal to 0, then the default value DEFAULT_NUM_COLUMNS is used.

Parameters:
numColumns - number of columns to draw the pies in

getCDL

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

Specified by:
getCDL in interface NFCDLGenerator
Returns:
CDL in the form: (layoutDirection, numRows, numColumns)

getCDL

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

toString

public java.lang.String toString()
Returns a String object representing the pie layout.

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

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: (layoutDirection, numRows, numColumns)

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 layout direction, numRows and numColumns 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