Package org.tinyuml.draw

Examples of org.tinyuml.draw.Label


    assertTrue(cloned.getModelElement() != element.getModelElement());
    assertTrue(cloned.getMainCompartment() != element.getMainCompartment());
    assertTrue(cloned.getMainCompartment().getParent() == cloned);
    // tests the contained label
    assertEquals(1, cloned.getMainCompartment().getLabels().size());
    Label label = cloned.getMainCompartment().getLabels().get(0);
    assertTrue(cloned.getMainCompartment() == label.getParent());
    assertTrue(label.getSource() == cloned);
  }
View Full Code Here


    if (multilineEditor.isVisible()) {
      currentEditor = multilineEditor;
    }
    if (currentEditor != null && currentEditor.isVisible()) {
      String text = currentEditor.getText();
      Label label = currentEditor.getLabel();
      SetLabelTextCommand command = new SetLabelTextCommand(label, text);
      execute(command);
      currentEditor.hideEditor();
      repaint();
      return true;
View Full Code Here

    classData.addModelElementListener(this);
    classData.setName("Class 1");
    mainCompartment = theMainCompartment;
    attributesCompartment = theAttributeCompartment;
    operationsCompartment = theOpCompartment;
    mainLabel = new Label();
    mainLabel.setSource(this);
    mainLabel.setFontType(getMainLabelFontType());
    mainCompartment.addLabel(mainLabel);
    mainCompartment.setParent(this);
    attributesCompartment.setParent(this);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Label getLabelAt(double mx, double my) {
    Label label = mainCompartment.getLabelAt(mx, my);
    if (label == null && showAttributes) {
      label = attributesCompartment.getLabelAt(mx, my);
    }
    if (label == null && showOperations) {
      label = operationsCompartment.getLabelAt(mx, my);
View Full Code Here

   * {@inheritDoc}
   */
  public void elementChanged(UmlModelElement element) {
    attributesCompartment.removeAllLabels();
    for (UmlProperty property : ((UmlClass) element).getAttributes()) {
      Label label = new Label();
      label.setSource(new UmlModelElementLabelSource(property));
      attributesCompartment.addLabel(label);
    }
    operationsCompartment.removeAllLabels();
    for (UmlProperty property : ((UmlClass) element).getMethods()) {
      Label label = new Label();
      label.setSource(new UmlModelElementLabelSource(property));
      operationsCompartment.addLabel(label);
    }
    reinitMainCompartment();
    invalidate();
  }
View Full Code Here

  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);
      }
    }
    mainCompartment.addLabel(mainLabel);
  }
View Full Code Here

    classData.addModelElementListener(this);
    classData.setName("Class 1");
    mainCompartment = theMainCompartment;
    attributesCompartment = theAttributeCompartment;
    operationsCompartment = theOpCompartment;
    mainLabel = new Label();
    mainLabel.setSource(this);
    mainLabel.setFontType(getMainLabelFontType());
    mainCompartment.addLabel(mainLabel);
    mainCompartment.setParent(this);
    attributesCompartment.setParent(this);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Label getLabelAt(double mx, double my) {
    Label label = mainCompartment.getLabelAt(mx, my);
    if (label == null && showAttributes) {
      label = attributesCompartment.getLabelAt(mx, my);
    }
    if (label == null && showOperations) {
      label = operationsCompartment.getLabelAt(mx, my);
View Full Code Here

   * {@inheritDoc}
   */
  public void elementChanged(UmlModelElement element) {
    attributesCompartment.removeAllLabels();
    for (UmlProperty property : ((UmlClass) element).getAttributes()) {
      Label label = new Label();
      label.setSource(new UmlModelElementLabelSource(property));
      attributesCompartment.addLabel(label);
    }
    operationsCompartment.removeAllLabels();
    for (UmlProperty property : ((UmlClass) element).getMethods()) {
      Label label = new Label();
      label.setSource(new UmlModelElementLabelSource(property));
      operationsCompartment.addLabel(label);
    }
    reinitMainCompartment();
    invalidate();
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Label getLabelAt(double mx, double my) {
    Label labelAt = tabCompartment.getLabelAt(mx, my);
    if (labelAt == null) labelAt = mainCompartment.getLabelAt(mx, my);
    return labelAt;
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.Label

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.