Changeset 10109 in josm for trunk/src/org
- Timestamp:
- 2016-04-04T23:13:08+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r9942 r10109 242 242 243 243 /** 244 * replies the tag table model for the respective point in time244 * Replies the tag table model for the respective point in time. 245 245 * 246 246 * @param pointInTimeType the type of the point in time (must not be null) … … 252 252 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 253 253 return currentTagTableModel; 254 else if (pointInTimeType.equals(PointInTimeType.REFERENCE_POINT_IN_TIME))254 else // REFERENCE_POINT_IN_TIME 255 255 return referenceTagTableModel; 256 257 // should not happen 258 return null; 259 } 260 256 } 257 258 /** 259 * Replies the node list table model for the respective point in time. 260 * 261 * @param pointInTimeType the type of the point in time (must not be null) 262 * @return the node list table model 263 * @throws IllegalArgumentException if pointInTimeType is null 264 */ 261 265 public DiffTableModel getNodeListTableModel(PointInTimeType pointInTimeType) { 262 266 CheckParameterUtil.ensureParameterNotNull(pointInTimeType, "pointInTimeType"); 263 267 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 264 268 return currentNodeListTableModel; 265 else if (pointInTimeType.equals(PointInTimeType.REFERENCE_POINT_IN_TIME))269 else // REFERENCE_POINT_IN_TIME 266 270 return referenceNodeListTableModel; 267 268 // should not happen 269 return null; 270 } 271 271 } 272 273 /** 274 * Replies the relation member table model for the respective point in time. 275 * 276 * @param pointInTimeType the type of the point in time (must not be null) 277 * @return the relation member table model 278 * @throws IllegalArgumentException if pointInTimeType is null 279 */ 272 280 public DiffTableModel getRelationMemberTableModel(PointInTimeType pointInTimeType) { 273 281 CheckParameterUtil.ensureParameterNotNull(pointInTimeType, "pointInTimeType"); 274 282 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 275 283 return currentRelationMemberTableModel; 276 else if (pointInTimeType.equals(PointInTimeType.REFERENCE_POINT_IN_TIME))284 else // REFERENCE_POINT_IN_TIME 277 285 return referenceRelationMemberTableModel; 278 279 // should not happen280 return null;281 286 } 282 287 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r10035 r10109 8 8 import java.awt.Component; 9 9 import java.awt.Font; 10 import java.awt.GraphicsEnvironment; 10 11 import java.awt.GridBagLayout; 11 12 import java.awt.event.MouseAdapter; … … 95 96 public boolean editPreference(final JComponent gui) { 96 97 if (getSelectedRowCount() != 1) { 97 JOptionPane.showMessageDialog( 98 gui, 99 tr("Please select the row to edit."), 100 tr("Warning"), 101 JOptionPane.WARNING_MESSAGE 102 ); 98 if (!GraphicsEnvironment.isHeadless()) { 99 JOptionPane.showMessageDialog( 100 gui, 101 tr("Please select the row to edit."), 102 tr("Warning"), 103 JOptionPane.WARNING_MESSAGE 104 ); 105 } 103 106 return false; 104 107 } … … 122 125 } 123 126 124 static boolean doEditList(final JComponent gui, final PrefEntry e, ListSetting lSetting) {127 private static boolean doEditList(final JComponent gui, final PrefEntry e, ListSetting lSetting) { 125 128 ListEditor lEditor = new ListEditor(gui, e, lSetting); 126 129 lEditor.showDialog(); … … 135 138 } 136 139 137 static boolean doEditListList(final JComponent gui, final PrefEntry e, ListListSetting llSetting) {140 private static boolean doEditListList(final JComponent gui, final PrefEntry e, ListListSetting llSetting) { 138 141 ListListEditor llEditor = new ListListEditor(gui, e, llSetting); 139 142 llEditor.showDialog(); … … 148 151 } 149 152 150 static boolean doEditMapList(final JComponent gui, final PrefEntry e, MapListSetting mlSetting) {153 private static boolean doEditMapList(final JComponent gui, final PrefEntry e, MapListSetting mlSetting) { 151 154 MapListEditor mlEditor = new MapListEditor(gui, e, mlSetting); 152 155 mlEditor.showDialog(); … … 192 195 rbString.setSelected(true); 193 196 194 ExtendedDialog dlg = new ExtendedDialog(gui, tr("Add setting"), new String[] {tr("OK"), tr("Cancel")});195 dlg.setButtonIcons(new String[] {"ok.png", "cancel.png"});196 dlg.setContent(p);197 dlg.showDialog();198 199 197 PrefEntry pe = null; 200 198 boolean ok = false; 201 if ( dlg.getValue() == 1) {199 if (!GraphicsEnvironment.isHeadless() && askAddSetting(gui, p)) { 202 200 if (rbString.isSelected()) { 203 201 StringSetting sSetting = new StringSetting(null); … … 221 219 } 222 220 223 static boolean doAddSimple(final JComponent gui, PrefEntry pe, StringSetting sSetting) { 221 private static boolean askAddSetting(JComponent gui, JPanel p) { 222 return new ExtendedDialog(gui, tr("Add setting"), new String[] {tr("OK"), tr("Cancel")}) 223 .setContent(p).setButtonIcons(new String[] {"ok.png", "cancel.png"}).showDialog().getValue() == 1; 224 } 225 226 private static boolean doAddSimple(final JComponent gui, PrefEntry pe, StringSetting sSetting) { 224 227 StringEditor sEditor = new StringEditor(gui, pe, sSetting); 225 228 sEditor.showDialog(); … … 234 237 } 235 238 236 static boolean doAddList(final JComponent gui, PrefEntry pe, ListSetting lSetting) {239 private static boolean doAddList(final JComponent gui, PrefEntry pe, ListSetting lSetting) { 237 240 ListEditor lEditor = new ListEditor(gui, pe, lSetting); 238 241 lEditor.showDialog(); … … 247 250 } 248 251 249 static boolean doAddListList(final JComponent gui, PrefEntry pe, ListListSetting llSetting) {252 private static boolean doAddListList(final JComponent gui, PrefEntry pe, ListListSetting llSetting) { 250 253 ListListEditor llEditor = new ListListEditor(gui, pe, llSetting); 251 254 llEditor.showDialog(); … … 260 263 } 261 264 262 static boolean doAddMapList(final JComponent gui, PrefEntry pe, MapListSetting mlSetting) {265 private static boolean doAddMapList(final JComponent gui, PrefEntry pe, MapListSetting mlSetting) { 263 266 MapListEditor mlEditor = new MapListEditor(gui, pe, mlSetting); 264 267 mlEditor.showDialog(); … … 279 282 public void resetPreferences(final JComponent gui) { 280 283 if (getSelectedRowCount() == 0) { 281 JOptionPane.showMessageDialog( 282 gui, 283 tr("Please select the row to delete."), 284 tr("Warning"), 285 JOptionPane.WARNING_MESSAGE 286 ); 284 if (!GraphicsEnvironment.isHeadless()) { 285 JOptionPane.showMessageDialog( 286 gui, 287 tr("Please select the row to delete."), 288 tr("Warning"), 289 JOptionPane.WARNING_MESSAGE 290 ); 291 } 287 292 return; 288 293 } … … 294 299 } 295 300 296 privateclass AllSettingsTableModel extends DefaultTableModel {301 final class AllSettingsTableModel extends DefaultTableModel { 297 302 298 303 AllSettingsTableModel() { … … 329 334 } 330 335 331 private staticclass SettingCellRenderer extends DefaultTableCellRenderer {336 static final class SettingCellRenderer extends DefaultTableCellRenderer { 332 337 private final Color backgroundColor = UIManager.getColor("Table.background"); 333 338 private final Color changedColor = Main.pref.getColor( … … 374 379 } 375 380 376 private staticclass SettingCellEditor extends DefaultCellEditor {381 static final class SettingCellEditor extends DefaultCellEditor { 377 382 SettingCellEditor() { 378 383 super(new JosmTextField());
Note:
See TracChangeset
for help on using the changeset viewer.