Changeset 1175 for trunk/src/org/expeditee/gui
- Timestamp:
- 09/28/18 10:23:49 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/PopupManager.java
r1144 r1175 43 43 { 44 44 // Only valid for Swing ecosystems 45 if (EcosystemManager.getType() != Ecosystem.Swing) return null; 45 if (EcosystemManager.getType() != Ecosystem.Swing) { 46 return null; 47 } 46 48 47 49 // Construct the instance 48 if (_instance == null) _instance = new PopupManager(); 50 if (_instance == null) { 51 _instance = new PopupManager(); 52 } 49 53 50 54 return _instance; … … 65 69 public void add(Popup p) 66 70 { 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 } 72 80 } 73 81 74 82 public void remove(Popup p) 75 83 { 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 } 80 92 } 81 93 } … … 100 112 public boolean isPointOverPopup(Point p) 101 113 { 102 if (p == null) throw new NullPointerException("p"); 114 if (p == null) { 115 throw new NullPointerException("p"); 116 } 103 117 104 118 synchronized(_popups) { 105 119 for (Popup popup : _popups) { 106 if (popup.getBounds().contains(p)) return true; 120 if (popup.getBounds().contains(p)) { 121 return true; 122 } 107 123 } 108 124 } … … 124 140 public boolean isShowing(Popup p) 125 141 { 126 if (p == null) throw new NullPointerException("p"); 142 if (p == null) { 143 throw new NullPointerException("p"); 144 } 127 145 128 146 synchronized(_popups) { … … 146 164 synchronized(_popups) { 147 165 for (Popup p : _popups) { 148 if (p.doesAutoHide()) p.hide(); 166 if (p.doesAutoHide()) { 167 p.hide(); 168 } 149 169 } 150 170 } … … 160 180 synchronized(_popups) { 161 181 for (Popup p : _popups) { 162 if (p.shouldConsumeBackClick()) return true; 182 if (p.shouldConsumeBackClick()) { 183 return true; 184 } 163 185 } 164 186 } … … 167 189 } 168 190 191 @Override 169 192 public void frameChanged() 170 193 { … … 176 199 public void paint() 177 200 { 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 // } 184 208 } 185 209 … … 235 259 public void hide() 236 260 { 237 if (!_showing) return; 261 if (!_showing) { 262 return; 263 } 238 264 239 265 _showing = false; … … 243 269 public void show() 244 270 { 245 if (_showing) return; 271 if (_showing) { 272 return; 273 } 246 274 247 275 _showing = true; … … 329 357 330 358 float percentShown = getProgress(); 331 if (!isShowing()) percentShown = 1 - percentShown; 359 if (!isShowing()) { 360 percentShown = 1 - percentShown; 361 } 332 362 333 363 return AxisAlignedBoxBounds.lerp(_initialBounds, fullBounds, percentShown);
Note:
See TracChangeset
for help on using the changeset viewer.