Examples of IShape


Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape



  @Override
  public IShape duplicate() {
    final IShape shape = ShapeFactory.newShape(this.getClass()).get();

    shape.copy(this);
    return shape;
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

    if(elt==null)
      throw new IllegalArgumentException();

    final NodeList nodeList  = elt.getChildNodes();
    IShape sh;

    if(nodeList.getLength()<2)
      throw new IllegalArgumentException();

    for(int i=0, size=nodeList.getLength(); i<size; i++) {
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

  @Override
  public void initAction() {
    final IPoint textPosition = instrument.relativePoint==null ? ShapeFactory.createPoint(instrument.textField.getX(),
                  instrument.textField.getY()+instrument.textField.getHeight()) : instrument.relativePoint;
    final IShape sh = instrument.pencil==null ? null : instrument.pencil.createShapeInstance();

    if(sh instanceof IText) {
      final IText text = (IText)sh;
      text.setPosition(textPosition.getX(), textPosition.getY());
      text.setText(instrument.textField.getText());
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

  @Override
  public void initAction() {
    instrument.textField.setValid(true);
    final IPoint textPosition = instrument.relativePoint==null ? ShapeFactory.createPoint(instrument.textField.getX(),
                  instrument.textField.getY()+instrument.textField.getHeight()) : instrument.relativePoint;
    final IShape sh = instrument.pencil==null ? null : instrument.pencil.createShapeInstance();

    if(sh instanceof IPlot) {
      final IPlot plot = (IPlot)sh;
      plot.setPosition(textPosition.getX(), textPosition.getY());
      plot.setPlotEquation(instrument.textField.getText());
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

      action.setRotationAngle(Math.toRadians(Double.valueOf(interaction.getSpinner().getValue().toString()))-obj.get().getRotationAngle());
  }

  @Override
  public void initAction() {
    final IShape sh = instrument.pencil.canvas().getDrawing().getSelection().duplicateDeep(false);
    action.setShape(sh);
    action.setGravityCentre(sh.getGravityCentre());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

    assertEquals(FreeHandType.LINES, shape.getType());
  }

  @Test
  public void testCopyWhenNotFreeHand() {
    IShape sh = ShapeFactory.createCircleArc();
    shape.copy(sh);
//    assertTrue(shape.isParametersEquals(sh, false));
//    assertTrue(shape.isParametersEquals(sh, true));
    //TODO
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape



  @Test
  public void testDuplicate() {
    IShape sh = shape.duplicate();

    assertNotNull(sh);
    assertEquals(sh.getClass(), shape.getClass());
//    assertTrue(shape.isParametersEquals(sh, true));
    //TODO
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape



  @Test
  public void testAddShapeIShape() {
    IShape sh1 = ShapeFactory.createRectangle();
    IShape sh2 = ShapeFactory.createRectangle();

    drawing.addShape(sh1);
    drawing.addShape(sh2);
    assertEquals(2, drawing.getShapes().size());
    assertEquals(sh1, drawing.getShapes().get(0));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

  }


  @Test
  public void testAddShapeIShapeInt() {
    IShape sh1 = ShapeFactory.createRectangle();
    IShape sh2 = ShapeFactory.createRectangle();
    IShape sh3 = ShapeFactory.createRectangle();

    drawing.addShape(sh1, 1);
    assertEquals(0, drawing.getShapes().size());
    drawing.addShape(sh1, -2);
    assertEquals(0, drawing.getShapes().size());
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IShape

  }


  @Test
  public void testRemoveShapeIShape() {
    IShape sh1 = ShapeFactory.createRectangle();
    IShape sh2 = ShapeFactory.createRectangle();
    IShape sh3 = ShapeFactory.createRectangle();

    drawing.getShapes().add(sh1);
    drawing.getShapes().add(sh2);
    drawing.getShapes().add(sh3);
    drawing.removeShape(sh2);
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.