Class Canvas

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

    public class Canvas
    extends AbstractGraphicalDisplay
    General purpose drawing canvas. What kind of data can be drawn depends on the paintlet in use.

    Input/output:
    - accepts:
       java.lang.Double[]


    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: Canvas
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
     
    -stop-flow-on-error (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
     
    -short-title (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
     
    -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
     
    -writer <adams.gui.print.JComponentWriter> (property: writer)
        The writer to use for generating the graphics output.
        default: adams.gui.print.NullWriter
     
    -background-paintlet <adams.gui.visualization.core.Paintlet> (property: backgroundPaintlet)
        The paintlet to use for plotting the background.
        default: adams.gui.visualization.core.BackgroundImagePaintlet
     
    -paintlet <adams.flow.sink.canvas.DataPoolPaintlet> (property: paintlet)
        The paintlet to use for plotting the data.
        default: adams.flow.sink.canvas.XYPaintlet
     
    -post-processor <adams.flow.sink.canvas.AbstractDataPoolPostProcessor> (property: postProcessor)
        The post-processor to use on the data after a token was received and plotted.
        default: adams.flow.sink.canvas.PassThrough
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • Canvas

        public Canvas()
    • Method Detail

      • setBackgroundPaintlet

        public void setBackgroundPaintlet​(Paintlet value)
        Sets the paintlet to use for plotting the background.
        Parameters:
        value - the paintlet
      • getBackgroundPaintlet

        public Paintlet getBackgroundPaintlet()
        Returns the paintlet to use for plotting the background.
        Returns:
        the paintlet
      • backgroundPaintletTipText

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

        public void setPaintlet​(DataPoolPaintlet value)
        Sets the paintlet to use for plotting the data.
        Parameters:
        value - the paintlet
      • getPaintlet

        public DataPoolPaintlet getPaintlet()
        Returns the paintlet to use for plotting the data.
        Returns:
        the paintlet
      • paintletTipText

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

        public void setPostProcessor​(AbstractDataPoolPostProcessor value)
        Sets the post-processor to use on the data, e.g., for pruning.
        Parameters:
        value - the post-processor
      • getPostProcessor

        public AbstractDataPoolPostProcessor getPostProcessor()
        Returns the post-processor to use on the data, e.g., for pruning.
        Returns:
        the post-processor
      • postProcessorTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        the Class of objects that can be processed
      • display

        protected void display​(Token token)
        Displays the token (the panel and dialog have already been created at this stage).
        Specified by:
        display in class AbstractDisplay
        Parameters:
        token - the token to display