Class VideoTask

java.lang.Object
mgui.interfaces.graphics.video.VideoTask
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<VideoTask>, XMLObject
Direct Known Subclasses:
AttributeObjectVideoTask, VideoTask3D

public abstract class VideoTask
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable<VideoTask>, XMLObject
Base class for a video task, which manipulates an InterfaceGraphic window or its associated InterfaceObjects, over a specified time interval. Video tasks form the elements of a Video sequence.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Nested Class Summary

    Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject

    XMLObject.XMLEncoding, XMLObject.XMLType
  • Field Summary

    Fields
    Modifier and Type Field Description
    boolean isOn  
    long start_time  
    protected boolean started  
    long stop_time  
  • Constructor Summary

    Constructors
    Constructor Description
    VideoTask()  
  • Method Summary

    Modifier and Type Method Description
    abstract java.lang.Object clone()  
    int compareTo​(VideoTask t2)  
    protected abstract boolean do_it​(InterfaceGraphic<?> g, long time)
    Perform this task, contingent on time.
    java.lang.String getDTD()
    Returns the Data Type Declaration (DTD) for this object's XML representation
    java.lang.String getLocalName()
    Returns the local name associated with this XML object.
    abstract java.lang.String getName()  
    java.lang.String getSchema()  
    java.lang.String getShortXML()  
    java.lang.String getShortXML​(int tab)
    Returns a short XML representation of this object.
    long getStart()
    Returns the start time for this task
    long getStop()
    Returns the stop time for this task
    java.lang.String getXML()
    Returns this object's XML representation as a single string.
    java.lang.String getXML​(int tab)
    Returns this object's XML representation as a single string.
    void handleXMLElementEnd​(java.lang.String localName)
    Handles the end of an XML element.
    void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
    Handles the start of an XML element.
    void handleXMLString​(java.lang.String s)
    Handles a string within an XML element.
    boolean isActive​(long time)  
    boolean perform​(InterfaceGraphic<?> g, long time)
    Performs this video task, for the given time.
    void reset()
    Resets this task
    abstract void setFromTask​(VideoTask task)  
    void setStart​(long d)
    Sets the start time for this task
    void setStop​(long d)
    Sets the stop time for this task
    void updateTask​(InterfaceDisplayPanel panel)  
    void writeXML​(int tab, java.io.Writer writer)
    Writes the XML representation of this object to file.
    void writeXML​(int tab, java.io.Writer writer, ProgressUpdater progress_bar)
    Writes the XML representation of this object to file, as XMLType.Normal.
    void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)
    Writes the XML representation of this object to file.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface mgui.interfaces.xml.XMLObject

    getXMLSchema
  • Field Details

    • start_time

      public long start_time
    • stop_time

      public long stop_time
    • started

      protected boolean started
    • isOn

      public boolean isOn
  • Constructor Details

    • VideoTask

      public VideoTask()
  • Method Details

    • perform

      public boolean perform​(InterfaceGraphic<?> g, long time)
      Performs this video task, for the given time.
      Parameters:
      g -
      time -
      Returns:
    • do_it

      protected abstract boolean do_it​(InterfaceGraphic<?> g, long time) throws VideoException
      Perform this task, contingent on time.
      Parameters:
      g -
      time -
      Returns:
      Throws:
      VideoException
    • setStart

      public void setStart​(long d)
      Sets the start time for this task
      Parameters:
      d -
    • setStop

      public void setStop​(long d)
      Sets the stop time for this task
      Parameters:
      d -
    • getStart

      public long getStart()
      Returns the start time for this task
      Returns:
    • getStop

      public long getStop()
      Returns the stop time for this task
      Returns:
    • reset

      public void reset()
      Resets this task
    • isActive

      public boolean isActive​(long time)
    • getName

      public abstract java.lang.String getName()
    • getDTD

      public java.lang.String getDTD()
      Description copied from interface: XMLObject
      Returns the Data Type Declaration (DTD) for this object's XML representation

      See http://en.wikipedia.org/wiki/Document_Type_Definition for a description.

      Specified by:
      getDTD in interface XMLObject
      Returns:
    • getSchema

      public java.lang.String getSchema()
    • getXML

      public java.lang.String getXML​(int tab)
      Description copied from interface: XMLObject
      Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use the XMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater) functions to write larger objects to file.
      Specified by:
      getXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the opening XML wrapper
      Returns:
    • getShortXML

      public java.lang.String getShortXML()
    • getXML

      public java.lang.String getXML()
      Description copied from interface: XMLObject
      Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use the XMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater) functions to write larger objects to file.
      Specified by:
      getXML in interface XMLObject
      Returns:
    • handleXMLElementStart

      public void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
      Description copied from interface: XMLObject
      Handles the start of an XML element.
      Specified by:
      handleXMLElementStart in interface XMLObject
      Parameters:
      localName - Local name of the element
      attributes - Set of element attributes
      type - The XMLType of this element
    • handleXMLElementEnd

      public void handleXMLElementEnd​(java.lang.String localName)
      Description copied from interface: XMLObject
      Handles the end of an XML element.
      Specified by:
      handleXMLElementEnd in interface XMLObject
      Parameters:
      localName - Local name of the element
    • handleXMLString

      public void handleXMLString​(java.lang.String s)
      Description copied from interface: XMLObject
      Handles a string within an XML element.
      Specified by:
      handleXMLString in interface XMLObject
      Parameters:
      s - String to handle
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Returns:
    • updateTask

      public void updateTask​(InterfaceDisplayPanel panel)
    • compareTo

      public int compareTo​(VideoTask t2)
      Specified by:
      compareTo in interface java.lang.Comparable<VideoTask>
    • setFromTask

      public abstract void setFromTask​(VideoTask task)
    • clone

      public abstract java.lang.Object clone()
      Overrides:
      clone in class java.lang.Object
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      Throws:
      java.io.IOException
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, ProgressUpdater progress_bar) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file, as XMLType.Normal. The default format of XMLFormat.Ascii will be used. The basic contract for this method is that it should not write a newline character at its start or end.
      Specified by:
      writeXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • getShortXML

      public java.lang.String getShortXML​(int tab)
      Description copied from interface: XMLObject
      Returns a short XML representation of this object.
      Specified by:
      getShortXML in interface XMLObject
      Returns: