Class VisualizationTask

    • Field Detail

      • level

        private int level
        Meta data key: Level for visualizer ordering

        Returns an integer indicating the "height" of this Visualizer. It is intended to impose an ordering on the execution of Visualizers as a Visualizer may depend on another Visualizer running earlier.
        Lower numbers should result in a earlier use of this Visualizer, while higher numbers should result in a later use. If more Visualizers have the same level, no ordering is guaranteed.
        Note that this value is only a recommendation, as it is totally up to the framework to ignore it.

      • visible

        private boolean visible
        Flag to control visibility.
      • flags

        private int flags
        Render capabilities
      • tool

        private boolean tool
        Flag to mark the visualizer as tool.
      • LEVEL_BACKGROUND

        public static final int LEVEL_BACKGROUND
        Background layer
        See Also:
        Constant Field Values
      • LEVEL_FOREGROUND

        public static final int LEVEL_FOREGROUND
        Passive foreground layer
        See Also:
        Constant Field Values
      • LEVEL_INTERACTIVE

        public static final int LEVEL_INTERACTIVE
        Active foreground layer (interactive elements)
        See Also:
        Constant Field Values
      • name

        private java.lang.String name
        Name
      • result

        private java.lang.Object result
        The result we are attached to
      • relation

        private Relation<?> relation
        The main representation
      • reqwidth

        private double reqwidth
        Width request
      • reqheight

        private double reqheight
        Height request
    • Constructor Detail

      • VisualizationTask

        public VisualizationTask​(VisFactory factory,
                                 java.lang.String name,
                                 java.lang.Object result,
                                 Relation<?> relation)
        Visualization task.
        Parameters:
        factory - Factory
        name - Name
        result - Result
        relation - Relation to use
    • Method Detail

      • has

        public boolean has​(VisualizationTask.UpdateFlag f)
        Update if any oft these bits is set.
        Parameters:
        f - update flag
        Returns:
        true if any bit is set.
      • has

        public boolean has​(VisualizationTask.RenderFlag f)
        Update if any oft these flags is set.
        Parameters:
        f - render flag
        Returns:
        true if any bit is set.
      • level

        public VisualizationTask level​(int level)
        Set the level (priority) of a visualization.
        Parameters:
        level - Level
        Returns:
        this, for method chaining.
      • level

        public int level()
        Get the level (priority) of the visualization.
        Returns:
        Level
      • tool

        public VisualizationTask tool​(boolean t)
        Flag as tool visualizer.

        TODO: don't use a separate boolean for this, but, e.g., interface?

        Parameters:
        t - Tool flag
        Returns:
        this, for method chaining.
      • isTool

        public boolean isTool()
        Get the "tool" flag of the visualizer.
        Returns:
        tool flag.
      • visibility

        public VisualizationTask visibility​(boolean vis)
        Init the default visibility of a task.
        Parameters:
        vis - Visibility.
        Returns:
        this, for method chaining.
      • isVisible

        public boolean isVisible()
        Get the visibility flag.
        Returns:
        Visibility
      • requestSize

        public VisualizationTask requestSize​(double w,
                                             double h)
        Set the size request.
        Parameters:
        w - Width
        h - Height
        Returns:
        this, for method chaining.
      • getRequestedWidth

        public double getRequestedWidth()
        Get the requested width.
        Returns:
        Width
      • getRequestedHeight

        public double getRequestedHeight()
        Get the requested height.
        Returns:
        Height
      • getFactory

        public VisFactory getFactory()
        Get the visualizer factory.
        Returns:
        Visualizer factory
      • getResult

        public <R> R getResult()
      • getRelation

        public <R extends Relation<?>> R getRelation()
      • getMenuName

        public java.lang.String getMenuName()
        Description copied from interface: VisualizationItem
        Name to display in the menu. May be null or empty string.
        Specified by:
        getMenuName in interface VisualizationItem
        Returns:
        Menu name.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object