Changeset 1987 in josm for trunk/src/org
- Timestamp:
- 2009-08-23T17:45:53+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
r1890 r1987 65 65 final JDialog dlg = optionPane.createDialog(Main.parent, tr("Rename layer")); 66 66 dlg.setModal(true); 67 try {68 dlg.setAlwaysOnTop(true);69 } catch(SecurityException ex) {70 System.out.println(tr("Warning: failed to put a dialog always on top. Exception was: {0}", ex.toString()));71 }72 dlg.toFront();73 67 dlg.setVisible(true); 74 68 -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r1902 r1987 139 139 setSize(d); 140 140 setLocationRelativeTo(parent); 141 142 // temporary fix for "#3181 : Dialogs causes JOSM window to be set as "always on top", preventing switchiong to143 // other windows."144 // See also {@see OptionPaneUtil}145 //146 if (Main.pref.getBoolean("window-handling.option-pane-always-on-top", true)) {147 // try to put always on top148 //149 try {150 setAlwaysOnTop(true);151 } catch(SecurityException e) {152 System.out.println(tr("Warning: failed to bring extended dialog always on top. Exception: {0}", e.toString()));153 }154 }155 141 } 156 142 -
trunk/src/org/openstreetmap/josm/gui/OptionPaneUtil.java
r1954 r1987 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.awt.Component; … … 27 25 * 28 26 */ 27 @Deprecated 29 28 public class OptionPaneUtil { 30 29 … … 41 40 */ 42 41 static protected void prepareDialog(JDialog dialog) { 43 44 // always on top can be disabled in a configuration option. This is necessary45 // for some WM on Linux, i.e. fluxbox. There, always-on-top propagates to the46 // parent window, i.e. the JOSM window itself.47 //48 42 // FIXME: this is a temporary solution. I'm still looking for an approach which 49 43 // works across all OS and WMs. Can we get rid of "always-on-top" in JOSM 50 44 // completely? 51 45 // 52 if (Main.pref.getBoolean("window-handling.option-pane-always-on-top", true)) {53 try {54 dialog.setAlwaysOnTop(true);55 } catch(SecurityException e) {56 System.out.println(tr("Warning: failed to put option pane dialog always on top. Exception was: {0}", e.toString()));57 }58 }59 46 dialog.setModal(true); 60 dialog.toFront();61 47 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 62 48 } -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r1861 r1987 55 55 } 56 56 }); 57 // make sure this dialog is always on top of the main JOSM window58 // and all the other windows (relation editors, detached dialogs, etc.)59 //60 try {61 setAlwaysOnTop(true);62 } catch(SecurityException e) {63 System.out.println(tr("Warning: failed to put ''please wait dialog'' always on top. Exception was: {0}", e.toString()));64 }65 57 } 66 58 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r1954 r1987 136 136 protected void build() { 137 137 updateTitle(); 138 try {139 setAlwaysOnTop(true);140 } catch(SecurityException e) {141 System.out.println(tr("Warning: couldn't setAlwaysOnTop(true) for ConflictResolution Dialog. Exception: {0}", e.toString()));142 }143 138 getContentPane().setLayout(new BorderLayout()); 144 139 -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r1970 r1987 208 208 }; 209 209 final JDialog dlg = optionPane.createDialog(Main.parent, tr("Change values?")); 210 try {211 dlg.setAlwaysOnTop(true);212 } catch(SecurityException e) {213 System.out.println(tr("Warning: failed to put properties dialog always on top. Exception was: {0}", e.toString()));214 }215 dlg.toFront();216 210 217 211 values.getEditor().addActionListener(new ActionListener() { … … 355 349 }; 356 350 JDialog dialog = pane.createDialog(Main.parent, tr("Change values?")); 357 try {358 dialog.setAlwaysOnTop(true);359 } catch(SecurityException e) {360 System.out.println(tr("Warning: failed to put dialog always on top. Exception was: {0}", e.toString()));361 }362 dialog.toFront();363 351 dialog.setVisible(true); 364 352 … … 481 469 String str = null; 482 470 switch (column) { 483 484 485 486 487 488 489 490 491 492 493 494 471 case 0: 472 str = (String) value; 473 break; 474 case 1: 475 Map<String, Integer> v = (Map<String,Integer>) value; 476 if (v.size()!=1) { 477 str=tr("<different>"); 478 c.setFont(c.getFont().deriveFont(Font.ITALIC)); 479 } else { 480 str=v.entrySet().iterator().next().getKey(); 481 } 482 break; 495 483 } 496 484 ((JLabel)c).setText(str); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r1861 r1987 163 163 public void actionPerformed(ActionEvent e) { 164 164 final JFrame f = new JFrame(name); 165 try {f.setAlwaysOnTop(true);}166 catch (SecurityException e1) {167 System.out.println(tr("Warning: failed to put toggle dialog always on top. Exception was: {0}", e1.toString()));168 }169 165 parent.remove(ToggleDialog.this); 170 166 f.getContentPane().add(ToggleDialog.this); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r1937 r1987 181 181 182 182 setSize(findMaxDialogSize()); 183 try {184 setAlwaysOnTop(true);185 } catch (SecurityException e) {186 logger.warning(tr("Caught security exception for setAlwaysOnTop(). Ignoring. Exception was: {0}", e187 .toString()));188 }189 183 190 184 addWindowListener( … … 689 683 ); 690 684 switch(ret) { 691 692 693 694 695 696 685 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION: return; 686 case JOptionPane.CLOSED_OPTION: return; 687 case JOptionPane.NO_OPTION: return; 688 case JOptionPane.YES_OPTION: 689 memberTableModel.removeMembersReferringTo(toCheck); 690 break; 697 691 } 698 692 } … … 727 721 ); 728 722 switch(ret) { 729 730 731 732 733 723 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION : return true; 724 case JOptionPane.YES_OPTION: return true; 725 case JOptionPane.NO_OPTION: return false; 726 case JOptionPane.CLOSED_OPTION: return false; 727 case JOptionPane.CANCEL_OPTION: throw new AddAbortException(); 734 728 } 735 729 // should not happen … … 1162 1156 ); 1163 1157 switch(ret) { 1164 1165 1166 1158 case JOptionPane.CANCEL_OPTION: return false; 1159 case JOptionPane.YES_OPTION: return true; 1160 case JOptionPane.NO_OPTION: return false; 1167 1161 } 1168 1162 return false; … … 1403 1397 ); 1404 1398 switch(ret) { 1405 1406 1407 1408 1399 case JOptionPane.YES_OPTION: return true; 1400 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION: return true; 1401 default: 1402 return false; 1409 1403 } 1410 1404 } -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java
r1861 r1987 69 69 public HistoryBrowserDialog(History history) { 70 70 super(JOptionPane.getFrameForComponent(Main.parent), false); 71 try {72 setAlwaysOnTop(true);73 } catch(SecurityException e) {74 System.out.println(tr("Warning: failed to put history browser always on top. Exception was: {0}", e.toString()));75 }76 71 build(); 77 72 setHistory(history);
Note:
See TracChangeset
for help on using the changeset viewer.