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;
}
}