Changeset 17704 in josm for trunk/src/org


Ignore:
Timestamp:
2021-04-07T20:43:26+02:00 (4 years ago)
Author:
simon04
Message:

see #19126 - Extract WindowGeometry.PREF_KEY_GUI_GEOMETRY

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

Legend:

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

    r17681 r17704  
    845845        Handler.install();
    846846
    847         WindowGeometry geometry = WindowGeometry.mainWindow("gui.geometry",
     847        WindowGeometry geometry = WindowGeometry.mainWindow(WindowGeometry.PREF_KEY_GUI_GEOMETRY,
    848848                args.getSingle(Option.GEOMETRY).orElse(null),
    849849                !args.hasOption(Option.NO_MAXIMIZE) && Config.getPref().getBoolean("gui.maximized", false));
  • trunk/src/org/openstreetmap/josm/gui/MainFrame.java

    r17626 r17704  
    117117    public void storeState() {
    118118        if (geometry != null) {
    119             geometry.remember("gui.geometry");
     119             geometry.remember(WindowGeometry.PREF_KEY_GUI_GEOMETRY);
    120120        }
    121121        Config.getPref().putBoolean("gui.maximized", (windowState & JFrame.MAXIMIZED_BOTH) != 0);
  • trunk/src/org/openstreetmap/josm/gui/SplashScreen.java

    r17449 r17704  
    111111        pack();
    112112
    113         WindowGeometry.centerOnScreen(this.getSize(), "gui.geometry").applySafe(this);
     113        WindowGeometry.centerOnScreen(this.getSize(), WindowGeometry.PREF_KEY_GUI_GEOMETRY).applySafe(this);
    114114
    115115        // Add ability to hide splash screen by clicking it
  • trunk/src/org/openstreetmap/josm/gui/util/WindowGeometry.java

    r16488 r17704  
    3434public class WindowGeometry {
    3535
     36    /**
     37     * Preference key for the {@code MainFrame} geometry
     38     */
     39    public static final String PREF_KEY_GUI_GEOMETRY = "gui.geometry";
     40
    3641    /** the top left point */
    3742    private Point topLeft;
     
    107112     */
    108113    public static WindowGeometry centerOnScreen(Dimension extent) {
    109         return centerOnScreen(extent, "gui.geometry");
     114        return centerOnScreen(extent, PREF_KEY_GUI_GEOMETRY);
    110115    }
    111116
     
    233238     */
    234239    public static WindowGeometry mainWindow(String preferenceKey, String arg, boolean maximize) {
    235         Rectangle screenDimension = getScreenInfo("gui.geometry");
     240        Rectangle screenDimension = getScreenInfo(PREF_KEY_GUI_GEOMETRY);
    236241        if (arg != null) {
    237242            final Matcher m = Pattern.compile("(\\d+)x(\\d+)(([+-])(\\d+)([+-])(\\d+))?").matcher(arg);
Note: See TracChangeset for help on using the changeset viewer.