66import com .openfin .desktop .animation .OpacityTransition ;
77import com .openfin .desktop .animation .PositionTransition ;
88import info .clearthought .layout .TableLayout ;
9- import org .json .JSONObject ;
109
1110import javax .swing .*;
1211import javax .swing .event .ListSelectionEvent ;
@@ -53,7 +52,7 @@ public class OpenFinDesktopDemo extends JPanel implements ActionListener, Window
5352
5453 InterApplicationBus bus ;
5554
56- protected DesktopConnection controller ;
55+ protected DesktopConnection desktopConnection ;
5756 protected System openfinSystem ;
5857 protected AppCreateDialog appCreateDialog ;
5958 protected LoadAppsDialog loadAppsDialog ;
@@ -65,11 +64,11 @@ public class OpenFinDesktopDemo extends JPanel implements ActionListener, Window
6564
6665 public OpenFinDesktopDemo (final String securityRealm ) {
6766 try {
68- this .controller = new DesktopConnection ("OpenFinDesktopDemoJava" );
67+ this .desktopConnection = new DesktopConnection ("OpenFinDesktopDemoJava" );
6968 if (securityRealm != null ) {
70- this .controller .setRuntimeSecurityRealm (securityRealm );
69+ this .desktopConnection .setRuntimeSecurityRealm (securityRealm );
7170 }
72- this .controller .setAdditionalRuntimeArguments ("--v=1" ); // enable additional logging
71+ this .desktopConnection .setAdditionalRuntimeArguments ("--v=1" ); // enable additional logging
7372 } catch (DesktopException desktopError ) {
7473 desktopError .printStackTrace ();
7574 }
@@ -286,9 +285,9 @@ protected JScrollPane layoutStatusPanel() {
286285 }
287286
288287 private void closeWebSocket () {
289- if (controller != null && controller .isConnected ()) {
288+ if (desktopConnection != null && desktopConnection .isConnected ()) {
290289 try {
291- controller .disconnect ();
290+ desktopConnection .disconnect ();
292291 } catch (DesktopException e ) {
293292 e .printStackTrace ();
294293 }
@@ -348,9 +347,9 @@ public void run() {
348347
349348
350349 private void closeDesktop () {
351- if (controller != null && controller .isConnected ()) {
350+ if (desktopConnection != null && desktopConnection .isConnected ()) {
352351 try {
353- new System (controller ).exit ();
352+ new System (desktopConnection ).exit ();
354353// Application app = Application.wrap(this.startupUUID, this.desktopConnection);
355354// app.close();
356355 setMainButtonsEnabled (false );
@@ -380,8 +379,8 @@ public void run() {
380379
381380 private void createAdminApplication () throws DesktopException {
382381 updateMessagePanel ("Creating InterAppBus" );
383- bus = controller .getInterApplicationBus ();
384- openfinSystem = new System (controller );
382+ bus = desktopConnection .getInterApplicationBus ();
383+ openfinSystem = new System (desktopConnection );
385384 updateMessagePanel ("Connected to Desktop" );
386385 setMainButtonsEnabled (true );
387386
@@ -421,7 +420,7 @@ public void onReady() {
421420 public void onError (String reason ) {
422421 updateMessagePanel ("Connection failed: " + reason );
423422
424- if (!controller .isConnected ()) {
423+ if (!desktopConnection .isConnected ()) {
425424
426425 }
427426 }
@@ -438,7 +437,7 @@ public void onOutgoingMessage(String message) {
438437 };
439438
440439 try {
441- controller .connectToVersion ("stable" , listener , 10000 );
440+ desktopConnection .connectToVersion ("stable" , listener , 10000 );
442441 } catch (Exception ex ) {
443442 ex .printStackTrace ();
444443 }
@@ -610,7 +609,7 @@ private void setAppButtonsEnabled(boolean enabled) {
610609 }
611610
612611 private void createApplication (final ApplicationOptions options ) {
613- Application app = new Application (options , controller , new AckListener () {
612+ Application app = new Application (options , desktopConnection , new AckListener () {
614613 @ Override
615614 public void onSuccess (Ack ack ) {
616615 Application application = (Application ) ack .getSource ();
0 commit comments