Examples of IShape


Examples of ag.ion.bion.officelayer.draw.shapes.IShape

    } catch (OfficeApplicationException e) {
      return null;
    }

    IShapeFactory shapeFactory = document.getDrawPage(0).getShapeFactory();
    IShape shape = shapeProvider.provide(shapeFactory);

    File image;
    try {
      image = export(shape, document);
    } catch (Exception e) {
View Full Code Here

Examples of com.aspose.slides.IShape

    Presentation pres = new Presentation("data/demo.pptx");
   
    //Access first slide
    ISlide slide = pres.getSlides().get_Item(0);
   
    IShape shape= null;
   
    //Iterate through the shapes and set a reference to the table found
    for (int i = 0 ; i < slide.getShapes().size() ; i++)
    {
        shape = slide.getShapes().get_Item(i);
        if (shape.getPlaceholder() != null)
        {
            //Change the text of each placeholder
            ((IAutoShape)shape).getTextFrame().setText("This is Placeholder");
        }
    }
View Full Code Here

Examples of net.sf.graphiti.ui.figure.shapes.IShape

    // attributes
    int width = (Integer) type.getAttribute(ObjectType.ATTRIBUTE_WIDTH);
    int height = (Integer) type.getAttribute(ObjectType.ATTRIBUTE_HEIGHT);
    Color color = (Color) type.getAttribute(ObjectType.ATTRIBUTE_COLOR);
    String name = (String) type.getAttribute(ObjectType.ATTRIBUTE_SHAPE);
    IShape shape = ShapeFactory.createShape(name);

    // adjust width and height
    double ratio = (double) width / (double) height;
    width = 16;
    height = (int) (width / ratio);
View Full Code Here

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

  }


  @Test
  public void testParamHatchangle() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=10]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(Math.toRadians(10.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=20.]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(20.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=0.5]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(0.5), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=+---123.1]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-123.1), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=10, hatchangle=-12]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-12.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamHatchsep() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=2mm, hatchsep=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamHatchwidth() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=2mm, hatchwidth=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamDoublesep() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isDbleBorderable()) {
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=2mm, doublesep=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamShadowsize() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isShadowable()) {
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=2mm, shadowsize=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamLinewidth() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isThicknessable()) {
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2, linewidth=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testStarFillsShape() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue(sh.isFilled());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
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.