Skip to content

Commit e78fa98

Browse files
authored
Add popup that robotbuilder is deprecated (#641)
Similar to pathweaver
1 parent 0c06bc8 commit e78fa98

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
package robotbuilder;
3+
4+
import java.awt.Font;
5+
6+
import javax.swing.Box;
7+
import javax.swing.BoxLayout;
8+
import javax.swing.JButton;
9+
import javax.swing.JFrame;
10+
import javax.swing.JLabel;
11+
12+
public class DeprecatedDialog extends CenteredDialog {
13+
14+
public DeprecatedDialog(JFrame parent, String applicationName) {
15+
super(parent, applicationName);
16+
Box deprecatedWindow = new Box(BoxLayout.Y_AXIS);
17+
deprecatedWindow.add(new JLabel("Warning: RobotBuilder is deprecated and will not be updated to generate projects for 2027 "));
18+
deprecatedWindow.add(Box.createVerticalStrut(15));
19+
ButtonBox buttonBox = new ButtonBox(BoxLayout.X_AXIS);
20+
JButton okButton = new JButton("OK");
21+
this.getRootPane().setDefaultButton(okButton);
22+
okButton.addActionListener(e -> setVisible(false));
23+
buttonBox.add(okButton);
24+
deprecatedWindow.add(buttonBox);
25+
this.getContentPane().add(deprecatedWindow, "Center");
26+
this.pack();
27+
}
28+
}

src/main/java/robotbuilder/MainFrame.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class MainFrame extends JFrame {
3232
JToolBar toolBar;
3333
StatusPanel statusPanel;
3434
NewProjectDialog newProjectDialog;
35+
DeprecatedDialog deprecatedDialog;
3536
private static MainFrame instance = null;
3637
public Preferences prefs;
3738

@@ -104,6 +105,9 @@ public void windowClosing(WindowEvent e) {
104105
statusPanel = new StatusPanel();
105106
add(statusPanel, BorderLayout.SOUTH);
106107

108+
deprecatedDialog = new DeprecatedDialog(this, "RobotBuilder");
109+
deprecatedDialog.setAlwaysOnTop(true);
110+
107111
newProjectDialog = new NewProjectDialog(null);
108112

109113
pack();
@@ -187,4 +191,8 @@ public void updateStatus() {
187191
public void showNewProjectDialog() {
188192
newProjectDialog.display();
189193
}
194+
195+
public void showDeprecatedDialog() {
196+
deprecatedDialog.setVisible(true);
197+
}
190198
}

src/main/java/robotbuilder/RobotBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static void main(String[] args) {
5151
}
5252
Extensions.init();
5353
MainFrame frame = MainFrame.getInstance();
54+
frame.showDeprecatedDialog();
5455
frame.openDefaultFile();
5556
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
5657
try {

0 commit comments

Comments
 (0)