Example usage for java.awt BasicStroke JOIN_BEVEL

List of usage examples for java.awt BasicStroke JOIN_BEVEL

Introduction

In this page you can find the example usage for java.awt BasicStroke JOIN_BEVEL.

Prototype

int JOIN_BEVEL

To view the source code for java.awt BasicStroke JOIN_BEVEL.

Click Source Link

Document

Joins path segments by connecting the outer corners of their wide outlines with a straight segment.

Usage

From source file:Main.java

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

    BasicStroke bs = new BasicStroke(16.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL);
    g2.setStroke(bs);/* w w w  .ja va  2s  . c  o m*/
    g.drawLine(30, 20, 270, 20);
}

From source file:Main.java

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

    g2.setPaint(Color.black);//from  w w  w . j  a v a 2  s  .  c  om
    g2.setStroke(new BasicStroke(8, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
    g2.draw(new Ellipse2D.Double(20, 20, 50, 50));
}

From source file:Main.java

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

    Stroke stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[] { 3, 1 },
            0);/*from w ww  .  jav  a2 s .c o  m*/
    g2.setStroke(stroke);

    g2.setPaint(Color.black);
    g2.draw(new Rectangle2D.Float(10, 20, 30, 40));
}

From source file:Main.java

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

    Stroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.1F);
    g2.setStroke(stroke);/*from   w ww. j a  v a 2s .c  o  m*/

    g2.setPaint(Color.black);
    g2.draw(new Rectangle2D.Float(10, 10, 200, 200));
}

From source file:Main.java

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

    Stroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[] { 3, 1 },
            0);/*from   ww w.j  ava  2 s  .  c o m*/
    g2.setStroke(stroke);

    g2.setPaint(Color.black);
    g2.draw(new Rectangle2D.Float(10, 10, 200, 200));
}

From source file:Main.java

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

    BasicStroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.1F);

    g2.setPaint(Color.black);/*from  w  ww .  j  ava  2 s  .  c  o  m*/
    g2.draw(stroke.createStrokedShape(new Rectangle2D.Float(10, 10, 20, 20)));
}

From source file:Main.java

public static String convertLineJoinToString(int lineJoin) {
    if (lineJoin == BasicStroke.JOIN_BEVEL)
        return "bevel";
    else if (lineJoin == BasicStroke.JOIN_MITER)
        return "miter";
    else if (lineJoin == BasicStroke.JOIN_ROUND)
        return "round";
    return null;/* w  ww  .  j a va 2 s  . c  om*/
}

From source file:Main.java

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

    RenderingHints rh = g2.getRenderingHints();
    rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHints(rh);//from  w  ww.j  a  v  a  2  s. co m

    BasicStroke bs = new BasicStroke(36.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
    g2.setStroke(bs);

    GeneralPath path = new GeneralPath();
    path.moveTo(30.0f, 90.0f);
    path.lineTo(150.0f, 20.0f);
    path.lineTo(270.0f, 90.0f);
    g2.draw(path);
}

From source file:MainClass.java

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

    RenderingHints rh = g2.getRenderingHints();
    rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHints(rh);/*from   www.j a  v  a 2  s.c o  m*/

    BasicStroke bs = new BasicStroke(36.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
    g2.setStroke(bs);

    GeneralPath path = new GeneralPath();
    path.moveTo(30.0f, 90.0f);
    path.lineTo(150.0f, 20.0f);
    path.lineTo(270.0f, 90.0f);
    g2.draw(path);

}

From source file:MainClass.java

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

    Stroke stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[] { 3, 1 },
            0);/* w  w  w . j a  va2  s . com*/
    g2.setStroke(stroke);

    g2.setPaint(Color.black);
    g2.draw(shape);

}