Changeset 1175 for trunk


Ignore:
Timestamp:
09/28/18 10:23:49 (6 years ago)
Author:
bln4
Message:

org.expeditee.gui.PopupManager ->

Temporarily comments out the code to paint popups while that system is not functional.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/PopupManager.java

    r1144 r1175  
    4343        {
    4444                // Only valid for Swing ecosystems
    45                 if (EcosystemManager.getType() != Ecosystem.Swing) return null;
     45                if (EcosystemManager.getType() != Ecosystem.Swing) {
     46                        return null;
     47                }
    4648               
    4749                // Construct the instance
    48                 if (_instance == null) _instance = new PopupManager();
     50                if (_instance == null) {
     51                        _instance = new PopupManager();
     52                }
    4953               
    5054                return _instance;
     
    6569        public void add(Popup p)
    6670        {
    67                 if (p == null) return;
    68 
    69                 synchronized(_popups) {
    70                         if (!_popups.contains(p)) _popups.add(p);
    71                 }
     71                if (p == null) {
     72                        return;
     73                }
     74
     75                 synchronized(_popups) {
     76                         if (!_popups.contains(p)) {
     77                                _popups.add(p);
     78                        }
     79                 }
    7280        }
    7381       
    7482        public void remove(Popup p)
    7583        {
    76                 if (p == null) return;
    77 
    78                 synchronized(_popups) {
    79                         if (_popups.contains(p)) _popups.remove(p);
     84                if (p == null) {
     85                        return;
     86                }
     87
     88                synchronized(_popups) {
     89                        if (_popups.contains(p)) {
     90                                _popups.remove(p);
     91                        }
    8092                }
    8193        }
     
    100112        public boolean isPointOverPopup(Point p)
    101113        {
    102                 if (p == null) throw new NullPointerException("p");
     114                if (p == null) {
     115                        throw new NullPointerException("p");
     116                }
    103117
    104118                synchronized(_popups) {
    105119                        for (Popup popup : _popups) {
    106                                 if (popup.getBounds().contains(p)) return true;
     120                                if (popup.getBounds().contains(p)) {
     121                                        return true;
     122                                }
    107123                        }
    108124                }
     
    124140        public boolean isShowing(Popup p)
    125141        {
    126                 if (p == null) throw new NullPointerException("p");
     142                if (p == null) {
     143                        throw new NullPointerException("p");
     144                }
    127145
    128146                synchronized(_popups) {
     
    146164                synchronized(_popups) {
    147165                        for (Popup p : _popups) {
    148                                 if (p.doesAutoHide()) p.hide();
     166                                if (p.doesAutoHide()) {
     167                                        p.hide();
     168                                }
    149169                        }
    150170                }
     
    160180                synchronized(_popups) {
    161181                        for (Popup p : _popups) {
    162                                 if (p.shouldConsumeBackClick()) return true;
     182                                if (p.shouldConsumeBackClick()) {
     183                                        return true;
     184                                }
    163185                        }
    164186                }
     
    167189        }
    168190       
     191        @Override
    169192        public void frameChanged()
    170193        {
     
    176199        public void paint()
    177200        {
    178                 synchronized (_popups) {
    179                         for (Popup popup : _popups) {
    180                                 popup.update();
    181                                 popup.paint();
    182                         }
    183                 }
     201                //Bryce: popups temporarly disabled due to them not working and interfering in things.
     202//              synchronized (_popups) {
     203//                      for (Popup popup : _popups) {
     204//                              popup.update();
     205//                              popup.paint();
     206//                      }
     207//              }
    184208        }
    185209       
     
    235259                public void hide()
    236260                {
    237                         if (!_showing) return;
     261                        if (!_showing) {
     262                                return;
     263                        }
    238264                       
    239265                        _showing = false;
     
    243269                public void show()
    244270                {
    245                         if (_showing) return;
     271                        if (_showing) {
     272                                return;
     273                        }
    246274                       
    247275                        _showing = true;
     
    329357                       
    330358                        float percentShown = getProgress();
    331                         if (!isShowing()) percentShown = 1 - percentShown;
     359                        if (!isShowing()) {
     360                                percentShown = 1 - percentShown;
     361                        }
    332362                       
    333363                        return AxisAlignedBoxBounds.lerp(_initialBounds, fullBounds, percentShown);
Note: See TracChangeset for help on using the changeset viewer.