|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ohf.stem.ui.ge.kml.KmlDoc
public class KmlDoc
Utility class used for Google Earth KML support. This class is used to build a KML file to be passed to Google Earth. It basically creates an XML file using KML related arguments. See the example in the "main()" method for an example of how to use the class.
Constructor Summary | |
---|---|
KmlDoc()
Construct an instance of KmlDoc. |
Method Summary | |
---|---|
org.w3c.dom.Element |
appendAttr(org.w3c.dom.Element element,
java.lang.String tag,
boolean value)
Utility method to Create an element that has a name and boolean value only. |
org.w3c.dom.Element |
appendCDATA(org.w3c.dom.Element element,
java.lang.String tag,
java.lang.String value)
Utility method to append an element that has a name and CData value only. |
org.w3c.dom.Element |
appendElement(org.w3c.dom.Element element,
java.lang.String tag)
Utility method to append an element that has no values. |
org.w3c.dom.Element |
appendText(org.w3c.dom.Element element,
java.lang.String tag,
java.lang.String value)
Utility method to Create an element that has a name and Text value only. |
static org.w3c.dom.Element |
createAttr(org.w3c.dom.Document doc,
java.lang.String tag,
java.lang.String value)
Utility method to Create an element that has a name and value only. |
void |
debug(java.lang.String msg)
debug output method |
void |
debug(java.lang.String method,
java.lang.String msg)
debug output method |
void |
debug(java.lang.String msg,
java.lang.Throwable t)
debug output method |
void |
debug(java.lang.Throwable t)
debug output method |
void |
display()
Display the current Kml document on stdOut. |
org.w3c.dom.Document |
getDocument()
|
static void |
main(java.lang.String[] args)
main class used for debug |
void |
setDocument(org.w3c.dom.Document _doc)
|
org.w3c.dom.Element |
setRoot(java.lang.String xmlns)
Setup the root of the KML document. |
void |
write(java.io.OutputStream os)
Write an Xml document to an outputStream |
void |
writeFile(java.lang.String xmlFileName_)
Write an Xml document to an outputStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KmlDoc()
Method Detail |
---|
public org.w3c.dom.Element setRoot(java.lang.String xmlns)
xmlns
- Value for xmlns
(if null, use default "http://earth.google.com/kml/2.0")
public void writeFile(java.lang.String xmlFileName_)
xmlFileName_
- public void write(java.io.OutputStream os)
os
- Allocated output Streampublic void display()
public void debug(java.lang.String msg)
msg
- public void debug(java.lang.String method, java.lang.String msg)
method
- msg
- public void debug(java.lang.Throwable t)
t
- public void debug(java.lang.String msg, java.lang.Throwable t)
msg
- t
- public org.w3c.dom.Document getDocument()
public void setDocument(org.w3c.dom.Document _doc)
_doc
- The _doc to set.public static org.w3c.dom.Element createAttr(org.w3c.dom.Document doc, java.lang.String tag, java.lang.String value)
There is probably a better way to do this but ... * @param doc Document
tag
- xml tagvalue
- string value of tag
public org.w3c.dom.Element appendElement(org.w3c.dom.Element element, java.lang.String tag)
Creates an XML tag and places it in the document as a child of the specified element. Createsvalue
element
- existing element where new tag is to gotag
- XML tag
public org.w3c.dom.Element appendText(org.w3c.dom.Element element, java.lang.String tag, java.lang.String value)
Creates an XML tag with a text value and places it in the document as a child of the specified element. Createsvalue
element
- existing element where new tag is to gotag
- XML tagvalue
- value of tag
public org.w3c.dom.Element appendCDATA(org.w3c.dom.Element element, java.lang.String tag, java.lang.String value)
value of tag with html in it
element
- existing element where new tag is to gotag
- XML tagvalue
- value of tag
public org.w3c.dom.Element appendAttr(org.w3c.dom.Element element, java.lang.String tag, boolean value)
1 or0
doc
- root documentelement
- existing element where new tag is to gotag
- XML tagvalue
- true or false
public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |