Changeset 1314 for trunk


Ignore:
Timestamp:
04/16/19 09:52:23 (5 years ago)
Author:
bln4
Message:

Feedback is now provided during account creation. In order to achieve this a forced refresh for the message bay area has been added.
Upon login the existing preview area for messages is now cleared.

Location:
trunk/src/org/expeditee
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/Actions.java

    r1313 r1314  
    5050import org.expeditee.gui.FrameIO;
    5151import org.expeditee.gui.MessageBay;
     52import org.expeditee.gui.MessageBay.Progress;
    5253import org.expeditee.io.ExpReader;
    5354import org.expeditee.items.Item;
     
    378379                // Track progress
    379380                String message = "Creating new user account...";
     381                int progress = 0;
     382                int step = 20;
    380383
    381384                // Extract user details
     
    384387                String email = userdata.get(AuthenticationTag.Email);
    385388               
    386                 System.out.println(message + "Generating Keys.");
     389                Progress progressBar = MessageBay.displayProgress(message);
     390                try {
     391                        progressBar.UpdateMessage(message + "Generating Keys.", progress += step);
     392                } catch (Exception e) {
     393                        e.printStackTrace();
     394                }
     395                DisplayController.refreshBayArea();
    387396
    388397                // Generate keys
     
    401410                String privateKey = Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded());
    402411               
    403                 System.out.println(message + "Creating Profile Frameset.");
     412                try {
     413                        progressBar.UpdateMessage(message + "Creating Profile Frameset.", progress += step);
     414                } catch (Exception e) {
     415                        e.printStackTrace();
     416                }
     417                DisplayController.refreshBayArea();
    404418               
    405419                // Update in memory settings
     
    470484                }
    471485               
    472                 System.out.println(message + "Establishing user credentials.");
     486                try {
     487                        progressBar.UpdateMessage(message + "Establishing user credentials.", progress += step);
     488                } catch (Exception e) {
     489                        e.printStackTrace();
     490                }
     491                DisplayController.refreshBayArea();
    473492                               
    474493                // Create credentials
     
    489508                FrameIO.migrateFrame(credentialsFrame, destinationFile);
    490509               
    491                 System.out.println(message + "Creating Individual Space.");
     510                MessageBay.displayMessage(message + "Creating Individual Space.");
     511                DisplayController.refreshBayArea();
    492512               
    493513                // Copy private resources to personal area
     
    496516                File contactsDir = new File(personalResources.resolve("contacts").toAbsolutePath().toString());
    497517                contactsDir.mkdir();
    498                
    499                 System.out.println(message + "Creating Space For Dead Drops");
     518
     519                try {
     520                        progressBar.UpdateMessage(message + "Creating Space For Dead Drops.", progress += step);
     521                } catch (Exception e) {
     522                        e.printStackTrace();
     523                }
     524                DisplayController.refreshBayArea();
    500525               
    501526                File deadDropsDir = new File(personalResources.resolve("deaddrops").toAbsolutePath().toString());
     
    505530                AudioPathManager.activateAndScanAudioDir(); // ****
    506531               
    507                 System.out.println(message + "Done.");
     532                try {
     533                        progressBar.UpdateMessage(message + "Done.", progress += step);
     534                } catch (Exception e) {
     535                        e.printStackTrace();
     536                }
     537                DisplayController.refreshBayArea();
     538               
    508539        }
    509540
  • trunk/src/org/expeditee/auth/account/Authenticate.java

    r1303 r1314  
    8181                        // Update were we get our frames.
    8282                        UserSettings.setupDefaultFolders();
     83                        MessageBay.clear();
    8384                        MessageBay.updateFramesetLocation();
    8485                        MailBay.disconnect();
  • trunk/src/org/expeditee/gui/DisplayController.java

    r1258 r1314  
    13751375        }
    13761376       
    1377         /*
    1378          *
    1379          * Thread-safe rendering.
    1380          *
    1381          */
    1382 
     1377        public static void refreshBayArea() {
     1378                // Always get the clip as it clears at the same time
     1379                Clip clip = _damagedAreas.getClip();
     1380                GraphicsManager g = EcosystemManager.getGraphicsManager();
     1381                pushBayAreaUpdate(true, clip, g);
     1382        }
     1383       
    13831384        /**
    13841385         * Redraws the entire window. Shouldn't be called directly, instead use
     
    14411442                }
    14421443
     1444                pushBayAreaUpdate(useInvalidation, clip, g);
     1445               
     1446                // Draw any separator lines
     1447                g.drawLine(getMessageBaySeparatorLine(), SEPARATOR_COLOUR, SEPARATOR_STROKE);
     1448                g.drawLine(getTwinFramesSeparatorLine(), SEPARATOR_COLOUR, SEPARATOR_STROKE);
     1449               
     1450                // Paint any popups
     1451                if (PopupManager.getInstance() != null) {
     1452                        PopupManager.getInstance().paint();
     1453                }
     1454               
     1455                g.popDrawingSurface();
     1456                g.drawImage(_refreshBuffer, Point.ORIGIN);
     1457                return true;
     1458        }
     1459
     1460        private static void pushBayAreaUpdate(boolean useInvalidation, Clip clip, GraphicsManager g) {
    14431461                if (!isAudienceMode()) {
    14441462                        if (!isMailMode()) {
     
    14501468                        }
    14511469                }
    1452                
    1453                 // Draw any separator lines
    1454                 g.drawLine(getMessageBaySeparatorLine(), SEPARATOR_COLOUR, SEPARATOR_STROKE);
    1455                 g.drawLine(getTwinFramesSeparatorLine(), SEPARATOR_COLOUR, SEPARATOR_STROKE);
    1456                
    1457                 // Paint any popups
    1458                 if (PopupManager.getInstance() != null) {
    1459                         PopupManager.getInstance().paint();
    1460                 }
    1461                
    1462                 g.popDrawingSurface();
    1463                 g.drawImage(_refreshBuffer, Point.ORIGIN);
    1464                 return true;
    1465         }
    1466 
     1470        }
     1471       
    14671472        private static void paintMessageBay(boolean useInvalidation, Clip clip, GraphicsManager g) {
    14681473                Clip messageBayClip = null;
  • trunk/src/org/expeditee/gui/MessageBay.java

    r1304 r1314  
    165165                return _messageBuffer;
    166166        }
     167       
     168        public static void clear() {
     169                MessageBay._messageCount = 0;
     170                MessageBay._messages.clear();
     171        }
    167172
    168173        /** Updates the image buffer to reflect the current state of the message bay. */
Note: See TracChangeset for help on using the changeset viewer.