Package java.awt.geom

Examples of java.awt.geom.Line2D$Double


        segments.clear();

        Point2D p = (Point2D) points.get(0);
        for (int n=1; n<points.size(); n++) {
            Point2D q = (Point2D) points.get(n);
            Line2D line =
                new Line2D.Double(p.getX(), p.getY(), q.getX(), q.getY());
            segments.add(line);
            path.append(line, true);
            p = q;
        }
View Full Code Here


           / lt);

    p4 = new Point2D.Double(x, y);

    //On trace la ligne entre les 2 elements du MPD
    Line2D l = new Line2D.Double(p1, p2);
    g2d.setColor(Color.RED);
    g2d.draw(l);

    AffineTransform affineTransform = new AffineTransform();
View Full Code Here

        Graphics2D g2d = (Graphics2D) g;
        g2d.setFont(font);

        RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY(),
                getWidth(), getHeight(), 35, 35);
        Line2D l = new Line2D.Double(getX(), getY() + 25, getX() + getWidth(),
                getY() + 25);
        g2d.setColor(Color.white);
        g2d.fill(r);
        g2d.setColor(Color.blue);
        g2d.draw(r);
View Full Code Here

     */
    public void paint(Graphics g)
    {
        updateLocation();
        Graphics2D g2d = (Graphics2D) g;
        Line2D l = new Line2D.Double(x1, y1, x2, y2);

        g2d.setColor(Color.black);
        g2d.draw(l);

        if (Math.abs(x1 - x2) > Math.abs(y1 - y2))
View Full Code Here

        RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY(),
                getWidth(), getHeight(), 1, 1);
        //Rectangle2D r = new Rectangle2D.Double(getX(), getY(), getWidth(),
        // getHeight());
        Line2D l = new Line2D.Double(getX(), 25 + getY(), getWidth() + getX(),
                getY() + 25);
        g2d.setColor(Color.white);
        g2d.fill(r);
        g2d.setColor(Color.blue);
        g2d.draw(r);
View Full Code Here

        Graphics2D g2d = (Graphics2D) g;
        g2d.setFont(font);
        updateSize();
        RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY(),
                getWidth(), getHeight(), 1, 1);
        Line2D l = new Line2D.Double(getX(), 25 + getY(), getWidth() + getX(),
                25 + getY());
        g2d.setColor(Color.white);
        g2d.fill(r);
        g2d.setColor(Color.blue);
        g2d.draw(r);
View Full Code Here

        if (creationLien && creationLienClic) {
            Graphics2D g2d = (Graphics2D) g;
            Rectangle2D r;
            g2d.setColor(Color.black);

            Line2D l = new Line2D.Double(x1, y1, x2, y2);
            g2d.draw(l);

            r = new Rectangle2D.Double(x1 - 1, y1 - 1, 4, 4);
            g2d.fill(r);
View Full Code Here

    double pixPerCm10 = canvas.getPPCDrawing()*canvas.getZoom()/10.;
    if(ScaleRuler.getUnit()==Unit.INCH)
      pixPerCm10*=PSTricksConstants.INCH_VAL_CM;

    if(Double.compare(pixPerCm10, 4.)>0) {
      final Line2D line = new Line2D.Double();
      final double xMinclip = Math.floor(clip.getMinX()/pixPerCm10)*pixPerCm10-clip.getMinX();
      final double yMinclip = Math.floor(clip.getMinY()/pixPerCm10)*pixPerCm10-clip.getMinY();
      final double xMaxclip = clip.getMaxX();
      final double yMaxclip = clip.getMaxY();
      final double minX     = clip.getMinX();
      final double minY    = clip.getMinY();

        for(double i=pixPerCm10-1+xMinclip+minX+canvas.getOrigin().getX()%pixPerCm10; i<xMaxclip; i+=pixPerCm10) {
        line.setLine(i, minY, i, yMaxclip);
        graph.draw(line);
      }

        for(double i=pixPerCm10-1+yMinclip+minY+canvas.getOrigin().getY()%pixPerCm10; i<yMaxclip; i+=pixPerCm10) {
        line.setLine(minX, i, xMaxclip, i);
        graph.draw(line);
      }
      }
  }
View Full Code Here

    final double yMinclip = Math.floor(clip.getMinY()/gap2)*gap2-clip.getMinY();
    final double xMaxclip = clip.getMaxX();
    final double yMaxclip = clip.getMaxY();
    final double minX     = clip.getMinX();
    final double minY    = clip.getMinY();
    final Line2D line     = new Line2D.Double();

    for(double i=gap2-1+xMinclip+minX+canvas.getOrigin().getX()%gap2; i<xMaxclip; i+=gap2) {
      line.setLine(i, minY, i, yMaxclip);
      graph.draw(line);
    }

    for(double j=gap2-1+yMinclip+minY+canvas.getOrigin().getY()%gap2; j<yMaxclip; j+=gap2) {
      line.setLine(minX, j, xMaxclip, j);
      graph.draw(line);
    }
  }
View Full Code Here

    /**
     * Serialize a <code>Line2D.Float</code> instance, and check that it can be
     * deserialized correctly.
     */
    public void testLine2DFloatSerialization() {
        Line2D l1 = new Line2D.Float(1.0f, 2.0f, 3.0f, 4.0f);
        Line2D l2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream(buffer);
            SerialUtilities.writeShape(l1, out);
            out.close();
View Full Code Here

TOP

Related Classes of java.awt.geom.Line2D$Double

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.