Package java.awt.geom

Examples of java.awt.geom.CubicCurve2D$Float


        int d = 100;
        int dist = (int) point1.distance(point2);
        if (dist < d) {
            d = dist;
        }
        CubicCurve2D line = new CubicCurve2D.Double(point1.x, point1.y, point1.x + d, point1.y, point2.x - d, point2.y,
                point2.x, point2.y);
        g.draw(line);
    }
View Full Code Here


    }
    g.setFont(oldFont);
    }

  private CubicCurve2D createCubicCurve2D(Point startPoint, Point startPoint2, Point endPoint2, Point endPoint) {
      final CubicCurve2D arrowLinkCurve = new CubicCurve2D.Double();
    if (startPoint != null && endPoint != null) {
      arrowLinkCurve.setCurve(startPoint, startPoint2, endPoint2, endPoint);
    }
    else if (startPoint != null) {
      arrowLinkCurve.setCurve(startPoint, startPoint2, startPoint, startPoint2);
    }
    else if (endPoint != null) {
      arrowLinkCurve.setCurve(endPoint, endPoint2, endPoint, endPoint2);
    }
      return arrowLinkCurve;
    }
View Full Code Here

                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
                g2.draw(q);
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
            }
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
                CubicCurve2D c = new CubicCurve2D .Float();
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY,
                        linkX, linkY);
                g2.draw(c);
            }
        }
        TextBox tb = record.getLabel();
View Full Code Here

                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
                g2.draw(q);
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
            }
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
                CubicCurve2D c = new CubicCurve2D .Float();
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY,
                        linkX, linkY);
                g2.draw(c);
            }
        }
View Full Code Here

     */
    private void paintCurve( ColorCurve c, Graphics2D g ) {
        // Paint curve segments
       
        for ( int n = 0 ; n < c.getPointCount()-1 ; n++ ) {
            CubicCurve2D segment = c.getSegment( n );
            double dw = getWidth();
            double dh = getHeight();
            CubicCurve2D xlated = new CubicCurve2D.Double(
                    segment.getX1()*dw, (1.0-segment.getY1())*dh,
                    segment.getCtrlX1() * dw, (1.0-segment.getCtrlY1())*dh,
                    segment.getCtrlX2()*dw, (1.0-segment.getCtrlY2())*dh,
                    segment.getX2()*dw, (1.0-segment.getY2())*dh );
            g.draw( xlated );
View Full Code Here

     @param n The order number of the segment, so that segment n is between
     points n and n+1.
     @return Cubic curve for the segment in question.
     */
    public CubicCurve2D getSegment( int n ) {
        CubicCurve2D c = new CubicCurve2D.Double();
        double x = pointX[n];
        double dx = (pointX[n+1]-pointX[n])/3.0;
        c.setCurve( x, b[n+1][0], x+dx, b[n+1][1], x+2.0*dx, b[n+1][2], pointX[n+1], b[n+1][3] );
        return c;
    }
View Full Code Here

                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
                g2.draw(q);
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
            }
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
                CubicCurve2D c = new CubicCurve2D .Float();
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY,
                        linkX, linkY);
                g2.draw(c);
            }
        }
        TextBox tb = record.getLabel();
View Full Code Here

                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
                g2.draw(q);
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
            }
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
                CubicCurve2D c = new CubicCurve2D .Float();
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY,
                        linkX, linkY);
                g2.draw(c);
            }
        }
View Full Code Here

        int d = 100;
        int dist = (int) point1.distance(point2);
        if (dist < d) {
            d = dist;
        }
        CubicCurve2D line = new CubicCurve2D.Double(point1.x, point1.y, point1.x + d, point1.y, point2.x - d, point2.y,
                point2.x, point2.y);
        g.draw(line);
    }
View Full Code Here

            // Note: 2x2 ends up hitting exactly 1 pixel...
            if (size < 2) size = 2;
            int x = cctx.initX;
            int y = cctx.initY;
            int cpoffset = (int) (size/relYmax/2);
            CubicCurve2D curve = cctx.curve;
            Graphics2D g2d = (Graphics2D) cctx.graphics;
            g2d.translate(cctx.orgX, cctx.orgY);
            Color rCArray[] = cctx.colorlist;
            int ci = cctx.colorindex;
            do {
                curve.setCurve(x, y+size/2.0,
                               x+size/2.0, y+size/2.0-cpoffset,
                               x+size/2.0, y+size/2.0+cpoffset,
                               x+size, y+size/2.0);

                if (rCArray != null) {
View Full Code Here

TOP

Related Classes of java.awt.geom.CubicCurve2D$Float

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.