Ignore:
Timestamp:
2009-08-23T17:45:53+02:00 (15 years ago)
Author:
Gubaer
Message:

removed all occurences of setAlwaysOnTop(). See http://josm.openstreetmap.de/wiki/JosmWinMgtDemoApplication

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r1902 r1987  
    139139        setSize(d);
    140140        setLocationRelativeTo(parent);
    141 
    142         // temporary fix for "#3181 : Dialogs causes JOSM window to be set as "always on top", preventing switchiong to
    143         // 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 top
    148             //
    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         }
    155141    }
    156142
  • trunk/src/org/openstreetmap/josm/gui/OptionPaneUtil.java

    r1954 r1987  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.awt.Component;
     
    2725 *
    2826 */
     27@Deprecated
    2928public class OptionPaneUtil {
    3029
     
    4140     */
    4241    static protected void prepareDialog(JDialog dialog) {
    43 
    44         // always on top can be disabled in a configuration option. This is necessary
    45         // for some WM on Linux, i.e. fluxbox. There, always-on-top propagates to the
    46         // parent window, i.e. the JOSM window itself.
    47         //
    4842        // FIXME: this is a temporary solution. I'm still looking for an approach which
    4943        // works across all OS and WMs. Can we get rid of "always-on-top" in JOSM
    5044        // completely?
    5145        //
    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         }
    5946        dialog.setModal(true);
    60         dialog.toFront();
    6147        dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    6248    }
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r1861 r1987  
    5555            }
    5656        });
    57         // make sure this dialog is always on top of the main JOSM window
    58         // 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         }
    6557    }
    6658
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r1954 r1987  
    136136    protected void build() {
    137137        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         }
    143138        getContentPane().setLayout(new BorderLayout());
    144139
  • trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r1970 r1987  
    208208        };
    209209        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();
    216210
    217211        values.getEditor().addActionListener(new ActionListener() {
     
    355349        };
    356350        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();
    363351        dialog.setVisible(true);
    364352
     
    481469                    String str = null;
    482470                    switch (column) {
    483                         case 0:
    484                             str = (String) value;
    485                             break;
    486                         case 1:
    487                             Map<String, Integer> v = (Map<String,Integer>) value;
    488                             if (v.size()!=1) {
    489                                 str=tr("<different>");
    490                                 c.setFont(c.getFont().deriveFont(Font.ITALIC));
    491                             } else {
    492                                 str=v.entrySet().iterator().next().getKey();
    493                             }
    494                             break;
     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;
    495483                    }
    496484                    ((JLabel)c).setText(str);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r1861 r1987  
    163163            public void actionPerformed(ActionEvent e) {
    164164                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                 }
    169165                parent.remove(ToggleDialog.this);
    170166                f.getContentPane().add(ToggleDialog.this);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r1937 r1987  
    181181
    182182        setSize(findMaxDialogSize());
    183         try {
    184             setAlwaysOnTop(true);
    185         } catch (SecurityException e) {
    186             logger.warning(tr("Caught security exception for setAlwaysOnTop(). Ignoring. Exception was: {0}", e
    187                     .toString()));
    188         }
    189183
    190184        addWindowListener(
     
    689683            );
    690684            switch(ret) {
    691                 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION: return;
    692                 case JOptionPane.CLOSED_OPTION: return;
    693                 case JOptionPane.NO_OPTION: return;
    694                 case JOptionPane.YES_OPTION:
    695                     memberTableModel.removeMembersReferringTo(toCheck);
    696                     break;
     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;
    697691            }
    698692        }
     
    727721            );
    728722            switch(ret) {
    729                 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION : return true;
    730                 case JOptionPane.YES_OPTION: return true;
    731                 case JOptionPane.NO_OPTION: return false;
    732                 case JOptionPane.CLOSED_OPTION: return false;
    733                 case JOptionPane.CANCEL_OPTION: throw new AddAbortException();
     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();
    734728            }
    735729            // should not happen
     
    11621156            );
    11631157            switch(ret) {
    1164                 case JOptionPane.CANCEL_OPTION: return false;
    1165                 case JOptionPane.YES_OPTION: return true;
    1166                 case JOptionPane.NO_OPTION: return false;
     1158            case JOptionPane.CANCEL_OPTION: return false;
     1159            case JOptionPane.YES_OPTION: return true;
     1160            case JOptionPane.NO_OPTION: return false;
    11671161            }
    11681162            return false;
     
    14031397            );
    14041398            switch(ret) {
    1405                 case JOptionPane.YES_OPTION: return true;
    1406                 case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION: return true;
    1407                 default:
    1408                     return false;
     1399            case JOptionPane.YES_OPTION: return true;
     1400            case ConditionalOptionPaneUtil.DIALOG_DISABLED_OPTION: return true;
     1401            default:
     1402                return false;
    14091403            }
    14101404        }
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java

    r1861 r1987  
    6969    public HistoryBrowserDialog(History history) {
    7070        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         }
    7671        build();
    7772        setHistory(history);
Note: See TracChangeset for help on using the changeset viewer.