Skip to content

Commit dd5decf

Browse files
committed
add support for newer remotelight-client version [ fixes Drumber/RemoteLight#31 ]
- use compat classes to support all 0.2.5 versions
1 parent 233d327 commit dd5decf

File tree

8 files changed

+47
-44
lines changed

8 files changed

+47
-44
lines changed

openrgb-plugin/dependency-reduced-pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>OpenRGB-Plugin</artifactId>
55
<groupId>de.lars</groupId>
6-
<version>1.3.2</version>
6+
<version>1.4</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>openrgb-plugin</artifactId>
@@ -21,7 +21,7 @@
2121
</plugin>
2222
<plugin>
2323
<artifactId>maven-shade-plugin</artifactId>
24-
<version>3.2.2</version>
24+
<version>3.2.4</version>
2525
<executions>
2626
<execution>
2727
<phase>package</phase>
@@ -32,6 +32,7 @@
3232
<minimizeJar>true</minimizeJar>
3333
<artifactSet>
3434
<includes>
35+
<include>com.github.Drumber.RemoteLight:remotelight-plugincompat</include>
3536
<include>de.lars:openrgb-wrapper</include>
3637
<include>org.jetbrains.kotlin:kotlin-stdlib</include>
3738
</includes>
@@ -52,7 +53,7 @@
5253
<dependency>
5354
<groupId>com.github.Drumber</groupId>
5455
<artifactId>RemoteLight</artifactId>
55-
<version>f25326a231</version>
56+
<version>9ff8723287</version>
5657
<scope>compile</scope>
5758
</dependency>
5859
</dependencies>

openrgb-plugin/pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<artifactId>OpenRGB-Plugin</artifactId>
99
<groupId>de.lars</groupId>
10-
<version>1.3.2</version>
10+
<version>1.4</version>
1111
</parent>
1212

1313
<artifactId>openrgb-plugin</artifactId>
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.github.Drumber</groupId>
2121
<artifactId>RemoteLight</artifactId>
22-
<version>f25326a231</version>
22+
<version>9ff8723287</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>de.lars</groupId>
@@ -49,7 +49,7 @@
4949
<plugin>
5050
<groupId>org.apache.maven.plugins</groupId>
5151
<artifactId>maven-shade-plugin</artifactId>
52-
<version>3.2.2</version>
52+
<version>3.2.4</version>
5353
<executions>
5454
<execution>
5555
<phase>package</phase>
@@ -60,6 +60,7 @@
6060
<minimizeJar>true</minimizeJar>
6161
<artifactSet>
6262
<includes>
63+
<include>com.github.Drumber.RemoteLight:remotelight-plugincompat</include>
6364
<include>de.lars:openrgb-wrapper</include>
6465
<include>org.jetbrains.kotlin:kotlin-stdlib</include>
6566
</includes>

openrgb-plugin/src/main/java/de/lars/openrgbplugin/ui/DeviceGroupsPanel.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import de.lars.remotelightclient.ui.panels.tools.ToolsPanel;
1010
import de.lars.remotelightclient.ui.panels.tools.ToolsPanelNavItem;
1111
import de.lars.remotelightclient.utils.ui.MenuIconFont;
12-
import de.lars.remotelightclient.utils.ui.UiUtils;
12+
import de.lars.remotelightplugincompat.StyleCompat;
13+
import de.lars.remotelightplugincompat.UiUtilsCompat;
1314

1415
import javax.swing.*;
1516
import javax.swing.border.CompoundBorder;
@@ -30,17 +31,17 @@ public class DeviceGroupsPanel extends JPanel {
3031
public DeviceGroupsPanel(ToolsPanel context, OpenRgbPlugin instance) {
3132
this.context = context;
3233
this.instance = instance;
33-
setBackground(Style.panelBackground);
34+
setBackground(StyleCompat.panelBackground());
3435
setLayout(new BorderLayout());
3536
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
3637

3738
panelSettings = new JPanel();
38-
panelSettings.setBackground(Style.panelDarkBackground);
39+
panelSettings.setBackground(StyleCompat.panelDarkBackground());
3940
panelSettings.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
4041
panelSettings.setLayout(new BoxLayout(panelSettings, BoxLayout.Y_AXIS));
4142

4243
panelDeviceList = new JPanel();
43-
panelDeviceList.setBackground(Style.panelDarkBackground);
44+
panelDeviceList.setBackground(StyleCompat.panelDarkBackground());
4445
panelDeviceList.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
4546
panelDeviceList.setLayout(new BoxLayout(panelDeviceList, BoxLayout.Y_AXIS));
4647

@@ -68,9 +69,9 @@ public DeviceGroupsPanel(ToolsPanel context, OpenRgbPlugin instance) {
6869
public void setupSettingsPanel() {
6970
panelSettings.removeAll();
7071
JLabel lblServerIp = new JLabel("OpenRGB Server IP:");
71-
lblServerIp.setForeground(Style.textColor);
72+
lblServerIp.setForeground(StyleCompat.textColor());
7273
JLabel lblServerPort = new JLabel("OpenRGB Port:");
73-
lblServerPort.setForeground(Style.textColor);
74+
lblServerPort.setForeground(StyleCompat.textColor());
7475

7576
JTextField fieldServerIp = new JTextField();
7677
fieldServerIp.setColumns(20);
@@ -86,7 +87,7 @@ public void setupSettingsPanel() {
8687

8788
boolean isConnected = instance.getOpenRGB().isConnected();
8889
JButton btnToggleClient = new JButton(isConnected ? "Disconnect" : "Connect");
89-
UiUtils.configureButton(btnToggleClient);
90+
UiUtilsCompat.configureButton(btnToggleClient);
9091
btnToggleClient.addActionListener(e -> {
9192
if(OpenRgbPlugin.getInstance().getOpenRGB().isConnected())
9293
OpenRgbPlugin.getInstance().disconnectOpenRGB();
@@ -95,17 +96,17 @@ public void setupSettingsPanel() {
9596
});
9697

9798
JLabel lblConnectionState = new JLabel("Client not connected");
98-
lblConnectionState.setForeground(Style.textColor);
99+
lblConnectionState.setForeground(StyleCompat.textColor());
99100
panelSettings.add(UserInterfaceUtil.createSettingBgr(panelSettings.getBackground(), btnToggleClient, lblConnectionState));
100101

101102
JCheckBox checkAutoConnect = new JCheckBox("Auto Connect");
102103
checkAutoConnect.setBackground(panelSettings.getBackground());
103-
checkAutoConnect.setForeground(Style.textColor);
104+
checkAutoConnect.setForeground(StyleCompat.textColor());
104105
checkAutoConnect.setSelected(instance.isAutoConnectEnabled());
105106
checkAutoConnect.addActionListener(e -> instance.setAutoConnectEnabled(checkAutoConnect.isSelected()));
106107

107108
JLabel lblInterval = new JLabel("Interval (sec):");
108-
lblInterval.setForeground(Style.textColor);
109+
lblInterval.setForeground(StyleCompat.textColor());
109110

110111
NumberFormatter intervalFormatter = UserInterfaceUtil.getIntFieldFormatter();
111112
intervalFormatter.setMinimum(1);
@@ -162,19 +163,19 @@ public void mouseClicked(MouseEvent e) {
162163

163164
boolean activeDevice = instance.getEnabledHandler().contains(handler);
164165
if(activeDevice) {
165-
el.setBorder(new CompoundBorder(BorderFactory.createLineBorder(Style.accent), el.getBorder()));
166+
el.setBorder(new CompoundBorder(BorderFactory.createLineBorder(StyleCompat.accent()), el.getBorder()));
166167
}
167168

168169
JLabel lblName = new JLabel(handler.getName());
169-
lblName.setForeground(Style.textColor);
170+
lblName.setForeground(StyleCompat.textColor());
170171
el.add(lblName);
171172
el.add(Box.createHorizontalStrut(10));
172173

173174
if(activeDevice) {
174175
JLabel lblConnection = new JLabel(String.format("Enabled and attached to %s (%d LEDs)",
175176
handler.getVirtualOutput().getId(),
176177
handler.getTotalPixelNumber()));
177-
lblConnection.setForeground(Style.textColorDarker);
178+
lblConnection.setForeground(StyleCompat.textColorDarker());
178179
el.add(lblConnection);
179180
}
180181
el.add(Box.createHorizontalGlue());
@@ -199,7 +200,7 @@ public void mouseClicked(MouseEvent e) {
199200
elAdd.add(Box.createHorizontalStrut(5));
200201

201202
JLabel lblAdd = new JLabel("Add OpenRGB Device Group");
202-
lblAdd.setForeground(Style.textColor);
203+
lblAdd.setForeground(StyleCompat.textColor());
203204
elAdd.add(lblAdd);
204205

205206
elAdd.addMouseListener(new MouseAdapter() {
@@ -239,7 +240,7 @@ public static void configureBorderlessButton(JButton btn) {
239240
btn.setFocusable(true);
240241
btn.setOpaque(true);
241242
btn.setBackground(null);
242-
btn.setForeground(Style.textColor);
243+
btn.setForeground(StyleCompat.textColor());
243244
btn.setCursor(new Cursor(Cursor.HAND_CURSOR));
244245
}
245246

openrgb-plugin/src/main/java/de/lars/openrgbplugin/ui/SetupPanel.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
import de.lars.openrgbplugin.OutputHandler;
55
import de.lars.openrgbplugin.utils.UserInterfaceUtil;
66
import de.lars.openrgbplugin.utils.ValueHolder;
7-
import de.lars.remotelightclient.ui.Style;
87
import de.lars.remotelightclient.ui.components.ListElement;
98
import de.lars.remotelightclient.ui.panels.tools.ToolsNavListener;
109
import de.lars.remotelightclient.ui.panels.tools.ToolsPanel;
11-
import de.lars.remotelightclient.utils.ui.UiUtils;
1210
import de.lars.remotelightcore.devices.Device;
1311
import de.lars.remotelightcore.devices.virtual.VirtualOutput;
1412
import de.lars.remotelightcore.notification.Notification;
1513
import de.lars.remotelightcore.notification.NotificationType;
14+
import de.lars.remotelightplugincompat.StyleCompat;
15+
import de.lars.remotelightplugincompat.UiUtilsCompat;
1616

1717
import javax.swing.*;
1818
import java.awt.*;
@@ -40,11 +40,11 @@ public SetupPanel(ToolsPanel context, OutputHandler handler, DeviceGroupsPanel d
4040
else
4141
listDevices = new ArrayList<>();
4242

43-
setBackground(Style.panelBackground);
43+
setBackground(StyleCompat.panelBackground());
4444
setLayout(new BorderLayout());
4545

4646
panelSettings = new JPanel();
47-
panelSettings.setBackground(Style.panelDarkBackground);
47+
panelSettings.setBackground(StyleCompat.panelDarkBackground());
4848
panelSettings.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
4949
panelSettings.setLayout(new BoxLayout(panelSettings, BoxLayout.Y_AXIS));
5050

@@ -64,13 +64,13 @@ public SetupPanel(ToolsPanel context, OutputHandler handler, DeviceGroupsPanel d
6464
*/
6565
private void initSettingsPanel() {
6666
JLabel lblName = new JLabel("Name:");
67-
lblName.setForeground(Style.textColor);
67+
lblName.setForeground(StyleCompat.textColor());
6868

6969
JTextField fieldName = new JTextField(20);
7070
panelSettings.add(UserInterfaceUtil.createSettingBgr(lblName, fieldName));
7171

7272
JLabel lblVirtOutput = new JLabel("VirtualOutput:");
73-
lblVirtOutput.setForeground(Style.textColor);
73+
lblVirtOutput.setForeground(StyleCompat.textColor());
7474

7575
JComboBox<String> comboVirtOutputs = new JComboBox<>();
7676
for(Device device : instance.getInterface().getDeviceManager().getDevices()) {
@@ -86,12 +86,12 @@ private void initSettingsPanel() {
8686
panelSettings.add(UserInterfaceUtil.createSettingBgr(lblVirtOutput, comboVirtOutputs));
8787

8888
JLabel lblDeviceId = new JLabel("OpenRGB Device ID (index):");
89-
lblDeviceId.setForeground(Style.textColor);
89+
lblDeviceId.setForeground(StyleCompat.textColor());
9090

9191
JFormattedTextField fieldDeviceId = new JFormattedTextField(UserInterfaceUtil.getIntFieldFormatter());
9292
fieldDeviceId.setColumns(5);
9393
JButton btnAddDeviceId = new JButton("Add device");
94-
UiUtils.configureButton(btnAddDeviceId);
94+
UiUtilsCompat.configureButton(btnAddDeviceId);
9595
btnAddDeviceId.addActionListener(e -> {
9696
if(fieldDeviceId.getValue() == null) return;
9797
int value = (int) fieldDeviceId.getValue();
@@ -111,10 +111,10 @@ private void initSettingsPanel() {
111111
int deviceCount = instance.getOpenRGB().getControllerCount();
112112

113113
JLabel lblCountInfo = new JLabel("There are " + deviceCount + " devices available.");
114-
lblCountInfo.setForeground(Style.textColor);
114+
lblCountInfo.setForeground(StyleCompat.textColor());
115115

116116
JButton btnAddAll = new JButton("Add all");
117-
UiUtils.configureButton(btnAddAll);
117+
UiUtilsCompat.configureButton(btnAddAll);
118118
btnAddAll.addActionListener(e -> {
119119
for(int i = 0; i < deviceCount; i++) {
120120
if(!listDevices.contains(i))
@@ -124,7 +124,7 @@ private void initSettingsPanel() {
124124
});
125125

126126
JButton btnRemoveAll = new JButton("Remove all");
127-
UiUtils.configureButton(btnRemoveAll);
127+
UiUtilsCompat.configureButton(btnRemoveAll);
128128
btnRemoveAll.addActionListener(e -> {
129129
listDevices.clear();
130130
updateDeviceListPanel();
@@ -135,12 +135,12 @@ private void initSettingsPanel() {
135135
} else {
136136
// show hint message
137137
JLabel lblHint = new JLabel("(i) Go back and connect the client to receive live data from the SDK server.");
138-
lblHint.setForeground(Style.textColorDarker);
138+
lblHint.setForeground(StyleCompat.textColorDarker());
139139
panelSettings.add(UserInterfaceUtil.createSettingBgr(lblHint));
140140
}
141141

142142
panelDeviceList = new JPanel();
143-
panelDeviceList.setBackground(Style.panelDarkBackground);
143+
panelDeviceList.setBackground(StyleCompat.panelDarkBackground());
144144
panelDeviceList.setLayout(new BoxLayout(panelDeviceList, BoxLayout.Y_AXIS));
145145
panelDeviceList.setAlignmentX(Component.LEFT_ALIGNMENT);
146146
panelSettings.add(Box.createVerticalStrut(10));
@@ -153,7 +153,7 @@ private void initSettingsPanel() {
153153
}
154154

155155
JButton btnAdd = new JButton(handler == null ? "Add OpenRGB Device" : "Save OpenRGB Device");
156-
UiUtils.configureButton(btnAdd);
156+
UiUtilsCompat.configureButton(btnAdd);
157157
btnAdd.setAlignmentX(Component.LEFT_ALIGNMENT);
158158
btnAdd.setMaximumSize(new Dimension(Integer.MAX_VALUE, 50));
159159
btnAdd.setMinimumSize(new Dimension(100, 50));
@@ -231,7 +231,7 @@ private void updateDeviceListPanel() {
231231
panelDeviceList.add(Box.createVerticalStrut(5));
232232

233233
JLabel lblDeviceId = new JLabel("Device #" + deviceId);
234-
lblDeviceId.setForeground(Style.textColor);
234+
lblDeviceId.setForeground(StyleCompat.textColor());
235235
el.add(lblDeviceId);
236236

237237
if(isConnected) {
@@ -240,15 +240,15 @@ private void updateDeviceListPanel() {
240240
if(deviceId >= controllerCount) {
241241
// invalid device id
242242
JLabel lblError = new JLabel("Invalid device ID. Available devices up to ID " + (controllerCount-1));
243-
lblError.setForeground(Style.error);
243+
lblError.setForeground(StyleCompat.error());
244244
el.add(lblError);
245245
} else {
246246
de.lars.openrgbwrapper.Device device = instance.getOpenRGB().getControllerData(deviceId);
247247
String text = String.format("%s (%s), %d LEDs",
248248
device.name, device.type.name(), device.leds.length);
249249

250250
JLabel lblInfo = new JLabel(text);
251-
lblInfo.setForeground(Style.textColorDarker);
251+
lblInfo.setForeground(StyleCompat.textColorDarker());
252252
lblInfo.setMaximumSize(new Dimension(800, lblInfo.getPreferredSize().height));
253253
el.add(lblInfo);
254254
}
@@ -313,7 +313,7 @@ private void configurePanelButton(JButton btn) {
313313
btn.setFocusPainted(false);
314314
btn.setBorderPainted(false);
315315
btn.setBorder(null);
316-
btn.setForeground(btn.isEnabled() ? Style.textColor : Style.textColorDarker);
316+
btn.setForeground(btn.isEnabled() ? StyleCompat.textColor() : StyleCompat.textColorDarker());
317317
btn.setCursor(new Cursor(Cursor.HAND_CURSOR));
318318
btn.setFont(new Font(Font.DIALOG, Font.PLAIN, 13));
319319
}

openrgb-plugin/src/main/java/de/lars/openrgbplugin/utils/UserInterfaceUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package de.lars.openrgbplugin.utils;
22

3-
import de.lars.remotelightclient.ui.Style;
3+
import de.lars.remotelightplugincompat.StyleCompat;
44

55
import javax.swing.*;
66
import javax.swing.text.NumberFormatter;
@@ -23,7 +23,7 @@ public static JPanel createSettingBgr(Color background, JComponent... components
2323
}
2424

2525
public static JPanel createSettingBgr(JComponent... components) {
26-
return createSettingBgr(Style.panelBackground, components);
26+
return createSettingBgr(StyleCompat.panelBackground(), components);
2727
}
2828

2929
public static NumberFormatter getIntFieldFormatter() {

openrgb-plugin/src/main/resources/plugin.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ main=de.lars.openrgbplugin.OpenRgbPlugin
22
name=OpenRGB-Plugin
33
displayname=OpenRGB Plugin
44
author=Lars (~Drumber)
5-
version=1.3.2
5+
version=1.4
66
scope=swing
77
minVersion=v0.2.5-beta

openrgb-wrapper/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<artifactId>OpenRGB-Plugin</artifactId>
99
<groupId>de.lars</groupId>
10-
<version>1.3.2</version>
10+
<version>1.4</version>
1111
</parent>
1212

1313
<artifactId>openrgb-wrapper</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>de.lars</groupId>
88
<artifactId>OpenRGB-Plugin</artifactId>
99
<packaging>pom</packaging>
10-
<version>1.3.2</version>
10+
<version>1.4</version>
1111

1212
<modules>
1313
<module>openrgb-wrapper</module>

0 commit comments

Comments
 (0)