| com.xoetrope.swing.animation.XAnimationSurface com.xoetrope.swing.XFlowedTextComponent
All known Subclasses: com.xoetrope.swing.XAnimatedText, com.xoetrope.swing.XPolygonalTextArea, com.xoetrope.swing.XReflectedText, com.xoetrope.swing.XRotatedText,
XFlowedTextComponent | public class XFlowedTextComponent extends XAnimationSurface (Code) | | A component that flows text around other components, child components and
components that overlap this component. Assumes that the area within which the
text is flowed is composed of rectangular blocks.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.23 $
|
Inner Class :protected class Attrib | |
Method Summary | |
public void | applyState(Graphics2D g2) | public void | drawObjects(int w, int h, Graphics2D g2) All classes that extend JAnimationSurface must implement this routine...
This component renders text in the flow area. | protected AttributedString | getAttributedString(String localCopy, Font font, int[] lengths) Get an AttribtedString for this component, converting the tags
<b>, <i>, <u>, <sub>, <super>, <swap>, <justify>, <strike>
to the proper internal form. | public boolean | getClip() | public int | getColSpacing() | public int | getNumColumns() | public String | getText() Get the label/text of the component. | public void | init() Attempts to load and reference the associated view/datastore. | public void | reset(int w, int h) Adjust the settings for the next step. | public int | setAttribute(String attribName, Object attribValue) Set one or more attributes of the component. | public void | setClip(boolean state) | public void | setColSpacing(int spacing) Set the column spacing as the number of pixels between each column. | public void | setNumColumns(int columns) | public void | setText(String text) Set the label/text of the component. | public void | step(int w, int h) Adjust the settings for the next step. | protected double | wrapString(Graphics2D g2, String text, double currentPos, double y, Area[] columns) |
ascent | protected float ascent(Code) | | |
clip | protected boolean clip(Code) | | |
colscolSpacing | protected int colscolSpacing(Code) | | |
currentColumn | protected int currentColumn(Code) | | |
deltaXdeltaY | protected int deltaXdeltaY(Code) | | |
oXoYoWoH | protected int oXoYoWoH(Code) | | |
XFlowedTextComponent | public XFlowedTextComponent()(Code) | | Create a new flowed text component
|
applyState | public void applyState(Graphics2D g2)(Code) | | Apply the current state to the graphics rendering context
Parameters: g2 - the graphics context |
drawObjects | public void drawObjects(int w, int h, Graphics2D g2)(Code) | | All classes that extend JAnimationSurface must implement this routine...
This component renders text in the flow area. The flow area is calculated
to be the non-overlapped client area
Parameters: w - the width Parameters: h - the height Parameters: g2 - the graphics context |
getAttributedString | protected AttributedString getAttributedString(String localCopy, Font font, int[] lengths)(Code) | | Get an AttribtedString for this component, converting the tags
<b>, <i>, <u>, <sub>, <super>, <swap>, <justify>, <strike>
to the proper internal form.
Parameters: localCopy - the text being rendered Parameters: font - the current font Parameters: lengths - on return contains the length of the text to be rendered - the argument should be a string[1] the new AttributedString |
getClip | public boolean getClip()(Code) | | Get the clip state
true if siblings are clipped |
getColSpacing | public int getColSpacing()(Code) | | Get the column spacing
the spacing in pixels |
getNumColumns | public int getNumColumns()(Code) | | Get the number of columns into which the flow area is divided
the number of columns |
getText | public String getText()(Code) | | Get the label/text of the component.
the component text. |
init | public void init()(Code) | | Attempts to load and reference the associated view/datastore.
|
reset | public void reset(int w, int h)(Code) | | Adjust the settings for the next step.
Parameters: w - the width Parameters: h - the height |
setAttribute | public int setAttribute(String attribName, Object attribValue)(Code) | | Set one or more attributes of the component. Currently this handles the
attributes
- text - set the text
- content - set the text
- increment - set the step size
- cols - the number of columns in which to flow the text, <1 = a single area/column
-
Parameters: attribName - the attribute name Parameters: attribValue - the attribute value 0 for success, non zero otherwise |
setClip | public void setClip(boolean state)(Code) | | Set the clip state
Parameters: state - true to clip siblings |
setColSpacing | public void setColSpacing(int spacing)(Code) | | Set the column spacing as the number of pixels between each column. The
spacing has no effect if there is a single column.
Parameters: spacing - the column spacing in pixels |
setNumColumns | public void setNumColumns(int columns)(Code) | | Set the number of columns in which to divide the flow area
Parameters: columns - the number of columns, if <1 a single flow area is used |
setText | public void setText(String text)(Code) | | Set the label/text of the component. Usage depends on the concrete component
type
Parameters: text - the new text. |
step | public void step(int w, int h)(Code) | | Adjust the settings for the next step.
Parameters: w - the width Parameters: h - the height |
wrapString | protected double wrapString(Graphics2D g2, String text, double currentPos, double y, Area[] columns)(Code) | | Draw text that wraps within the flow area
Parameters: g2 - the graphics context Parameters: text - the text Parameters: currentPos - the current y offset for a new column Parameters: y - the current y offset within the column for a new block of text Parameters: columns - the area of the columns the latest y position for drawing/rendering |
Methods inherited from com.xoetrope.swing.animation.XAnimationSurface | protected void autoStart()(Code)(Java Doc) public void begin()(Code)(Java Doc) public BufferedImage createBufferedImage(int w, int h, int imgType)(Code)(Java Doc) public Graphics2D createGraphics2D(int width, int height, BufferedImage bi, Graphics g)(Code)(Java Doc) abstract public void drawObjects(int w, int h, Graphics2D g2)(Code)(Java Doc) public void end()(Code)(Java Doc) public Animator getAnimator()(Code)(Java Doc) public boolean getAntiAlias()(Code)(Java Doc) public boolean getAutoStart()(Code)(Java Doc) public boolean getComposite()(Code)(Java Doc) public int getImageType()(Code)(Java Doc) public int getIncrement()(Code)(Java Doc) public int getLoopTime()(Code)(Java Doc) public boolean getRendering()(Code)(Java Doc) public long getSleepTime()(Code)(Java Doc) public String getText()(Code)(Java Doc) public void init()(Code)(Java Doc) public boolean isAnimated(Animator at)(Code)(Java Doc) public boolean isFinished(Animator at)(Code)(Java Doc) public boolean isStarted()(Code)(Java Doc) public void paintComponent(Graphics g)(Code)(Java Doc) public int print(Graphics g, PageFormat pf, int pi) throws PrinterException(Code)(Java Doc) public static String quoteReplacement(String s)(Code)(Java Doc) public void render(Animator at)(Code)(Java Doc) public void repeat()(Code)(Java Doc) public static String replace(String source, CharSequence target, CharSequence replacement)(Code)(Java Doc) public void reset()(Code)(Java Doc) public void setAnimator(Animator thread)(Code)(Java Doc) public void setAntiAlias(boolean aa)(Code)(Java Doc) public int setAttribute(String attribName, Object attribValue)(Code)(Java Doc) public void setAutoStart(boolean as)(Code)(Java Doc) public void setComposite(boolean cp)(Code)(Java Doc) public void setImageType(int imgType)(Code)(Java Doc) public void setIncrement(int incr)(Code)(Java Doc) public void setLoopTime(int lt)(Code)(Java Doc) public void setRendering(boolean rd)(Code)(Java Doc) public void setSleepTime(long st)(Code)(Java Doc) public void setText(String newText)(Code)(Java Doc) public void setTexture(Object obj)(Code)(Java Doc) public void start()(Code)(Java Doc) public synchronized void stop()(Code)(Java Doc) public void timingEvent(float fraction)(Code)(Java Doc)
|
|
|