101 @SuppressWarnings("serial") // Superclass is not serializable across versions
102 private static class IFIcon extends IconUIResource {
103 private Icon pressed;
104
105 public IFIcon(Icon normal, Icon pressed) {
106 super(normal);
107 this.pressed = pressed;
108 }
109
110 public void paintIcon(Component c, Graphics g, int x, int y) {
111 ButtonModel model = ((AbstractButton)c).getModel();
112 if (model.isPressed() && model.isArmed()) {
113 pressed.paintIcon(c, g, x, y);
114 } else {
115 super.paintIcon(c, g, x, y);
116 }
117 }
118 }
119
120 /**
121 * Creates an instance of <code>OceanTheme</code>
122 */
123 public OceanTheme() {
124 }
125
126 /**
127 * Add this theme's custom entries to the defaults table.
128 *
129 * @param table the defaults table, non-null
130 * @throws NullPointerException if {@code table} is {@code null}
131 */
132 public void addCustomEntriesToTable(UIDefaults table) {
133 UIDefaults.LazyValue focusBorder = t ->
134 new BorderUIResource.LineBorderUIResource(getPrimary1());
135 // .30 0 DDE8F3 white secondary2
136 java.util.List<?> buttonGradient = Arrays.asList(
137 new Object[] {new Float(.3f), new Float(0f),
138 new ColorUIResource(0xDDE8F3), getWhite(), getSecondary2() });
139
140 // Other possible properties that aren't defined:
141 //
|
101 @SuppressWarnings("serial") // Superclass is not serializable across versions
102 private static class IFIcon extends IconUIResource {
103 private Icon pressed;
104
105 public IFIcon(Icon normal, Icon pressed) {
106 super(normal);
107 this.pressed = pressed;
108 }
109
110 public void paintIcon(Component c, Graphics g, int x, int y) {
111 ButtonModel model = ((AbstractButton)c).getModel();
112 if (model.isPressed() && model.isArmed()) {
113 pressed.paintIcon(c, g, x, y);
114 } else {
115 super.paintIcon(c, g, x, y);
116 }
117 }
118 }
119
120 /**
121 * Creates an instance of {@code OceanTheme}
122 */
123 public OceanTheme() {
124 }
125
126 /**
127 * Add this theme's custom entries to the defaults table.
128 *
129 * @param table the defaults table, non-null
130 * @throws NullPointerException if {@code table} is {@code null}
131 */
132 public void addCustomEntriesToTable(UIDefaults table) {
133 UIDefaults.LazyValue focusBorder = t ->
134 new BorderUIResource.LineBorderUIResource(getPrimary1());
135 // .30 0 DDE8F3 white secondary2
136 java.util.List<?> buttonGradient = Arrays.asList(
137 new Object[] {new Float(.3f), new Float(0f),
138 new ColorUIResource(0xDDE8F3), getWhite(), getSecondary2() });
139
140 // Other possible properties that aren't defined:
141 //
|