Class DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy
- java.lang.Object
-
- org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy
-
- All Implemented Interfaces:
DownloadSourceSizingPolicy
- Enclosing interface:
- DownloadSourceSizingPolicy
public static class DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy extends java.lang.Object implements DownloadSourceSizingPolicy
The height of this component is given by a preference entry.Mind that using a preferred component size is not possible in this case, since the preference entry needs to have a constant default value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy
DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy, DownloadSourceSizingPolicy.FixedDownloadSourceSizePolicy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.IntSupplier
minHeight
private AbstractProperty<java.lang.Integer>
preference
-
Constructor Summary
Constructors Constructor Description AdjustableDownloadSizePolicy(AbstractProperty<java.lang.Integer> preference)
AdjustableDownloadSizePolicy(AbstractProperty<java.lang.Integer> preference, java.util.function.IntSupplier minHeight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getComponentHeight()
Gets the height of the download source panel.boolean
isHeightAdjustable()
Check whether the user should be allowed to adjust the height of this download source panelvoid
storeHeight(int height)
Stores the height
-
-
-
Field Detail
-
preference
private final AbstractProperty<java.lang.Integer> preference
-
minHeight
private final java.util.function.IntSupplier minHeight
-
-
Constructor Detail
-
AdjustableDownloadSizePolicy
public AdjustableDownloadSizePolicy(AbstractProperty<java.lang.Integer> preference)
- Parameters:
preference
- The preference to use
-
AdjustableDownloadSizePolicy
public AdjustableDownloadSizePolicy(AbstractProperty<java.lang.Integer> preference, java.util.function.IntSupplier minHeight)
- Parameters:
preference
- The preference to useminHeight
- A supplier that gives the minimum height of the component. Must be positive or 0.- Since:
- 14418
-
-
Method Detail
-
getComponentHeight
public int getComponentHeight()
Description copied from interface:DownloadSourceSizingPolicy
Gets the height of the download source panel.- Specified by:
getComponentHeight
in interfaceDownloadSourceSizingPolicy
- Returns:
- The height the component should have.
-
isHeightAdjustable
public boolean isHeightAdjustable()
Description copied from interface:DownloadSourceSizingPolicy
Check whether the user should be allowed to adjust the height of this download source panel- Specified by:
isHeightAdjustable
in interfaceDownloadSourceSizingPolicy
- Returns:
true
if the height should be adjustable
-
storeHeight
public void storeHeight(int height)
Description copied from interface:DownloadSourceSizingPolicy
Stores the height- Specified by:
storeHeight
in interfaceDownloadSourceSizingPolicy
- Parameters:
height
- the height in pixel
-
-