Class GridView

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ActorHandler, ActorReferenceHandler, DataPlotUpdaterSupporter, DisplayTypeSupporter, ErrorHandler, Flushable, MutableActorHandler, ComponentSupplier, MenuBarProvider, SendToActionSupporter, Serializable, Comparable

    public class GridView
    extends AbstractMultiView
    implements ComponentSupplier, DataPlotUpdaterSupporter
    Displays multiple graphical actors in a grid. The actors get added row-wise to the grid from top-left to bottom-right. The actors can be referenced in the flow using adams.flow.sink.CallableSink actors.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: GridView
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; useful for critical 
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -short-title <boolean> (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
        default: false
     
    -display-in-editor <boolean> (property: displayInEditor)
        If enabled displays the panel in a tab in the flow editor rather than in 
        a separate frame.
        default: false
     
    -width <int> (property: width)
        The width of the dialog.
        default: 800
        minimum: -1
     
    -height <int> (property: height)
        The height of the dialog.
        default: 600
        minimum: -1
     
    -x <int> (property: x)
        The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right
        ).
        default: -1
        minimum: -3
     
    -y <int> (property: y)
        The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom
        ).
        default: -1
        minimum: -3
     
    -actor <adams.flow.core.Actor> [-actor ...] (property: actors)
        The panel-generating actors to display in the grid.
        default: 
     
    -num-rows <int> (property: numRows)
        The number of rows in the grid.
        default: 1
        minimum: 1
     
    -num-cols <int> (property: numCols)
        The number of columns in the grid.
        default: 1
        minimum: 1
     
    -add-headers <boolean> (property: addHeaders)
        If enabled, headers with the names of the actors as labels get added as 
        well.
        default: false
     
    -show-controls <boolean> (property: showControls)
        If enabled, the controls for adjusting rows/columns are visible.
        default: false
     
    -writer <adams.gui.print.JComponentWriter> (property: writer)
        The writer to use for generating the graphics output.
        default: adams.gui.print.NullWriter
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_NumRows

        protected int m_NumRows
        the number of rows to display.
      • m_NumCols

        protected int m_NumCols
        the number of columns to display.
      • m_AddHeaders

        protected boolean m_AddHeaders
        whether to add headers.
      • m_ShowControls

        protected boolean m_ShowControls
        whether to show the controls.
      • m_Panels

        protected List<BasePanel> m_Panels
        the panels to display.
    • Constructor Detail

      • GridView

        public GridView()
    • Method Detail

      • setNumRows

        public void setNumRows​(int value)
        Sets the number of rows in the grid.
        Parameters:
        value - the number of rows
      • getNumRows

        public int getNumRows()
        Returns the number of rows in the grid.
        Returns:
        the number of rows
      • numRowsTipText

        public String numRowsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumCols

        public void setNumCols​(int value)
        Sets the number of columns in the grid.
        Parameters:
        value - the number of cols
      • getNumCols

        public int getNumCols()
        Returns the number of columns in the grid.
        Returns:
        the number of cols
      • numColsTipText

        public String numColsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAddHeaders

        public void setAddHeaders​(boolean value)
        Sets whether to add headers to the cells in the grid with the names of the actors.
        Parameters:
        value - true if to add headers
      • getAddHeaders

        public boolean getAddHeaders()
        Returns whether to add headers to the cells in the grid with the names of the actors.
        Returns:
        true if to add headers
      • addHeadersTipText

        public String addHeadersTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setShowControls

        public void setShowControls​(boolean value)
        Sets whether to show the controls for adjusting rows/columns.
        Parameters:
        value - true if to show controls
      • getShowControls

        public boolean getShowControls()
        Returns whether to show the controls for adjusting rows/columns.
        Returns:
        true if to show controls
      • showControlsTipText

        public String showControlsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setWriter

        public void setWriter​(JComponentWriter value)
        Sets the writer.
        Parameters:
        value - the writer
      • getWriter

        public JComponentWriter getWriter()
        Returns the writer.
        Returns:
        the writer
      • writerTipText

        public String writerTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • actorsTipText

        public String actorsTipText()
        Returns the tip text for this property.
        Specified by:
        actorsTipText in class AbstractMultiView
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • updatePlot

        public void updatePlot()
        Updates the data container panel regardless, notifying the listeners.
        Specified by:
        updatePlot in interface DataPlotUpdaterSupporter
      • addPanel

        public void addPanel​(Actor actor,
                             BasePanel panel)
        Replaces the current dummy panel with the actual panel.
        Specified by:
        addPanel in class AbstractMultiView
        Parameters:
        actor - the actor this panel is for
        panel - the panel to replace the dummy one