public abstract class AbstractTextDrawer extends Object implements GLG2DTextHelper
Modifier and Type | Class and Description |
---|---|
static class |
AbstractTextDrawer.GLFontMetrics
The default implementation is good enough for now.
|
Constructor and Description |
---|
AbstractTextDrawer() |
Modifier and Type | Method and Description |
---|---|
Font |
getFont() |
FontMetrics |
getFontMetrics(Font font) |
FontRenderContext |
getFontRenderContext() |
void |
pop(GLGraphics2D parentG2d)
Sets the new
GLGraphics2D context in a stack after a pop. |
void |
push(GLGraphics2D newG2d)
Sets the new
GLGraphics2D context in a stack. |
void |
resetHints()
Clears all hints back to their default states.
|
void |
setFont(Font font) |
void |
setG2D(GLGraphics2D g2d)
Sets the current
GLGraphics2D parent. |
void |
setHint(RenderingHints.Key key,
Object value)
Sets a new rendering hint.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
drawString, drawString, drawString, drawString
dispose
public void setG2D(GLGraphics2D g2d)
G2DDrawingHelper
GLGraphics2D
parent. The current GL
and
GLContext
objects can be accessed from this. This should clear all
internal stacks in the helper object because previous painting iterations
may not have called dispose() for each time they called create().setG2D
in interface G2DDrawingHelper
g2d
- The parent context for subsequent drawing operations.public void push(GLGraphics2D newG2d)
G2DDrawingHelper
GLGraphics2D
context in a stack. This is called when
Graphics2D.create()
is called and each helper is given notice to
push any necessary information onto the stack. This is used in conjunction
with G2DDrawingHelper.pop(GLGraphics2D)
.push
in interface G2DDrawingHelper
newG2d
- The new context, top of the stack.public void pop(GLGraphics2D parentG2d)
G2DDrawingHelper
GLGraphics2D
context in a stack after a pop. This is
called when Graphics2D.dispose()
is called and each helper is given
notice to pop any necessary information off the stack. This is used in
conjunction with G2DDrawingHelper.push(GLGraphics2D)
.pop
in interface G2DDrawingHelper
parentG2d
- The new context, top of the stack - which is actually the parent
of what was popped.public void setHint(RenderingHints.Key key, Object value)
G2DDrawingHelper
GLGraphics2D
object, but all new state changes are propagated to
all listeners.setHint
in interface G2DDrawingHelper
key
- The rendering hint key.value
- The new hint value.public void resetHints()
G2DDrawingHelper
resetHints
in interface G2DDrawingHelper
public void setFont(Font font)
setFont
in interface GLG2DTextHelper
public Font getFont()
getFont
in interface GLG2DTextHelper
public FontMetrics getFontMetrics(Font font)
getFontMetrics
in interface GLG2DTextHelper
public FontRenderContext getFontRenderContext()
getFontRenderContext
in interface GLG2DTextHelper
Copyright © 2010-2013. All Rights Reserved.