Package org.odftoolkit.simple.style

Examples of org.odftoolkit.simple.style.GraphicProperties


     
      textDoc.changeMode(OdfMediaType.TEXT_TEMPLATE);
      frameStyleHandler.setAchorType(StyleTypeDefinitions.AnchorType.TO_PAGE);
     
      //validate
      GraphicProperties graphicPropertiesForWrite = frameStyleHandler.getGraphicPropertiesForWrite();
      Assert.assertEquals(VerticalRelative.PAGE, graphicPropertiesForWrite.getVerticalRelative());
      Assert.assertEquals(FrameVerticalPosition.TOP, graphicPropertiesForWrite.getVerticalPosition());
      Assert.assertEquals(HorizontalRelative.PAGE, graphicPropertiesForWrite.getHorizontalRelative());
      Assert.assertEquals(FrameHorizontalPosition.CENTER, graphicPropertiesForWrite.getHorizontalPosition());
     
      //save
      textDoc.save(ResourceUtilities.newTestOutputFile("textsample.odt"));

    } catch (Exception e) {
View Full Code Here


   *            If <code>true</code>, the frame is displayed in the
   *            background.
   * @since 0.5.5
   */
  public void setBackgroundFrame(boolean isBackgroundFrame) {
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();
    graphicPropertiesForWrite.setStyleRunThrough(isBackgroundFrame);
  }
View Full Code Here

  public void setAchorType(StyleTypeDefinitions.AnchorType achorType)
  {
    if (!mDocument.getMediaTypeString().equals(Document.OdfMediaType.TEXT.getMediaTypeString()) &&
        !mDocument.getMediaTypeString().equals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString()))
      return;
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();

    DrawFrameElement frameElement = (DrawFrameElement)mOdfElement;
    frameElement.setTextAnchorTypeAttribute(achorType.toString());
   
    //set default relative
    switch(achorType)
    {
    case AS_CHARACTER:
      graphicPropertiesForWrite.setVerticalRelative(VerticalRelative.BASELINE);
      graphicPropertiesForWrite.setVerticalPosition(FrameVerticalPosition.TOP);
      break;
    case TO_CHARACTER:
      graphicPropertiesForWrite.setVerticalRelative(VerticalRelative.PARAGRAPH);
      graphicPropertiesForWrite.setVerticalPosition(FrameVerticalPosition.TOP);
      graphicPropertiesForWrite.setHorizontalRelative(HorizontalRelative.PARAGRAPH);
      graphicPropertiesForWrite.setHorizontalPosition(FrameHorizontalPosition.CENTER);
      break;
    case TO_PAGE:
      graphicPropertiesForWrite.setVerticalRelative(VerticalRelative.PAGE);
      graphicPropertiesForWrite.setVerticalPosition(FrameVerticalPosition.TOP);
      graphicPropertiesForWrite.setHorizontalRelative(HorizontalRelative.PAGE);
      graphicPropertiesForWrite.setHorizontalPosition(FrameHorizontalPosition.CENTER);
      break;
    case TO_PARAGRAPH:
      graphicPropertiesForWrite.setVerticalRelative(VerticalRelative.PARAGRAPH);
      graphicPropertiesForWrite.setVerticalPosition(FrameVerticalPosition.TOP);
      graphicPropertiesForWrite.setHorizontalRelative(HorizontalRelative.PARAGRAPH);
      graphicPropertiesForWrite.setHorizontalPosition(FrameHorizontalPosition.CENTER);
      break;
    case TO_FRAME:
      break;
    }
  }
View Full Code Here

   *
   * @param horizontalPos
   *            - the horizontal position
   */
  public void setHorizontalPosition(FrameHorizontalPosition horizontalPos) {
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();
    graphicPropertiesForWrite.setHorizontalPosition(horizontalPos);
  }
View Full Code Here

   * @param relative
   *            - the horizontal relative
   */
  public void setHorizontalRelative(HorizontalRelative relative)
  {
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();
    graphicPropertiesForWrite.setHorizontalRelative(relative);
  }
View Full Code Here

   * @param relative
   *            - the vertical relative
   */
  public void setVerticalRelative(VerticalRelative relative)
  {
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();
    graphicPropertiesForWrite.setVerticalRelative(relative);
  }
View Full Code Here

   *
   * @param verticalPos
   *            - the vertical position
   */
  public void setVerticalPosition(FrameVerticalPosition verticalPos) {
    GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite();
    graphicPropertiesForWrite.setVerticalPosition(verticalPos);
  }
View Full Code Here

   * Return the horizontal position
   *
   * @return the horizontal position
   */
  public FrameHorizontalPosition getHorizontalPosition() {
    GraphicProperties graphicPropertiesForRead = getGraphicPropertiesForRead();
    return graphicPropertiesForRead.getHorizontalPosition();
  }
View Full Code Here

   * Return the vertical position
   *
   * @return the vertical position
   */
  public FrameVerticalPosition getVerticalPosition() {
    GraphicProperties graphicPropertiesForRead = getGraphicPropertiesForRead();
    return graphicPropertiesForRead.getVerticalPosition();
  }
View Full Code Here

   * Return the vertical relative
   * @return the vertical relative
   */
  public VerticalRelative getVerticalRelative()
  {
    GraphicProperties graphicPropertiesForRead = getGraphicPropertiesForRead();
    return graphicPropertiesForRead.getVerticalRelative();
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.style.GraphicProperties

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.