예제 #1
0
  /**
   * Creates a new instance of SubsystemNode. Creates sublevel named classLevel for containing
   * ClassNodes. Creates ClassNodes based on LEM Class objects in LEM Subsystem object. If no Class
   * objects in LEM Subsystem object then classLevel will display message "[No Classes]".
   *
   * @param s LEM Subsystem object to be contained.
   */
  public SubsystemNode(Subsystem s) {
    this.subsystem = s;

    if (s.getClasses().size() == 0) {
      DefaultMutableTreeNode classLevel = new DefaultMutableTreeNode("[No Classes]");
      add(classLevel);
    } else {
      DefaultMutableTreeNode classLevel = new DefaultMutableTreeNode("Classes");

      Iterator i = s.getClasses().values().iterator();
      while (i.hasNext()) {
        classLevel.add(new ClassNode((org.jdns.xtuml.metamodel.Class) i.next()));
      }

      add(classLevel);
    }
  }
예제 #2
0
 /**
  * Returns the description property of the LEM Subsystem object.
  *
  * @return the Subsystem description.
  */
 public String getDescription() {
   if (subsystem.getDescription() != null) return trim(subsystem.getDescription());
   else return "";
 }
예제 #3
0
 /**
  * Returns name property of LEM Subsystem object.
  *
  * @return the Subsystem name.
  */
 public String toString() {
   return "Subsystem " + subsystem.getName();
 }