Changeset 16034 in josm


Ignore:
Timestamp:
2020-03-04T20:57:31+01:00 (5 years ago)
Author:
simon04
Message:

Fix typo "preferred"

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r15902 r16034  
    118118
    119119            // Only return cached size, item is not shown
    120             if (!list.isShowing() && item.prefferedWidth != -1 && item.prefferedHeight != -1) {
     120            if (!list.isShowing() && item.preferredWidth != -1 && item.preferredHeight != -1) {
    121121                if (index == -1) {
    122                     lbl.setPreferredSize(new Dimension(item.prefferedWidth, 10));
     122                    lbl.setPreferredSize(new Dimension(item.preferredWidth, 10));
    123123                } else {
    124                     lbl.setPreferredSize(new Dimension(item.prefferedWidth, item.prefferedHeight));
     124                    lbl.setPreferredSize(new Dimension(item.preferredWidth, item.preferredHeight));
    125125                }
    126126                return lbl;
     
    144144
    145145            // Cache size
    146             item.prefferedWidth = lbl.getPreferredSize().width;
    147             item.prefferedHeight = lbl.getPreferredSize().height;
     146            item.preferredWidth = lbl.getPreferredSize().width;
     147            item.preferredHeight = lbl.getPreferredSize().height;
    148148
    149149            // We do not want the editor to have the maximum height of all
     
    229229
    230230        /** Cached width (currently only for Combo) to speed up preset dialog initialization */
    231         public int prefferedWidth = -1; // NOSONAR
     231        public int preferredWidth = -1; // NOSONAR
    232232        /** Cached height (currently only for Combo) to speed up preset dialog initialization */
    233         public int prefferedHeight = -1; // NOSONAR
     233        public int preferredHeight = -1; // NOSONAR
    234234
    235235        /**
  • trunk/src/org/openstreetmap/josm/gui/util/MultiLineFlowLayout.java

    r12799 r16034  
    1010
    1111/**
    12  * This is an extension of the flow layout that preferes wrapping the text instead of increasing the component width
     12 * This is an extension of the flow layout that prefers wrapping the text instead of increasing the component width
    1313 * when there is not enough space.
    1414 * <p>
    15  * This allows for a better preffered size computation.
     15 * This allows for a better preferred size computation.
    1616 * It should be used in all places where a flow layout fills the full width of the parent container.
    1717 * <p>
  • trunk/test/unit/org/openstreetmap/josm/gui/util/MultiLineFlowLayoutTest.java

    r12800 r16034  
    5252
    5353        container.invalidate();
    54         Dimension preffered = container.getPreferredSize();
    55         assertEquals(TEST_WIDHT, preffered.width);
    56         assertEquals(100, preffered.height);
     54        Dimension preferredSize = container.getPreferredSize();
     55        assertEquals(TEST_WIDHT, preferredSize.width);
     56        assertEquals(100, preferredSize.height);
    5757
    5858        Dimension minimum = container.getMinimumSize();
     
    7070        container.setBorder(BorderFactory.createEmptyBorder(3, 0, 7, 0));
    7171        container.invalidate();
    72         Dimension preffered = container.getPreferredSize();
    73         assertEquals(TEST_WIDHT, preffered.width);
    74         assertEquals(110, preffered.height);
     72        Dimension preferredSize = container.getPreferredSize();
     73        assertEquals(TEST_WIDHT, preferredSize.width);
     74        assertEquals(110, preferredSize.height);
    7575
    7676        // This should force wrapping
    7777        container.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 40));
    7878        container.invalidate();
    79         preffered = container.getPreferredSize();
    80         assertEquals(TEST_WIDHT, preffered.width);
    81         assertEquals(200, preffered.height);
     79        preferredSize = container.getPreferredSize();
     80        assertEquals(TEST_WIDHT, preferredSize.width);
     81        assertEquals(200, preferredSize.height);
    8282    }
    8383
     
    9191        container.setLayout(new MultiLineFlowLayout(FlowLayout.LEADING, 20, 10));
    9292        container.invalidate();
    93         Dimension preffered = container.getPreferredSize();
    94         assertEquals(TEST_WIDHT, preffered.width);
    95         assertEquals(230, preffered.height);
     93        Dimension preferredSize = container.getPreferredSize();
     94        assertEquals(TEST_WIDHT, preferredSize.width);
     95        assertEquals(230, preferredSize.height);
    9696    }
    9797
Note: See TracChangeset for help on using the changeset viewer.