edu.eside.flingbox.scene
Class Scene
java.lang.Object
edu.eside.flingbox.scene.StaticScene
edu.eside.flingbox.scene.DrawableScene
edu.eside.flingbox.scene.Scene
- All Implemented Interfaces:
- SceneGestureDetector.OnInputListener, XmlExporter.XmlSerializable, XmlImporter.XmlParseable
public class Scene
- extends DrawableScene
- implements SceneGestureDetector.OnInputListener, XmlExporter.XmlSerializable, XmlImporter.XmlParseable
Scene Descriptor.
Constructor Summary |
Scene(Context c)
Default constructor for an scene |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Scene
public Scene(Context c)
- Default constructor for an scene
- Parameters:
c
- context
startSimulation
public boolean startSimulation()
- Starts physical simulation
- Returns:
- true if simulation is started
stopSimulation
public boolean stopSimulation()
isSimulating
public boolean isSimulating()
onFling
public boolean onFling(MotionEvent onDownEv,
MotionEvent e,
float velocityX,
float velocityY)
- Overrides:
onFling
in class StaticScene
onLongPress
public void onLongPress(MotionEvent e)
- Overrides:
onLongPress
in class DrawableScene
onDown
public boolean onDown(MotionEvent e)
- Overrides:
onDown
in class DrawableScene
onUp
public boolean onUp(MotionEvent e)
- Description copied from class:
DrawableScene
- Called when touch event ends correctly.
Drawable scene creates the polygon for drawing pattern.
- Specified by:
onUp
in interface SceneGestureDetector.OnInputListener
- Overrides:
onUp
in class DrawableScene
- Returns:
onScroll
public boolean onScroll(MotionEvent downEv,
MotionEvent e,
float distanceX,
float distanceY)
- Overrides:
onScroll
in class DrawableScene
onDragBody
public boolean onDragBody(MotionEvent e,
Body b)
onTrackballEvent
public boolean onTrackballEvent(MotionEvent ev)
- Overrides:
onTrackballEvent
in class StaticScene
writeXml
public boolean writeXml(XmlSerializer serializer)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
java.io.IOException
- Specified by:
writeXml
in interface XmlExporter.XmlSerializable
- Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
java.io.IOException
readXml
public boolean readXml(XmlPullParser parser)
throws XmlPullParserException,
java.io.IOException,
InvalidXmlException
- Specified by:
readXml
in interface XmlImporter.XmlParseable
- Throws:
XmlPullParserException
java.io.IOException
InvalidXmlException