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 class
CodePainter.ColorPaletteConflictStrategy
Defines strategies for resolving coloring conflictsstatic class
CodePainter.UnstyledFrontierResult
Holds and unstyled frontier resultstatic class
CodePainter.UnstyledResult
Holds 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 void
addColorPalette(ColorPalette palette)
Adds a color palette to the code painter and enables the color palettevoid
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 indexabstract 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.CodePainter.UnstyledResult
computeResult(com.ensoftcorp.atlas.core.query.Q filteredSelections)
Computes an unstyled result for the given selection.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.void
disableColorPalette(ColorPalette palette)
Disables the color palette if the color palette exists and isn't already disabledvoid
enableColorPalette(ColorPalette palette)
Enables the color palette if the color palette exists and isn't already enabledvoid
enableHighlightSelections(boolean enabled)
boolean
equals(java.lang.Object obj)
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.com.ensoftcorp.atlas.core.script.FrontierStyledResult
explore(com.ensoftcorp.atlas.ui.selection.event.FrontierEdgeExploreEvent event, com.ensoftcorp.atlas.core.script.FrontierStyledResult oldResult)
ColorPalette
getActiveColorPalette()
abstract java.lang.String
getCategory()
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 appliedint
getDefaultStepBottom()
Deprecated.abstract int
getDefaultStepForward()
Returns the number of forward steps out of the graph to computeabstract int
getDefaultStepReverse()
Returns the number of reverse steps out of the graph to computeint
getDefaultStepTop()
Deprecated.abstract java.lang.String
getDescription()
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.String
getName()
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 toint
hashCode()
boolean
isColorPaletteEnabled(ColorPalette palette)
Returns true if the color palette exists in the code painter and the palette is enabledboolean
isHighlightSelectionsEnabled()
void
removeColorPalette(int index)
Removes a color palette at the given index and shifts any subsequent methods to the left of the indexvoid
removeColorPalette(ColorPalette palette)
Removes a color palette from the code paintervoid
restoreDefaultColorPalettes()
Restores default color palettesvoid
setColorPaletteConflictStrategy(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:
getDefaultStepTop
in 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:
getDefaultStepBottom
in 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:
explore
in 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:
evaluate
in 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-