File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
src/main/java/robotbuilder Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments