Changeset 2676 in josm for trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
- Timestamp:
- 2009-12-24T08:48:40+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
r2512 r2676 13 13 import java.awt.event.MouseAdapter; 14 14 import java.awt.event.MouseEvent; 15 16 15 import java.util.ArrayList; 17 16 import java.util.List; … … 145 144 int direction = scrollDirection; 146 145 147 if (component == null || direction == NO_SCROLL) {146 if (component == null || direction == NO_SCROLL) 148 147 return; 149 } 150 151 Dimension compSize = component.getSize(); 148 152 149 Rectangle viewRect = vp.getViewRect(); 153 150 … … 162 159 163 160 switch (direction) { 164 165 166 167 168 169 161 case UP_DIRECTION : 162 deltaY *= -1; 163 break; 164 case LEFT_DIRECTION : 165 deltaX *= -1; 166 break; 170 167 } 171 168 … … 173 170 } 174 171 public synchronized void scroll(int deltaX, int deltaY) { 175 if (component == null) {172 if (component == null) 176 173 return; 177 }178 174 Dimension compSize = component.getSize(); 179 175 Rectangle viewRect = vp.getViewRect(); … … 204 200 public void showOrHideButtons() { 205 201 boolean needButtons = vp.getViewSize().height > vp.getViewRect().height || 206 202 vp.getViewSize().width > vp.getViewRect().width; 207 203 for (JButton b : buttons) { 208 204 b.setVisible(needButtons);
Note:
See TracChangeset
for help on using the changeset viewer.