public interface PositionForAreaStrategy
Modifier and Type | Method and Description |
---|---|
MapViewPositionAndRotation |
findLabelPlacement(MapViewPath path,
java.awt.geom.Rectangle2D nb)
Finds the correct position of a label / icon inside the area.
|
static PositionForAreaStrategy |
forKeyword(Keyword keyword)
Gets a strategy for the given keyword.
|
static PositionForAreaStrategy |
forKeyword(Keyword keyword,
PositionForAreaStrategy defaultStrategy)
Gets a strategy for the given keyword.
|
default java.util.List<java.awt.font.GlyphVector> |
generateGlyphVectors(MapViewPath path,
java.awt.geom.Rectangle2D nb,
java.util.List<java.awt.font.GlyphVector> gvs,
boolean isDoubleTranslationBug)
Generates the transformed glyph vectors for the given text.
|
boolean |
supportsGlyphVector()
Checks whether this placement strategy supports more detailed (rotation / ...) placement using a glyph vector.
|
PositionForAreaStrategy |
withAddedOffset(java.awt.geom.Point2D addToOffset)
Create a new instance of the same strategy adding a offset
|
MapViewPositionAndRotation findLabelPlacement(MapViewPath path, java.awt.geom.Rectangle2D nb)
path
- The area to search innb
- The bounding box of the thing we are searching a place for.null
if none was found.boolean supportsGlyphVector()
true
if it is supported.default java.util.List<java.awt.font.GlyphVector> generateGlyphVectors(MapViewPath path, java.awt.geom.Rectangle2D nb, java.util.List<java.awt.font.GlyphVector> gvs, boolean isDoubleTranslationBug)
path
- The path to place the text alongnb
- The bounds of the textgvs
- The glyph vectors for the text. May be modifiedisDoubleTranslationBug
- true
to fix a glyph placement bug.java.lang.UnsupportedOperationException
- if supportsGlyphVector()
returns falsestatic PositionForAreaStrategy forKeyword(Keyword keyword)
keyword
- The text position keyword.static PositionForAreaStrategy forKeyword(Keyword keyword, PositionForAreaStrategy defaultStrategy)
keyword
- The text position keyword.defaultStrategy
- The default if no strategy was recognized.PositionForAreaStrategy withAddedOffset(java.awt.geom.Point2D addToOffset)
addToOffset
- The offset to add