Package journeymap.api.v2.client.display
Class Overlay
java.lang.Object
journeymap.api.v2.client.display.Displayable
journeymap.api.v2.client.display.Overlay
- All Implemented Interfaces:
Comparable<Displayable>
- Direct Known Subclasses:
ImageOverlay,MarkerOverlay,PolygonOverlay
Provides IDs and key information for map overlays in JourneyMap.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<Context.MapType> protected Set<Context.UI> protected net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> protected intprotected Stringprotected intprotected intprotected booleanprotected Stringprotected IOverlayListenerprotected TextPropertiesprotected StringFields inherited from class journeymap.api.v2.client.display.Displayable
displayType, id, modId -
Method Summary
Modifier and TypeMethodDescriptionvoidUsed by JourneyMap after the overlay has been re-rendered.voidIndicate the overlay needs to be re-rendered.Returns a set of enums indicating which map types (Day, Night) the overlay should be active in.Returns a set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the overlay should be active in.net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> The dimension this overlay should be displayed in.intAny features are displayed on the map in order of their screen displayOrder, with higher values displaying in front of features with lower values.getLabel()Label text to be displayed on the overlay.intThe maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the overlay should be visible.intThe minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the overlay should be visible.booleanGets whether the overlay needs to be re-rendered.A suggested group or category name used to organize map overlays.Gets the listener for user events on the overlay.Gets the text properties for the overlay.getTitle()Rollover text to be displayed when the mouse is over the overlay.booleanisActiveIn(UIState uiState) Whether the overlay should be active for the given contexts.booleanisInZoomRange(UIState uiState) Whether the zoom of the given context is within the zoom range of the overlay.setActiveMapTypes(Context.MapType... activeMapTypes) Set of enums indicating which JourneyMap map types (Day, Night) the overlay should be active in.setActiveUIs(Context.UI... activeUIs) Set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the overlay should be active in.setDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Sets dimension.setDisplayOrder(int zIndex) Any features are displayed on the map in order of their screen displayOrder, with higher values displaying in front of features with lower values.Label text to be displayed on the overlay.setMaxZoom(int maxZoom) Sets the maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the overlay should be visible.setMinZoom(int minZoom) Sets the minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the overlay should be visible.setOverlayGroupName(String overlayGroupName) A suggested group or category name used to organize map overlays.setOverlayListener(IOverlayListener overlayListener) Sets a listener for receiving user events related to the Overlay.setTextProperties(TextProperties textProperties) Sets the text properties for the overlay.Rollover text to be displayed when the mouse is over the overlay.protected final com.google.common.base.MoreObjects.ToStringHelpertoStringHelper(Overlay instance) Provides common output for toStringHelper() to subclassesMethods inherited from class journeymap.api.v2.client.display.Displayable
clampOpacity, clampRGB, compareTo, equals, getDisplayType, getGuid, getId, getModId, hashCode
-
Field Details
-
overlayGroupName
-
title
-
label
-
dimension
protected net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension -
minZoom
protected int minZoom -
maxZoom
protected int maxZoom -
displayOrder
protected int displayOrder -
activeUIs
-
activeMapTypes
-
textProperties
-
overlayListener
-
needsRerender
protected boolean needsRerender
-
-
Method Details
-
getDimension
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimension()The dimension this overlay should be displayed in.- Returns:
- dimension id
-
setDimension
public Overlay setDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Sets dimension.- Parameters:
dimension- the dimension- Returns:
- this
-
getOverlayGroupName
A suggested group or category name used to organize map overlays.- Returns:
- the overlay group name
-
setOverlayGroupName
A suggested group or category name used to organize map overlays.- Parameters:
overlayGroupName- the overlay group name- Returns:
- this
-
getTitle
Rollover text to be displayed when the mouse is over the overlay.- Returns:
- the title
-
setTitle
Rollover text to be displayed when the mouse is over the overlay.- Parameters:
title- the title- Returns:
- this
-
getLabel
Label text to be displayed on the overlay.- Returns:
- the label
-
setLabel
Label text to be displayed on the overlay.- Parameters:
label- the label- Returns:
- this
-
getMinZoom
public int getMinZoom()The minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the overlay should be visible.- Returns:
- the min zoom
-
setMinZoom
Sets the minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the overlay should be visible.- Parameters:
minZoom- the min zoom- Returns:
- this
-
getMaxZoom
public int getMaxZoom()The maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the overlay should be visible.- Returns:
- the max zoom
-
setMaxZoom
Sets the maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the overlay should be visible.- Parameters:
maxZoom- the max zoom- Returns:
- this
-
getDisplayOrder
public int getDisplayOrder()Any features are displayed on the map in order of their screen displayOrder, with higher values displaying in front of features with lower values. Default is 1000.- Specified by:
getDisplayOrderin classDisplayable- Returns:
- the z index
-
setDisplayOrder
Any features are displayed on the map in order of their screen displayOrder, with higher values displaying in front of features with lower values. Default is 1000.- Parameters:
zIndex- the z index- Returns:
- this
-
getTextProperties
Gets the text properties for the overlay.- Returns:
- properties
-
setTextProperties
Sets the text properties for the overlay.- Parameters:
textProperties- properties- Returns:
- this
-
getActiveUIs
Returns a set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the overlay should be active in.- Returns:
- enumset
-
setActiveUIs
Set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the overlay should be active in.- Parameters:
activeUIs- active UIs- Returns:
- this
-
getActiveMapTypes
Returns a set of enums indicating which map types (Day, Night) the overlay should be active in.- Returns:
- enumset
-
setActiveMapTypes
Set of enums indicating which JourneyMap map types (Day, Night) the overlay should be active in.- Parameters:
activeMapTypes- active types- Returns:
- this
-
isActiveIn
Whether the overlay should be active for the given contexts.- Parameters:
uiState- UIState- Returns:
- true if the overlay should be active
-
isInZoomRange
Whether the zoom of the given context is within the zoom range of the overlay.- Parameters:
uiState- UIState- Returns:
- true if the zoom of uiState is within the zoom range of the overlay
-
getOverlayListener
Gets the listener for user events on the overlay.- Returns:
- listener impl or null
-
setOverlayListener
Sets a listener for receiving user events related to the Overlay.- Parameters:
overlayListener- IOverlayListener impl- Returns:
- this
-
flagForRerender
public void flagForRerender()Indicate the overlay needs to be re-rendered. Typically you don't need to use this unless you are updating an overlay dynamically and the chances aren't shown until the map is panned or zoomed. For example within and IOverlayListener. Overusing this can cause performance problems. -
clearFlagForRerender
public void clearFlagForRerender()Used by JourneyMap after the overlay has been re-rendered. -
getNeedsRerender
public boolean getNeedsRerender()Gets whether the overlay needs to be re-rendered.- Returns:
- true if rerender needed
-
toStringHelper
Provides common output for toStringHelper() to subclasses- Parameters:
instance- subclass- Returns:
- helper for continuing to add properties on subclass
-