org.concord.flash.player
Class FFlash

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.concord.flash.player.FFlash
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class FFlash
extends javax.swing.JPanel

timer Main class for handling flash files.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FFlash()
          After calling this constructor, setInputStream MUST be called with the InputStream of the flash file in order to "play" the flash file.
FFlash(java.io.InputStream in)
          Constructor for creating a flash.
 
Method Summary
protected  void calculateFrameRate()
          For calculating the actual frame rate
protected  boolean checkImage(java.awt.Dimension d)
           
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
 FMovieClip getMovieClipByPath(java.lang.String path)
          Gets an movie clip by the specified path.
 int getMovieHeight()
          Gets the height of the movie as specified in the SWF file.
 int getMovieWidth()
          Gets the width of the movie as specified in the SWF file.
 java.lang.Object getObject(java.lang.String name)
          Gets a member object from the root
 java.awt.Dimension getPreferredSize()
           
 boolean isFrameRateDrawn()
           
 boolean isSkippingFrames()
          If SkippingFrames is true then the movie skips frames when the actual frame rate drops below the specified frame rate.
static void main(java.lang.String[] args)
           
 void paintComponent(java.awt.Graphics g)
           
 void play()
          Starts playing the movie
 void render()
          Immediately paints the frame
 void setBounds(int x, int y, int width, int height)
           
 void setBounds(java.awt.Rectangle r)
           
 void setFrameRateDrawn(boolean state)
          if frameRateDrawn is true then the current frame rate is displayed at the top left corner of the movie.
 void setInputStream(java.io.InputStream in)
          Sets the input stream of the flash movie file.
 void setSize(java.awt.Dimension d)
           
 void setSize(int w, int h)
           
 void setSkippingFrames(boolean skip)
           
 void stop()
          Stops playing the movie.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FFlash

public FFlash()
After calling this constructor, setInputStream MUST be called with the InputStream of the flash file in order to "play" the flash file.

FFlash

public FFlash(java.io.InputStream in)
       throws java.io.IOException
Constructor for creating a flash. This is the way it should be created normally.
Parameters:
in - The InputStream to the SWF file.
Method Detail

setInputStream

public void setInputStream(java.io.InputStream in)
                    throws java.io.IOException
Sets the input stream of the flash movie file. This will initialize this flash object with the contents from the stream
Parameters:
in - The input stream for the .swf content

getObject

public java.lang.Object getObject(java.lang.String name)
Gets a member object from the root

getMovieClipByPath

public FMovieClip getMovieClipByPath(java.lang.String path)
Gets an movie clip by the specified path.
Parameters:
the - path
Returns:
The movie clip object of the specified path

isSkippingFrames

public boolean isSkippingFrames()
If SkippingFrames is true then the movie skips frames when the actual frame rate drops below the specified frame rate. if it is false, then the movie will play every frame (which may slow the movie...) The default is true.
Returns:
true is this movie is skipping frames

setSkippingFrames

public void setSkippingFrames(boolean skip)
Parameters:
skip - Skip frames setting

play

public void play()
Starts playing the movie

stop

public void stop()
Stops playing the movie.

getMovieWidth

public int getMovieWidth()
Gets the width of the movie as specified in the SWF file.
Returns:
the movie width (specified in the SWF file)

getMovieHeight

public int getMovieHeight()
Gets the height of the movie as specified in the SWF file.
Returns:
the movie height (as specified in the SWF file)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class javax.swing.JComponent

setSize

public void setSize(int w,
                    int h)
Overrides:
setSize in class java.awt.Component

setSize

public void setSize(java.awt.Dimension d)
Overrides:
setSize in class java.awt.Component

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class java.awt.Component

setBounds

public void setBounds(java.awt.Rectangle r)
Overrides:
setBounds in class java.awt.Component

checkImage

protected boolean checkImage(java.awt.Dimension d)
Returns:
True if the component has displayable area. False otherwise.

calculateFrameRate

protected void calculateFrameRate()
For calculating the actual frame rate

setFrameRateDrawn

public void setFrameRateDrawn(boolean state)
if frameRateDrawn is true then the current frame rate is displayed at the top left corner of the movie.
Parameters:
state - True if frame rate is to be displayed, false otherwise.

isFrameRateDrawn

public boolean isFrameRateDrawn()
Returns:
True if frame rate is currently being drawn.

render

public void render()
Immediately paints the frame

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

main

public static void main(java.lang.String[] args)