Package org.tinyuml.umldraw.shared

Examples of org.tinyuml.umldraw.shared.UmlConnection


   * Switches a rectilinear connection to a direct one.
   */
  public void rectilinearToDirect() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new SimpleConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
View Full Code Here


   * Switches a direct connection into a rectilinear one.
   */
  public void directToRectilinear() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new RectilinearConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
View Full Code Here

   * @param endType the RelationEndType
   */
  public void setNavigability(RelationEndType endType) {
    if (getSelectedElements().size() > 0 &&
      getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      Relation relation = (Relation) conn.getModelElement();
      // Setup a toggle
      if (endType == RelationEndType.SOURCE) {
        execute(new SetConnectionNavigabilityCommand(this, conn, endType,
          !relation.isNavigableToElement1()));
      }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public UmlConnection createConnection(RelationType relationType,
    UmlNode node1, UmlNode node2) {
    UmlConnection prototype = connectionPrototypes.get(relationType);
    UmlConnection conn = null;
    if (prototype != null) {
      conn = (UmlConnection) prototype.clone();
      bindConnection(conn, node1, node2);
    }
    return conn;
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public LineConnectMethod getConnectMethod(RelationType relationType) {
    UmlConnection conn = connectionPrototypes.get(relationType);
    return (conn == null) ? null : conn.getConnectMethod();
  }
View Full Code Here

   * Switches a rectilinear connection to a direct one.
   */
  public void rectilinearToDirect() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new SimpleConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
View Full Code Here

   * Switches a direct connection into a rectilinear one.
   */
  public void directToRectilinear() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new RectilinearConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
View Full Code Here

   * @param endType the RelationEndType
   */
  public void setNavigability(RelationEndType endType) {
    if (getSelectedElements().size() > 0 &&
      getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      Relation relation = (Relation) conn.getModelElement();
      // Setup a toggle
      if (endType == RelationEndType.SOURCE) {
        execute(new SetConnectionNavigabilityCommand(this, conn, endType,
          !relation.isNavigableToElement1()));
      }
View Full Code Here

   */
  public void mouseReleased(EditorMouseEvent event) {
    double mx = event.getX(), my = event.getY();
    DiagramElement elem = editor.getDiagram().getChildAt(mx, my);
    if (source != null && isValidTarget(elem)) {
      UmlConnection conn =
        editor.getDiagram().getElementFactory().createConnection(relationType,
          (UmlNode) source, (UmlNode) elem);
      connectMethod.generateAndSetPointsToConnection(conn, source,
        (UmlNode) elem, anchor, tmpPos);
      AddElementCommand command = new AddElementCommand(editor,
View Full Code Here

   * Switches a rectilinear connection to a direct one.
   */
  public void rectilinearToDirect() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new SimpleConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
View Full Code Here

TOP

Related Classes of org.tinyuml.umldraw.shared.UmlConnection

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.