Package org.tinyuml.draw

Examples of org.tinyuml.draw.UmlDiagramElement


   */
  public void mouseClicked(EditorMouseEvent e) {
    double mx = e.getX(), my = e.getY();
    // this is a pretty ugly cast, it is needed in order to use the getLabel()
    // method which is not a base DiagramElement method
    UmlDiagramElement previousSelected = (UmlDiagramElement)
      currentSelection.getElement();
    UmlDiagramElement element = (UmlDiagramElement)
      editor.getDiagram().getChildAt(mx, my);
    if (element != NullElement.getInstance() && previousSelected == element) {
      editor.editLabel(element.getLabelAt(mx, my));
    } else if (editor.getDiagram().getLabelAt(mx, my) != null) {
      // Edit the diagram name
      editor.editLabel(editor.getDiagram().getLabelAt(mx, my));
    } else {
      currentSelection = element.getSelection(editor);
    }
    editor.repaint();
    notifyListeners();
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.UmlDiagramElement

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.