Java 2D Graphics g2.rotate(mTheta, d.width / 2, d.height
Java 2D Graphics g2.rotate(mTheta, d.width / 2, d.height / 2); } protected Shape createShape() { GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, mPoints.length); path.moveTo(mPoints[0], mPoints[1]); for (int i = 2; i < mN; i += 6) path.curveTo(mPoints[i], mPoints[i + 1], mPoints[i + 2], mPoints[i + 3], mPoints[i + 4], mPoints[i + 5]); path.closePath(); return path; } protected void setPaint(Graphics2D g2) { if (mGradient) { GradientPaint gp = new GradientPaint(0, 0, Color.yellow, 50, 25, Color.red, true); g2.setPaint(gp); } else g2.setPaint(Color.orange); } protected void setStroke(Graphics2D g2) { if (mDotted == false) return; // Create a dotted stroke. Stroke stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 10, new float[] { 4, 4 }, 0); g2.setStroke(stroke); } protected void drawAxes(Graphics2D g2) { if (mAxes == false) return; g2.setPaint(getForeground()); g2.setStroke(new BasicStroke()); Dimension d = getSize(); int side = 20; int arrow = 4; int w = d.width / 2, h = d.height / 2; g2.drawLine(w - side, h, w + side, h); g2.drawLine(w + side - arrow, h - arrow, w + side, h); g2.drawLine(w, h - side, w, h + side); g2.drawLine(w + arrow, h + side - arrow, w, h + side); } } You can learn quite a bit from this application. Table 14-1 shows some results when testing under the following conditions: JDK 1.2 build V Windows NT 4.0 with Service Pack 3 266 MHz Pentium II processor Matrox Millenium II display card, set to "True Color" and 1152 by 864 pixels 64 MB physical memory The frame rates are approximate, as they fluctuate based on the size of the rendered shape as well as changing system conditions. page 262
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services