Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## application.workbooks.workbook.presentations.presentation.slides.slide
Class PgShapes

    java.lang.Object
      application.workbooks.workbook.Shapes
          application.workbooks.workbook.presentations.presentation.slides.slide.PgShapes

All Implemented Interfaces:
  application.resource.com.ComExceptionConstants

public class PgShapes
extends Shapes

该类设置了在简报制作中获取和插入浮动图形对象的方法。

Field Summary

Fields inherited from interface application.resource.com.ComExceptionConstants
`CANNOT_EDIT, CANNOT_MAKE_ARROW, DELETE_DOCFIELD, DELETE_SHAPE, DIRECTRY_NOT_FIND, ERROR_DOCFIELD, ERROR_MACRO_NAME, FILE_NOT_FIND, LOCKED_DOCFIELD, LOCKED_POSITION_DOCFIELD, NO_ARROW_STYLE, NO_BOOK_NAME, NO_BUILDER, NO_CONNECTOR_TYPE, NO_DOCFIELDNAME, NO_MACRO_FOUND, NO_OBJECT, NO_PATH_NAME, NO_PRINT_PREVIEW, NO_PRODUCT, NO_Seal, NO_Seal_File, NO_SELECTED_OBJECT, NO_SHAPE, NO_TOOLBAR, NO_UNDO_TIMES, NO_WINDOW, NO_WORKBOOK, NO_WORKBOOK_TYPE, NOT_CONNECT, NOT_IMAGE, NOT_PRESENTATION, NOT_SUPPORT_DIALOG_SHOW, NOT_SUPPORT_DIALOG_TYPE, NOT_TEXT_EFFECT, Repeat_Name, Seal_Sign, SHAPE_TYPE_ERROR, WRONG_FREEFORM_TYPE`

Method Summary
`void` | `addComment()` 插入注释。
`void` | `deleteComment(int index)` 删除幻灯片上指定的注释。
`PgShape[]` | `getAllPgShapes()` 获取所有浮动图形对象。
`PgShape` | `getComment(int index)` 获取指定的注释。
`PgShape` | `getPgShape(int id)` 获取指定的浮动图形对象。
`int` | `getShapesCount()` 得到该幻灯片上插入浮动对象总数。
`void` | `insertMediaInShape(java.lang.String fileName)` 插入多媒体到布局中的多媒体自选图形(必须是有多媒体的布局)。
`void` | `insertMediaMovie(java.lang.String fileName)` 插入电影。
`void` | `insertMediaSound(java.lang.String fileName)` 插入声音。
`void` | `insertPicture(java.lang.String fileName)` 插入图片。
`void` | `insertPictureInShape(java.lang.String fileName)` 插入图片到布局中的剪切画自选图形(必须是有剪切画的布局)。
`void` | `setCommentsVisible(boolean isVisible)` 设置是否显示注释。

Methods inherited from class application.workbooks.workbook.Shapes
`addArrow, addConnector, addDocField, addLine, addSeal, addSeal, addShape, addTextBox, addWordArt, appendSeal, getAllSelectedShapes, getAllShapes, getDocField, getDocFieldRange, getRange, getShape, insertSeal, insertSeal, insertSeal, insertSeal, isSelectAll, removeSeal, renameSeal, selectAll, selectRange, unSelect`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### addComment

    public void addComment()

  插入注释。

  例子:

       ActivePresentation.getSlides()
       .getSlide(0).getShapes()
       .addComment();

  See Also:
    `nextComment()`, `backComment()`, `deleteComment(int index)`, `deleteComment()`

### deleteComment

    public void deleteComment(int index)

  删除幻灯片上指定的注释。

  Parameters:
    `index` - 注释的索引值

    例子:

         ActivePresentation.getSlides()
         .getSlide(0).getShapes()
         .deleteComment(1);

  See Also:
    `addComment()`, `nextComment()`, `backComment()`, `deleteComment()`

### getAllPgShapes

    public PgShape[] getAllPgShapes()

  获取所有浮动图形对象。

  Returns:
    PgShape[]，所有简报制作中的浮动图形对象

    例子:

         PgShape[] shapes = Presentations.getActivePresentation().getActiveShapes().getAllPgShapes();
         for(int i=0;i

  See Also:
    `PgShape`

### getComment

    public PgShape getComment(int index)

  获取指定的注释。

  Parameters:
    `index` - 注释的索引号
  Returns:
    PgShape，即浮动图形对象

    例子:

         Slide slide = Presentations.getActivePresentation().getSlides().getSlide(1);
         PgShapes shapes = slide.getShapes();
         shapes.addComment();
         PgShape[] shapess= shapes.getAllPgShapes();
         for(int i=0;i

### getPgShape

    public PgShape getPgShape(int id)

  获取指定的浮动图形对象。

  Parameters:
    `id` - 浮动图形对象的ID(一般情况下，标题占位符的id为0，文本占位符的id为1,添加的浮动图形对象的id依次加1）
  Returns:
    PgShape，简报制作中的浮动图形对象

    例子:

         PgShapes pgShapes = Presentations.getActivePresentation().getActiveShapes();
         PgShape pgShape = pgShapes.getPgShape(0);
         System.out.println("name is "+pgShape.getName());

  See Also:
    `PgShape`

### getShapesCount

    public int getShapesCount()

  得到该幻灯片上插入浮动对象总数。

  Returns:
    插入浮动对象总数，为整型数值

    例子:

         System.out.println(Presentations.getActivePresentation().getSlides()
         .getSlide(0).getShapes()
         .getShapesCount());

  See Also:
    `Shape`

### insertMediaInShape

    public void insertMediaInShape(java.lang.String fileName)

  插入多媒体到布局中的多媒体自选图形(必须是有多媒体的布局)。

  Parameters:
    `fileName` - 文件路径

    例子:

         Slide slide = Presentations.getActivePresentation().getSlides().getSlide(3);
         slide.setLayout(SlideConstants.LAYOUT_TEXTANDMEDIA);
         PgShapes shapes = slide.getShapes();
         shapes.getShape("对象 2").select(true);
         shapes.insertMediaInShape("C:/EIO_Binders/cat.wav");

### insertMediaMovie

    public void insertMediaMovie(java.lang.String fileName)

  插入电影。

  Parameters:
    `fileName` - 电影文件路径

    例子:

         ActivePresentation.getSlides()
         .getSlide(0).getShapes()
         .insertMediaMovie("D:\\growingpains.avi");

### insertMediaSound

    public void insertMediaSound(java.lang.String fileName)

  插入声音。

  Parameters:
    `fileName` - 声音文件路径

    例子:

         ActivePresentation.getSlides()
         .getSlide(0).getShapes()
         .insertMediaSound("D:\\11.wav");

### insertPicture

    public void insertPicture(java.lang.String fileName)

  插入图片。

  Parameters:
    `fileName` - 图片路径

    例子:

         ActivePresentation.getSlides()
         .getSlide(0).getShapes()
         .insertPicture("D:\\1.jpg");

### insertPictureInShape

    public void insertPictureInShape(java.lang.String fileName)

  插入图片到布局中的剪切画自选图形(必须是有剪切画的布局)。

  Parameters:
    `fileName` - 图片路径

    例子:

         Slide slide = Presentations.getActivePresentation().getSlides().getSlide(1);
         slide.setLayout(SlideConstants.LAYOUT_CLIPANDTEXT);

         PgShapes shapes = slide.getShapes();
         shapes.getShape("图片 2").select(true);
         shapes.insertPictureInShape("D:/office/1.2-1397/Clipart/picture/Business/Business10.jpg");

### setCommentsVisible

    public void setCommentsVisible(boolean isVisible)

  设置是否显示注释。

  Parameters:
    `isVisible` - 布尔型值，是否显示注释。如果为true，则显示注释；否则，不显示注释

    例子:

         ActivePresentation.getSlides()
         .getSlide(0).getShapes()
         .setCommentsVisible(true);

Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

版权所有 2001-2004 无锡永中科技有限公司