Class CodePainter
- java.lang.Object
-
- com.ensoftcorp.open.commons.codepainter.Configurable
-
- com.ensoftcorp.open.commons.codepainter.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCodePainter.ColorPaletteConflictStrategyDefines strategies for resolving coloring conflictsstatic classCodePainter.UnstyledFrontierResultHolds and unstyled frontier resultstatic classCodePainter.UnstyledResultHolds an unstyled result
-
Constructor Summary
Constructors Constructor Description CodePainter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddColorPalette(ColorPalette palette)Adds a color palette to the code painter and enables the color palettevoidaddColorPalette(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 indexabstract CodePainter.UnstyledFrontierResultcomputeFrontierResult(com.ensoftcorp.atlas.core.query.Q filteredSelections, int reverse, int forward)Computes an unstyled frontier result for the given selection and steps reverse/forward.CodePainter.UnstyledResultcomputeResult(com.ensoftcorp.atlas.core.query.Q filteredSelections)Computes an unstyled result for the given selection.com.ensoftcorp.atlas.core.query.QconvertSelection(com.ensoftcorp.atlas.core.query.Q filteredSelections)Filters the selection event to selections that the code painter responds to.voiddisableColorPalette(ColorPalette palette)Disables the color palette if the color palette exists and isn't already disabledvoidenableColorPalette(ColorPalette palette)Enables the color palette if the color palette exists and isn't already enabledvoidenableHighlightSelections(boolean enabled)booleanequals(java.lang.Object obj)com.ensoftcorp.atlas.core.script.FrontierStyledResultevaluate(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.com.ensoftcorp.atlas.core.script.FrontierStyledResultexplore(com.ensoftcorp.atlas.ui.selection.event.FrontierEdgeExploreEvent event, com.ensoftcorp.atlas.core.script.FrontierStyledResult oldResult)ColorPalettegetActiveColorPalette()abstract java.lang.StringgetCategory()Defines the category this code painter is classified under.java.util.List<ColorPalette>getColorPalettes()Returns an ordered list of color palettes The 0th element represents the first layer of coloringabstract 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 appliedintgetDefaultStepBottom()Deprecated.abstract intgetDefaultStepForward()Returns the number of forward steps out of the graph to computeabstract intgetDefaultStepReverse()Returns the number of reverse steps out of the graph to computeintgetDefaultStepTop()Deprecated.abstract java.lang.StringgetDescription()Returns a plaintext description of the code painterjava.util.List<ColorPalette>getEnabledColorPalettes()Returns an ordered list of color palettes that are enabled.abstract java.lang.StringgetName()Returns the name of the code painterabstract java.lang.String[]getSupportedEdgeTags()Returns the supported edge types this code painter can respond toabstract java.lang.String[]getSupportedNodeTags()Returns the supported node types this code painter can respond tointhashCode()booleanisColorPaletteEnabled(ColorPalette palette)Returns true if the color palette exists in the code painter and the palette is enabledbooleanisHighlightSelectionsEnabled()voidremoveColorPalette(int index)Removes a color palette at the given index and shifts any subsequent methods to the left of the indexvoidremoveColorPalette(ColorPalette palette)Removes a color palette from the code paintervoidrestoreDefaultColorPalettes()Restores default color palettesvoidsetColorPaletteConflictStrategy(CodePainter.ColorPaletteConflictStrategy conflictStrategy)Sets a coloring conflict resolution strategy-
Methods inherited from class com.ensoftcorp.open.commons.codepainter.Configurable
getFlagDescription, getParameterDescription, getParameterValue, getPossibleFlags, getPossibleParameters, isFlagSet, isParameterSet, restoreDefaultConfigurations, setFlag, setParameterValue, unsetFlag, unsetParameter
-
-
-
-
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:
getDefaultStepTopin interfacecom.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:
getDefaultStepBottomin interfacecom.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:
explorein interfacecom.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:
evaluatein interfacecom.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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-