NetCharts Pro

netcharts.pro.charts.time
Class NFTimeSet

java.lang.Object
  |
  +--netcharts.pro.common.NFBaseClass
        |
        +--netcharts.pro.common.NFVector
              |
              +--netcharts.pro.common.NFSet
                    |
                    +--netcharts.pro.common.rectangular.NFDataSet
                          |
                          +--netcharts.pro.charts.time.NFTimeSet
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator

public class NFTimeSet
extends NFDataSet
implements NFCDLGenerator

An NFTimeSet describes a single set time data along with its appearance characteristics. A simple example of this object's usage is shown here:

	NFTimechart tc = new NFBarchart();
	NFTimeSet timeSet = new NFTimeSet();
	Calendar start = Calendar.getInstance();
	Calendar stop = Calendar.getInstance();
	for (int j=0; j <5; j++){
		int val = (int)(Math.random()*100);
		stop.add(Calendar.HOUR, val);
		timeSet.addElement(start.getTime(), stop.getTime(), val+"");

		// for next loop
		start.add(Calendar.HOUR, val+1);
		stop.add(Calendar.HOUR, 1);
	}
	ts.setLegendName("Time Set "+(i+1));
	tc.addTimeSet(timeSet);
 


Field Summary
 java.text.SimpleDateFormat dateFormat
           
 
Constructor Summary
NFTimeSet()
          Constructs a default time set
 
Method Summary
 void addElement(java.util.Date startTime, java.util.Date stopTime, java.awt.Color fillColor, NFLabel label)
          Adds a time element to the set.
 void addElement(java.util.Date startTime, java.util.Date stopTime, java.lang.String text)
          Adds a time element to the set.
 java.lang.Object clone()
          Does a deep copy of this timeset object
 java.lang.String getCDL()
          Generate CDL parameters representing this time set
 java.lang.String getCDLAppearance()
          Generate CDL parameters representing the time set
 NFRegion getDefaultRegion()
          Set the default background element for time periods.
 java.lang.String getLegendName()
          Returns the legend name
 boolean getModifiedAppearance()
          Returns if the appearance of this timeset has changed.
 void setCDL(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLAppearance(java.lang.String s)
          Configures this object from a CDL parameter representation.
 void setDefaultRegion(NFRegion defaultRegion)
          Set the default background element for time periods.
 void setLegendName(java.lang.String legendName)
          Set the legend name of the set
 java.lang.String toString()
          Returns a new String object representing this time set.
 
Methods inherited from class netcharts.pro.common.rectangular.NFDataSet
setXAxis, setYAxis
 
Methods inherited from class netcharts.pro.common.NFSet
addActiveLabel, getActiveLabels, getAxisMap, getSetName, setActiveLabels, setAxisMap, setSetName
 
Methods inherited from class netcharts.pro.common.NFVector
addElement, addElement, elementAt, elementAt, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getMaxDimensions, getQuoteStrings, getSize, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, setElementAt, setQuoteStrings, setSize, size, skipNulls, toArray
 
Methods inherited from class netcharts.pro.common.NFBaseClass
getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dateFormat

public java.text.SimpleDateFormat dateFormat
Constructor Detail

NFTimeSet

public NFTimeSet()
Constructs a default time set
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Does a deep copy of this timeset object
Overrides:
clone in class NFSet
Returns:
Object

setDefaultRegion

public void setDefaultRegion(NFRegion defaultRegion)
Set the default background element for time periods.
Parameters:
defaultRegion - Background style.

getDefaultRegion

public NFRegion getDefaultRegion()
Set the default background element for time periods.
Parameters:
defaultRegion - Background style.

setLegendName

public void setLegendName(java.lang.String legendName)
Set the legend name of the set
Parameters:
legendName - Name of the set to use.

getLegendName

public java.lang.String getLegendName()
Returns the legend name
Returns:
the legend set name or null if not defined.

addElement

public void addElement(java.util.Date startTime,
                       java.util.Date stopTime,
                       java.lang.String text)
Adds a time element to the set.
Parameters:
startTime - Time where the element will start.
stopTime - Time where the element will end.
text - The text to be shown on the element.

addElement

public void addElement(java.util.Date startTime,
                       java.util.Date stopTime,
                       java.awt.Color fillColor,
                       NFLabel label)
Adds a time element to the set.
Parameters:
startTime - Time where the element will start.
stopTime - Time where the element will end.
fillColor - Color of element.
text - The text and text style to shown on the element.

getCDLAppearance

public java.lang.String getCDLAppearance()
Generate CDL parameters representing the time set
Parameters:
dialName - The dial that this hand is associated with.
Returns:
CDL in the form: ("legendName", defaultFillColor, defaultType, defaultBorderWidth, "defaultImageURL")

setCDLAppearance

public void setCDLAppearance(java.lang.String s)
Configures this object from a CDL parameter representation.
Parameters:
cdl - CDL in the form: ("legendName", defaultFillColor, defaultType, defaultBorderWidth, "defaultImageURL")

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: (startTime, stopTime, fillColor, "text", textColor, font, fontSize, angle)

getCDL

public java.lang.String getCDL()
Generate CDL parameters representing this time set
Specified by:
getCDL in interface NFCDLGenerator
Overrides:
getCDL in class NFVector
Returns:
CDL in the form: (startTime, stopTime, fillColor, "text", textColor, font, fontSize, angle)/code>

toString

public java.lang.String toString()
Returns a new String object representing this time set.
Specified by:
toString in interface NFCDLGenerator
Overrides:
toString in class NFVector
Returns:
A new String object in the same form as that given by getCDL().

getModifiedAppearance

public boolean getModifiedAppearance()
Returns if the appearance of this timeset has changed.
Returns:
modified

NetCharts Pro


Visual Mining, Inc.
15825 Shady Grove Rd.
Suite 20
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2004
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: Apr 1, 2004