Examples of Shape


Examples of java.awt.Shape

     */
    public void render(Graphics g, int width, int height,
                       DrawingAttributes appDA) {

        // Handle clip area in Graphics, first
        Shape clip = getClip();
        if (clip != null) {
            g.setClip(clip);
        }

        DrawingAttributes da = getRenderingAttributes();
View Full Code Here

Examples of java.awt.Shape

        GeneralPath geometry = null;
        Iterator it = iterator();
        while (it.hasNext()) {
            IconPart part = (IconPart) it.next();

            Shape shp = part.getGeometry();

            if (shp == null) {
                continue;
            }
View Full Code Here

Examples of java.awt.Shape

     * @param y Y pixel coordinate of the point.
     * @return getShape().contains(x, y), false if the OMGraphic
     *         hasn't been generated yet.
     */
    public boolean contains(int x, int y) {
        Shape shape = getShape();
        boolean ret = false;

        if (shape != null) {
            ret = shape.contains((double) x, (double) y);
        }

        return ret;
    }
View Full Code Here

Examples of java.awt.Shape

     * not rendered.
     *
     * @param gr the AWT Graphics context
     */
    public synchronized void render(Graphics gr) {
        Shape shp = getShape();
        if (shp != null) {

            if (matted) {
                if (gr instanceof Graphics2D && stroke instanceof BasicStroke) {
                    ((Graphics2D) gr).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
View Full Code Here

Examples of java.awt.Shape

                        failedFilter(omg);
                    }
                    continue;
                } else {
                    Shape omgShape = omg.getShape();
                    if (omgShape != null
                            && area.intersects(omgShape.getBounds2D())) {

                        if (DEBUG_DETAIL) {
                            Debug.output("   +++ omg intersects bounds");
                        }
View Full Code Here

Examples of java.awt.Shape

            Graphics2D g2 = (Graphics2D) g;
            if (getTextMatteColor() != null) {
                FontRenderContext context = g2.getFontRenderContext();
                GlyphVector glyphVector = g2.getFont()
                        .createGlyphVector(context, string);
                Shape outline = glyphVector.getOutline();
                g2.translate(x, y);
                g2.setStroke(getTextMatteStroke());
                g2.setColor(getTextMatteColor());
                g2.draw(outline);
                g2.translate(-x, -y);
View Full Code Here

Examples of java.awt.Shape

    }

    public static void addArrowHeads(int arrowDirectionType, int location,
                                     OMAbstractLine line) {

        Shape arrowHeads = createArrowHeads(arrowDirectionType, location, line);
        if (arrowHeads != null) {
            line.getShape().append(arrowHeads, false);
        }
    }
View Full Code Here

Examples of java.awt.Shape

                OMGeometry graphic = (OMGeometry) iter.next();

                if (logger.isLoggable(Level.FINE))
                    logger.fine("examining " + graphic);

                Shape shape = graphic.getShape();
                if (shape == null)
                    continue;

                PathIterator path = shape.getPathIterator(new AffineTransform());
                int segment = 0;
                int itemsInPath = 0;
                boolean pathValid = true;

                for (; !path.isDone() && pathValid; path.next()) {
View Full Code Here

Examples of java.awt.Shape

        da2.setLinePaint(Color.lightGray);
        da2.setStroke(new BasicStroke(2));

        int[] xpoints = new int[] { 15, 15, 50, 50, 90, 50, 50, 15 };
        int[] ypoints = new int[] { 30, 70, 70, 90, 50, 10, 30, 30 };
        Shape shape = new Polygon(xpoints, ypoints, xpoints.length);

        BasicIconPart testPart = new BasicIconPart(shape);
        testPart.setRenderingAttributes(da);
        testPart.setGradient(true);

        Shape shape2 = new Ellipse2D.Double(5, 5, 90, 90);
        BasicIconPart testPart2 = new BasicIconPart(shape2);
        testPart2.setRenderingAttributes(da2);
        testPart2.setGradient(true);

        IconPartList parts = new IconPartList();
View Full Code Here

Examples of java.awt.Shape

        AffineTransform transform = AffineTransform.getScaleInstance((double) width / 100,
                (double) height / 100);
        transform.concatenate(baseTransform);

        // Handle clip area in Graphics, first
        Shape clip = getClip();
        if (clip != null) {
            g.setClip(new GeneralPath(clip).createTransformedShape(transform));
        }

        Shape shape = new GeneralPath(geometry).createTransformedShape(transform);
        getAttributesForRendering(appDA).render((Graphics2D) g, shape, gradient);
    }
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.