|
21 | 21 | import org.httprpc.sierra.Outlet; |
22 | 22 | import org.httprpc.sierra.TaskExecutor; |
23 | 23 | import org.httprpc.sierra.UILoader; |
| 24 | +import org.pushingpixels.radiance.theming.api.skin.RadianceGraphiteLookAndFeel; |
24 | 25 |
|
25 | 26 | import javax.swing.JButton; |
26 | 27 | import javax.swing.JComponent; |
|
34 | 35 | import javax.swing.SpinnerNumberModel; |
35 | 36 | import javax.swing.SwingConstants; |
36 | 37 | import javax.swing.SwingUtilities; |
| 38 | +import javax.swing.UIManager; |
37 | 39 | import javax.swing.event.TableModelListener; |
38 | 40 | import javax.swing.table.DefaultTableCellRenderer; |
39 | 41 | import javax.swing.table.TableModel; |
@@ -155,6 +157,8 @@ public void setValue(Object value) { |
155 | 157 | } |
156 | 158 | } |
157 | 159 |
|
| 160 | + private boolean radiance; |
| 161 | + |
158 | 162 | private @Outlet JTextField tickerTextField = null; |
159 | 163 | private @Outlet JSpinner countSpinner = null; |
160 | 164 |
|
@@ -183,14 +187,24 @@ public void setValue(Object value) { |
183 | 187 |
|
184 | 188 | private static final URI baseURI = URI.create("https://api.tiingo.com/"); |
185 | 189 |
|
186 | | - private TiingoTest() { |
| 190 | + private TiingoTest(boolean radiance) { |
187 | 191 | super(resourceBundle.getString("title")); |
188 | 192 |
|
| 193 | + this.radiance = radiance; |
| 194 | + |
189 | 195 | setDefaultCloseOperation(EXIT_ON_CLOSE); |
190 | 196 | } |
191 | 197 |
|
192 | 198 | @Override |
193 | 199 | public void run() { |
| 200 | + if (radiance) { |
| 201 | + try { |
| 202 | + UIManager.setLookAndFeel(RadianceGraphiteLookAndFeel.class.getName()); |
| 203 | + } catch (Exception exception) { |
| 204 | + throw new RuntimeException(exception); |
| 205 | + } |
| 206 | + } |
| 207 | + |
194 | 208 | setContentPane(UILoader.load(this, "TiingoTest.xml", resourceBundle)); |
195 | 209 |
|
196 | 210 | countSpinner.setModel(new SpinnerNumberModel(30, 10, 150, 10)); |
@@ -302,8 +316,12 @@ private void updateHistoricalPricing(List<AssetPricing> historicalPricing) { |
302 | 316 | } |
303 | 317 |
|
304 | 318 | public static void main(String[] args) { |
305 | | - FlatLightLaf.setup(); |
| 319 | + var radiance = coalesce(map(System.getProperty("radiance"), Boolean::valueOf), () -> false); |
| 320 | + |
| 321 | + if (!radiance) { |
| 322 | + FlatLightLaf.setup(); |
| 323 | + } |
306 | 324 |
|
307 | | - SwingUtilities.invokeLater(new TiingoTest()); |
| 325 | + SwingUtilities.invokeLater(new TiingoTest(radiance)); |
308 | 326 | } |
309 | 327 | } |
0 commit comments