Changeset 1790 in josm for trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
- Timestamp:
- 2009-07-15T17:22:56+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r1661 r1790 95 95 96 96 button = new JButton(action); 97 if(buttonIcons != null && buttonIcons[i] != null) 97 if(buttonIcons != null && buttonIcons[i] != null) { 98 98 button.setIcon(ImageProvider.get(buttonIcons[i])); 99 } 99 100 100 if(i == 0) rootPane.setDefaultButton(button); 101 if(i == 0) { 102 rootPane.setDefaultButton(button); 103 } 101 104 buttonsPanel.add(button, GBC.std().insets(2,2,2,2)); 102 105 buttons.add(button); … … 120 123 boolean limitedInHeight = d.height > x.height; 121 124 122 if(x.width > 0 && d.width > x.width) d.width = x.width; 123 if(x.height > 0 && d.height > x.height) d.height = x.height; 125 if(x.width > 0 && d.width > x.width) { 126 d.width = x.width; 127 } 128 if(x.height > 0 && d.height > x.height) { 129 d.height = x.height; 130 } 124 131 125 132 // We have a vertical scrollbar and enough space to prevent a horizontal one 126 if(!limitedInWidth && limitedInHeight) 133 if(!limitedInWidth && limitedInHeight) { 127 134 d.width += new JScrollBar().getPreferredSize().width; 135 } 128 136 129 137 setSize(d); … … 161 169 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 162 170 Dimension x = new Dimension(Math.round(screenSize.width*2/3), 163 171 Math.round(screenSize.height*2/3)); 164 172 try { 165 if(parent != null) 173 if(parent != null) { 166 174 x = JOptionPane.getFrameForComponent(parent).getSize(); 175 } 167 176 } catch(NullPointerException e) { } 168 177 return x; … … 184 193 185 194 rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) 186 195 .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); 187 196 rootPane.getActionMap().put("ESCAPE", actionListener); 188 197 }
Note:
See TracChangeset
for help on using the changeset viewer.