Class CodePainter

  • All Implemented Interfaces:
    com.ensoftcorp.atlas.ui.scripts.selections.IExplorableScript, com.ensoftcorp.atlas.ui.scripts.selections.IResizableScript

    public abstract class CodePainter
    extends Configurable
    implements com.ensoftcorp.atlas.ui.scripts.selections.IResizableScript, com.ensoftcorp.atlas.ui.scripts.selections.IExplorableScript
    • Constructor Detail

      • CodePainter

        public CodePainter()
    • Method Detail

      • isHighlightSelectionsEnabled

        public boolean isHighlightSelectionsEnabled()
      • enableHighlightSelections

        public void enableHighlightSelections​(boolean enabled)
      • getDefaultColorPalettes

        public abstract java.util.List<ColorPalette> getDefaultColorPalettes()
        Returns a default list of ordered color palettes The 0th element represents the first color palette layer the will be applied
        Returns:
      • restoreDefaultColorPalettes

        public void restoreDefaultColorPalettes()
        Restores default color palettes
      • setColorPaletteConflictStrategy

        public void setColorPaletteConflictStrategy​(CodePainter.ColorPaletteConflictStrategy conflictStrategy)
        Sets a coloring conflict resolution strategy
        Parameters:
        conflictStrategy -
      • getActiveColorPalette

        public ColorPalette getActiveColorPalette()
      • getColorPalettes

        public java.util.List<ColorPalette> getColorPalettes()
        Returns an ordered list of color palettes The 0th element represents the first layer of coloring
        Returns:
      • getEnabledColorPalettes

        public java.util.List<ColorPalette> getEnabledColorPalettes()
        Returns an ordered list of color palettes that are enabled. This result is a subset of the result produced by getColorPalettes() The 0th element represents the first layer of coloring
        Returns:
      • addColorPalette

        public void addColorPalette​(ColorPalette palette)
        Adds a color palette to the code painter and enables the color palette
        Parameters:
        palette -
      • addColorPalette

        public void addColorPalette​(ColorPalette palette,
                                    int index)
        Adds a color palette to the code painter at the given index and shifts any subsequent color palettes to the right of the index
        Parameters:
        palette -
        index -
      • removeColorPalette

        public void removeColorPalette​(ColorPalette palette)
        Removes a color palette from the code painter
        Parameters:
        palette -
      • removeColorPalette

        public void removeColorPalette​(int index)
        Removes a color palette at the given index and shifts any subsequent methods to the left of the index
        Parameters:
        index -
      • isColorPaletteEnabled

        public boolean isColorPaletteEnabled​(ColorPalette palette)
        Returns true if the color palette exists in the code painter and the palette is enabled
        Parameters:
        palette -
        Returns:
      • enableColorPalette

        public void enableColorPalette​(ColorPalette palette)
        Enables the color palette if the color palette exists and isn't already enabled
        Parameters:
        palette -
      • disableColorPalette

        public void disableColorPalette​(ColorPalette palette)
        Disables the color palette if the color palette exists and isn't already disabled
        Parameters:
        palette -
      • getName

        public abstract java.lang.String getName()
        Returns the name of the code painter
        Returns:
      • getDescription

        public abstract java.lang.String getDescription()
        Returns a plaintext description of the code painter
        Returns:
      • getCategory

        public abstract java.lang.String getCategory()
        Defines the category this code painter is classified under. Optionally categories can be qualified for multiple levels with "/"
        Returns:
      • getSupportedNodeTags

        public abstract java.lang.String[] getSupportedNodeTags()
        Returns the supported node types this code painter can respond to
        Returns:
      • getSupportedEdgeTags

        public abstract java.lang.String[] getSupportedEdgeTags()
        Returns the supported edge types this code painter can respond to
        Returns:
      • getDefaultStepReverse

        public abstract int getDefaultStepReverse()
        Returns the number of reverse steps out of the graph to compute
        Returns:
      • getDefaultStepTop

        @Deprecated
        public int getDefaultStepTop()
        Deprecated.
        This is a legacy interface to get the number of steps to reverse Use getDefaultStepReverse method instead.
        Specified by:
        getDefaultStepTop in interface com.ensoftcorp.atlas.ui.scripts.selections.IResizableScript
      • getDefaultStepBottom

        @Deprecated
        public int getDefaultStepBottom()
        Deprecated.
        This is a legacy interface to get the number of steps to forward Use getDefaultStepForward method instead.
        Specified by:
        getDefaultStepBottom in interface com.ensoftcorp.atlas.ui.scripts.selections.IResizableScript
      • getDefaultStepForward

        public abstract int getDefaultStepForward()
        Returns the number of forward steps out of the graph to compute
        Returns:
      • explore

        public com.ensoftcorp.atlas.core.script.FrontierStyledResult explore​(com.ensoftcorp.atlas.ui.selection.event.FrontierEdgeExploreEvent event,
                                                                             com.ensoftcorp.atlas.core.script.FrontierStyledResult oldResult)
        Specified by:
        explore in interface com.ensoftcorp.atlas.ui.scripts.selections.IExplorableScript
      • evaluate

        public com.ensoftcorp.atlas.core.script.FrontierStyledResult evaluate​(com.ensoftcorp.atlas.ui.selection.event.IAtlasSelectionEvent event,
                                                                              int reverse,
                                                                              int forward)
        Computes a new styled frontier result for a given selection event and the number of steps forward and reverse to explore on the frontier.
        Specified by:
        evaluate in interface com.ensoftcorp.atlas.ui.scripts.selections.IResizableScript
      • convertSelection

        public com.ensoftcorp.atlas.core.query.Q convertSelection​(com.ensoftcorp.atlas.core.query.Q filteredSelections)
        Filters the selection event to selections that the code painter responds to. Ideally any selection that a script can respond to should be included in the result or converted to a selection that is contained in the final result. If the selection is just a convenience input (for example a data flow node) that corresponds to a selection contained in the final result (say a control flow node that contains the selected data flow node) then this method should be overridden to convert the selection to selections contained in the final result.
        Parameters:
        event -
        Returns:
      • computeFrontierResult

        public abstract CodePainter.UnstyledFrontierResult computeFrontierResult​(com.ensoftcorp.atlas.core.query.Q filteredSelections,
                                                                                 int reverse,
                                                                                 int forward)
        Computes an unstyled frontier result for the given selection and steps reverse/forward.
        Parameters:
        filteredSelections -
        reverse -
        forward -
        Returns:
      • computeResult

        public CodePainter.UnstyledResult computeResult​(com.ensoftcorp.atlas.core.query.Q filteredSelections)
        Computes an unstyled result for the given selection. This method is equivalent to computing a frontier result with 0 steps reverse/forward.
        Parameters:
        filteredSelections -
        Returns:
      • hashCode

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

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