| javax.swing.JComponent com.xoetrope.swing.animation.XAnimationSurface
All known Subclasses: com.xoetrope.swing.XFlowedTextComponent, com.xoetrope.swing.XCreditsText, com.xoetrope.swing.XProgressIndicator, com.xoetrope.swing.XMarqueeText,
XAnimationSurface | abstract public class XAnimationSurface extends JComponent implements Printable,TimingTarget,XAttributedComponent,XTextHolder(Code) | | All demos extend this JAnimationSurface Abstract class. From
this class demos must implement the drawObjects method. This
class handles animated demos, the demo must implement the
JAnimationContext interface.
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.27 $
|
Method Summary | |
protected void | autoStart() | public void | begin() Called when the Animator's animation begins. | public BufferedImage | createBufferedImage(int w, int h, int imgType) Create a buffer for the animation
Parameters: w - the image width Parameters: h - the image height Parameters: imgType - the image type e.g. | public Graphics2D | createGraphics2D(int width, int height, BufferedImage bi, Graphics g) Create a graphics context for an image buffer and prepare that buffer for use. | abstract public void | drawObjects(int w, int h, Graphics2D g2) All classes that extend JAnimationSurface must implement this routine... | public void | end() | public Animator | getAnimator() Get the animation thread. | public boolean | getAntiAlias() | public boolean | getAutoStart() | public boolean | getComposite() | public int | getImageType() | public int | getIncrement() | public int | getLoopTime() | public boolean | getRendering() | public long | getSleepTime() | public String | getText() | public void | init() | public boolean | isAnimated(Animator at) | public boolean | isFinished(Animator at) | public boolean | isStarted() | public void | paintComponent(Graphics g) | public int | print(Graphics g, PageFormat pf, int pi) | public static String | quoteReplacement(String s) Returns a literal replacement String for the specified
String .
This method produces a String that will work
use as a literal replacement s in the
appendReplacement method of the
Matcher class.
The String produced will match the sequence of characters
in s treated as a literal sequence. | public void | render(Animator at) | public void | repeat() | public static String | replace(String source, CharSequence target, CharSequence replacement) Replaces each substring of this string that matches the literal target
sequence with the specified literal replacement sequence. | public void | reset() | public void | setAnimator(Animator thread) Set the animation thread. | public void | setAntiAlias(boolean aa) Turn the value anti-aliasing on or off. | public int | setAttribute(String attribName, Object attribValue) Set one or more attributes of the component. | public void | setAutoStart(boolean as) | public void | setComposite(boolean cp) Set the composite instance
Parameters: cp - the composite e.g. | public void | setImageType(int imgType) Set the way in which the image is presented. | public void | setIncrement(int incr) Sets the update increment. | public void | setLoopTime(int lt) | public void | setRendering(boolean rd) | public void | setSleepTime(long st) | public void | setText(String newText) Set the label/text of the component. | public void | setTexture(Object obj) | public void | start() | public synchronized void | stop() | public void | timingEvent(float fraction) This method will receive all of the timing events from an Animator
during an animation. |
animator | protected Animator animator(Code) | | |
ascent | protected float ascent(Code) | | |
autoStart | protected boolean autoStart(Code) | | |
currentProject | protected XProject currentProject(Code) | | The owner project and the context in which this object operates.
|
finished | protected boolean finished(Code) | | |
imageType | protected int imageType(Code) | | |
increment | protected int increment(Code) | | |
loopTime | protected int loopTime(Code) | | |
oXoYoWoH | protected int oXoYoWoH(Code) | | |
oldWoldH | protected int oldWoldH(Code) | | |
position | protected int position(Code) | | |
sleepTime | protected long sleepTime(Code) | | |
startTime | protected long startTime(Code) | | |
timingFraction | protected float timingFraction(Code) | | |
XAnimationSurface | protected XAnimationSurface()(Code) | | |
autoStart | protected void autoStart()(Code) | | Start an autostart animation if it hassn't started already
|
begin | public void begin()(Code) | | Called when the Animator's animation begins. This provides a chance
for targets to perform any setup required at animation start time.
|
createBufferedImage | public BufferedImage createBufferedImage(int w, int h, int imgType)(Code) | | Create a buffer for the animation
Parameters: w - the image width Parameters: h - the image height Parameters: imgType - the image type e.g. BufferedImage.TYPE_INT_ARGB the new image |
createGraphics2D | public Graphics2D createGraphics2D(int width, int height, BufferedImage bi, Graphics g)(Code) | | Create a graphics context for an image buffer and prepare that buffer for use.
Parameters: width - the width Parameters: height - the height Parameters: bi - the buffered image Parameters: g - the graphics context the Java2D graphics context for the buffer |
drawObjects | abstract public void drawObjects(int w, int h, Graphics2D g2)(Code) | | All classes that extend JAnimationSurface must implement this routine...
Parameters: w - the width Parameters: h - the height Parameters: g2 - the graphics context |
end | public void end()(Code) | | Called when the Animator's animation ends
|
getAnimator | public Animator getAnimator()(Code) | | Get the animation thread.
the animation thread |
getAntiAlias | public boolean getAntiAlias()(Code) | | Get the value anti-aliasing value
Parameters: aa - true if anti-aliasing is on |
getAutoStart | public boolean getAutoStart()(Code) | | Get the autostart parameter
the autostart value |
getComposite | public boolean getComposite()(Code) | | Get the composite setup state
true if a compisite is used |
getImageType | public int getImageType()(Code) | | Get the iamge type used for buffering the animation
Parameters: the - image type flag |
getIncrement | public int getIncrement()(Code) | | Get the update increment
the animation step increment in milliseconds |
getLoopTime | public int getLoopTime()(Code) | | Get the animation loop time
the loop time |
getRendering | public boolean getRendering()(Code) | | Get the rendering hint
true if rendering is to favour quality over speed |
getSleepTime | public long getSleepTime()(Code) | | Get the sleep time in milliseconds
the sleep time |
getText | public String getText()(Code) | | Get the text of the control
the text |
init | public void init()(Code) | | Initialize the animation surface and prepare the starting point/setup
|
isAnimated | public boolean isAnimated(Animator at)(Code) | | Should the object be animated in this step?
Parameters: at - the animation thread true if the animation has started and is still animating |
isFinished | public boolean isFinished(Animator at)(Code) | | Are there more steps to come?
Parameters: at - the animation thread true if the animation has completed |
isStarted | public boolean isStarted()(Code) | | Has the animation begun
Parameters: at - the animation thread true if the animation has started |
paintComponent | public void paintComponent(Graphics g)(Code) | | Paint the component, buffering the image in the process if necessary
Parameters: g - the graphics context |
quoteReplacement | public static String quoteReplacement(String s)(Code) | | Returns a literal replacement String for the specified
String .
This method produces a String that will work
use as a literal replacement s in the
appendReplacement method of the
Matcher class.
The String produced will match the sequence of characters
in s treated as a literal sequence. Slashes ('\') and
dollar signs ('$') will be given no special meaning.
Parameters: s - The string to be literalized A literal string replacement since: 1.5 |
render | public void render(Animator at)(Code) | | Do the rendering of the animation object
Parameters: at - the animation thread |
repeat | public void repeat()(Code) | | Called when the Animator repeats the animation cycle
|
replace | public static String replace(String source, CharSequence target, CharSequence replacement)(Code) | | Replaces each substring of this string that matches the literal target
sequence with the specified literal replacement sequence. The
replacement proceeds from the beginning of the string to the end, for
example, replacing "aa" with "b" in the string "aaa" will result in
"ba" rather than "ab".
Pulled from JDK 1.5 for compatibility with 1.4
Parameters: source - the source text/string Parameters: target - The sequence of char values to be replaced Parameters: replacement - The replacement sequence of char values The resulting string |
reset | public void reset()(Code) | | |
setAnimator | public void setAnimator(Animator thread)(Code) | | Set the animation thread.
Parameters: thread - the animation thread |
setAntiAlias | public void setAntiAlias(boolean aa)(Code) | | Turn the value anti-aliasing on or off. By default the anti-aliasing is on
Parameters: aa - true to turn the anti-aliasing on |
setAttribute | public int setAttribute(String attribName, Object attribValue)(Code) | | Set one or more attributes of the component.
Parameters: attribName - the name of the attribute- text - set the text
- content - set the text
- autostart - true to automatically start the animation
- increment - set the step size
- sleep - the sleep time in milliseconds
- loopTime - the length of the animation loop in milliseconds
Parameters: attribValue - the value of the attribute 0 for success, non zero otherwise |
setAutoStart | public void setAutoStart(boolean as)(Code) | | Flag the animation to automatically start on first display
Parameters: as - true to automatically start, false to wait for a start signal |
setComposite | public void setComposite(boolean cp)(Code) | | Set the composite instance
Parameters: cp - the composite e.g. AlphaComposite |
setImageType | public void setImageType(int imgType)(Code) | | Set the way in which the image is presented.
Parameters: imgType - = 0 to create a buffered image of TYPE_INT_ARGB, 1 = this class does not set up a buffered image or, >2 = BufferedImage.<> + 2 where type is the BufferedImage type constant |
setIncrement | public void setIncrement(int incr)(Code) | | Sets the update increment.
Parameters: incr - the increment for animation steps in milliseconds |
setLoopTime | public void setLoopTime(int lt)(Code) | | Set the animation loop time in milliseconds
Parameters: lt - the animation time |
setRendering | public void setRendering(boolean rd)(Code) | | Set the rendering hint for quality or speed
Parameters: rd - true for quality, false for speed |
setSleepTime | public void setSleepTime(long st)(Code) | | Set the sleep time for the animation thread
Parameters: st - defaults to 100 milliseconds |
setText | public void setText(String newText)(Code) | | Set the label/text of the component. Usage depends on the concrete component
type
Parameters: newText - the new text |
setTexture | public void setTexture(Object obj)(Code) | | Set a texture for paints
Parameters: obj - the Paint object, for example a GradientPaint |
start | public void start()(Code) | | Begin the animation
|
stop | public synchronized void stop()(Code) | | End the animation
|
timingEvent | public void timingEvent(float fraction)(Code) | | This method will receive all of the timing events from an Animator
during an animation. The fraction is the percent elapsed (0 to 1)
of the current animation cycle.
Parameters: fraction - the fraction of completion between the start andend of the current cycle. Note that on reversing cycles(Animator.Direction.BACKWARD) the fraction decreasesfrom 1.0 to 0 on backwards-running cycles. Note also that animationswith a duration of Animator.INFINITE INFINITE will calltimingEvent with an undefined value for fraction, since there isno fraction that makes sense if the animation has no defined length. See Also: Animator.Direction |
Methods inherited from javax.swing.JComponent | public void addAncestorListener(AncestorListener listener)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) public synchronized void addVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void computeVisibleRect(Rectangle visibleRect)(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public JToolTip createToolTip()(Code)(Java Doc) public void disable()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, int oldValue, int newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, char oldValue, char newValue)(Code)(Java Doc) protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws java.beans.PropertyVetoException(Code)(Java Doc) public AccessibleContext getAccessibleContext()(Code)(Java Doc) public ActionListener getActionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) final public ActionMap getActionMap()(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public AncestorListener[] getAncestorListeners()(Code)(Java Doc) public boolean getAutoscrolls()(Code)(Java Doc) public int getBaseline(int width, int height)(Code)(Java Doc) public BaselineResizeBehavior getBaselineResizeBehavior()(Code)(Java Doc) public Border getBorder()(Code)(Java Doc) public Rectangle getBounds(Rectangle rv)(Code)(Java Doc) final public Object getClientProperty(Object key)(Code)(Java Doc) protected Graphics getComponentGraphics(Graphics g)(Code)(Java Doc) public JPopupMenu getComponentPopupMenu()(Code)(Java Doc) public int getConditionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) public int getDebugGraphicsOptions()(Code)(Java Doc) public static Locale getDefaultLocale()(Code)(Java Doc) public FontMetrics getFontMetrics(Font font)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public boolean getInheritsPopupMenu()(Code)(Java Doc) final public InputMap getInputMap(int condition)(Code)(Java Doc) final public InputMap getInputMap()(Code)(Java Doc) public InputVerifier getInputVerifier()(Code)(Java Doc) public Insets getInsets()(Code)(Java Doc) public Insets getInsets(Insets insets)(Code)(Java Doc) public T[] getListeners(Class<T> listenerType)(Code)(Java Doc) public Point getLocation(Point rv)(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public Component getNextFocusableComponent()(Code)(Java Doc) public Point getPopupLocation(MouseEvent event)(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) public KeyStroke[] getRegisteredKeyStrokes()(Code)(Java Doc) public JRootPane getRootPane()(Code)(Java Doc) public Dimension getSize(Dimension rv)(Code)(Java Doc) public Point getToolTipLocation(MouseEvent event)(Code)(Java Doc) public String getToolTipText()(Code)(Java Doc) public String getToolTipText(MouseEvent event)(Code)(Java Doc) public Container getTopLevelAncestor()(Code)(Java Doc) public TransferHandler getTransferHandler()(Code)(Java Doc) public String getUIClassID()(Code)(Java Doc) public boolean getVerifyInputWhenFocusTarget()(Code)(Java Doc) public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)(Java Doc) public Rectangle getVisibleRect()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getX()(Code)(Java Doc) public int getY()(Code)(Java Doc) public void grabFocus()(Code)(Java Doc) public boolean isDoubleBuffered()(Code)(Java Doc) public static boolean isLightweightComponent(Component c)(Code)(Java Doc) public boolean isManagingFocus()(Code)(Java Doc) public boolean isOpaque()(Code)(Java Doc) public boolean isOptimizedDrawingEnabled()(Code)(Java Doc) final public boolean isPaintingForPrint()(Code)(Java Doc) public boolean isPaintingTile()(Code)(Java Doc) public boolean isRequestFocusEnabled()(Code)(Java Doc) public boolean isValidateRoot()(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) protected void paintBorder(Graphics g)(Code)(Java Doc) protected void paintChildren(Graphics g)(Code)(Java Doc) protected void paintComponent(Graphics g)(Code)(Java Doc) public void paintImmediately(int x, int y, int w, int h)(Code)(Java Doc) public void paintImmediately(Rectangle r)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printAll(Graphics g)(Code)(Java Doc) protected void printBorder(Graphics g)(Code)(Java Doc) protected void printChildren(Graphics g)(Code)(Java Doc) protected void printComponent(Graphics g)(Code)(Java Doc) protected void processComponentKeyEvent(KeyEvent e)(Code)(Java Doc) protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)(Code)(Java Doc) protected void processKeyEvent(KeyEvent e)(Code)(Java Doc) protected void processMouseEvent(MouseEvent e)(Code)(Java Doc) protected void processMouseMotionEvent(MouseEvent e)(Code)(Java Doc) final public void putClientProperty(Object key, Object value)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void removeAncestorListener(AncestorListener listener)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void repaint(long tm, int x, int y, int width, int height)(Code)(Java Doc) public void repaint(Rectangle r)(Code)(Java Doc) public boolean requestDefaultFocus()(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public boolean requestFocus(boolean temporary)(Code)(Java Doc) public boolean requestFocusInWindow()(Code)(Java Doc) protected boolean requestFocusInWindow(boolean temporary)(Code)(Java Doc) public void resetKeyboardActions()(Code)(Java Doc) public void reshape(int x, int y, int w, int h)(Code)(Java Doc) public void revalidate()(Code)(Java Doc) public void scrollRectToVisible(Rectangle aRect)(Code)(Java Doc) final public void setActionMap(ActionMap am)(Code)(Java Doc) public void setAlignmentX(float alignmentX)(Code)(Java Doc) public void setAlignmentY(float alignmentY)(Code)(Java Doc) public void setAutoscrolls(boolean autoscrolls)(Code)(Java Doc) public void setBackground(Color bg)(Code)(Java Doc) public void setBorder(Border border)(Code)(Java Doc) public void setComponentPopupMenu(JPopupMenu popup)(Code)(Java Doc) public void setDebugGraphicsOptions(int debugOptions)(Code)(Java Doc) public static void setDefaultLocale(Locale l)(Code)(Java Doc) public void setDoubleBuffered(boolean aFlag)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)(Java Doc) public void setFont(Font font)(Code)(Java Doc) public void setForeground(Color fg)(Code)(Java Doc) public void setInheritsPopupMenu(boolean value)(Code)(Java Doc) final public void setInputMap(int condition, InputMap map)(Code)(Java Doc) public void setInputVerifier(InputVerifier inputVerifier)(Code)(Java Doc) public void setMaximumSize(Dimension maximumSize)(Code)(Java Doc) public void setMinimumSize(Dimension minimumSize)(Code)(Java Doc) public void setNextFocusableComponent(Component aComponent)(Code)(Java Doc) public void setOpaque(boolean isOpaque)(Code)(Java Doc) public void setPreferredSize(Dimension preferredSize)(Code)(Java Doc) public void setRequestFocusEnabled(boolean requestFocusEnabled)(Code)(Java Doc) public void setToolTipText(String text)(Code)(Java Doc) public void setTransferHandler(TransferHandler newHandler)(Code)(Java Doc) protected void setUI(ComponentUI newUI)(Code)(Java Doc) public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)(Code)(Java Doc) public void setVisible(boolean aFlag)(Code)(Java Doc) public void unregisterKeyboardAction(KeyStroke aKeyStroke)(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void updateUI()(Code)(Java Doc)
|
|
|