|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kinetic.KineticObject | +--kinetic.KineticString
string object that contain text and font information for rendering strings on the screen with the engine
Field Summary | |
double |
absoluteX
global coordinate X |
double |
absoluteY
global coordinate Y |
protected java.awt.Font |
font
font object |
kinetic.KineticDiscreteProperty |
font_face
font face |
protected java.lang.String |
font_name
font name |
kinetic.KineticProperty |
font_size
font size |
protected int |
font_style
font style |
protected java.awt.font.GlyphVector |
glyphVector
glyphvector for text |
protected java.awt.geom.Rectangle2D |
original_bounds
local coordinate bbox |
java.lang.String |
s
text string |
kinetic.KineticProperty |
tracking
tracking |
protected java.awt.geom.GeneralPath |
transformed_bounds
global coordinate bbox |
Fields inherited from class kinetic.KineticObject |
alpha, blue, BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT, delay, duration, green, lastUpdateTime, MIDDLE_CENTER, MIDDLE_LEFT, MIDDLE_RIGHT, mode, name, orientation, parent, properties, red, rotation, selected, timeFilters, TOP_CENTER, TOP_LEFT, TOP_RIGHT, visible, x, xScale, xShear, y, yScale, yShear |
Constructor Summary | |
KineticString()
creates a new instance of a KineticString |
|
KineticString(java.lang.String n,
double del,
double dur)
creates a new instance |
Method Summary | |
kinetic.Sequence |
breakIntoCharacters(double delay,
double duration,
java.awt.Graphics2D g2)
breaks this KineticString into individual characters in KineticString wrapped into the returned sequence |
kinetic.Sequence |
breakIntoWords(double delay,
double duration,
java.awt.Graphics2D g2)
Breaks the KineticString into space delimited words while preserving the spatial layout of the text |
protected void |
buildFontList()
loads available system fonts |
boolean |
contains(java.awt.Point p)
hit test |
kinetic.KineticString |
copy()
produces a new instance that is an exact copy |
kinetic.KineticString |
copy(double time)
produces a new instance that captures the state of the kinetic string at a specified time |
void |
draw(java.awt.Graphics2D g2)
main drawing routine with an affine transform - adds a unitiy transforms and calls main routine |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.AffineTransform ax)
main drawing routing |
double |
getAbsoluteX()
get global coordinate X |
double |
getAbsoluteY()
get global coordinate Y |
double |
getAdvance(char c,
java.awt.Graphics2D g2)
get the advance of a character using the world of this string |
double |
getAdvance(java.awt.Graphics2D g2,
boolean space)
get the advance of the entire word plus a space |
java.awt.geom.Rectangle2D |
getBounds()
get global coordinate bbox |
double |
getDescent()
get decent of this object |
double |
getHeight()
get height |
double |
getWidth()
get global coordinate width |
void |
handleMouseEvent(java.awt.event.MouseEvent e,
boolean button_event,
double time,
java.awt.Graphics2D g2)
support interactivity |
void |
initBounds(java.awt.Graphics2D g2)
initialize bounds, create glyphs, fonts, etc. |
void |
setFont(java.awt.Font f)
set font using font object |
void |
setFont(java.lang.String name,
int style,
double size)
set font using paramters |
void |
setFontChoice(int i)
select from from discrete property list |
void |
setFontFace(java.lang.String name)
set font face |
void |
setFontSize(double size)
set font size |
void |
setString(java.lang.String new_string)
set text string |
Methods inherited from class kinetic.KineticObject |
addProperty, addTimeFilter, clear, getDelay, getDuration, getMaxDuration, getName, getPropertyList, getTimeFilterList, initialize, onUpdate, PrepareVariables, reset, setColor, setColor, setColor, setDelay, setDuration, setMode, setName, setOrientation, setPosition, setRotation, setScale, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String s
protected java.lang.String font_name
protected int font_style
public kinetic.KineticProperty font_size
public kinetic.KineticProperty tracking
public kinetic.KineticDiscreteProperty font_face
protected java.awt.geom.Rectangle2D original_bounds
protected java.awt.geom.GeneralPath transformed_bounds
protected java.awt.font.GlyphVector glyphVector
protected java.awt.Font font
public double absoluteX
public double absoluteY
Constructor Detail |
public KineticString()
public KineticString(java.lang.String n, double del, double dur)
n
- namedel
- delay - msdur
- duration - msMethod Detail |
protected void buildFontList()
public void draw(java.awt.Graphics2D g2)
draw
in class KineticObject
g2
- graphics handlepublic void draw(java.awt.Graphics2D g2, java.awt.geom.AffineTransform ax)
draw
in class KineticObject
g2
- graphics handleax
- current affine transformpublic void setFontFace(java.lang.String name)
name
- name of the font familypublic void setFont(java.lang.String name, int style, double size)
name
- name of the font familystyle
- type stylesize
- font sizepublic void setFont(java.awt.Font f)
f
- instance of font objectpublic void setFontChoice(int i)
i
- index of font from font listpublic void setFontSize(double size)
size
- font sizepublic void setString(java.lang.String new_string)
new_string
- new text stringpublic java.awt.geom.Rectangle2D getBounds()
public boolean contains(java.awt.Point p)
contains
in class KineticObject
p
- hit location
public void initBounds(java.awt.Graphics2D g2)
g2
- graphics handlepublic double getWidth()
public double getAdvance(java.awt.Graphics2D g2, boolean space)
g2
- graphics handlespace
- add the advance of a space
public double getAdvance(char c, java.awt.Graphics2D g2)
c
- characterg2
- graphics handle
public double getDescent()
public double getHeight()
public double getAbsoluteX()
public double getAbsoluteY()
public kinetic.KineticString copy()
public kinetic.KineticString copy(double time)
time
- time when to capture the state - ms
public kinetic.Sequence breakIntoCharacters(double delay, double duration, java.awt.Graphics2D g2)
delay
- time delay for the produced sequenceduration
- time duration of the produced sequenceg2
- graphics handle
public kinetic.Sequence breakIntoWords(double delay, double duration, java.awt.Graphics2D g2)
delay
- the start time - msduration
- duration of the sequence - msg2
- graphic context for accessing font metrics
public void handleMouseEvent(java.awt.event.MouseEvent e, boolean button_event, double time, java.awt.Graphics2D g2)
handleMouseEvent
in class KineticObject
e
- mouse eventbutton_event
- true if generated by a buttontime
- timestampg2
- graphics handle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |