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
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
FieldsModifier and TypeFieldDescriptionstatic final PartiallyInsideAreaStrategyAn instance of this class.Fields inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
offsetX, offsetY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePartiallyInsideAreaStrategy(double offsetX, double offsetY) -
Method Summary
Modifier and TypeMethodDescriptionfindLabelPlacement(MapViewPath path, Rectangle2D nb) Finds the correct position of a label / icon inside the area.toString()withAddedOffset(Point2D addToOffset) Create a new instance of the same strategy adding a offsetMethods inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
equals, hashCode, supportsGlyphVectorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.gui.mappaint.styleelement.placement.PositionForAreaStrategy
generateGlyphVectors
-
Field Details
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
PartiallyInsideAreaStrategy
-
-
Method Details
-
findLabelPlacement
Description copied from interface:PositionForAreaStrategyFinds the correct position of a label / icon inside the area.- Specified by:
findLabelPlacementin interfacePositionForAreaStrategy- Overrides:
findLabelPlacementin 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.
nullif none was found.
-
withAddedOffset
Description copied from interface:PositionForAreaStrategyCreate a new instance of the same strategy adding a offset- Specified by:
withAddedOffsetin interfacePositionForAreaStrategy- Overrides:
withAddedOffsetin classCompletelyInsideAreaStrategy- Parameters:
addToOffset- The offset to add- Returns:
- The new strategy
-
toString
- Overrides:
toStringin classCompletelyInsideAreaStrategy
-