Class MatrixPlotDataSource

java.lang.Object
mgui.interfaces.plots.MatrixPlotDataSource
All Implemented Interfaces:
InterfaceDataSource<MguiDouble>, NamedDataSource, VariableListener

public class MatrixPlotDataSource
extends java.lang.Object
implements InterfaceDataSource<MguiDouble>, VariableListener, NamedDataSource
Data source representing a MatrixInt object.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • matrix_map

      protected java.util.HashMap<java.lang.String,​MatrixInt> matrix_map
    • sourceListeners

      protected java.util.ArrayList<DataSourceListener> sourceListeners
    • last_channel_changed

      protected java.lang.String last_channel_changed
    • last_channel_removed

      protected java.lang.String last_channel_removed
    • last_channel_added

      protected java.lang.String last_channel_added
    • batch

      protected boolean batch
    • emission

      protected boolean emission
    • reset

      protected boolean reset
    • cursor

      protected int cursor
  • Constructor Details

    • MatrixPlotDataSource

      public MatrixPlotDataSource()
  • Method Details

    • getMatrix

      public MatrixInt getMatrix​(java.lang.String channel)
      Return the matrix corresponding to channel.
      Parameters:
      channel -
      Returns:
    • getSourceSignal

      public java.util.List<MguiDouble> getSourceSignal()
      Description copied from interface: InterfaceDataSource
      Returns a list of type T, representing a signal emission.
      Specified by:
      getSourceSignal in interface InterfaceDataSource<MguiDouble>
      Returns:
    • getSourceSignalAsBytes

      public byte[] getSourceSignalAsBytes()
      Description copied from interface: InterfaceDataSource
      Returns an array of bytes, representing a signal emission.
      Specified by:
      getSourceSignalAsBytes in interface InterfaceDataSource<MguiDouble>
      Returns:
    • addDataSourceListener

      public void addDataSourceListener​(DataSourceListener l)
      Specified by:
      addDataSourceListener in interface InterfaceDataSource<MguiDouble>
    • removeDataSourceListener

      public void removeDataSourceListener​(DataSourceListener l)
      Specified by:
      removeDataSourceListener in interface InterfaceDataSource<MguiDouble>
    • getChannelNames

      public java.util.List<java.lang.String> getChannelNames()
      Specified by:
      getChannelNames in interface NamedDataSource
    • setChannelNames

      public void setChannelNames​(java.util.List<java.lang.String> names)
      Specified by:
      setChannelNames in interface NamedDataSource
    • variableValuesUpdated

      public void variableValuesUpdated​(VariableEvent e)
      Description copied from interface: VariableListener
      Called when a variable's values are updated
      Specified by:
      variableValuesUpdated in interface VariableListener
    • fireEmission

      protected void fireEmission​(int size)
      Fires a source emission of size size, and updates the cursor.
      Parameters:
      size -
    • fireReset

      protected void fireReset()
      Informs listeners that this data source has been reset (i.e., the XY signal history should be destroyed.
    • setBatch

      public void setBatch​(boolean b)
      Informs this data source to treat all subsequent operations as a batch job; i.e., do not fire any events. Events will be fired, if necessary, when this method is called with b == false.
      Parameters:
      b -
    • reset

      public void reset() throws java.io.IOException
      Resets this data source.
      Throws:
      java.io.IOException
    • setChannel

      public void setChannel​(MatrixInt matrix)
      Sets a channel for this data source; uses the object's name as the channel name. If a channel by this name doesn't already exist, creates it; otherwise overwrites it. Finally, fires an emission event to alert listeners of this change.
      Parameters:
      matrix -
    • removeChannel

      public void removeChannel​(java.lang.String channel)
      Removes a channel for this data source.
      Parameters:
      channel -