| 1 | public class SteelCheckBox extends javax.swing.JCheckBox |
| 2 | { |
| 3 | // <editor-fold defaultstate="collapsed" desc="Variable declaration"> |
| 4 | private boolean colored = false; |
| 5 | private boolean rised = false; |
| 6 | private eu.hansolo.tools.ColorDef selectedColor = eu.hansolo.tools.ColorDef.JUG_GREEN; |
| 7 | protected static final String COLORED_PROPERTY = "colored"; |
| 8 | protected static final String COLOR_PROPERTY = "color"; |
| 9 | protected static final String RISED_PROPERTY = "rised"; |
| 10 | // </editor-fold> |
| 11 | |
| 12 | // <editor-fold defaultstate="collapsed" desc="Constructor"> |
| 13 | public SteelCheckBox() |
| 14 | { |
| 15 | super(); |
| 16 | setPreferredSize(new java.awt.Dimension(100, 26)); |
| 17 | } |
| 18 | // </editor-fold> |
| 19 | |
| 20 | // <editor-fold defaultstate="collapsed" desc="Getter/Setter"> |
| 21 | public boolean isColored() |
| 22 | { |
| 23 | return this.colored; |
| 24 | } |
| 25 | |
| 26 | public void setColored(final boolean COLORED) |
| 27 | { |
| 28 | final boolean OLD_STATE = this.colored; |
| 29 | this.colored = COLORED; |
| 30 | firePropertyChange(COLORED_PROPERTY, OLD_STATE, COLORED); |
| 31 | repaint(); |
| 32 | } |
| 33 | |
| 34 | public boolean isRised() |
| 35 | { |
| 36 | return this.rised; |
| 37 | } |
| 38 | |
| 39 | public void setRised(final boolean RISED) |
| 40 | { |
| 41 | final boolean OLD_VALUE = this.rised; |
| 42 | this.rised = RISED; |
| 43 | firePropertyChange(RISED_PROPERTY, OLD_VALUE, RISED); |
| 44 | } |
| 45 | |
| 46 | public eu.hansolo.tools.ColorDef getSelectedColor() |
| 47 | { |
| 48 | return this.selectedColor; |
| 49 | } |
| 50 | |
| 51 | public void setSelectedColor(final eu.hansolo.tools.ColorDef SELECTED_COLOR) |
| 52 | { |
| 53 | final eu.hansolo.tools.ColorDef OLD_COLOR = this.selectedColor; |
| 54 | this.selectedColor = SELECTED_COLOR; |
| 55 | firePropertyChange(COLOR_PROPERTY, OLD_COLOR, SELECTED_COLOR); |
| 56 | repaint(); |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public void setUI(final javax.swing.plaf.ButtonUI BUI) |
| 61 | { |
| 62 | super.setUI(new SteelCheckBoxUI(this)); |
| 63 | } |
| 64 | |
| 65 | public void setUi(final javax.swing.plaf.ComponentUI UI) |
| 66 | { |
| 67 | this.ui = new SteelCheckBoxUI(this); |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | protected void setUI(final javax.swing.plaf.ComponentUI UI) |
| 72 | { |
| 73 | super.setUI(new SteelCheckBoxUI(this)); |
| 74 | } |
| 75 | // </editor-fold> |
| 76 | |
| 77 | @Override |
| 78 | public String toString() |
| 79 | { |
| 80 | return "SteelCheckBox"; |
| 81 | } |
| 82 | } |