< prev index next >
src/demo/share/jfc/J2Ddemo/java2d/demos/Lines/LineAnim.java
Print this page
*** 1,8 ****
/*
*
! * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
--- 1,8 ----
/*
*
! * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
*** 53,74 ****
* Lines & Paths animation illustrating BasicStroke attributes.
*/
@SuppressWarnings("serial")
public class LineAnim extends AnimatingSurface {
! private static int caps[] = { BasicStroke.CAP_BUTT,
BasicStroke.CAP_SQUARE, BasicStroke.CAP_ROUND };
! private static int joins[] = { BasicStroke.JOIN_MITER,
BasicStroke.JOIN_BEVEL, BasicStroke.JOIN_ROUND };
! private static Color colors[] = { GRAY, PINK, LIGHT_GRAY };
private static BasicStroke bs1 = new BasicStroke(1.0f);
private static final int CLOCKWISE = 0;
! private Line2D lines[] = new Line2D[3];
! private int rAmt[] = new int[lines.length];
! private int direction[] = new int[lines.length];
! private int speed[] = new int[lines.length];
! private BasicStroke strokes[] = new BasicStroke[lines.length];
private GeneralPath path;
private Point2D[] pts;
private float size;
private Ellipse2D ellipse = new Ellipse2D.Double();
--- 53,74 ----
* Lines & Paths animation illustrating BasicStroke attributes.
*/
@SuppressWarnings("serial")
public class LineAnim extends AnimatingSurface {
! private static int[] caps = { BasicStroke.CAP_BUTT,
BasicStroke.CAP_SQUARE, BasicStroke.CAP_ROUND };
! private static int[] joins = { BasicStroke.JOIN_MITER,
BasicStroke.JOIN_BEVEL, BasicStroke.JOIN_ROUND };
! private static Color[] colors = { GRAY, PINK, LIGHT_GRAY };
private static BasicStroke bs1 = new BasicStroke(1.0f);
private static final int CLOCKWISE = 0;
! private Line2D[] lines = new Line2D[3];
! private int[] rAmt = new int[lines.length];
! private int[] direction = new int[lines.length];
! private int[] speed = new int[lines.length];
! private BasicStroke[] strokes = new BasicStroke[lines.length];
private GeneralPath path;
private Point2D[] pts;
private float size;
private Ellipse2D ellipse = new Ellipse2D.Double();
*** 156,164 ****
ellipse.setFrame(pts[i].getX(), pts[i].getY(), 9, 9);
g2.draw(ellipse);
}
}
! public static void main(String argv[]) {
createDemoFrame(new LineAnim());
}
}
--- 156,164 ----
ellipse.setFrame(pts[i].getX(), pts[i].getY(), 9, 9);
g2.draw(ellipse);
}
}
! public static void main(String[] argv) {
createDemoFrame(new LineAnim());
}
}
< prev index next >