|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSEdit.Structure
A structure is the basic model data type. It contains nodes and arrows, and is responsible for creation, I/O, and identificaiton. The structure data type is completely decoupled from actual graphic representation (which is managed by the StructureEditor, and GObject plus its subclasses)
StructureEditor
Field Summary | |
protected StructureAgent |
agent
|
protected Vector |
arrowList
|
protected String |
description
|
protected boolean |
displayGrid
|
protected StructureEditor |
editor
|
protected Formalism |
formalism
The model formalism |
protected int |
gridSize
|
protected boolean |
modified
Ol: FIXME nobody sets this flag JF: right, but somebody should!! |
protected Vector |
nodeList
|
protected boolean |
snapToGrid
|
Constructor Summary | |
Structure()
|
Method Summary | |
void |
activate()
|
void |
addArrow(SArrow o,
SNode from,
SNode to)
|
void |
addArrow(SArrow o,
String s,
SNode from,
SNode to)
|
void |
addNode(SNode o)
|
void |
addNode(SNode o,
String s)
|
void |
clearAll()
|
SNode |
createNode(String nameDescr,
int x,
int y)
create a node and install it into the editor. |
void |
deleteAll()
|
void |
drawBackground(Graphics g)
draw the background. |
void |
dump()
|
void |
end()
Called by the StructureAgent when the agent is killed Does nothing by default. |
boolean |
existID(String id)
Find if a given ID exists already in the structure |
StructureAgent |
getAgent()
|
SArrow |
getArrow(String id)
Find an arrow by its ID |
SArrow |
getArrowFromLabel(String id)
Return the *first* node with a given label in the structure |
Vector |
getArrows()
|
String |
getDescription()
|
boolean |
getDisplayGrid()
|
StructureEditor |
getEditor()
|
Formalism |
getFormalism()
|
int |
getGridSize()
|
SNode |
getNode(String id)
Find a node by its ID |
SNode |
getNodeFromLabel(String name)
Return the *first* node with a given label in the structure |
Vector |
getNodes()
|
boolean |
getSnapToGrid()
|
void |
initStructure()
Initialize a structure when everything is OK. |
boolean |
isConnectable(SArrow edge,
SNode from,
SNode to)
|
String |
newArrowID()
Returns a new arrow ID not existing yet in the structure |
String |
newNodeID()
Returns a new node ID not existing yet in the structure |
void |
preactivate()
|
void |
removeArrow(SArrow o)
|
void |
removeNode(SNode o)
|
void |
setAgent(StructureAgent s)
|
void |
setDescription(String s)
|
void |
setDisplayGrid(boolean b)
|
void |
setEditor(StructureEditor s)
|
void |
setFormalism(Formalism f)
|
void |
setGridSize(int n)
|
void |
setSnapToGrid(boolean b)
|
void |
setSnapToGrid1(boolean b)
|
void |
toggleShowGrid()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Formalism formalism
protected String description
protected Vector nodeList
protected Vector arrowList
protected boolean modified
protected StructureEditor editor
protected StructureAgent agent
protected boolean snapToGrid
protected boolean displayGrid
protected int gridSize
Constructor Detail |
public Structure()
Method Detail |
public void setFormalism(Formalism f)
public Formalism getFormalism()
public String getDescription()
public void setDescription(String s)
public Vector getNodes()
public Vector getArrows()
public StructureEditor getEditor()
public void setEditor(StructureEditor s)
public StructureAgent getAgent()
public void setAgent(StructureAgent s)
public void setSnapToGrid(boolean b)
public boolean getSnapToGrid()
public void setSnapToGrid1(boolean b)
public void setDisplayGrid(boolean b)
public boolean getDisplayGrid()
public void toggleShowGrid()
public void setGridSize(int n)
public int getGridSize()
public void initStructure()
public void end()
public void activate()
public void preactivate()
public void clearAll()
public String newNodeID()
public String newArrowID()
public boolean existID(String id)
public void addNode(SNode o)
public void addNode(SNode o, String s)
public void addArrow(SArrow o, SNode from, SNode to)
public void addArrow(SArrow o, String s, SNode from, SNode to)
public boolean isConnectable(SArrow edge, SNode from, SNode to)
public void removeNode(SNode o)
public void removeArrow(SArrow o)
public void deleteAll()
public SNode getNode(String id)
public SArrow getArrow(String id)
public SNode getNodeFromLabel(String name)
public SArrow getArrowFromLabel(String id)
public void drawBackground(Graphics g)
public SNode createNode(String nameDescr, int x, int y)
public void dump()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |