Package org.tinyuml.draw

Examples of org.tinyuml.draw.DiagramElement


  /**
   * Removes the current selection.
   */
  public void deleteSelection() {
    DiagramElement element = getSelectedElement();
    if (element != null) {
      execute(new DeleteElementCommand(this, element));
    }
  }
View Full Code Here


  /**
   * Returns the current selection.
   * @return the selected element
   */
  public DiagramElement getSelectedElement() {
    DiagramElement elem = selectionHandler.getSelectedElement();
    return elem == NullElement.getInstance() ? null : elem;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mousePressed(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (elem instanceof Node) {
      anchor.setLocation(mx, my);
      isDragging = true;
      source = elem;
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mouseReleased(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (elem instanceof UmlNode && elem != source) {
      Connection connection = null;
      if (connectionType == ConnectionType.DEPENDENCY) {
        connection = editor.getDiagram().getElementFactory().createDependency(
          (UmlNode) source, (UmlNode) elem);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mouseClicked(EditorMouseEvent e) {
    double mx = e.getX(), my = e.getY();
    DiagramElement element = editor.getDiagram().getChildAt(mx, my);
    currentSelection = element.getSelection(editor);
    /*
    if (e.getClickCount() == 2) {
        // To be edited, this is hacked
        Font editorFont = captionEditor.getFont();
        PackageShape pkgShape = (PackageShape) shape;
View Full Code Here

  public void mousePressed(EditorMouseEvent e) {
    double mx = e.getX(), my = e.getY();
    if (currentSelection.contains(mx, my)) {
      currentSelection.startDragging(mx, my);
    } else {
      DiagramElement element = editor.getDiagram().getChildAt(mx, my);
      if (element != NullElement.getInstance()) {
        currentSelection = element.getSelection(editor);
      } else {
        currentSelection = selector;
      }
      currentSelection.startDragging(mx, my);
    }
View Full Code Here

  /**
   * Returns the current selection.
   * @return the selected element
   */
  public DiagramElement getSelectedElement() {
    DiagramElement elem = selectionHandler.getSelectedElement();
    return elem == NullElement.getInstance() ? null : elem;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mousePressed(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (elem instanceof PackageElement) {
      anchor.setLocation(mx, my);
      isDragging = true;
      source = elem;
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mouseReleased(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (elem instanceof PackageElement && elem != source) {
      CreateConnectionCommand command = new CreateConnectionCommand(
        elementFactory, editor.getDiagram(), editor, (Node) source,
        (Node) elem);
      editor.execute(command);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mousePressed(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (isValidSource(elem)) {
      source = (UmlNode) elem;
      anchor.setLocation(source.getAbsCenterX(), source.getAbsCenterY());
      isDragging = true;
    }
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.