public void createUI(LGraphics g, int nx, int ny, int x, int y, int w, int h) { if (!visible) { return; } Color oldColor = g.getColor(); g.translate(nx, ny); if (alpha > 0.1 && alpha < 1.0) { g.setAlpha(alpha); g.setColor(color); g.fillRect(x, y, w, h); g.setAlpha(1.0F); } else { g.setColor(color); g.fillRect(x, y, w, h); } g.translate(-nx, -ny); g.setColor(oldColor); }
public void draw(LGraphics g, int x, int y, int w, int h) { switch (style) { case 0: Color oldColor = g.getColor(); g.setAntiAlias(true); g.setColor(color); float alpha = 0.0f; int nx = x + w / 2 - (int) r * 4, ny = y + h / 2 - (int) r * 4; g.translate(nx, ny); for (Iterator it = list.iterator(); it.hasNext(); ) { Shape s = (Shape) it.next(); alpha = isRunning ? alpha + 0.1f : 0.5f; g.setAlpha(alpha); g.fill(s); } g.setAntiAlias(false); g.setAlpha(1.0F); g.translate(-nx, -ny); g.setColor(oldColor); break; case 1: g.translate(x, y); g.setAntialiasAll(true); g.setColor(fill); g.drawRect(0, 0, width, height); g.setStroke(stroke); int sa = angle % 360; g.setPaint(border); g.drawArc( x + (width - paintWidth) / 2, y + (height - paintHeight) / 2, paintWidth, paintHeight, sa, sa + ANGLE_STEP); g.setAntialiasAll(false); g.translate(-x, -y); break; } }