NetCharts Pro

netcharts.util
Class NFCdf

java.lang.Object
  extended by netcharts.util.NFCdf

public class NFCdf
extends java.lang.Object

This class is used to represent a chart definition. It provides methods to process NFHtmlFile tag lists and to load parameters directly from CDFs.


Field Summary
 NFHtmlTag appletTag
           
 java.lang.String codebase
           
 java.util.Vector exprs
           
 java.lang.String fileBase
           
 int height
           
 int id
           
 boolean maintainScript
           
 java.lang.String name
           
 java.util.Hashtable params
           
 java.util.Vector script
           
 java.util.Vector tags
           
 int type
           
 java.net.URL url
           
 int width
           
 
Constructor Summary
NFCdf()
          Create a new object for this class.
 
Method Summary
 void loadParams(NFLoadParams lp, java.util.Vector errors)
          Parse each parameter definition in the current chart, based on the given parameter object.
static void parseCDF(java.io.InputStream is, java.util.Vector charts)
          Process the chart definition parameters in the given stream and append each chart definition found as a NFCdf object to the given list.
static void parseCDF(java.io.InputStream is, java.util.Vector charts, NFContext context)
          Process the chart definition parameters in the given stream and append each chart definition found as a NFCdf object to the given list.
static void parseCDF(java.io.InputStream is, java.util.Vector charts, java.lang.String filebase, NFContext context)
           
static void parseCDF(java.io.InputStream is, java.util.Vector charts, java.lang.String filebase, java.lang.String queryString, NFContext context)
           
static void parseCDF(java.io.InputStream is, java.util.Vector charts, java.lang.String filebase, java.lang.String queryString, NFContext context, boolean useBufferedStream)
           
static void parseCDF(java.lang.String filename, java.util.Vector charts)
          Process the chart definition parameters in the given file, which may be a URL or a local filename, and append each chart definition found as a NFCdf object to the given list.
static void parseCDF(java.lang.String filename, java.util.Vector charts, NFContext context)
          Process the chart definition parameters in the given file, which may be a URL or a local filename, and append each chart definition found as a NFCdf object to the given list.
static void parseCDL(java.lang.String cdl, java.util.Vector charts)
          Process the chart definition parameters in the given string and append each chart definition found as a NFCdf object to the given list.
static void parseCDL(java.lang.String cdl, java.util.Vector charts, NFContext context)
          Process the chart definition parameters in the given string and append each chart definition found as a NFCdf object to the given list.
static void parseHtml(java.util.Vector tags)
          Process the list of HTML tags looking for Chart APPLET tags.
 void printCDF(java.io.PrintWriter ps)
          Print the chart parameters for the current chart object to the given print stream as a CDF parameter set.
 void printCDF(java.io.PrintWriter ps, java.lang.String prefix)
          Print the chart parameters for the current chart object to the given print stream as a CDF parameter set.
 void printChartScript(java.io.PrintWriter ps, int index)
          Print the chart parameters as an NFChartScript parameter within an applet tag.
 void printHtml(java.io.PrintWriter ps, boolean newline)
          Print the chart parameters for the current chart object to the given print stream as an HTML APPLET tag.
 void printMultiChart(java.io.PrintWriter ps)
          Print the MultiChart applet parameters as part of an Applet tag.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public int id

type

public int type

name

public java.lang.String name

codebase

public java.lang.String codebase

width

public int width

height

public int height

appletTag

public NFHtmlTag appletTag

tags

public java.util.Vector tags

params

public java.util.Hashtable params

exprs

public java.util.Vector exprs

script

public java.util.Vector script

maintainScript

public boolean maintainScript

fileBase

public java.lang.String fileBase

url

public java.net.URL url
Constructor Detail

NFCdf

public NFCdf()
Create a new object for this class.

Method Detail

parseHtml

public static void parseHtml(java.util.Vector tags)
                      throws java.lang.Exception
Process the list of HTML tags looking for Chart APPLET tags. When found, move all of the tags and strings up until the end tag into an NFCdf object, and then place that object in the given vector instead of the raw tags and strings.

Parameters:
tags - Vector of NFHtmlTag objects.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDF

public static void parseCDF(java.lang.String filename,
                            java.util.Vector charts)
                     throws java.lang.Exception
Process the chart definition parameters in the given file, which may be a URL or a local filename, and append each chart definition found as a NFCdf object to the given list.

Parameters:
filename - The file to parse.
charts - Resulting NFCdf objects are placed here.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDF

public static void parseCDF(java.lang.String filename,
                            java.util.Vector charts,
                            NFContext context)
                     throws java.lang.Exception
Process the chart definition parameters in the given file, which may be a URL or a local filename, and append each chart definition found as a NFCdf object to the given list.

Parameters:
filename - The file to parse.
charts - Resulting NFCdf objects are placed here.
context - The context to use for path resolution and authenication information retrieval.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDL

public static void parseCDL(java.lang.String cdl,
                            java.util.Vector charts)
                     throws java.lang.Exception
Process the chart definition parameters in the given string and append each chart definition found as a NFCdf object to the given list.

Parameters:
cdl - The string of cdl.
charts - Resulting NFCdf objects are placed here.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDL

public static void parseCDL(java.lang.String cdl,
                            java.util.Vector charts,
                            NFContext context)
                     throws java.lang.Exception
Process the chart definition parameters in the given string and append each chart definition found as a NFCdf object to the given list.

Parameters:
cdl - The string of cdl.
charts - Resulting NFCdf objects are placed here.
context - The context to use for path resolution and authenication information retrieval.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDF

public static void parseCDF(java.io.InputStream is,
                            java.util.Vector charts)
                     throws java.lang.Exception
Process the chart definition parameters in the given stream and append each chart definition found as a NFCdf object to the given list.

Parameters:
is - The stream of cdl.
charts - Resulting NFCdf objects are placed here.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDF

public static void parseCDF(java.io.InputStream is,
                            java.util.Vector charts,
                            NFContext context)
                     throws java.lang.Exception
Process the chart definition parameters in the given stream and append each chart definition found as a NFCdf object to the given list.

Parameters:
is - The stream of cdl.
charts - Resulting NFCdf objects are placed here.
context - The context to use for path resolution and authenication information retrieval.
Throws:
java.lang.Exception - If a parse error occurs.

parseCDF

public static void parseCDF(java.io.InputStream is,
                            java.util.Vector charts,
                            java.lang.String filebase,
                            NFContext context)
                     throws java.lang.Exception
Throws:
java.lang.Exception

parseCDF

public static void parseCDF(java.io.InputStream is,
                            java.util.Vector charts,
                            java.lang.String filebase,
                            java.lang.String queryString,
                            NFContext context)
                     throws java.lang.Exception
Throws:
java.lang.Exception

parseCDF

public static void parseCDF(java.io.InputStream is,
                            java.util.Vector charts,
                            java.lang.String filebase,
                            java.lang.String queryString,
                            NFContext context,
                            boolean useBufferedStream)
                     throws java.lang.Exception
Throws:
java.lang.Exception

loadParams

public void loadParams(NFLoadParams lp,
                       java.util.Vector errors)
                throws java.lang.Exception
Parse each parameter definition in the current chart, based on the given parameter object. For all valid parameters, a complete string definition is stored in the "params" hashtable for the current chart and the script vector. If "errors" is non-null, then all error messages generated will be appended to the vector. Otherwise, when the first error is encountered, an exception will be generated.

Parameters:
lp - The NFLoadParams to use to parse the parameters.
errors - The errors produced are placed in this vector.
Throws:
java.lang.Exception - If a parse error occurs.

printHtml

public void printHtml(java.io.PrintWriter ps,
                      boolean newline)
Print the chart parameters for the current chart object to the given print stream as an HTML APPLET tag. If "newline" is true, then a newline will be printed after each HTML tag.

Parameters:
ps - The stream to write on.
newline - Whether to print a newline after each tag or not.

printCDF

public void printCDF(java.io.PrintWriter ps)
Print the chart parameters for the current chart object to the given print stream as a CDF parameter set.

Parameters:
ps - The stream to write on.

printCDF

public void printCDF(java.io.PrintWriter ps,
                     java.lang.String prefix)
Print the chart parameters for the current chart object to the given print stream as a CDF parameter set. If prefix is non-null, it is printed before each parameter name/value pair.

Parameters:
ps - The stream to write on.
prefix - What to print before each parameter.

printChartScript

public void printChartScript(java.io.PrintWriter ps,
                             int index)
Print the chart parameters as an NFChartScript parameter within an applet tag.

Parameters:
ps - The stream to write on.
index - The NFChartScript index.

printMultiChart

public void printMultiChart(java.io.PrintWriter ps)
Print the MultiChart applet parameters as part of an Applet tag. note: the final </applet> tag must be supplied by the caller after the embedded charts have been printed (using printChartScript)

Parameters:
ps - The stream to write on.

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