home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.metal;
-
- import com.sun.java.swing.ButtonModel;
- import com.sun.java.swing.Icon;
- import com.sun.java.swing.JRadioButton;
- import com.sun.java.swing.plaf.UIResource;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
- import java.io.Serializable;
-
- class MetalIconFactory$RadioButtonIcon implements Icon, UIResource, Serializable {
- // $FF: renamed from: rb com.sun.java.swing.JRadioButton
- JRadioButton field_0;
- ButtonModel model;
- boolean drawDot;
- Color background;
- Color shadow;
- Color darkCircle;
- Color dotColor;
- Color interiorColor;
- Color whiteInnerLeftArc;
- Color whiteOuterRightArc;
-
- public void paintIcon(Component c, Graphics g, int x, int y) {
- this.field_0 = (JRadioButton)c;
- this.model = this.field_0.getModel();
- this.drawDot = this.model.isSelected();
- this.background = c.getBackground();
- this.dotColor = c.getForeground();
- this.shadow = MetalLookAndFeel.getControlShadow();
- this.darkCircle = MetalLookAndFeel.getControlDarkShadow();
- this.whiteInnerLeftArc = MetalLookAndFeel.getControlHighlight();
- this.whiteOuterRightArc = MetalLookAndFeel.getControlHighlight();
- this.interiorColor = this.background;
- if (!this.model.isEnabled()) {
- this.whiteInnerLeftArc = this.whiteOuterRightArc = this.background;
- this.darkCircle = this.dotColor = this.shadow;
- } else if (this.model.isPressed() && this.model.isArmed()) {
- this.whiteInnerLeftArc = this.interiorColor = this.shadow;
- }
-
- g.translate(x, y);
- g.setColor(this.interiorColor);
- g.fillRect(2, 2, 9, 9);
- g.setColor(this.darkCircle);
- g.drawLine(4, 0, 7, 0);
- g.drawLine(8, 1, 9, 1);
- g.drawLine(10, 2, 10, 3);
- g.drawLine(11, 4, 11, 7);
- g.drawLine(10, 8, 10, 9);
- g.drawLine(9, 10, 8, 10);
- g.drawLine(7, 11, 4, 11);
- g.drawLine(3, 10, 2, 10);
- g.drawLine(1, 9, 1, 8);
- g.drawLine(0, 7, 0, 4);
- g.drawLine(1, 3, 1, 2);
- g.drawLine(2, 1, 3, 1);
- g.setColor(this.whiteInnerLeftArc);
- g.drawLine(2, 9, 2, 8);
- g.drawLine(1, 7, 1, 4);
- g.drawLine(2, 2, 2, 3);
- g.drawLine(2, 2, 3, 2);
- g.drawLine(4, 1, 7, 1);
- g.drawLine(8, 2, 9, 2);
- g.setColor(this.whiteOuterRightArc);
- g.drawLine(10, 1, 10, 1);
- g.drawLine(11, 2, 11, 3);
- g.drawLine(12, 4, 12, 7);
- g.drawLine(11, 8, 11, 9);
- g.drawLine(10, 10, 10, 10);
- g.drawLine(9, 11, 8, 11);
- g.drawLine(7, 12, 4, 12);
- g.drawLine(3, 11, 2, 11);
- if (this.drawDot) {
- g.setColor(this.dotColor);
- g.fillRect(4, 4, 4, 4);
- g.drawLine(4, 3, 7, 3);
- g.drawLine(8, 4, 8, 7);
- g.drawLine(7, 8, 4, 8);
- g.drawLine(3, 7, 3, 4);
- }
-
- g.translate(-x, -y);
- }
-
- public int getIconWidth() {
- return 13;
- }
-
- public int getIconHeight() {
- return 13;
- }
- }
-