ar.edu.unr.fceia.bottallo
Class JDOMWorker

java.lang.Object
  extended by ar.edu.unr.fceia.bottallo.JDOMWorker

public class JDOMWorker
extends java.lang.Object

Works with the XML library JDOM to detect graphical elements in .odg files


Constructor Summary
JDOMWorker()
          Creates a new instance of JDOMWorker
 
Method Summary
protected  void addLine(org.jdom.Element e, java.lang.String text)
          Add an invisble line to put information about active state in parametrized states
protected  boolean continuousBorder(org.jdom.Element e)
          Determines if a state has continuous border
 void finalize()
           
protected  java.lang.String getActionPart(org.jdom.Element e)
          Return the action part of a transition label if exists
protected  java.lang.String getConditionPart(org.jdom.Element e)
          Return the condition part of a transition label if exists
protected  java.lang.String getConnectorId(org.jdom.Element e)
          Return the id of a connector
protected  java.lang.String getConnectorName(org.jdom.Element e)
          Return the name of a connector
protected  int getConnectorType(org.jdom.Element e)
          Return the type of a connector
protected  Dimension getDimension(org.jdom.Element e)
          Set information of spatial characteristics of a graphical object
protected  java.util.List<org.jdom.Element> getDrawElements(java.lang.String path)
          Joins all the graphical objects of a XML file
protected  java.lang.String getDrawStyle(org.jdom.Element e)
          Return the style of a graphical element, useful to set the efect of activity
protected  org.jdom.Element getElementById(java.lang.String id)
          Get an element by the internal id
protected  java.lang.String getEndShape(org.jdom.Element e)
          Get the end shape of a transition
protected  java.lang.String getEventPart(org.jdom.Element e)
          Return the event part of a transition label if exists
protected  int getLowLimit(org.jdom.Element e)
          Return the low time-limit a temporized state
protected  java.lang.String getRingId(org.jdom.Element e)
          Return the id of a ring
protected  java.lang.String getStartShape(org.jdom.Element e)
          Get the start shape of a transition
protected  java.lang.String getStateId(org.jdom.Element e)
          Return the id of a Element
 java.lang.String getStateName(org.jdom.Element e)
          Return the name of a Element (state)
protected  java.lang.String getStyleName(org.jdom.Element e)
          Set the style of a graphical element, useful to set the efect of activity
protected  byte getTypeOfShape(org.jdom.Element e)
          Given a JDOM custom-shape Element determines the figure type
protected  int getUpLimit(org.jdom.Element e)
          Return the up time-limit a temporized state
protected  boolean isADefaultTransition(org.jdom.Element e)
          Return true if a transition is a default transition
protected  boolean isAShape(org.jdom.Element e)
          Check if a XML element is a custom-shape (figures, not arrows)
protected  boolean isATransition(org.jdom.Element e)
          Returns true if a graphical object is an arrow (transition)
protected  void setActive(java.lang.String name, java.lang.String id)
          Blink the text of a state, making it active
protected  void setInactive(java.lang.String name, java.lang.String id)
           
protected  boolean testName(org.jdom.Element e)
          Test the name of a temporized state
protected  void writeFile(java.lang.String path)
          Write a XML file to the absolute path passed
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOMWorker

public JDOMWorker()
           throws ar.edu.unr.fceia.bottallo.JDOMWException
Creates a new instance of JDOMWorker

Throws:
ar.edu.unr.fceia.bottallo.JDOMWException
Method Detail

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getDrawElements

protected java.util.List<org.jdom.Element> getDrawElements(java.lang.String path)
Joins all the graphical objects of a XML file

Parameters:
path - Path to the XML file
Returns:
A list with all the graphical objects of a XML file

writeFile

protected void writeFile(java.lang.String path)
Write a XML file to the absolute path passed

Parameters:
path - Path to the new XML file

getStateName

public java.lang.String getStateName(org.jdom.Element e)
Return the name of a Element (state)

Parameters:
e - Element representing a State
Returns:
Name of the Element (state)

getStateId

protected java.lang.String getStateId(org.jdom.Element e)
Return the id of a Element

Parameters:
e - Element representing a State
Returns:
Id of the Element

continuousBorder

protected boolean continuousBorder(org.jdom.Element e)
Determines if a state has continuous border

Parameters:
e - JDOM Element
Returns:
True if it has continuous border, false otherwise

setActive

protected void setActive(java.lang.String name,
                         java.lang.String id)
Blink the text of a state, making it active

Parameters:
name - String representing the state name
id - String representing the state id

setInactive

protected void setInactive(java.lang.String name,
                           java.lang.String id)

addLine

protected void addLine(org.jdom.Element e,
                       java.lang.String text)
Add an invisble line to put information about active state in parametrized states


testName

protected boolean testName(org.jdom.Element e)
Test the name of a temporized state


getLowLimit

protected int getLowLimit(org.jdom.Element e)
Return the low time-limit a temporized state


getUpLimit

protected int getUpLimit(org.jdom.Element e)
Return the up time-limit a temporized state


isATransition

protected boolean isATransition(org.jdom.Element e)
Returns true if a graphical object is an arrow (transition)

Parameters:
e - Element representing a graphical object
Returns:
Retrun true if e is an arrow, false otherwise

getStartShape

protected java.lang.String getStartShape(org.jdom.Element e)
Get the start shape of a transition


getEndShape

protected java.lang.String getEndShape(org.jdom.Element e)
Get the end shape of a transition


getEventPart

protected java.lang.String getEventPart(org.jdom.Element e)
Return the event part of a transition label if exists


getConditionPart

protected java.lang.String getConditionPart(org.jdom.Element e)
Return the condition part of a transition label if exists


getActionPart

protected java.lang.String getActionPart(org.jdom.Element e)
Return the action part of a transition label if exists


isADefaultTransition

protected boolean isADefaultTransition(org.jdom.Element e)
Return true if a transition is a default transition


getConnectorType

protected int getConnectorType(org.jdom.Element e)
Return the type of a connector


getConnectorName

protected java.lang.String getConnectorName(org.jdom.Element e)
Return the name of a connector


getConnectorId

protected java.lang.String getConnectorId(org.jdom.Element e)
Return the id of a connector


getRingId

protected java.lang.String getRingId(org.jdom.Element e)
Return the id of a ring


isAShape

protected boolean isAShape(org.jdom.Element e)
Check if a XML element is a custom-shape (figures, not arrows)

Parameters:
e - A JDOM Element return True if the element is a custom-shape. False otherwise

getDrawStyle

protected java.lang.String getDrawStyle(org.jdom.Element e)
Return the style of a graphical element, useful to set the efect of activity


getStyleName

protected java.lang.String getStyleName(org.jdom.Element e)
Set the style of a graphical element, useful to set the efect of activity


getElementById

protected org.jdom.Element getElementById(java.lang.String id)
Get an element by the internal id


getDimension

protected Dimension getDimension(org.jdom.Element e)
Set information of spatial characteristics of a graphical object

Parameters:
e - Element representing a graphical object
Returns:
A Dimension object with spatial information

getTypeOfShape

protected byte getTypeOfShape(org.jdom.Element e)
Given a JDOM custom-shape Element determines the figure type

Parameters:
e - A JDOM custom-shape Element
Returns:
A byte with an unique code for each shape