NetCharts Pro

netcharts.pro.charts.time
Class NFTimeSet

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFVector
          extended by netcharts.pro.common.NFBaseSet
              extended by netcharts.pro.common.NFSet
                  extended by netcharts.pro.common.rectangular.NFDataSet
                      extended by 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
          Deprecated.  
 
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
 NFColorTable getColorTable()
          Gets the colorTable for the bars (time segments) in this 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 setColorTable(NFColorTable colorTable)
          Sets the individual color for each bar (time segment) in this set.
 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
getAxisMap, setAxisMap
 
Methods inherited from class netcharts.pro.common.NFBaseSet
addActiveLabel, getActiveLabels, getSetName, setActiveLabels, setSetName
 
Methods inherited from class netcharts.pro.common.NFVector
addElement, addElement, elementAt, elementAt, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getCDLKeyValuesHasPoints, getMaxDimensions, getQuoteStrings, getSize, isEmptyStringAsNull, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, setElementAt, setEmptyStringAsNull, 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
Deprecated. 
A date format used in date parsing during template loading. (dd-MMM-yyyy HH:mm:ss)

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
Throws:
java.lang.CloneNotSupportedException

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.


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.
label - The text and text style to shown on the element.

getCDLAppearance

public java.lang.String getCDLAppearance()
Generate CDL parameters representing the time set

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:
s - 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

getColorTable

public NFColorTable getColorTable()
Gets the colorTable for the bars (time segments) in this set.

Returns:
the colorTable for this set's bars or null if not defined.

setColorTable

public void setColorTable(NFColorTable colorTable)
Sets the individual color for each bar (time segment) in this set. If null or not specified then the entire timeset gets a color from the default color table.

Parameters:
colorTable - the colors to use for the bars (time segments) in the set

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