Package gov.nasa.worldwind.render
Class DeclutterableText
- java.lang.Object
-
- gov.nasa.worldwind.render.DeclutterableText
-
- All Implemented Interfaces:
Declutterable
,OrderedRenderable
,Renderable
public class DeclutterableText extends java.lang.Object implements Declutterable
A wrapper aroundGeographicText
that allows provides participation in global text decluttering.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Font
boundsFont
protected boolean
enableDecluttering
protected double
eyeDistance
protected Vec4
point
protected GeographicText
text
protected java.awt.geom.Rectangle2D
textBounds
protected DeclutteringTextRenderer
textRenderer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2D
getBounds(DrawContext dc)
double
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point.Vec4
getPoint()
GeographicText
getText()
boolean
isEnableDecluttering()
Indicates whether this text should participate in decluttering.void
pick(DrawContext dc, java.awt.Point pickPoint)
Executes a pick of the ordered renderable.void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.
-
-
-
Field Detail
-
text
protected GeographicText text
-
point
protected Vec4 point
-
eyeDistance
protected double eyeDistance
-
textRenderer
protected DeclutteringTextRenderer textRenderer
-
enableDecluttering
protected boolean enableDecluttering
-
textBounds
protected java.awt.geom.Rectangle2D textBounds
-
boundsFont
protected java.awt.Font boundsFont
-
-
Method Detail
-
isEnableDecluttering
public boolean isEnableDecluttering()
Indicates whether this text should participate in decluttering.- Specified by:
isEnableDecluttering
in interfaceDeclutterable
- Returns:
- true (the default) if it should participate, otherwise false.
-
getDistanceFromEye
public double getDistanceFromEye()
Description copied from interface:OrderedRenderable
Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.- Specified by:
getDistanceFromEye
in interfaceOrderedRenderable
- Returns:
- the distance of the ordered renderable from the current view's eye point.
-
getText
public GeographicText getText()
-
getPoint
public Vec4 getPoint()
-
getBounds
public java.awt.geom.Rectangle2D getBounds(DrawContext dc)
- Specified by:
getBounds
in interfaceDeclutterable
-
render
public void render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.- Specified by:
render
in interfaceRenderable
- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
pick
public void pick(DrawContext dc, java.awt.Point pickPoint)
Description copied from interface:OrderedRenderable
Executes a pick of the ordered renderable.- Specified by:
pick
in interfaceOrderedRenderable
- Parameters:
dc
- the current draw context.pickPoint
- the pick point.
-
-