Class PartiallyInsideAreaStrategy
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
-
- org.openstreetmap.josm.gui.mappaint.styleelement.placement.PartiallyInsideAreaStrategy
-
- All Implemented Interfaces:
PositionForAreaStrategy
public final class PartiallyInsideAreaStrategy extends CompletelyInsideAreaStrategy
A strategy that places the label / icon so that is is on the area. The center of that place should be in the area, but the icon / label may overlap on the edges.- Since:
- 11722, 11748 moved to own file
-
-
Field Summary
Fields Modifier and Type Field Description static PartiallyInsideAreaStrategy
INSTANCE
An instance of this class.-
Fields inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
offsetX, offsetY
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PartiallyInsideAreaStrategy(double offsetX, double offsetY)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapViewPositionAndRotation
findLabelPlacement(MapViewPath path, java.awt.geom.Rectangle2D nb)
Finds the correct position of a label / icon inside the area.java.lang.String
toString()
PositionForAreaStrategy
withAddedOffset(java.awt.geom.Point2D addToOffset)
Create a new instance of the same strategy adding a offset-
Methods inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
equals, hashCode, supportsGlyphVector
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.mappaint.styleelement.placement.PositionForAreaStrategy
generateGlyphVectors
-
-
-
-
Field Detail
-
INSTANCE
public static final PartiallyInsideAreaStrategy INSTANCE
An instance of this class.
-
-
Constructor Detail
-
PartiallyInsideAreaStrategy
private PartiallyInsideAreaStrategy(double offsetX, double offsetY)
-
-
Method Detail
-
findLabelPlacement
public MapViewPositionAndRotation findLabelPlacement(MapViewPath path, java.awt.geom.Rectangle2D nb)
Description copied from interface:PositionForAreaStrategy
Finds the correct position of a label / icon inside the area.- Specified by:
findLabelPlacement
in interfacePositionForAreaStrategy
- Overrides:
findLabelPlacement
in classCompletelyInsideAreaStrategy
- Parameters:
path
- The area to search innb
- The bounding box of the thing we are searching a place for.- Returns:
- The position as rectangle with the same dimension as nb.
null
if none was found.
-
withAddedOffset
public PositionForAreaStrategy withAddedOffset(java.awt.geom.Point2D addToOffset)
Description copied from interface:PositionForAreaStrategy
Create a new instance of the same strategy adding a offset- Specified by:
withAddedOffset
in interfacePositionForAreaStrategy
- Overrides:
withAddedOffset
in classCompletelyInsideAreaStrategy
- Parameters:
addToOffset
- The offset to add- Returns:
- The new strategy
-
toString
public java.lang.String toString()
- Overrides:
toString
in classCompletelyInsideAreaStrategy
-
-