Package org.apache.poi.hslf.record

Examples of org.apache.poi.hslf.record.SlideAtom


   */
  public void setNotes(Notes notes) {
    _notes = notes;

    // Update the Slide Atom's ID of where to point to
    SlideAtom sa = _slide.getSlideAtom();

    if(notes == null) {
      // Set to 0
      sa.setNotesID(0);
    } else {
      // Set to the value from the notes' sheet id
      sa.setNotesID(notes._getSheetNumber());
    }
  }
View Full Code Here


     *
     * @return the slide master associated with this slide.
     */
     public MasterSheet getMasterSheet(){
        SlideMaster[] master = getSlideShow().getSlidesMasters();
        SlideAtom sa = _slide.getSlideAtom();
        int masterId = sa.getMasterID();
        for (int i = 0; i < master.length; i++) {
            if (masterId == master[i]._getSheetNumber()) return master[i];
        }
        throw new RuntimeException("Master slide not found for slide " + _slideNo);
    }
View Full Code Here

    /**
     * Change Master of this slide.
     */
    public void setMasterSheet(MasterSheet master){
        SlideAtom sa = _slide.getSlideAtom();
        int sheetNo = master._getSheetNumber();
        sa.setMasterID(sheetNo);
    }
View Full Code Here

     *
     * @param flag  <code>true</code> if the slide follows master,
     * <code>false</code> otherwise
     */
    public void setFollowMasterBackground(boolean flag){
        SlideAtom sa = _slide.getSlideAtom();
        sa.setFollowMasterBackground(flag);
    }
View Full Code Here

     *
     * @return <code>true</code> if the slide follows master background,
     * <code>false</code> otherwise
     */
    public boolean getFollowMasterBackground(){
        SlideAtom sa = _slide.getSlideAtom();
        return sa.getFollowMasterBackground();
    }
View Full Code Here

    ss = new SlideShow(hss);
    }

    public void testSetToNone() throws Exception {
    Slide slideOne = ss.getSlides()[0];
    SlideAtom sa = slideOne.getSlideRecord().getSlideAtom();

    slideOne.setNotes(null);

    assertEquals(0, sa.getNotesID());
    }
View Full Code Here

    }

    public void testSetToSomething() throws Exception {
    Slide slideOne = ss.getSlides()[0];
    Notes notesOne = ss.getNotes()[1];
    SlideAtom sa = slideOne.getSlideRecord().getSlideAtom();

    slideOne.setNotes(notesOne);

    assertEquals(notesOne._getSheetNumber(), sa.getNotesID());
    }
View Full Code Here

  private byte[] data_a = new byte[] { 1, 0, 0xEF-256, 3, 0x18, 0, 0, 0,
    0, 0, 0, 0, 0x0F, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80-256,
    0, 1, 0, 0, 7, 0, 0x0C, 0x30 };

    public void testRecordType() throws Exception {
    SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
    assertEquals(1007l, sa.getRecordType());
  }
View Full Code Here

    public void testRecordType() throws Exception {
    SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
    assertEquals(1007l, sa.getRecordType());
  }
  public void testFlags() throws Exception {
    SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);

    // First 12 bytes are a SSlideLayoutAtom, checked elsewhere

    // Check the IDs
    assertEquals(0x80000000, sa.getMasterID());
    assertEquals(256, sa.getNotesID());

    // Check the flags
    assertEquals(true, sa.getFollowMasterObjects());
    assertEquals(true, sa.getFollowMasterScheme());
    assertEquals(true, sa.getFollowMasterBackground());
  }
View Full Code Here

    assertEquals(true, sa.getFollowMasterObjects());
    assertEquals(true, sa.getFollowMasterScheme());
    assertEquals(true, sa.getFollowMasterBackground());
  }
  public void testSSlideLayoutAtom() throws Exception {
    SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
    SSlideLayoutAtom ssla = sa.getSSlideLayoutAtom();

    assertEquals(0, ssla.getGeometryType());

    // Should also check the placehold IDs at some point
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.record.SlideAtom

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.