Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Image


  public void test2002276(){
    final String nm = "B-2002276.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    Iterator iter = sheet1.getImages().iterator();
    Image image = (Image)iter.next();
    assertEquals(1,image.getColumn());
    assertEquals(2,image.getRow());
    assertEquals(0.015625,image.getColumnFraction());
    assertEquals(0.05078125,image.getRowFraction());
    assertEquals(446,image.getFrameHeight());
    assertEquals(666,image.getFrameWidth());
    assertEquals(1547,image.getHeight());
    assertEquals(2323,image.getWidth());
   
    image = (Image)iter.next();
    assertEquals(1,image.getColumn());
    assertEquals(24,image.getRow());
    assertEquals(0.015625,image.getColumnFraction());
    assertEquals(0.1484375,image.getRowFraction());
    assertEquals(616,image.getFrameHeight());
    assertEquals(666,image.getFrameWidth());
    assertEquals(1811,image.getHeight());
    assertEquals(1969,image.getWidth());

   
  }
View Full Code Here


    final int sz = sheet.getNumberOfImages();
    for(int i =0; i < sz; i++){
      Drawing drawing =  (Drawing) sheet.getDrawing(i);
      ZssDrawing zd = new ZssDrawing(drawing);
      try {
        final Image image = new ImageImpl(zd.getName(), zd.getAlt(), zd.getImageData(),
            zd.getTop(), zd.getTopFraction() / 256d,
            zd.getLeft(), zd.getLeftFraction() / 1024d,
            getWidthInPx(zkSheet, zd), getHeightInPx(zkSheet, zd));
        zkSheet.addImage(image);

        if(log.debugable()){
          StringBuffer sb = new StringBuffer();
          sb.append(zd.getName());
          sb.append("\n\tProperties: "+zd.getProperties());
          sb.append("\n\tLeft: "+zd.getLeft());
          sb.append("\n\tLeftFraction: "+zd.getLeftFraction());
          sb.append("\n\tTop: "+zd.getTop());
          sb.append("\n\tTopFraction: "+zd.getTopFraction());
          sb.append("\n\tRight: "+zd.getRight());
          sb.append("\n\tRightFraction: "+zd.getRightFraction());
          sb.append("\n\tBottom: "+zd.getBottom());
          sb.append("\n\tBottomFraction: "+zd.getBottomFraction());
 
          sb.append("\n\timage.getAlt(): "+image.getAlt());
          sb.append("\n\timage.getColumn(): "+image.getColumn());
          sb.append("\n\timage.getColumnFraction(): "+image.getColumnFraction());
          sb.append("\n\timage.getRow(): "+image.getRow());
          sb.append("\n\timage.getRowFaction(): "+image.getRowFraction());
          sb.append("\n\timage.getFrameWidth(): "+image.getFrameWidth());
          sb.append("\n\timage.getFrameHeight():"+image.getFrameHeight());
         
          log.debug(sb.toString());
        }
      } catch (IOException e) {
        // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Image

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.