List of usage examples for java.awt.geom Arc2D.Float setAngleStart
public void setAngleStart(Point2D p)
From source file:MyCanvas.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; // Draw the pie chart Arc2D.Float arc = new Arc2D.Float(Arc2D.PIE); arc.setFrame(140, 200, 67, 46);/*from w ww .j av a 2s . c o m*/ arc.setAngleStart(45); arc.setAngleExtent(270); g2.setColor(Color.gray); g2.draw(arc); g2.setColor(Color.red); g2.fill(arc); g2.setColor(Color.black); g2.drawString("Arc2D.PIE", 140, 190); }
From source file:MyCanvas.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; //Draw the open arc Arc2D.Float arc = new Arc2D.Float(Arc2D.OPEN); arc.setFrame(140, 100, 67, 46);/*from ww w .j a va 2 s .c o m*/ arc.setAngleStart(45); arc.setAngleExtent(270); g2.setColor(Color.gray); g2.draw(arc); g2.setColor(Color.green); g2.fill(arc); g2.setColor(Color.black); g2.drawString("Arc2D.OPEN", 140, 90); }
From source file:MyCanvas.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; //Draw the chord Arc2D.Float arc1 = new Arc2D.Float(Arc2D.CHORD); arc1.setFrame(140, 30, 67, 46);//from w w w . j a v a 2s .c o m arc1.setAngleStart(45); arc1.setAngleExtent(270); g2.setColor(Color.blue); g2.draw(arc1); g2.setColor(Color.gray); g2.fill(arc1); g2.setColor(Color.black); g2.drawString("Arc2D.CHORD", 140, 20); }
From source file:MyCanvas.java
public void draw(Graphics g) { Graphics2D g2 = (Graphics2D) g; // Draw the pie chart Arc2D.Float arc = new Arc2D.Float(Arc2D.PIE); arc.setFrame(140, 200, 67, 46);//from ww w .j av a2s . c o m arc.setAngleStart(45); arc.setAngleExtent(270); g2.setColor(Color.gray); g2.draw(arc); g2.setColor(Color.red); g2.fill(arc); g2.setColor(Color.black); g2.drawString("Arc2D.PIE", 140, 190); }