Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## SEdit
Class Structure

    java.lang.Object
      SEdit.Structure

Direct Known Subclasses:
  AutomatonStructure, MobileStructure, PetriStructure, WarbotStructure, WorldStructure

    public class Structure

extends java.lang.Object

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)

Version:
  2.0
Author:
  Jacques Ferber and Olivier Gutknecht
See Also:
  `StructureEditor`

Field Summary
`protected StructureAgent` | `agent`
`protected java.util.Vector` | `arrowList`
`protected java.lang.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 java.util.Vector` | `nodeList`
`protected boolean` | `snapToGrid`

Constructor Summary
`Structure()`

Method Summary
`void` | `activate()`
`void` | `addArrow(SArrow o, SNode from, SNode to)`
`void` | `addArrow(SArrow o, java.lang.String s, SNode from, SNode to)`
`void` | `addNode(SNode o)`
`void` | `addNode(SNode o, java.lang.String s)`
`void` | `clearAll()`
`SNode` | `createNode(java.lang.String nameDescr, int x, int y)` create a node and install it into the editor.
`void` | `deleteAll()`
`void` | `drawBackground(java.awt.Graphics g)` draw the background.
`void` | `dump()`
`void` | `end()` Called by the StructureAgent when the agent is killed Does nothing by default.
`boolean` | `existID(java.lang.String id)` Find if a given ID exists already in the structure
`StructureAgent` | `getAgent()`
`SArrow` | `getArrow(java.lang.String id)` Find an arrow by its ID
`SArrow` | `getArrowFromLabel(java.lang.String id)` Return the *first* node with a given label in the structure
`java.util.Vector` | `getArrows()`
`java.lang.String` | `getDescription()`
`boolean` | `getDisplayGrid()`
`StructureEditor` | `getEditor()`
`Formalism` | `getFormalism()`
`int` | `getGridSize()`
`SNode` | `getNode(java.lang.String id)` Find a node by its ID
`SNode` | `getNodeFromLabel(java.lang.String name)` Return the *first* node with a given label in the structure
`java.util.Vector` | `getNodes()`
`boolean` | `getSnapToGrid()`
`void` | `initStructure()` Initialize a structure when everything is OK.
`boolean` | `isConnectable(SArrow edge, SNode from, SNode to)`
`java.lang.String` | `newArrowID()` Returns a new arrow ID not existing yet in the structure
`java.lang.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(java.lang.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()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### formalism

    protected Formalism formalism

  The model formalism

### description

    protected java.lang.String description

### nodeList

    protected java.util.Vector nodeList

### arrowList

    protected java.util.Vector arrowList

### modified

    protected boolean modified

  Ol: FIXME nobody sets this flag JF: right, but somebody should!! Ol: Not sure. Who sould know if a structure is modified or not ? The structure itself or the editor ?

### editor

    protected StructureEditor editor

### agent

    protected StructureAgent agent

### snapToGrid

    protected boolean snapToGrid

### displayGrid

    protected boolean displayGrid

### gridSize

    protected int gridSize

Constructor Detail

### Structure

    public Structure()

Method Detail

### setFormalism

    public void setFormalism(Formalism f)

### getFormalism

    public Formalism getFormalism()

### getDescription

    public java.lang.String getDescription()

### setDescription

    public void setDescription(java.lang.String s)

### getNodes

    public java.util.Vector getNodes()

### getArrows

    public java.util.Vector getArrows()

### getEditor

    public StructureEditor getEditor()

### setEditor

    public void setEditor(StructureEditor s)

### getAgent

    public StructureAgent getAgent()

### setAgent

    public void setAgent(StructureAgent s)

### setSnapToGrid

    public void setSnapToGrid(boolean b)

### getSnapToGrid

    public boolean getSnapToGrid()

### setSnapToGrid1

    public void setSnapToGrid1(boolean b)

### setDisplayGrid

    public void setDisplayGrid(boolean b)

### getDisplayGrid

    public boolean getDisplayGrid()

### toggleShowGrid

    public void toggleShowGrid()

### setGridSize

    public void setGridSize(int n)

### getGridSize

    public int getGridSize()

### initStructure

    public void initStructure()

  Initialize a structure when everything is OK. Does nothing by default. May be redefined by subclasses.

### end

    public void end()

  Called by the StructureAgent when the agent is killed Does nothing by default. May be used by subclasses.

### activate

    public void activate()

### preactivate

    public void preactivate()

### clearAll

    public void clearAll()

### newNodeID

    public java.lang.String newNodeID()

  Returns a new node ID not existing yet in the structure

### newArrowID

    public java.lang.String newArrowID()

  Returns a new arrow ID not existing yet in the structure

### existID

    public boolean existID(java.lang.String id)

  Find if a given ID exists already in the structure

### addNode

    public void addNode(SNode o)

### addNode

    public void addNode(SNode o,
                        java.lang.String s)

### addArrow

    public void addArrow(SArrow o,
                         SNode from,
                         SNode to)

### addArrow

    public void addArrow(SArrow o,
                         java.lang.String s,
                         SNode from,
                         SNode to)

### isConnectable

    public boolean isConnectable(SArrow edge,
                                 SNode from,
                                 SNode to)

### removeNode

    public void removeNode(SNode o)

### removeArrow

    public void removeArrow(SArrow o)

### deleteAll

    public void deleteAll()

### getNode

    public SNode getNode(java.lang.String id)

  Find a node by its ID

### getArrow

    public SArrow getArrow(java.lang.String id)

  Find an arrow by its ID

### getNodeFromLabel

    public SNode getNodeFromLabel(java.lang.String name)

  Return the *first* node with a given label in the structure

### getArrowFromLabel

    public SArrow getArrowFromLabel(java.lang.String id)

  Return the *first* node with a given label in the structure

### drawBackground

    public void drawBackground(java.awt.Graphics g)

  draw the background. Does nothing in Structure. May be overridden by subclasses.

### createNode

    public SNode createNode(java.lang.String nameDescr,
                            int x,
                            int y)

  create a node and install it into the editor.

### dump

    public void dump()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.