Examples of DoubleDimension


Examples of org.tinyuml.draw.DoubleDimension

  // *************************************************************************
  // ******** Resizing operations
  // ***************************************
 
  private void doRecalculateSizeExpectations(double mainwidth) {
    Dimension2D mainsize = new DoubleDimension(mainwidth, 30);
    Dimension2D opsize = new DoubleDimension(35, 10);
    Dimension2D mainminsize = new DoubleDimension(50, 30);
    Dimension2D opminsize = new DoubleDimension(35, 10);
    mockMainCompartment.expects(once()).method("recalculateSize")
      .with(eq(mockDrawingContext.proxy()));
    mockAttrCompartment.expects(once()).method("recalculateSize")
      .with(eq(mockDrawingContext.proxy()));
    mockOpCompartment.expects(once()).method("recalculateSize")
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

    mockCompartment.expects(once()).method("setSize").with(eq(1.0), eq(2.0));
    mockedElement.setSize(1.0, 2.0);
    mockCompartment.expects(once()).method("setMinimumSize")
      .with(eq(3.0), eq(4.0));
    mockedElement.setMinimumSize(3.0, 4.0);
    Dimension2D minsize = new DoubleDimension(11.0, 12.0);
    Dimension2D size = new DoubleDimension(15.0, 18.0);
    mockCompartment.expects(once()).method("getSize").will(returnValue(size));
    assertEquals(size, mockedElement.getSize());
    mockCompartment.expects(once()).method("getMinimumSize")
      .will(returnValue(minsize));
    assertEquals(minsize, mockedElement.getMinimumSize());
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

      .with(eq(mockDrawingContext.proxy()));
    // drawing the icon
    mockParent.expects(once()).method("getAbsoluteX1").will(returnValue(100.0));
    mockParent.expects(once()).method("getAbsoluteY1").will(returnValue(50.0));
    mockCompartment.expects(atLeastOnce()).method("getSize")
      .will(returnValue(new DoubleDimension(100, 50)));
    mockDrawingContext.expects(atLeastOnce()).method("drawRectangle");
    mockedElement.draw((DrawingContext) mockDrawingContext.proxy());
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

   */
  private void setDrawArrowExpectations() {
    mockLabel.expects(once()).method("draw")
      .with(eq(mockDrawingContext.proxy()));
    mockLabel.expects(once()).method("getSize")
      .will(returnValue(new DoubleDimension(100, 20)));   
    mockDrawingContext.expects(once()).method("draw");
    mockLabel.expects(once()).method("getAbsoluteY1")
      .will(returnValue(0.0));
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

 
  /**
   * Tests the centerHorizontally() method.
   */
  public void testCenterHorizontally() {
    Dimension2D size = new DoubleDimension(100, 30);
    label.setSize(40, 10);
    label.setOrigin(0, 12);
    mockParent.expects(once()).method("getSize").will(returnValue(size));
    label.centerHorizontally();
    assertEquals(12.0, label.getOrigin().getY());
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

  /**
   * {@inheritDoc}
   */
  @Override
  public Dimension2D getMinimumSize() {
    return new DoubleDimension(calculateMinimumWidth(),
                               calculateMinimumHeight());
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

  /**
   * {@inheritDoc}
   */
  @Override
  public Dimension2D getMinimumSize() {
    return new DoubleDimension(calculateMinimumWidth(),
                               calculateMinimumHeight());
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

   */
  @Override
  public Dimension2D getMinimumSize() {
    Dimension2D minTabSize = tabCompartment.getMinimumSize();
    Dimension2D minMainSize = mainCompartment.getMinimumSize();
    return new DoubleDimension(
      Math.max(minTabSize.getWidth(), minMainSize.getWidth()),
      minTabSize.getHeight() + minMainSize.getHeight());
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

   */
  @Override
  public Dimension2D getSize() {
    Dimension2D tabSize = tabCompartment.getSize();
    Dimension2D mainSize = mainCompartment.getSize();
    return new DoubleDimension(
      Math.max(tabSize.getWidth(), mainSize.getWidth()),
      tabSize.getHeight() + mainSize.getHeight());
  }
View Full Code Here

Examples of org.tinyuml.draw.DoubleDimension

    mockNode.expects(atLeastOnce()).method("getAbsoluteX1")
      .will(returnValue(x));
    mockNode.expects(atLeastOnce()).method("getAbsoluteY1")
      .will(returnValue(y));
    mockNode.expects(atLeastOnce()).method("getSize")
      .will(returnValue(new DoubleDimension(width, height)));
    mockNode.expects(once()).method("addNodeChangeListener");
    selection = new NodeSelection((DiagramOperations) mockOperations.proxy(),
      (Node) mockNode.proxy());
  }
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.