|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jv.object.PsConfig
Static configuration class of JavaView with global static variables.
The class must be initialized with current applet and frame. Initialization is
automatically done in PvViewer
when PvViewer instance is created in the top applet. If applet does not create an
instance of PvViewer then applet must initialize this class directly using its
init method.
Information about version, authors etc. is parsed during generation of jar file
to be included as manifest information (currently, the information is just added
as a file _jarVersion.txt to the archive).
| Field Summary | |
static java.lang.String[] |
AUTHOR
Deprecated. use method getAuthors() to access list of authors. |
static java.lang.String[] |
CONTRIBUTOR
Deprecated. use method getContributors() to access list of contributors. |
static java.lang.String |
EMAIL
Email address for contact. |
static int |
FONT_FIXED
Identifier of fixed (i.e. non-proportional) text font used in panels. |
static int |
FONT_HEADER2
Identifier of header font used in panels. |
static int |
FONT_HEADER4
Identifier of sub header font used in panels. |
static int |
FONT_MENU
Identifier of menu font used in panels. |
static int |
FONT_TEXT
Identifier of text font used in panels. |
static java.lang.String |
FONTS_HTML
Page with an applet showing available system fonts. |
static java.lang.String |
HELP_HTML
Help page of JavaView in Html format. |
static java.lang.String |
HOMEPAGE
Homepage of JavaView. |
static int |
m_osId
Identifier of current operating system. |
static int |
OS_IRIX
Identifier of Silicon Graphics Irix operating system. |
static int |
OS_LINUX
Identifier of Linux operating system. |
static int |
OS_OTHER
Identifier of unknown other operating system. |
static int |
OS_SOLARIS
Identifier of Sun Solaris operating system. |
static int |
OS_WIN
Identifier of Microsoft Windows operating systems. |
| Constructor Summary | |
PsConfig()
|
|
| Method Summary | |
static java.applet.Applet |
getApplet()
Get applet if run as applet. |
static java.lang.String |
getAuthors()
Get author names separated by comma as single string |
static java.lang.String |
getCodeBase()
Get codebase of current applet or application. |
static java.lang.String[] |
getContributors()
Get list of contributors as array of strings. |
static java.lang.String |
getCopyright()
Get copyright notice as string. |
static java.lang.String |
getEmail()
Get email contact address of JavaView as string. |
static char |
getFileSeparator()
Always return "/", and do not use system file separator. |
static java.awt.Font |
getFont(int type)
Get font for specific textual application type, like FONT_TEXT, FONT_HEADER2 etc. |
static java.awt.Frame |
getFrame()
Get frame to be used as parent frame for dialogs. |
static java.lang.String |
getHomepage()
Get homepage of JavaView as string. |
static java.lang.String |
getLanguage()
Get the current language used in localizations. |
static java.lang.String |
getMessage(java.lang.String key)
Get localized translation of message. |
static int |
getOSId()
Get index of current operating system. |
static java.lang.String |
getOSName()
Get name of operating system as string. |
static java.lang.String |
getProgram()
Get name of program as string. |
static java.lang.String |
getProject()
Get name of project as string. |
static java.util.Hashtable |
getProperties()
Get JavaView and system properties. |
static java.lang.String |
getTopic()
Get topic of current version as string. |
static java.lang.String |
getVersion()
Get version number as string. |
static PsViewerIf |
getViewer()
Get viewer. |
static void |
init(java.applet.Applet applet,
java.awt.Frame frame)
Initialize this configuration class. |
static void |
init(java.applet.Applet applet,
PsViewerIf viewer,
java.awt.Frame frame)
Initialize this configuration class. |
static boolean |
isApplication()
Returns true if run as application, else false.
|
static void |
setCodeBase(java.lang.String aCodeBase)
Set codebase of current applet or application. |
static boolean |
setFont(int os,
int type,
java.lang.String name,
int style,
int size)
Set font for specific textual application type, like FONT_TEXT, FONT_HEADER2 etc. |
static void |
setLanguage(java.lang.String language)
Set the current language used in localizations. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String[] AUTHOR
public static java.lang.String[] CONTRIBUTOR
public static final java.lang.String HOMEPAGE
public static final java.lang.String EMAIL
public static final java.lang.String HELP_HTML
public static final java.lang.String FONTS_HTML
public static final int OS_WIN
public static final int OS_IRIX
public static final int OS_SOLARIS
public static final int OS_LINUX
public static final int OS_OTHER
public static int m_osId
public static final int FONT_TEXT
public static final int FONT_FIXED
public static final int FONT_MENU
public static final int FONT_HEADER2
public static final int FONT_HEADER4
| Constructor Detail |
public PsConfig()
| Method Detail |
public static boolean isApplication()
true if run as application, else false.
E.g. applet.stub is not initialized when applet does not run in browser.
This information is used e.g. in PsDebug when displaying status messages.
JavaView runs as application if and only if the argument frame != null
in PsConfig.init.
Therefore it is essential to call PsConfig.init.
Usually, this initialization is automatically done in the contructor of PvViewer,
but it can be done by hand, if no PvViewer is created.
init(Applet, PsViewerIf, Frame),
PvViewer.PvViewer(Applet, Frame)public static java.applet.Applet getApplet()
public static java.awt.Frame getFrame()
PsConfig.init this
frame is return. Otherwise an invisible new frame is generated upon the first invocation.public static PsViewerIf getViewer()
PsViewerIf,
PvViewerIf,
PvViewer.PvViewer(Applet, Frame)
public static void init(java.applet.Applet applet,
PsViewerIf viewer,
java.awt.Frame frame)
PvViewer.PvViewer(Applet, Frame),
init(Applet, Frame)
public static void init(java.applet.Applet applet,
java.awt.Frame frame)
If argument frame == null and applet != null then program
runs as applet, and applet is used to access codebase etc.
Otherwise, the program runs as application.
Initialization must be done as soon as possible in an applet or application since system properties are parsed and evaluated. Usually, method is called automatically in the constructor of PvViewer.
public static java.lang.String getLanguage()
public static void setLanguage(java.lang.String language)
getMessage(String) will return
a message in the selected language.
This method does not change any existing labels or menu items which must be done by hand at other place.
language - Two letter id of language in {"de", "en", ...}public static java.lang.String getMessage(java.lang.String key)
key - message identifier whose localized text is requestedpublic static java.lang.String getAuthors()
public static java.lang.String[] getContributors()
public static java.lang.String getEmail()
public static java.lang.String getHomepage()
public static java.lang.String getTopic()
public static java.lang.String getCopyright()
public static java.lang.String getVersion()
public static java.lang.String getProgram()
public static java.lang.String getProject()
public static java.lang.String getOSName()
null if not identified.getOSId()public static int getOSId()
OS_WIN
is used as default. Use method getOSName() to check
whether system could be identified.OS_WIN if not identified.getOSName()public static java.util.Hashtable getProperties()
public static java.lang.String getCodeBase()
This method just returns the codebase as string. The codebase was most likely
automatically determined in init, or it was assigned using
setCodeBase(String).
If JavaView runs as application then the codeBase ends with current file separator.
init(java.applet.Applet, jv.object.PsViewerIf, java.awt.Frame),
getFileSeparator()public static void setCodeBase(java.lang.String aCodeBase)
If JavaView runs as application then the codeBase ends with current file separator.
If JavaView is running locally within a web page then some browser use the the "file:" protocol to access local files. In this case, some browsers, notably IE, modify the codebase and replace blanks with %20. This leads to a FileNotFoundException when later reading a local file. I solved this problem by replacing any %20 in a codebase argument of this method if the codebase starts with "file:".
new - codebasegetFileSeparator()public static char getFileSeparator()
public static java.awt.Font getFont(int type)
public static boolean setFont(int os,
int type,
java.lang.String name,
int style,
int size)
Use JavaView applet SystemFonts
to show a list all available fonts.
os - identifier of operating system among OS_WIN etc. If os==-1 use current osId.type - identifier among FONT_TEXT, FONT_HEADER2 etc.name - name of font such as Helvetica, Courier etc. If name==null ignore name.style - use among Font.PLAIN, Font.BOLD etc. If style==-1 ignore style.size - any size which is supported by Java and operating system.
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||