Package org.tinyuml.draw

Examples of org.tinyuml.draw.RectilinearConnection


 
  /**
   * Tests the clone() method.
   */
  public void testClone() {
    RectilinearConnection cloned = (RectilinearConnection) conn.clone();
    assertNull(cloned.getPoints());
   
    List<Point2D> points = new ArrayList<Point2D>();
    points.add(new Point2D.Double(1, 2));
    points.add(new Point2D.Double(1, 3));
    conn.setPoints(points);
    RectilinearConnection cloned2 = (RectilinearConnection) conn.clone();
    assertEquals(cloned2.getPoints(), conn.getPoints());
    assertFalse(cloned2.getPoints() == conn.getPoints());
    for (int i = 0; i < cloned2.getPoints().size(); i++) {
      assertTrue(cloned2.getPoints().get(i) != conn.getPoints().get(i));
    }
  }
View Full Code Here


    points.add(new Point2D.Double(rectNode1.getAbsoluteX2(), 30));
    points.add(new Point2D.Double(190, 30));
    points.add(new Point2D.Double(190, rectNode2.getAbsoluteY1()));
    conn.setPoints(points);
   
    RectilinearConnection copy = new RectilinearConnection();
    copy.copyData(conn);
    assertEquals(3, copy.getPoints().size());
    assertEquals(rectNode1.getAbsoluteX2(), copy.getPoints().get(0).getX());
    assertEquals(copy.getPoints().get(0).getY(),
                 copy.getPoints().get(1).getY());
    assertEquals(copy.getPoints().get(1).getX(),
                 copy.getPoints().get(2).getX());
    assertEquals(rectNode2.getAbsoluteY1(), copy.getPoints().get(2).getY());
  }
View Full Code Here

  /**
   * Private constructor.
   */
  private Inheritance() {
    setConnection(new RectilinearConnection());
    setIsDashed(false);
  }
View Full Code Here

  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

  /**
   * Private constructor.
   */
  private Inheritance() {
    setConnection(new RectilinearConnection());
    setIsDashed(false);
  }
View Full Code Here

  /**
   * Constructor.
   */
  private Association() {
    setConnection(new RectilinearConnection());
    setupMultiplicityLabels();
    setupNameLabel();
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.RectilinearConnection

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.