|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.uml.gui.UmlGui
This class contains all the methods available in the edu.uml.gui package.
Field Summary | |
private static java.lang.String |
strServletURI
location of umlguiStoreXML.jsp |
Constructor Summary | |
UmlGui()
Creates a new instance of UmlGui |
Method Summary | |
static org.w3c.dom.Document |
openXMLDocument(java.lang.String strFilePath)
This public static method opens and XML file and returns the
Document object representing the XML document it contains. |
static java.lang.String |
storeXMLDocument(java.applet.Applet app,
org.w3c.dom.Document doc,
java.lang.String strFileName)
This three-parameter public static method calls the
four-parameter version with the file path set to null . |
static java.lang.String |
storeXMLDocument(java.applet.Applet app,
org.w3c.dom.Document doc,
java.lang.String strFileName,
java.lang.String strFilePath)
This four-parameter public static method parses the user
name from Applet.getCodeBase() and then calls the five-parameter
version of this same method. |
static java.lang.String |
storeXMLDocument(java.applet.Applet app,
org.w3c.dom.Document doc,
java.lang.String strFileName,
java.lang.String strFilePath,
java.lang.String strUserName)
This five-parameter public static method calls
(Applet.getCodeBase()).getHost() to get the name of the
host system on which the calling applet is running, which is required
to store the host on which to the XML document, and then calls the private
version of storeXMLDocument to do the actual save. |
private static java.lang.String |
storeXMLDocument(java.lang.String strHost,
org.w3c.dom.Document doc,
java.lang.String strFileName,
java.lang.String strFilePath,
java.lang.String strUserName)
This private static method saves an XML Document on a
specified system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.lang.String strServletURI
Constructor Detail |
public UmlGui()
Method Detail |
public static org.w3c.dom.Document openXMLDocument(java.lang.String strFilePath) throws UmlGuiException
public static
method opens and XML file and returns the
Document
object representing the XML document it contains.
If the file cannot be opened or parsed, a UmlGuiException
is
thrown. This is a checked exception derived from IOException
,
so this method must be called from within a try block.
strFilePath
- full path to the XML file to be opened
Document
object for that file
UmlGuiException
private static java.lang.String storeXMLDocument(java.lang.String strHost, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath, java.lang.String strUserName) throws UmlGuiException
private static
method saves an XML Document on a
specified system. It is the main version of this method that is called
by all overloaded methods with the same name.
It works by calling the current version of umlguiStoreXML.jsp
(specified in private static String strServletURI
) on the
system specified in the first parameter. Note that it will only work if
the system specified in the first parameter is the same as that from which
the calling applet was loaded.
The file is saved in the user area specified in the third parameter, under the name specified in the fourth parameter, and in the subdirectory specified in the fifth parameter.
Note that if a file exists with the same name in the same area and the same subdirectory, it is overwritten.
If an error occurs, a UmlGuiException
is thrown. This is a
checked exception derived from IOException
, so this method must
be called from within a try
block.
strHost
- name of host system on which to store the documentdoc
- XML document to savestrFileName
- name under which to store the documentstrFilePath
- subdirectory of the user area in which to store the
documentstrUserName
- name of user area in which to store the document
String
indicating the full path to the XML document
stored
UmlGuiException
public static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath, java.lang.String strUserName) throws UmlGuiException
This five-parameter public static
method calls
(Applet.getCodeBase()).getHost()
to get the name of the
host system on which the calling applet is running, which is required
to store the host on which to the XML document, and then calls the private
version of storeXMLDocument
to do the actual save.
Note that you do not usually want to call this version of this method because you will typically store your XML documents under the name in the directory from which the applet was run. This name can be extracted from the applet's code base by the four-parameter version of this method.
app
- the calling appletdoc
- XML document to savestrFileName
- name under which to store the documentstrFilePath
- subdirectory of the user area in which to store the
documentstrUserName
- name of user area in which to store the document
String
indicating the full path to the XML document
stored
UmlGuiException
public static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath) throws UmlGuiException
public static
method parses the user
name from Applet.getCodeBase()
and then calls the five-parameter
version of this same method.
app
- the calling appletdoc
- XML document to savestrFileName
- name under which to store the documentstrFilePath
- subdirectory of the user area in which to store the
document
String
indicating the full path to the XML document
stored
UmlGuiException
public static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName) throws UmlGuiException
public static
method calls the
four-parameter version with the file path set to null
.
app
- the calling appletdoc
- XML document to savestrFileName
- name under which to store the document
String
indicating the full path to the XML document
stored
UmlGuiException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |