+
+ private static void fillPolygon(Graphics g, int[] xpoints, int[] ypoints,
+ int n)
+ {
+ setAntiAlias(g);
+ g.fillPolygon(xpoints, ypoints, n);
+ g.drawPolygon(xpoints, ypoints, n);
+ }
+
+ private static void fillRect(Graphics g, int a, int b, int c, int d)
+ {
+ setAntiAlias(g);
+ g.fillRect(a, b, c, d);
+ g.drawRect(a, b, c, d);
+ }
+
+ private static void fillRoundRect(Graphics g, int a, int b, int c, int d,
+ int e, int f)
+ {
+ setAntiAlias(g);
+ g.fillRoundRect(a, b, c, d, e, f);
+ g.drawRoundRect(a, b, c, d, e, f);
+ }
+
+ private static void fillArc(Graphics g, int a, int b, int c, int d, int e,
+ int f)
+ {
+ setAntiAlias(g);
+ g.fillArc(a, b, c, d, e, f);
+ g.drawArc(a, b, c, d, e, f);
+ }
+
+ private static void setAntiAlias(Graphics g)
+ {
+ if (Cache.getDefault("ANTI_ALIAS", true))
+ {
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ }
+ }
+
+ private static void unsetAntiAlias(Graphics g)
+ {
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_OFF);
+ }