FrameStyleHandler extends DefaultStyleHandler { public void setVerticalRelative(VerticalRelative relative) { GraphicProperties graphicPropertiesForWrite = getGraphicPropertiesForWrite(); graphicPropertiesForWrite.setVerticalRelative(relative); } FrameStyleHandler(Frame frame); void setBorders(Border border, CellBordersType bordersType); void setStroke(StyleTypeDefinitions.OdfDrawStroke stroke, Color color, String widthDesc, String dashStyleName); void setBackgroundColor(Color color); void setBackgroundFrame(boolean isBackgroundFrame); void setAchorType(StyleTypeDefinitions.AnchorType achorType); void setHorizontalPosition(FrameHorizontalPosition horizontalPos); void setHorizontalRelative(HorizontalRelative relative); void setVerticalRelative(VerticalRelative relative); void setVerticalPosition(FrameVerticalPosition verticalPos); FrameHorizontalPosition getHorizontalPosition(); FrameVerticalPosition getVerticalPosition(); VerticalRelative getVerticalRelative(); HorizontalRelative getHorizontalRelative();  }
@Test public void testSetVerticalRelative() { String content = "This is a text box"; try { TextDocument textDoc = TextDocument.newTextDocument(); Paragraph p = textDoc.addParagraph("paragraph"); FrameRectangle frameR = new FrameRectangle(4.21, 1.32, 4.41, 3.92, SupportedLinearMeasure.IN); Textbox box = p.addTextbox(frameR); box.setName("tbox name"); box.setTextContent(content); FrameStyleHandler frameStyleHandler = new FrameStyleHandler(box); frameStyleHandler.setBackgroundColor(Color.YELLOW); frameStyleHandler.setVerticalRelative(VerticalRelative.PARAGRAPH); Assert.assertEquals(VerticalRelative.PARAGRAPH, frameStyleHandler.getVerticalRelative()); textDoc.save(ResourceUtilities.newTestOutputFile("textsample.odt")); } catch (Exception e) { Logger.getLogger(FrameStyleHandlerTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(); } }