Package com.jogamp.graph.ui.shapes
Class GlyphShape
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.GraphShape
-
- com.jogamp.graph.ui.shapes.GlyphShape
-
public class GlyphShape extends GraphShape
Representing a singleFont.Glyph
as aGraphShape
A GlyphShape is represented in font em-size [0..1] unscaled w/ bottom-left origin at 0/0 while preserving an intended position, seegetOrigPos()
. Scaling, if any, should be applied viaShape.setScale(float, float, float)
etc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description GlyphShape(int renderModes, Font.Glyph glyph, float x, float y)
Creates a new GlyphShapeGlyphShape(int renderModes, Font.Glyph glyph, com.jogamp.math.Vec3f pos)
Creates a new GlyphShapeGlyphShape(int renderModes, Font font, char codepoint, float x, float y)
Creates a new GlyphShapeGlyphShape(GlyphShape orig)
GlyphShape copy-ctor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Font
getFont()
Returns theFont
used to render the textFont.Glyph
getGlyph()
Returns theFont.Glyph
to be rendered.float
getLineHeight()
ReturnsFont.getLineHeight()
.com.jogamp.math.Vec3f
getOrigPos()
Returns the unscaled original position of this glyph, e.g.String
getSubString()
static com.jogamp.math.geom.AABBox
processString(List<GlyphShape> res, int renderModes, Font font, CharSequence text)
Process the given text resulting in a list ofGlyphShape
s with stored original position#getOrigX()
and#getOrigY()
each at font em-size [0..1].-
Methods inherited from class com.jogamp.graph.ui.GraphShape
getRegion, getRenderModes, getRenderModesReq, getSharpness, hasColorChannel, setSharpness, setTextureUnit
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isGroup, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Constructor Detail
-
GlyphShape
public GlyphShape(int renderModes, Font.Glyph glyph, float x, float y)
Creates a new GlyphShape- Parameters:
renderModes
- Graph'sRegion
render modes, seecreate(..)
.glyph
- theFont.Glyph
x
- the intended unscaled X position of this Glyph, e.g. if part of a string - otherwise use zero.y
- the intended unscaled Y position of this Glyph, e.g. if part of a string - otherwise use zero.- See Also:
#processString(List, int, Font, String)
-
GlyphShape
public GlyphShape(int renderModes, Font.Glyph glyph, com.jogamp.math.Vec3f pos)
Creates a new GlyphShape- Parameters:
renderModes
- Graph'sRegion
render modes, seecreate(..)
.glyph
- theFont.Glyph
pos
- the intended unscaled Vec3f position of this Glyph, e.g. if part of a string - otherwise use zero.- See Also:
#processString(List, int, Font, String)
-
GlyphShape
public GlyphShape(int renderModes, Font font, char codepoint, float x, float y)
Creates a new GlyphShape- Parameters:
renderModes
- Graph'sRegion
render modes, seecreate(..)
.font
- theFont
to lookup the symbol'sFont.Glyph
codepoint
- the represented character unicode `codepoint` symbolx
- the intended unscaled X position of this Glyph, e.g. if part of a string - otherwise use zero.y
- the intended unscaled Y position of this Glyph, e.g. if part of a string - otherwise use zero.
-
GlyphShape
public GlyphShape(GlyphShape orig)
GlyphShape copy-ctor
-
-
Method Detail
-
getGlyph
public Font.Glyph getGlyph()
Returns theFont.Glyph
to be rendered.
-
getOrigPos
public com.jogamp.math.Vec3f getOrigPos()
Returns the unscaled original position of this glyph, e.g. if part of a string, otherwise zero. Method borrows and returns the internal instance.- See Also:
#processString(List, int, Font, String)
-
getLineHeight
public float getLineHeight()
ReturnsFont.getLineHeight()
.
-
processString
public static final com.jogamp.math.geom.AABBox processString(List<GlyphShape> res, int renderModes, Font font, CharSequence text)
Process the given text resulting in a list ofGlyphShape
s with stored original position#getOrigX()
and#getOrigY()
each at font em-size [0..1].- Parameters:
res
- storage for resultingGlyphShape
s.renderModes
- Graph'sRegion
render modes, seecreate(..)
.font
-Font
usedtext
- text to be represented- Returns:
- the bounding box of the given string by taking each glyph's font em-sized [0..1] OutlineShape into account.
- See Also:
#getOrigX()
,#getOrigY()
-
getSubString
public String getSubString()
- Overrides:
getSubString
in classGraphShape
-
-