Overview | Package | Class | Tree | Index | Help NetCharts Pro (Applets) 7.0
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

netcharts.util
Class NFContext

java.lang.Object
  |
  +--netcharts.util.NFContext

public class NFContext
implements
NFContext describes the environment in which a Chart is executing. This environment can be anything from a browser, to a ChartWorks stand-alone product, to a custom built applicaltion.


Field Summary
static int CUSTOM
          This user agent type indicates that the execution context is a custom application.
static java.lang.String CUSTOM_AGENT
          This user agent describes the execution context as a ChartWorks Custom Application.
static int DESIGNER
          This user agent type indicates that the execution context is ChartWorks ChartDesinger.
static java.lang.String DESIGNER_AGENT
          This user agent describes the execution context as ChartWorks ChartDesinger.
static int NETCHARTS
          This user agent type indicates that the execution context is a browser.
static java.lang.String NETCHARTS_AGENT
          This user agent describes the execution context as a browser.
static int SERVER
          This user agent type indicates that the execution context is ChartWorks Enterprise Server.
static java.lang.String SERVER_AGENT
          This user agent describes the execution context as ChartWorks Enterprise Server.
static int VIEWER
          This user agent type indicates that the execution context is ChartWorks Viewer.
static java.lang.String VIEWER_AGENT
          This user agent describes the execution context as ChartWorks Viewer.
 
Constructor Summary
NFContext(java.applet.Applet applet)
          Construct a Context with the given applet.
NFContext(java.net.URL docURL)
          Construct a Context with the given document base.
NFContext(java.net.URL docURL, java.net.URL codeURL)
          Construct a Context with the given document base and code base.
 
Method Summary
java.applet.Applet getApplet()
          Get the applet associated with this Context.
java.lang.String[] getAuthInfo(java.lang.String host, int port)
          Get the authentication information for the given host and port.
java.net.URL getCodeBase()
          Get the code base.
static NFContext getDefault()
          Get the default application context.
java.net.URL getDocumentBase()
          Get the document base.
java.awt.Component getTopLevel()
          Get the top level component associated with this Context.
static java.lang.String getUserAgent()
          Get the user agent.
static int getUserAgentType()
          Get the user agent type.
void mergeAuthInfo(NFContext from)
          Merge authentication information between this Context and another.
static void mergeAuthInfo(NFContext to, NFContext from)
          Merge authentication information between two Contexts.
void setApplet(java.applet.Applet applet)
          Set the applet in which the chart is being executed.
void setAuthInfo(java.lang.String host, int port, java.lang.String user, java.lang.String pass)
          Sets authentication information for a specified server and port.
void setCodeBase(java.net.URL codeURL)
          Get the code base.
static void setDefault(NFContext defaultContext)
          Set the default application context.
void setDefaultAuthInfo(java.lang.String user, java.lang.String pass)
          Sets the default authentication information.
void setDocumentBase(java.net.URL docURL)
          Set the document base.
void setTopLevel(java.awt.Component comp)
          Set the top level component associated with this Context.
static void setUserAgent(java.lang.String agent)
          Set the user agent.
static void setUserAgentType(int type)
          Set the user agent type.
 

Field Detail

NETCHARTS

public static final int NETCHARTS
This user agent type indicates that the execution context is a browser.

NETCHARTS_AGENT

public static final java.lang.String NETCHARTS_AGENT
This user agent describes the execution context as a browser.

DESIGNER

public static final int DESIGNER
This user agent type indicates that the execution context is ChartWorks ChartDesinger.

DESIGNER_AGENT

public static final java.lang.String DESIGNER_AGENT
This user agent describes the execution context as ChartWorks ChartDesinger.

VIEWER

public static final int VIEWER
This user agent type indicates that the execution context is ChartWorks Viewer.

VIEWER_AGENT

public static final java.lang.String VIEWER_AGENT
This user agent describes the execution context as ChartWorks Viewer.

SERVER

public static final int SERVER
This user agent type indicates that the execution context is ChartWorks Enterprise Server.

SERVER_AGENT

public static final java.lang.String SERVER_AGENT
This user agent describes the execution context as ChartWorks Enterprise Server.

CUSTOM

public static final int CUSTOM
This user agent type indicates that the execution context is a custom application.

CUSTOM_AGENT

public static final java.lang.String CUSTOM_AGENT
This user agent describes the execution context as a ChartWorks Custom Application.
Constructor Detail

NFContext

public NFContext(java.applet.Applet applet)
Construct a Context with the given applet. The document base and code base will be set using this applet if possible.
Parameters:
applet - The applet

NFContext

public NFContext(java.net.URL docURL)
Construct a Context with the given document base.
Parameters:
docURL - The document base

NFContext

public NFContext(java.net.URL docURL,
                 java.net.URL codeURL)
Construct a Context with the given document base and code base.
Parameters:
docURL - The document base
codeURL - The code base
Method Detail

getDefault

public static NFContext getDefault()
Get the default application context.
Returns:
The default NFContext instance

setDefault

public static void setDefault(NFContext defaultContext)
Set the default application context.
Parameters:
defaultContext - The default NFContext instance

getDocumentBase

public java.net.URL getDocumentBase()
Get the document base.
Specified by:
getDocumentBase() in interface java.applet.AppletStub
Returns:
The document base

setDocumentBase

public void setDocumentBase(java.net.URL docURL)
Set the document base.
Parameters:
docURL - The document base

getCodeBase

public java.net.URL getCodeBase()
Get the code base.
Specified by:
getCodeBase() in interface java.applet.AppletStub
Returns:
The code base

setCodeBase

public void setCodeBase(java.net.URL codeURL)
Get the code base.
Parameters:
codeURL - The code base

getUserAgent

public static java.lang.String getUserAgent()
Get the user agent. The user agent is the description given to web servers during requests made using NFHttpClient.
Returns:
The description of the user agent

setUserAgent

public static void setUserAgent(java.lang.String agent)
Set the user agent. The user agent is the description given to web servers during requests made using NFHttpClient.
Parameters:
agent - The description of the user agent

getUserAgentType

public static int getUserAgentType()
Get the user agent type. There are several pre-defined user agent types described above.
Returns:
The user agent type

setUserAgentType

public static void setUserAgentType(int type)
Set the user agent type. If it is a recognized type, the user agent is set to the cooresponding value.
Parameters:
type - The user agent type

getApplet

public java.applet.Applet getApplet()
Get the applet associated with this Context.
Returns:
The applet

setApplet

public void setApplet(java.applet.Applet applet)
Set the applet in which the chart is being executed. If the applet is non-null, then it is assumed that the application is being executed within a browser environment, otherwise it will assume that it is running in a standalone environment. This is important for properly determining the codebase, loading images, and processing applet parameters. The top level component is also set to the designated applet if there has been no top level component specified.
Parameters:
applet - The applet
See Also:
setTopLevel(Component)

getTopLevel

public java.awt.Component getTopLevel()
Get the top level component associated with this Context.
Returns:
The component

setTopLevel

public void setTopLevel(java.awt.Component comp)
Set the top level component associated with this Context. The top level component is used when creating interactive dialogs. The topLevel attribute is also used whenever a validated component is needed, such as for image processing. The comp parameter can reference any valid component. The top level component will be automatically determined as needed.
Parameters:
comp - The top level component

setDefaultAuthInfo

public void setDefaultAuthInfo(java.lang.String user,
                               java.lang.String pass)
Sets the default authentication information. Authentication information is used by NFHttpClient for requests made to web servers.
Parameters:
user - The username
pass - The password

setAuthInfo

public void setAuthInfo(java.lang.String host,
                        int port,
                        java.lang.String user,
                        java.lang.String pass)
Sets authentication information for a specified server and port. Authentication information is used by NFHttpClient for requests made to web servers.
Parameters:
host - The server
port - The port
user - The username
pass - The password

getAuthInfo

public java.lang.String[] getAuthInfo(java.lang.String host,
                            int port)
Get the authentication information for the given host and port. The array returned contains the username and password, in that order.
Parameters:
host - The server
port - The port
Returns:
The username/password pair in an array.

mergeAuthInfo

public void mergeAuthInfo(NFContext from)
Merge authentication information between this Context and another.
Parameters:
from - The Context to merge authentication information from

mergeAuthInfo

public static void mergeAuthInfo(NFContext to,
                                 NFContext from)
Merge authentication information between two Contexts.
Parameters:
from - The Context to merge authentication information to
from - The Context to merge authentication information from

Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD


Visual Mining, Inc.
2099 Gaither Grove Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2010
All Rights Reserved.

NetCharts ProTM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 29, 2010