Package org.odftoolkit.odfdom.incubator.doc.style

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfStyle.compareTo()


            // 3. same # of attributes, same attributes, different values
            style1.setStyleNextStyleNameAttribute("nextStyle");
            style2.setStyleNextStyleNameAttribute("xnextStyle");
            style2.setStyleDisplayNameAttribute("displayName");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 4. same # of attributes, same attributes, same values, different
            // number of children
            style2.setStyleNextStyleNameAttribute("nextStyle");
            style2.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
View Full Code Here


            // 4. same # of attributes, same attributes, same values, different
            // number of children
            style2.setStyleNextStyleNameAttribute("nextStyle");
            style2.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
            style2.setProperty(StyleParagraphPropertiesElement.TextAlign, "left");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 5. same # of attributes, same attributes, same values, same number
            // of children, different number of properties
            style1.setProperty(StyleChartPropertiesElement.DataLabelNumber, "value");
            style1.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
View Full Code Here

            style1.setProperty(StyleChartPropertiesElement.DataLabelNumber, "value");
            style1.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
            style1.setProperty(StyleParagraphPropertiesElement.TextAlign, "left");
            style2.setProperty(StyleParagraphPropertiesElement.KeepTogether, "auto");
            style2.setProperty(StyleChartPropertiesElement.DataLabelNumber, "value");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 6. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, different properties:
            style1.setProperty(StyleParagraphPropertiesElement.AutoTextIndent, "true");
            Assert.assertTrue(style2.compareTo(style1) > 0);
View Full Code Here

            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 6. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, different properties:
            style1.setProperty(StyleParagraphPropertiesElement.AutoTextIndent, "true");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 7. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, same properties, different
            // values:
            style2.setProperty(StyleParagraphPropertiesElement.AutoTextIndent, "true");
View Full Code Here

            // 7. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, same properties, different
            // values:
            style2.setProperty(StyleParagraphPropertiesElement.AutoTextIndent, "true");
            style1.setProperty(StyleParagraphPropertiesElement.KeepTogether, "always");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 8. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, same properties, same
            // values:
            style1.setProperty(StyleParagraphPropertiesElement.KeepTogether, "auto");
View Full Code Here

            // 8. same # of attributes, same attributes, same values, same number
            // of children, same number of properties, same properties, same
            // values:
            style1.setProperty(StyleParagraphPropertiesElement.KeepTogether, "auto");
            Assert.assertTrue(style2.compareTo(style1) == 0);

            // 9. tab stops vs background image
            StyleTabStopsElement tabStops = (StyleTabStopsElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopsElement.ELEMENT_NAME);
            StyleTabStopElement tabStop1 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            StyleTabStopElement tabStop2 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
View Full Code Here

            tabStops.appendChild(tabStop1);
            tabStops.appendChild(tabStop2);
            StyleBackgroundImageElement img = (StyleBackgroundImageElement) OdfXMLFactory.newOdfElement(dom, StyleBackgroundImageElement.ELEMENT_NAME);
            propElement = style2.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(img);
            Assert.assertTrue(style2.compareTo(style1) < 0);

            // 10. Same tab stops and background image, different position:
            // These two styles are considered distinct!
            tabStops = (StyleTabStopsElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopsElement.ELEMENT_NAME);
            tabStop1 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
View Full Code Here

            tabStops.appendChild(tabStop1);
            tabStops.appendChild(tabStop2);
            img = (StyleBackgroundImageElement) OdfXMLFactory.newOdfElement(dom, StyleBackgroundImageElement.ELEMENT_NAME);
            propElement = style1.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(img);
            Assert.assertTrue(style2.compareTo(style1) < 0);

        } catch (Exception e) {
            Logger.getLogger(StyleTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
            Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
        }
View Full Code Here

            style1.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());

            OdfStyle style2 = new OdfStyle(dom);
            style2.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());
            style2.setStyleNextStyleNameAttribute("nextStyle");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 2. same # of attributes, different attributes
            style1.setStyleDisplayNameAttribute("displayName");
            Assert.assertTrue(style2.compareTo(style1) > 0);
View Full Code Here

            style2.setStyleNextStyleNameAttribute("nextStyle");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 2. same # of attributes, different attributes
            style1.setStyleDisplayNameAttribute("displayName");
            Assert.assertTrue(style2.compareTo(style1) > 0);

            // 3. same # of attributes, same attributes, different values
            style1.setStyleNextStyleNameAttribute("nextStyle");
            style2.setStyleNextStyleNameAttribute("xnextStyle");
            style2.setStyleDisplayNameAttribute("displayName");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.