Class CellFactory

java.lang.Object
jsimgraph.JGraphMod.CellFactory

public class CellFactory extends Object
A class grouping all cell creation suff
  • Constructor Details

    • CellFactory

      public CellFactory(Mediator mediator)
      Instantiate a new CellFactory
      Parameters:
      mediator - reference to mediator
  • Method Details

    • createCell

      public JmtCell createCell(String className)
      Creates a new cell of given class with default user object (CellComponent)
      Parameters:
      className - Name of the class to be instantiated
      Returns:
      created JmtCell Author: Bertoli Marco
    • createStationCell

      public JmtCell createStationCell(Object key)
      Creates a new cell for the station with the given search key
      Parameters:
      key - search's key (into data structure) for station cell to be created
      Returns:
      created cell component
    • createCell

      public JmtCell createCell(String className, Object userObject)
      Creates a new cell of given class with given user object
      Parameters:
      className - Name of the class to be instantiated
      userObject - object to be inserted into cell's data structure
      Returns:
      created JmtCell Author: Bertoli Marco
    • createComponent

      public CellComponent createComponent(String className)
      Creates a new component of a given class.
      Parameters:
      className - className of cell component to be created
      Returns:
      created component Author: Bertoli Marco
    • getComponentType

      public String getComponentType(String className)
      This class is used as a bridge with new data structure (common with JSIM). It will returns component type constant to be used on JMODELModel given *Cell classname.
      Parameters:
      className - className of cell component
      Returns:
      type in the format needed by JMODELModel methods Author: Bertoli Marco
    • deleteCell

      public void deleteCell(JmtCell cell)
      Deletes a JmtCell component removing its data structure
      Parameters:
      cell - component to be eliminated
    • predictCellSize

      public Dimension predictCellSize(String className)
      Calculate exact size of a JmtCell component before creating it. Will be used to avoid overlapping of nodes on the graph before placement.
      Parameters:
      className - name of the *Cell that will be instantiated
      Returns:
      predicted dimensions of Node