Package java.awt

Examples of java.awt.Graphics2D.draw()


                                _startX = endX;
                                _startY = endY;
                            }
                                //gp.closePath();
                            g2.setStroke( solid );
                            g2.draw( gp );
                        }
                    catch ( Exception e ) {
                        System.out.println( "Unable to draw static text as a 2D graphics context is required" );
                    }
                    break;
View Full Code Here


            g2.drawRect(0, 0, w - 1, h - 1);
           
            for (Vector2D point : points) {
                Vector2D p = transform(point, w, h);
                double[] arr = p.toArray();
                g2.draw(new Rectangle2D.Double(arr[0] - 1, arr[1] - 1, 2, 2));
            }
        }       
       
        @Override
        public Dimension getPreferredSize() {
View Full Code Here

                    Clusterable p = transform(((CentroidCluster<?>) cluster).getCenter(), w, h);
                    double[] arr = p.getPoint();
                    Shape s = new Ellipse2D.Double(arr[0] - 4, arr[1] - 4, 8, 8);
                    g2.fill(s);
                    g2.setPaint(Color.black);
                    g2.draw(s);
                }
            }
           
            g2.setPaint(Color.black);
            g2.drawString(String.format("%.2f s", duration / 1e3), w - 40, h - 5);
View Full Code Here

        ig.setPaint(Color.red);
        ig.fillRect(100, 50, 100, 50);
        ig.setPaint(new Color(255, 127, 127));
        ig.fillRect(0, 100, 100, 50);
        ig.setPaint(Color.black);
        ig.draw(new Rectangle2D.Double(0.5, 0.5, 199, 149));
        ig.dispose();
        return image;
    }

    /**
 
View Full Code Here

      g.setPaint(gp);
    }

    //if (!selected || rollover)
    {
      g.draw(roundRectangle2D);
    }

    g.drawImage(icon.getImage(), insets.left, insets.top, null);

    return new ImageIcon(bi);
View Full Code Here

    final Graphics2D g2 = (Graphics2D) graphics.create();
    if (background != null)
    {
      g2.setPaint(background);
      g2.draw(drawArea);
    }

    if (data.length == 0)
    {
      g2.dispose();
View Full Code Here

        line.setLine(px1, y + (height - ((number.floatValue() - min) / scale)),
            px2, y + (height - ((nextNumber.floatValue() - min) / scale)));
      }
      lastX = line.getX2();
      lastY = line.getY2();
      g2.draw(line);

    }

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

      state.postPaint();
    }
    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      graph.draw(arc);
      state.postDraw();
    }
  }

  /**
 
View Full Code Here

    final Point destP = getScaledDestination();

    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      graph.draw(new Line2D.Double(cx, cy, destP.x, destP.y));
      state.postDraw();

    }
    state.setCurPos(destP.x, destP.y);
  }
View Full Code Here

      for (int i = 1; i < count; i++)
      {
        final int destX = points_x[i];
        final int destY = points_y[i];
        line.setLine(cx, cy, destX, destY);
        graph.draw(line);
        cx = destX;
        cy = destY;
      }
      state.postDraw();
    }
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.