Class CompletelyInsideAreaStrategy
java.lang.Object
org.openstreetmap.josm.gui.mappaint.styleelement.placement.CompletelyInsideAreaStrategy
- All Implemented Interfaces:
PositionForAreaStrategy
- Direct Known Subclasses:
PartiallyInsideAreaStrategy
Places the label / icon so that it is completely inside the area.
- Since:
- 11722, 11748 moved to own file
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompletelyInsideAreaStrategyAn instance of this class.protected final doubleprotected final double -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompletelyInsideAreaStrategy(double offsetX, double offsetY) -
Method Summary
Modifier and TypeMethodDescriptionprivate MapViewPositionAndRotationcenterOf(MapViewState mapViewState, Rectangle centeredNBounds) booleanfindLabelPlacement(MapViewPath path, Rectangle2D nb) Finds the correct position of a label / icon inside the area.inthashCode()booleanChecks whether this placement strategy supports more detailed (rotation / ...) placement using a glyph vector.toString()withAddedOffset(Point2D addToOffset) Create a new instance of the same strategy adding a offsetMethods 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. -
offsetX
-
offsetY
-
-
Constructor Details
-
CompletelyInsideAreaStrategy
-
-
Method Details
-
findLabelPlacement
Description copied from interface:PositionForAreaStrategyFinds the correct position of a label / icon inside the area.- Specified by:
findLabelPlacementin interfacePositionForAreaStrategy- 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.
-
centerOf
-
supportsGlyphVector
Description copied from interface:PositionForAreaStrategyChecks whether this placement strategy supports more detailed (rotation / ...) placement using a glyph vector.- Specified by:
supportsGlyphVectorin interfacePositionForAreaStrategy- Returns:
trueif it is supported.
-
withAddedOffset
Description copied from interface:PositionForAreaStrategyCreate a new instance of the same strategy adding a offset- Specified by:
withAddedOffsetin interfacePositionForAreaStrategy- Parameters:
addToOffset- The offset to add- Returns:
- The new strategy
-
toString
-
hashCode
-
equals
-