Package org.opensourcephysics.media.core
Class VideoPanel.Loader
java.lang.Object
org.opensourcephysics.media.core.VideoPanel.Loader
- All Implemented Interfaces:
XML.NonStaticLoader
,XML.ObjectLoader
,VideoIO.FinalizableLoader
- Enclosing class:
- VideoPanel
public static class VideoPanel.Loader
extends Object
implements XML.ObjectLoader, VideoIO.FinalizableLoader
A class to save and load data for this object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateObject
(XMLControl control) Return a new VideoPanel.void
dispose()
void
finalize()
void
boolean
getClip
(XMLControl control) Common to both VideoPanel and TrackerPanel, this method obtains the VideoClip and possibly its basePath, then either finalizes the panel or schedules that finalization for when an asynchronous video (SwingJS) is ready.boolean
loadObject
(XMLControl control, Object obj) Loads an object with data from an XMLControl.void
saveObject
(XMLControl control, Object obj) Saves object data to an XMLControl.
-
Field Details
-
control
-
clip
-
videoPanel
-
finalized
protected boolean finalized
-
-
Constructor Details
-
Loader
public Loader()
-
-
Method Details
-
createObject
Return a new VideoPanel.- Specified by:
createObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the control- Returns:
- the newly created object
-
loadObject
Loads an object with data from an XMLControl.- Specified by:
loadObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the controlobj
- the VideoPanel from createObject- Returns:
- the final VideoPanel (not necessarily obj)
-
getClip
Common to both VideoPanel and TrackerPanel, this method obtains the VideoClip and possibly its basePath, then either finalizes the panel or schedules that finalization for when an asynchronous video (SwingJS) is ready. Note that this method will be called multiple times if the the video is IncrementallyLoadable (Xuggle, Java).- Parameters:
control
-- Returns:
- false if deferring finalization (TrackerPanel AsyncVideo)
-
finalizeClip
-
finalizeLoading
public void finalizeLoading()- Specified by:
finalizeLoading
in interfaceVideoIO.FinalizableLoader
-
isFinalized
public boolean isFinalized()- Specified by:
isFinalized
in interfaceVideoIO.FinalizableLoader
-
finalize
public void finalize() -
saveObject
Saves object data to an XMLControl.- Specified by:
saveObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the control to save toobj
- the object to save
-
dispose
public void dispose()
-