Package org.tinyuml.draw

Examples of org.tinyuml.draw.DiagramElement


   */
  private void handleSelectionOnMouseClicked(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
    DiagramElement previousSelected = currentSelection.getElement();
    DiagramElement element = editor.getDiagram().getChildAt(mx, my);
    if (element instanceof UmlDiagramElement && previousSelected == element) {
      Label label = element.getLabelAt(mx, my);
      if (label != null) {
        editor.editLabel(label);
      } else if (e.getClickCount() >= 2) {
        editor.editProperties(element);
      }
    } else if (editor.getDiagram().getLabelAt(mx, my) != null) {
      // Edit the diagram name
      editor.editLabel(editor.getDiagram().getLabelAt(mx, my));
    } else {
      if (element == NullElement.getInstance()) {
        element = editor.getDiagram();
      }
      currentSelection = element.getSelection(editor);
    }
    editor.redraw();
    notifyListeners();
  }
View Full Code Here


   */
  private Selection getSelection(double mx, double my) {
    if (!nothingSelected() && currentSelection.contains(mx, my)) {
      return currentSelection;
    }
    DiagramElement element = editor.getDiagram().getChildAt(mx, my);
    if (element != NullElement.getInstance()) {
      // select the element
      return element.getSelection(editor);
    }
    return editor.getDiagram().getSelection(editor);
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.DiagramElement

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.