- Timestamp:
- 2018-09-13T22:48:54+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
r14134 r14248 159 159 160 160 static void launch(Component parent, KeyStroke keystroke) { 161 Rectangle r = parent.getBounds(); 162 new RecentRelationsPopupMenu(getRecentRelationsOnActiveLayer(), keystroke).show(parent, r.x, r.y + r.height); 161 if (parent.isShowing()) { 162 Rectangle r = parent.getBounds(); 163 new RecentRelationsPopupMenu(getRecentRelationsOnActiveLayer(), keystroke).show(parent, r.x, r.y + r.height); 164 } 163 165 } 164 166 } -
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r12643 r14248 72 72 ((JMenuItem) c).getAction().actionPerformed(e); 73 73 } else { 74 if (source == null ) return;74 if (source == null || !source.isShowing()) return; 75 75 popup.show(source, source.getWidth()/2, source.getHeight()/2); 76 76 } -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r13832 r14248 682 682 })); 683 683 } 684 if (button != null ) {684 if (button != null && button.isShowing()) { 685 685 Rectangle bounds = button.getBounds(); 686 686 menu.show(button, bounds.x + bounds.width, 0); -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java
r14153 r14248 35 35 36 36 import org.openstreetmap.josm.gui.MainApplication; 37 import org.openstreetmap.josm.gui.MainFrame; 37 38 import org.openstreetmap.josm.gui.SideButton; 38 39 import org.openstreetmap.josm.gui.dialogs.IEnabledStateUpdating; … … 113 114 updateValues(); 114 115 if (e.getSource() == sideButton) { 115 popup.show(sideButton, 0, sideButton.getHeight()); 116 if (sideButton.isShowing()) { 117 popup.show(sideButton, 0, sideButton.getHeight()); 118 } 116 119 } else { 117 120 // Action can be trigger either by opacity button or by popup menu (in case toggle buttons are hidden). 118 121 // In that case, show it in the middle of screen (because opacityButton is not visible) 119 popup.show(MainApplication.getMainFrame(), 120 MainApplication.getMainFrame().getWidth() / 2, 121 (MainApplication.getMainFrame().getHeight() - popup.getHeight()) / 2); 122 MainFrame mainFrame = MainApplication.getMainFrame(); 123 if (mainFrame.isShowing()) { 124 popup.show(mainFrame, mainFrame.getWidth() / 2, (mainFrame.getHeight() - popup.getHeight()) / 2); 125 } 122 126 } 123 127 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r14153 r14248 967 967 action.actionPerformed(null); 968 968 if (SwingUtilities.isRightMouseButton(e)) { 969 new TagPopupMenu(t).show(e.getComponent(), e.getX(), e.getY()); 969 Component component = e.getComponent(); 970 if (component.isShowing()) { 971 new TagPopupMenu(t).show(component, e.getX(), e.getY()); 972 } 970 973 } else if (e.isShiftDown()) { 971 974 // add tags on Shift-Click -
trunk/src/org/openstreetmap/josm/gui/download/UserQueryList.java
r14146 r14248 323 323 if (model.getSize() == 0 || index == -1) { 324 324 list.clearSelection(); 325 emptySelectionPopup.show(list, e.getX(), e.getY()); 325 if (list.isShowing()) { 326 emptySelectionPopup.show(list, e.getX(), e.getY()); 327 } 326 328 } else { 327 329 list.setSelectedIndex(index); 328 330 list.ensureIndexIsVisible(index); 329 elementPopup.show(list, e.getX(), e.getY()); 331 if (list.isShowing()) { 332 elementPopup.show(list, e.getX(), e.getY()); 333 } 330 334 } 331 335 } -
trunk/src/org/openstreetmap/josm/gui/history/OpenChangesetPopupMenu.java
r14119 r14248 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Container; 6 7 import java.awt.Rectangle; 7 8 import java.awt.event.ActionEvent; … … 46 47 */ 47 48 public void show(final JComponent parent) { 48 final Rectangle r = parent.getBounds(); 49 show(parent.getParent(), r.x, r.y + r.height); 49 Container parentParent = parent.getParent(); 50 if (parentParent.isShowing()) { 51 final Rectangle r = parent.getBounds(); 52 show(parentParent, r.x, r.y + r.height); 53 } 50 54 } 51 55 -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r14153 r14248 5 5 6 6 import java.awt.Color; 7 import java.awt.Component; 7 8 import java.awt.Dimension; 8 9 import java.awt.Font; … … 191 192 if (!isVisible()) return; 192 193 if (e.getButton() == MouseEvent.BUTTON3) { 193 new TileSourceLayerPopup(e.getX(), e.getY()).show(e.getComponent(), e.getX(), e.getY()); 194 Component component = e.getComponent(); 195 if (component.isShowing()) { 196 new TileSourceLayerPopup(e.getX(), e.getY()).show(component, e.getX(), e.getY()); 197 } 194 198 } else if (e.getButton() == MouseEvent.BUTTON1) { 195 199 attribution.handleAttribution(e.getPoint(), true); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r14153 r14248 173 173 more.addActionListener(new ActionListener() { 174 174 private JPopupMenu menu = buildPopupMenu(); 175 @Override public void actionPerformed(ActionEvent ev) { 176 menu.show(more, 0, 0); 175 @Override 176 public void actionPerformed(ActionEvent ev) { 177 if (more.isShowing()) { 178 menu.show(more, 0, 0); 179 } 177 180 } 178 181 }); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java
r14153 r14248 106 106 Point p = pointerInfo.getLocation(); 107 107 MainFrame parent = MainApplication.getMainFrame(); 108 pm.show(parent, p.x-parent.getX(), p.y-parent.getY()); 108 if (parent.isShowing()) { 109 pm.show(parent, p.x-parent.getX(), p.y-parent.getY()); 110 } 109 111 } 110 112 } catch (SecurityException ex) { -
trunk/src/org/openstreetmap/josm/gui/util/MultikeyActionsHandler.java
r14153 r14248 24 24 25 25 import org.openstreetmap.josm.gui.MainApplication; 26 import org.openstreetmap.josm.gui.MainFrame; 26 27 import org.openstreetmap.josm.gui.util.MultikeyShortcutAction.MultikeyInfo; 27 28 import org.openstreetmap.josm.tools.Shortcut; … … 101 102 } 102 103 layers.addPopupMenuListener(new StatusLinePopupMenuListener()); 103 layers.show(MainApplication.getMainFrame(), Integer.MAX_VALUE, Integer.MAX_VALUE); 104 layers.setLocation(MainApplication.getMainFrame().getX() + MainApplication.getMainFrame().getWidth() - layers.getWidth(), 105 MainApplication.getMainFrame().getY() + MainApplication.getMainFrame().getHeight() - layers.getHeight()); 104 MainFrame mainFrame = MainApplication.getMainFrame(); 105 if (mainFrame.isShowing()) { 106 layers.show(mainFrame, Integer.MAX_VALUE, Integer.MAX_VALUE); 107 layers.setLocation(mainFrame.getX() + mainFrame.getWidth() - layers.getWidth(), 108 mainFrame.getY() + mainFrame.getHeight() - layers.getHeight()); 109 } 106 110 } 107 111 } -
trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuButton.java
r13076 r14248 144 144 */ 145 145 public void setPopupMenu(JPopupMenu m) { 146 this.menu = m;146 menu = m; 147 147 } 148 148 149 149 @Override 150 150 public void actionPerformed(ActionEvent e) { 151 this.menu.show(this, 0, this.getHeight()); 151 if (isShowing()) { 152 menu.show(this, 0, this.getHeight()); 153 } 152 154 } 153 155 -
trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java
r10173 r14248 109 109 protected void showMenu(MouseEvent evt) { 110 110 if (menu != null && evt != null) { 111 menu.show(evt.getComponent(), evt.getX(), evt.getY()); 111 Component component = evt.getComponent(); 112 if (component.isShowing()) { 113 menu.show(component, evt.getX(), evt.getY()); 114 } 112 115 } 113 116 }
Note:
See TracChangeset
for help on using the changeset viewer.