public class DeclutteringTextRenderer extends Object
GeographicTextRenderer
that participates in globe text decluttering. See ClutterFilter
for more information on decluttering.Modifier and Type | Field and Description |
---|---|
protected static Color |
DEFAULT_COLOR |
protected static Font |
DEFAULT_FONT |
protected GLU |
glu |
protected boolean |
hasJOGLv111Bug |
Constructor and Description |
---|
DeclutteringTextRenderer() |
Modifier and Type | Method and Description |
---|---|
protected Color |
applyOpacity(Color color,
double opacity) |
protected void |
beginRendering(DrawContext dc) |
protected Point2D.Float |
computeDrawPoint(Rectangle2D rect,
Vec4 screenPoint)
Computes the final draw point for the given rectangle lower left corner and target screen point.
|
protected Rectangle2D |
computeTextBounds(DrawContext dc,
DeclutterableText text) |
protected Vec4 |
drawText(DrawContext dc,
DeclutterableText uText,
double scale,
double opacity) |
protected void |
endRendering(DrawContext dc) |
Font |
getDefaultFont() |
TextRenderer |
getTextRenderer(DrawContext dc,
Font font)
Returns either a cached or new text renderer for a specified font.
|
protected void |
handleTextRendererExceptions(Exception e) |
protected static boolean |
isTextValid(GeographicText text,
boolean checkPosition) |
void |
render(DrawContext dc,
Iterable<? extends GeographicText> textIterable)
Adds ordered renderables to the ordered renderable list.
|
protected void |
setDepthFunc(DrawContext dc,
Vec4 screenPoint) |
protected static final Color DEFAULT_COLOR
protected static final Font DEFAULT_FONT
protected final GLU glu
protected boolean hasJOGLv111Bug
protected void beginRendering(DrawContext dc)
protected Point2D.Float computeDrawPoint(Rectangle2D rect, Vec4 screenPoint)
null
the text will not be drawn.rect
- the text rectangle to draw.screenPoint
- the projected screen point the text relates to.null
.protected Rectangle2D computeTextBounds(DrawContext dc, DeclutterableText text) throws Exception
Exception
protected Vec4 drawText(DrawContext dc, DeclutterableText uText, double scale, double opacity) throws Exception
Exception
protected void endRendering(DrawContext dc)
public Font getDefaultFont()
public TextRenderer getTextRenderer(DrawContext dc, Font font)
dc
- the current draw context.font
- the text font.protected void handleTextRendererExceptions(Exception e) throws Exception
Exception
protected static boolean isTextValid(GeographicText text, boolean checkPosition)
public void render(DrawContext dc, Iterable<? extends GeographicText> textIterable)
dc
- the current draw context.textIterable
- a collection of text shapes to add to the ordered-renderable list.protected void setDepthFunc(DrawContext dc, Vec4 screenPoint)