Changeset 13774 in josm for trunk/src/org
- Timestamp:
- 2018-05-15T22:52:56+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryDialog.java
r12530 r13774 7 7 import java.awt.Dimension; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.gui.ExtendedDialog; 10 11 import org.openstreetmap.josm.gui.preferences.imagery.AddImageryPanel.ContentValidationListener; 12 import org.openstreetmap.josm.gui.util.WindowGeometry; 11 13 12 14 /** … … 15 17 */ 16 18 public class AddImageryDialog extends ExtendedDialog implements ContentValidationListener { 19 20 private final String saveGeometryEntryName; 17 21 18 22 /** … … 29 33 setMinimumSize(new Dimension(300, 400)); 30 34 panel.addContentValidationListener(this); 35 this.saveGeometryEntryName = panel.getClass().getName() + ".geometry"; 31 36 } 32 37 … … 41 46 buttons.get(0).setEnabled(isValid); 42 47 } 48 49 @Override 50 public void setVisible(boolean visible) { 51 if (visible) { 52 new WindowGeometry(saveGeometryEntryName, WindowGeometry.centerInWindow(Main.parent, 53 new Dimension(800, 600))).applySafe(this); 54 } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775 55 new WindowGeometry(this).remember(saveGeometryEntryName); 56 } 57 super.setVisible(visible); 58 } 43 59 }
Note:
See TracChangeset
for help on using the changeset viewer.