|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.tigris.gef.xml.pgml.PGMLParser
org.argouml.persistence.PGMLParser
The PGML parser.
Nested Class Summary | |
protected class |
PGMLParser.NameVal
Utility class to pair a name and a value String together. |
Field Summary | |
private String[] |
entityPaths
|
private org.tigris.gef.presentation.Fig |
figGroup
HACK to handle issue 2719. |
private static Logger |
LOG
|
private boolean |
nestedGroupFlag
HACK to handle issue 2719. |
private org.tigris.gef.presentation.FigNode |
previousNode
|
private StringBuffer |
privateText
|
private int |
privateTextDepth
|
private HashMap |
translationTable
|
Fields inherited from class org.tigris.gef.xml.pgml.PGMLParser |
_currentEdge, _currentEncloser, _currentLine, _currentNode, _currentPoly, _detectedFailure, _diagram, _elementState, _figRegistry, _nestedGroups, _ownerRegistry, _textBuf, _x1Int, _y1Int, ANNOTATION_EDGE_STATE, ANNOTATION_STATE, DEFAULT_EDGE_STATE, DEFAULT_NODE_STATE, DEFAULT_STATE, EDGE_STATE, LINE_STATE, NODE_STATE, POLY_EDGE_STATE, POLY_NODE_STATE, POLY_STATE, PRIVATE_EDGE_STATE, PRIVATE_NODE_STATE, PRIVATE_STATE, systemId, TEXT_ANNOTATION_STATE, TEXT_EDGE_STATE, TEXT_NODE_STATE, TEXT_STATE |
Constructor Summary | |
PGMLParser(Map modelElementsByUuid)
Constructor. |
Method Summary | |
void |
addTranslation(String from,
String to)
|
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(String uri,
String localname,
String name)
|
protected org.tigris.gef.presentation.Fig |
findFig(String uri)
|
protected String[] |
getEntityPaths()
|
private Object |
getModelElement(Attributes attrList)
Return the model element being referred to by interogating the attributes of the XML group node. |
protected org.tigris.gef.presentation.Fig |
handleGroup(Attributes attrList)
|
protected void |
handlePGML(Attributes attrList)
|
private Map |
interpretStyle(StringTokenizer st)
The StringTokenizer is expected to be positioned at the start a a string of style identifiers in the format name=value;name=value;name=value.... |
private boolean |
isAttributesXml(Attributes attrList)
|
private boolean |
isOperationsXml(Attributes attrList)
|
protected void |
privateStateEndElement(String tagName)
|
org.tigris.gef.base.Diagram |
readDiagram(InputStream is,
boolean closeStream)
|
protected void |
setElementItemUID(String id)
Sets the ItemUID value of the current element in the file. |
private void |
setStyleAttributes(org.tigris.gef.presentation.Fig fig,
Map attributeMap)
Set the fig style attributes. |
protected PGMLParser.NameVal |
splitNameVal(String str)
Splits a name value pair into a NameVal instance. |
void |
startElement(String uri,
String localname,
String elementName,
Attributes attrList)
|
protected String |
translateClassName(String oldName)
|
Methods inherited from class org.tigris.gef.xml.pgml.PGMLParser |
annotationStateStartElement, colorByName, edgeStateStartElement, findOwner, getGraphModelFor, getSystemId, handleEllipse, handleLine, handlePath, handlePolyLine, handleRect, handleText, initDiagram, lineStateStartElement, nodeStateStartElement, polyStateStartElement, readDiagram, readDiagram, resolveEntity, rollbackAdd, setAttrs, setDetectedFailure, setOwnerAttr, setSystemId |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean nestedGroupFlag
private org.tigris.gef.presentation.Fig figGroup
private static final Logger LOG
private int privateTextDepth
private StringBuffer privateText
private HashMap translationTable
private String[] entityPaths
private org.tigris.gef.presentation.FigNode previousNode
Constructor Detail |
public PGMLParser(Map modelElementsByUuid)
modelElementsByUuid
- a map of model elements indexed
by a unique string identifier.Method Detail |
public void addTranslation(String from, String to)
from
- the class name to be "translated", i.e. replaced
by something elseto
- the resulting nameprotected String translateClassName(String oldName)
PGMLParser.translateClassName(java.lang.String)
protected String[] getEntityPaths()
PGMLParser.getEntityPaths()
public void startElement(String uri, String localname, String elementName, Attributes attrList) throws SAXException
SAXException
Called by the XML framework when an entity starts.
private boolean isAttributesXml(Attributes attrList)
private boolean isOperationsXml(Attributes attrList)
public void characters(char[] ch, int start, int length)
Called by the PGML framework when there are characters inside an XML
entity. We need to save them if it would turn out to be a private
entity.
protected void setElementItemUID(String id)
id
- the given idprotected PGMLParser.NameVal splitNameVal(String str)
str
- A String with a name value pair.
public org.tigris.gef.base.Diagram readDiagram(InputStream is, boolean closeStream)
PGMLParser.readDiagram(
java.io.InputStream, boolean)
public void endElement(String uri, String localname, String name) throws SAXException
SAXException
ContentHandler.endElement(
java.lang.String, java.lang.String, java.lang.String)
protected org.tigris.gef.presentation.Fig handleGroup(Attributes attrList)
This is a correct implementation of handleGroup and will add
FigGroups to the diagram ONLY if they are
not a FigNode AND if they are not part of a FigNode.
private void setStyleAttributes(org.tigris.gef.presentation.Fig fig, Map attributeMap)
fig
- the fig to style.attributeMap
- a map of name value pairsprivate Object getModelElement(Attributes attrList)
attrList
- a collection of name value pairsprivate Map interpretStyle(StringTokenizer st)
st
- The StrinkTokenizer positioned at the first style identifier
protected void handlePGML(Attributes attrList)
PGMLParser.handlePGML(org.xml.sax.Attributes)
protected void privateStateEndElement(String tagName)
PGMLParser.privateStateEndElement(java.lang.String)
protected org.tigris.gef.presentation.Fig findFig(String uri)
PGMLParser.findFig(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |