Package com.lowagie.text.rtf.graphic

Examples of com.lowagie.text.rtf.graphic.RtfShapeProperty


            // The position defines the extent of the shape in the page (in Twips)
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE,
                    new RtfShapePosition(1000, 2000, 3000, 2000));
           
            // Set the line colour to red
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_LINE_COLOR,
                    Color.RED));
           
            // Set the fill colour to cyan
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR,
                    Color.CYAN));
           
            // Text wraps around the shape on both sides
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
           
View Full Code Here


            // Create a rounded rectangle RtfShape and position it below the text
            position = new RtfShapePosition(4000, 1500, 4500, 5000);
            position.setShapeBelowText(true);
            shape = new RtfShape(RtfShape.SHAPE_ROUND_RECTANGLE, position);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_ADJUST_VALUE, 4500));
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.GRAY));
            document.add(shape);

            // Create a triangle RtfShape, around which text will wrap on both sides
            position = new RtfShapePosition(1500, 3000, 4000, 2500);
            shape = new RtfShape(RtfShape.SHAPE_TRIANGLE_RIGHT, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
            document.add(shape);

            // Create an elliptical RtfShape, around which text will only wrap on the left side
            position = new RtfShapePosition(3000, 6000, 10500, 4500);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.BLUE));
            document.add(shape);

            // Create a circular RtfShape and set its z-order to 1
            position = new RtfShapePosition(5850, 6800, 8200, 7250);
            position.setZOrder(1);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.RED));
            document.add(shape);

            // Create a star RtfShape and set its z-order to 2, above the circle
            // defined above
            position = new RtfShapePosition(6000, 7000, 8000, 7000);
            position.setZOrder(2);
            shape = new RtfShape(RtfShape.SHAPE_STAR, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.YELLOW));
            document.add(shape);

            document.close();
        } catch (FileNotFoundException fnfe) {
            fnfe.printStackTrace();
View Full Code Here

            // Create a new rectangle RtfShape using the SHAPE_FREEFORM constant.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 4000, 4000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_FREEFORM, position);

            // Set the bottom and right extents of the drawing object.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_RIGHT, 3000));
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_BOTTOM, 3000));

            // Define the vertices that make up the drawing object.
            // This list draws a basic table shape.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_VERTICIES,
                new Point[]{
                    new Point(100, 100),
                    new Point(2900, 100),
                    new Point(2900, 200),
                    new Point(2600, 200),
                    new Point(2600, 1500),
                    new Point(2520, 1500),
                    new Point(2520, 200),
                    new Point(480, 200),
                    new Point(480, 1500),
                    new Point(400, 1500),
                    new Point(400, 200),
                    new Point(100, 200)
                }));
           
            // A nice red Table :-)
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.red));

            document.add(shape);

            document.close();
        } catch (FileNotFoundException fnfe) {
View Full Code Here

            // Create a rounded rectangle RtfShape and position it below the text
            position = new RtfShapePosition(4000, 1500, 4500, 5000);
            position.setShapeBelowText(true);
            shape = new RtfShape(RtfShape.SHAPE_ROUND_RECTANGLE, position);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_ADJUST_VALUE, 4500));
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.GRAY));
            document.add(shape);

            // Create a triangle RtfShape, around which text will wrap on both sides
            position = new RtfShapePosition(1500, 3000, 4000, 2500);
            shape = new RtfShape(RtfShape.SHAPE_TRIANGLE_RIGHT, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
            document.add(shape);

            // Create an elliptical RtfShape, around which text will only wrap on the left side
            position = new RtfShapePosition(3000, 6000, 10500, 4500);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.BLUE));
            document.add(shape);

            // Create a circular RtfShape and set its z-order to 1
            position = new RtfShapePosition(5850, 6800, 8200, 7250);
            position.setZOrder(1);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.RED));
            document.add(shape);

            // Create a star RtfShape and set its z-order to 2, above the circle
            // defined above
            position = new RtfShapePosition(6000, 7000, 8000, 7000);
            position.setZOrder(2);
            shape = new RtfShape(RtfShape.SHAPE_STAR, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.YELLOW));
            document.add(shape);

            document.close();
        } catch (FileNotFoundException fnfe) {
            fnfe.printStackTrace();
View Full Code Here

            // Create a new rectangle RtfShape using the SHAPE_FREEFORM constant.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 4000, 4000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_FREEFORM, position);

            // Set the bottom and right extents of the drawing object.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_RIGHT, 3000));
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_BOTTOM, 3000));

            // Define the vertices that make up the drawing object.
            // This list draws a basic table shape.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_VERTICIES,
                new Point[]{
                    new Point(100, 100),
                    new Point(2900, 100),
                    new Point(2900, 200),
                    new Point(2600, 200),
                    new Point(2600, 1500),
                    new Point(2520, 1500),
                    new Point(2520, 200),
                    new Point(480, 200),
                    new Point(480, 1500),
                    new Point(400, 1500),
                    new Point(400, 200),
                    new Point(100, 200)
                }));
           
            // A nice red Table :-)
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.red));

            document.add(shape);

            document.close();
        } catch (FileNotFoundException fnfe) {
View Full Code Here

            // The position defines the extent of the shape in the page (in Twips)
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE,
                    new RtfShapePosition(1000, 2000, 3000, 2000));
           
            // Set the line colour to red
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_LINE_COLOR,
                    Color.RED));
           
            // Set the fill colour to cyan
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR,
                    Color.CYAN));
           
            // Text wraps around the shape on both sides
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
           
View Full Code Here

TOP

Related Classes of com.lowagie.text.rtf.graphic.RtfShapeProperty

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.