Package org.tinyuml.model

Examples of org.tinyuml.model.UmlClass


  /**
   * Reinitializes the main compartment with the contained labels.
   */
  private void reinitMainCompartment() {
    UmlClass umlclass = (UmlClass) getModelElement();
    mainCompartment.removeAllLabels();
    if (showStereotypes) {
      for (UmlStereotype stereotype : umlclass.getStereotypes()) {
        Label label = new Label();
        label.setSource(new UmlModelElementLabelSource(stereotype));
        mainCompartment.addLabel(label);
      }
    }
View Full Code Here


    compElem.setModelElement(comp);
    compElem.addNodeChangeListener(diagram);
    elementPrototypes.put(ElementType.COMPONENT, compElem);

    // Add class prototype
    UmlClass clss = (UmlClass) UmlClass.getPrototype().clone();
    clss.setName("Class 1");
    ClassElement classElem = (ClassElement) ClassElement.getPrototype().clone();
    classElem.setModelElement(clss);
    classElem.addNodeChangeListener(diagram);
    elementPrototypes.put(ElementType.CLASS, classElem);
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public ClassElement createClass() {
    UmlClass clss = (UmlClass)
      modelElementFactory.create(ElementType.CLASS);
    ClassElement classElem = new ClassElement(clss);
    classElem.addNodeChangeListener(diagram);
    return classElem;
  }
View Full Code Here

  /**
   * Initializes the models in this dialog.
   */
  private void myInitModels() {
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    for (UmlProperty method : umlclass.getMethods()) {
      methodTableModel.addEntry(method.getName());
    }
    for (UmlProperty attribute : umlclass.getAttributes()) {
      attributeTableModel.addEntry(attribute.getName());
    }
    for (UmlStereotype stereotype : umlclass.getStereotypes()) {
      stereotypeTableModel.addEntry(stereotype.getName());
    }
  }
View Full Code Here

  /**
   * Initialization after model and components are initialized.
   */
  private void myPostInit() {
    docVisibilityCb.setEnabled(false);
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    abstractCb.setSelected(umlclass.isAbstract());
    attributeVisibilityCb.setSelected(classElement.showAttributes());
    methodVisibilityCb.setSelected(classElement.showOperations());
    stereotypeVisibilityCb.setSelected(classElement.showStereotypes());
    methodTable.getTableHeader().setVisible(false);
    attributeTable.getTableHeader().setVisible(false);
View Full Code Here

  /**
   * Initializes the models in this dialog.
   */
  private void myInitModels() {
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    for (UmlProperty method : umlclass.getMethods()) {
      methodTableModel.addEntry(method.getName());
    }
    for (UmlProperty attribute : umlclass.getAttributes()) {
      attributeTableModel.addEntry(attribute.getName());
    }
    for (UmlStereotype stereotype : umlclass.getStereotypes()) {
      stereotypeTableModel.addEntry(stereotype.getName());
    }
  }
View Full Code Here

  /**
   * Initialization after model and components are initialized.
   */
  private void myPostInit() {
    docVisibilityCb.setEnabled(false);
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    abstractCb.setSelected(umlclass.isAbstract());
    attributeVisibilityCb.setSelected(classElement.showAttributes());
    methodVisibilityCb.setSelected(classElement.showOperations());
    stereotypeVisibilityCb.setSelected(classElement.showStereotypes());
    methodTable.getTableHeader().setVisible(false);
    attributeTable.getTableHeader().setVisible(false);
View Full Code Here

  public void editProperties(DiagramElement element) {
    Window window = (mainWindow instanceof Window) ? ((Window) mainWindow) :
        null;
    if (element instanceof ClassElement) {
      ClassElement classElement = (ClassElement) element;
      UmlClass umlclass = (UmlClass) classElement.getModelElement();
      EditClassDialog dialog = new EditClassDialog(window, classElement,
        true);
      dialog.setLocationRelativeTo(mainWindow);
      dialog.setVisible(true);
      if (dialog.isOk()) {
        umlclass.setAbstract(dialog.classIsAbstract());
        classElement.setShowOperations(dialog.showOperations());
        classElement.setShowAttributes(dialog.showAttributes());
        classElement.setShowStereotypes(dialog.showStereotypes());
        umlclass.setName(dialog.getName());
        umlclass.setMethods(dialog.getMethods());
        umlclass.setAttributes(dialog.getAttributes());
        umlclass.setStereotypes(dialog.getStereotypes());
        redraw();
      }
    } else if (element instanceof Association) {
      Association association = (Association) element;
      EditAssociationDialog dialog = new EditAssociationDialog(window,
View Full Code Here

  /**
   * Initializes the models in this dialog.
   */
  private void myInitModels() {
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    for (UmlProperty method : umlclass.getMethods()) {
      methodTableModel.addEntry(method.getName());
    }
    for (UmlProperty attribute : umlclass.getAttributes()) {
      attributeTableModel.addEntry(attribute.getName());
    }
    for (UmlStereotype stereotype : umlclass.getStereotypes()) {
      stereotypeTableModel.addEntry(stereotype.getName());
    }
  }
View Full Code Here

  /**
   * Initialization after model and components are initialized.
   */
  private void myPostInit() {
    docVisibilityCb.setEnabled(false);
    UmlClass umlclass = (UmlClass) classElement.getModelElement();
    abstractCb.setSelected(umlclass.isAbstract());
    attributeVisibilityCb.setSelected(classElement.showAttributes());
    methodVisibilityCb.setSelected(classElement.showOperations());
    stereotypeVisibilityCb.setSelected(classElement.showStereotypes());
    methodTable.getTableHeader().setVisible(false);
    attributeTable.getTableHeader().setVisible(false);
    stereotypeTable.getTableHeader().setVisible(false);
    nameTextField.setText(umlclass.getName());
    getRootPane().setDefaultButton(okButton);
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.model.UmlClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.