Examples of UmlDiagramElement


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

Examples of org.tinyuml.umldraw.shared.UmlDiagramElement

   */
  public JPopupMenu createContextMenu(Selection selection) {
    if (selection.getElements().size() > 1) {
      return createMultipleSelectionContextMenu();
    } else {
      UmlDiagramElement elem = (UmlDiagramElement) selection.getElement();
      if (elem instanceof Connection) {
        return createSingleConnectionContextMenu((Connection) elem);
      }
      return createSingleNodeContextMenu(elem);
    }
View Full Code Here

Examples of org.tinyuml.umldraw.shared.UmlDiagramElement

   */
  public JPopupMenu createContextMenu(Selection selection) {
    if (selection.getElements().size() > 1) {
      return createMultipleSelectionContextMenu();
    } else {
      UmlDiagramElement elem = (UmlDiagramElement) selection.getElement();
      if (elem instanceof Connection) {
        return createSingleConnectionContextMenu((Connection) elem);
      }
      return createSingleNodeContextMenu(elem);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.