Example usage for java.awt Graphics2D fill

List of usage examples for java.awt Graphics2D fill

Introduction

In this page you can find the example usage for java.awt Graphics2D fill.

Prototype

public abstract void fill(Shape s);

Source Link

Document

Fills the interior of a Shape using the settings of the Graphics2D context.

Usage

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    r.setRect(20, 20, 40, 40);/* w w w. j  a  v a2s.  c  o  m*/

    g2.fill(r);
}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(new Point(10, 10));

    r.setSize(30, 30);//from   www  .j  av a  2s  .c  o  m

    g2.fill(r);

    System.out.println(r.isEmpty());
}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    r.setBounds(20, 20, 40, 40);//  w ww  .ja va  2  s. co  m

    g2.fill(r);
}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    r.add(new Point(40, 40));

    g2.fill(r);

}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    Rectangle newR = new Rectangle(r);

    g2.fill(newR);

}

From source file:MainClass.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Ellipse2D e1 = new Ellipse2D.Double(20.0, 20.0, 80.0, 70.0);

    g2.setColor(Color.red);// ww  w.  j  a  va 2s  . c om
    g2.fill(e1);

}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    System.out.println(r.outcode(40D, 40D));

    g2.fill(r);
}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle();

    r.setLocation(10, 10);/* w ww. java 2  s  .c om*/
    r.setSize(10, 10);

    g2.fill(r);
    System.out.println(r.height);

}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    r.add(new Rectangle(40, 40, 100, 100));

    g2.fill(r);

}

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(10, 10, 50, 40);

    r = r.union(new Rectangle(20, 20, 60, 60));

    g2.fill(r);
}