Package org.jfree.text

Examples of org.jfree.text.TextBlock.addLine()


     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        final TextBlock b1 = new TextBlock();
        b1.addLine(new TextLine("Test"));
        TextBlock b2 = null;

        try {
            final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            final ObjectOutput out = new ObjectOutputStream(buffer);
View Full Code Here


        b2.setShadowYOffset(1.0);
        assertTrue(b1.equals(b2));
       
        // textBlock
        final TextBlock tb1 = new TextBlock();
        tb1.addLine(new TextLine("Testing"));
        b1.setTextBlock(tb1);
        assertFalse(b1.equals(b2));
        final TextBlock tb2 = new TextBlock();
        tb2.addLine(new TextLine("Testing"));
        b2.setTextBlock(tb2);
View Full Code Here

        final TextBlock tb1 = new TextBlock();
        tb1.addLine(new TextLine("Testing"));
        b1.setTextBlock(tb1);
        assertFalse(b1.equals(b2));
        final TextBlock tb2 = new TextBlock();
        tb2.addLine(new TextLine("Testing"));
        b2.setTextBlock(tb2);
        assertTrue(b1.equals(b2));
       
    }
View Full Code Here

     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
       
        final TextBlock b1 = new TextBlock();
        b1.addLine(new TextLine("Test"));
        final TextBlock b2 = new TextBlock();
        b2.addLine(new TextLine("Test"));
        assertTrue(b1.equals(b2));
        assertTrue(b2.equals(b1));

View Full Code Here

    public void testEquals() {
       
        final TextBlock b1 = new TextBlock();
        b1.addLine(new TextLine("Test"));
        final TextBlock b2 = new TextBlock();
        b2.addLine(new TextLine("Test"));
        assertTrue(b1.equals(b2));
        assertTrue(b2.equals(b1));

    }
View Full Code Here

     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        final TextBlock b1 = new TextBlock();
        b1.addLine(new TextLine("Test"));
        TextBlock b2 = null;

        try {
            final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            final ObjectOutput out = new ObjectOutputStream(buffer);
View Full Code Here

        b2.setShadowYOffset(1.0);
        assertTrue(b1.equals(b2));
       
        // textBlock
        final TextBlock tb1 = new TextBlock();
        tb1.addLine(new TextLine("Testing"));
        b1.setTextBlock(tb1);
        assertFalse(b1.equals(b2));
        final TextBlock tb2 = new TextBlock();
        tb2.addLine(new TextLine("Testing"));
        b2.setTextBlock(tb2);
View Full Code Here

        final TextBlock tb1 = new TextBlock();
        tb1.addLine(new TextLine("Testing"));
        b1.setTextBlock(tb1);
        assertFalse(b1.equals(b2));
        final TextBlock tb2 = new TextBlock();
        tb2.addLine(new TextLine("Testing"));
        b2.setTextBlock(tb2);
        assertTrue(b1.equals(b2));
       
    }
View Full Code Here

    public void testEquals() {
       
        Comparable c1 = "C1";
        Comparable c2 = "C2";
        TextBlock tb1 = new TextBlock();
        tb1.addLine(new TextLine("Block 1"));
        TextBlock tb2 = new TextBlock();
        tb1.addLine(new TextLine("Block 2"));
        TextBlockAnchor tba1 = TextBlockAnchor.CENTER;
        TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER;
        TextAnchor ta1 = TextAnchor.CENTER;
View Full Code Here

        TextBlock label = super.createLabel(category, width, edge, g2);  
        String s = (String) this.sublabels.get(category);
        if (s != null) {
            if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {
                TextLine line = new TextLine(s, this.sublabelFont, this.sublabelPaint);
                label.addLine(line);
            }
            else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) {
                TextLine line = label.getLastLine();
                if (line != null) {
                    line.addFragment(
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.