Class UISettings
- java.lang.Object
-
- de.aristaflow.adept2.ui.processvisualisation.UISettings
-
public class UISettings extends Object
Store all UI Settings that can change at runtime.
-
-
Field Summary
Fields Modifier and Type Field Description static String
GRAPH_FIGURE_PROVIDER_ID
The name of the advanced option in the render options for the ID of the graph figure provider.static String
GRAPH_ORIENTATION
The name of the advanced option in the render options for the process graph orientation.static String
GRAPH_ORIENTATION_H
Fields for the graph orientationstatic String
GRAPH_ORIENTATION_V
static String
HORIZONTAL_SPACING
The name of the advanced option in the render options for horizontal spacing.static String
ID
Property IDprotected Logger
logger
The logger for UI settings.static String
VERTICAL_SPACING
The name of the advanced option in the render options for vertical spacing.
-
Constructor Summary
Constructors Constructor Description UISettings(RenderOptions options)
Creates new UI settings for rendering process templates and instances.UISettings(org.eclipse.gef.GraphicalViewer viewer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUIListener(PropertyChangeListener listener)
protected void
firePropertyChange(String preferenceConstantID, Object oldValue, Object newValue)
Fired if the uiSettings changedboolean
getBooleanValue(String preferenceName)
String
getFigureProviderID()
GraphFigureProvider
getGraphElements()
Returns the implementation of the graph elements which are used to visualise the process graphString
getGraphOrientation()
int
getHorizontalSpacing()
int
getIntValue(String preferenceName)
Locale
getLocale()
Gets the locale to be used for the UI.String
getStringValue(String preferenceName)
int
getVerticalSpacing()
boolean
isDataEdgesVisible()
boolean
isDataElementsVisible()
boolean
isDataFlowLaneVisible()
Gets whether the data flow lane (part displaying data elements and edges) is visible.boolean
isDecisionDataEdgeVisible()
boolean
isDecisionDataElementVisible()
boolean
isDependencyVisibilityModeOn()
boolean
isHiddenNodesVisible()
boolean
isSyncEdgeVisible()
boolean
isSystemDataEdgeVisible()
boolean
isSystemDataElementVisible()
void
removeUIListener(PropertyChangeListener listener)
boolean
scrollToChanges()
void
setBooleanValue(String preferenceName, boolean booleanValue)
void
setDataEdgesVisible(boolean dataEdgesVisible)
void
setDataElementsVisible(boolean dataElementsVisible)
void
setDecisionDataEdgesVisible(boolean decisionDataEdgesVisible)
void
setDecisionDataElementsVisible(boolean decisionDataElementsVisible)
void
setDependencyVisiblityMode(boolean dependencyVisibilityMode)
void
setFigureProviderID(String figureProviderID)
void
setGraphOrientation(String graphOrientation)
void
setHiddenNodesVisible(boolean hiddenNodesVisible)
void
setHorizontalSpacing(int horizontalSpacing)
void
setIntValue(String preferenceName, int intValue)
void
setScrollToChanges(boolean booleanValue)
Set the scrolling behaviour.void
setSpacing(int horizontal, int vertical)
Set the horizontal and vertical spacingvoid
setStringValue(String preferenceName, String stringValue)
void
setSyncEdgeVisible(boolean syncEdgeVisible)
void
setSystemDataEdgesVisible(boolean systemDataEdgesVisible)
void
setSystemDataElementsVisible(boolean systemDataElementsVisible)
void
setVerticalSpacing(int verticalSpacing)
void
showConfigDialog(org.eclipse.swt.widgets.Shell parent)
Open modal config dialog
-
-
-
Field Detail
-
HORIZONTAL_SPACING
public static final String HORIZONTAL_SPACING
The name of the advanced option in the render options for horizontal spacing.- See Also:
- Constant Field Values
-
VERTICAL_SPACING
public static final String VERTICAL_SPACING
The name of the advanced option in the render options for vertical spacing.- See Also:
- Constant Field Values
-
GRAPH_FIGURE_PROVIDER_ID
public static final String GRAPH_FIGURE_PROVIDER_ID
The name of the advanced option in the render options for the ID of the graph figure provider.- See Also:
- Constant Field Values
-
GRAPH_ORIENTATION
public static final String GRAPH_ORIENTATION
The name of the advanced option in the render options for the process graph orientation.- See Also:
- Constant Field Values
-
GRAPH_ORIENTATION_H
public static final String GRAPH_ORIENTATION_H
Fields for the graph orientation- See Also:
- Constant Field Values
-
GRAPH_ORIENTATION_V
public static final String GRAPH_ORIENTATION_V
- See Also:
- Constant Field Values
-
ID
public static final String ID
Property ID
-
logger
protected final Logger logger
The logger for UI settings. It is protected for extensibility.
-
-
Constructor Detail
-
UISettings
public UISettings(org.eclipse.gef.GraphicalViewer viewer)
- Parameters:
viewer
- the Graphical Viewer
-
UISettings
public UISettings(RenderOptions options)
Creates new UI settings for rendering process templates and instances.This supports the following advanced options from the designated render options:
- "GraphOrientation" (
GRAPH_ORIENTATION
):- h: horizontal orientation of the process image (default)
- v: vertical orientation of the process image
- "HorizontalSpacing" (
HORIZONTAL_SPACING
):
The space (int
) between nodes and data elements on the horizontal axis. The default is60
. - "VerticalSpacing" (
VERTICAL_SPACING
):
The space (int
) between nodes and data elements on the vertical axis. The default is20
. - "GraphFigureProviderID" (
GRAPH_FIGURE_PROVIDER_ID
):
The full name of the class implementingGraphFigureProvider
. This class provides the figures used for the process elements, i. e. nodes, data elements and alike.
The default isModelGlue
.
- Parameters:
options
- The options to set for rendering process templates and instances.
- "GraphOrientation" (
-
-
Method Detail
-
getGraphElements
public GraphFigureProvider getGraphElements()
Returns the implementation of the graph elements which are used to visualise the process graph- Returns:
- the graph elements
-
firePropertyChange
protected void firePropertyChange(String preferenceConstantID, Object oldValue, Object newValue)
Fired if the uiSettings changed- Parameters:
preferenceConstantID
- the ID of the Preference Constant which changedoldValue
- the value before the changenewValue
- the value after the change
-
addUIListener
public void addUIListener(PropertyChangeListener listener)
- Parameters:
listener
- the listener to receive events
-
removeUIListener
public void removeUIListener(PropertyChangeListener listener)
- Parameters:
listener
- the listener to stop receiving events
-
isDataEdgesVisible
public boolean isDataEdgesVisible()
- Returns:
- Returns the dataEdgesVisible.
-
setDataEdgesVisible
public void setDataEdgesVisible(boolean dataEdgesVisible)
- Parameters:
dataEdgesVisible
- The dataEdgesVisible to set.
-
isSystemDataEdgeVisible
public boolean isSystemDataEdgeVisible()
- Returns:
- Returns the systemDataEdgesVisible.
-
setSystemDataEdgesVisible
public void setSystemDataEdgesVisible(boolean systemDataEdgesVisible)
- Parameters:
systemDataEdgesVisible
- The systemDataEdgesVisible to set.
-
isDataElementsVisible
public boolean isDataElementsVisible()
- Returns:
- Returns the dataElementsVisible.
-
setDataElementsVisible
public void setDataElementsVisible(boolean dataElementsVisible)
- Parameters:
dataElementsVisible
- The dataElementsVisible to set.
-
isSystemDataElementVisible
public boolean isSystemDataElementVisible()
- Returns:
- Returns the systemDataElementsVisible.
-
setSystemDataElementsVisible
public void setSystemDataElementsVisible(boolean systemDataElementsVisible)
- Parameters:
systemDataElementsVisible
- The systemDataElementsVisible to set.
-
isDecisionDataElementVisible
public boolean isDecisionDataElementVisible()
- Returns:
- Returns the decisionDataElementsVisible.
-
setDecisionDataElementsVisible
public void setDecisionDataElementsVisible(boolean decisionDataElementsVisible)
- Parameters:
decisionDataElementsVisible
- The decisionDataElementsVisible to set.
-
isDecisionDataEdgeVisible
public boolean isDecisionDataEdgeVisible()
- Returns:
- Returns the decisionDataEdgesVisible.
-
setDecisionDataEdgesVisible
public void setDecisionDataEdgesVisible(boolean decisionDataEdgesVisible)
- Parameters:
decisionDataEdgesVisible
- The decisionDataEdgesVisible to set.
-
isDataFlowLaneVisible
public boolean isDataFlowLaneVisible()
Gets whether the data flow lane (part displaying data elements and edges) is visible. If not, there will be no whitespace for data elements and edges. This is only allowed if all data elements and edges are hidden.- Returns:
- Whether the data flow lane (part displaying data elements and edges) is visible
-
isSyncEdgeVisible
public boolean isSyncEdgeVisible()
- Returns:
- Returns the syncEdgeVisible.
-
setSyncEdgeVisible
public void setSyncEdgeVisible(boolean syncEdgeVisible)
- Parameters:
syncEdgeVisible
- The syncEdgeVisible to set.
-
isHiddenNodesVisible
public boolean isHiddenNodesVisible()
- Returns:
- Returns the hiddenNodesVisible state.
-
setHiddenNodesVisible
public void setHiddenNodesVisible(boolean hiddenNodesVisible)
- Parameters:
hiddenNodesVisible
- True to show the hidden nodes.
-
isDependencyVisibilityModeOn
public boolean isDependencyVisibilityModeOn()
- Returns:
- Returns the value of the dependency visibility mode field.
-
setDependencyVisiblityMode
public void setDependencyVisiblityMode(boolean dependencyVisibilityMode)
- Parameters:
dependencyVisibilityMode
- The setter for the dependency visibility mode field.
-
getGraphOrientation
public String getGraphOrientation()
- Returns:
- Returns the graph orientation.
-
setGraphOrientation
public void setGraphOrientation(String graphOrientation)
- Parameters:
graphOrientation
- Sets the orientation of the process graph.
-
getHorizontalSpacing
public int getHorizontalSpacing()
- Returns:
- Returns the horizontalSpacing.
-
setHorizontalSpacing
public void setHorizontalSpacing(int horizontalSpacing)
- Parameters:
horizontalSpacing
- The horizontalSpacing to set.
-
getVerticalSpacing
public int getVerticalSpacing()
- Returns:
- Returns the verticalSpacing.
-
setVerticalSpacing
public void setVerticalSpacing(int verticalSpacing)
- Parameters:
verticalSpacing
- The verticalSpacing to set.
-
showConfigDialog
public void showConfigDialog(org.eclipse.swt.widgets.Shell parent)
Open modal config dialog- Parameters:
parent
- the parent Shell
-
setSpacing
public void setSpacing(int horizontal, int vertical)
Set the horizontal and vertical spacing- Parameters:
horizontal
- the horizontal distancevertical
- the vertical distance
-
setFigureProviderID
public void setFigureProviderID(String figureProviderID)
- Parameters:
figureProviderID
- The figure provider name to set.
-
getFigureProviderID
public String getFigureProviderID()
- Returns:
- Returns the figure provider id.
-
getIntValue
public int getIntValue(String preferenceName)
- Parameters:
preferenceName
-PreferenceConstants
- Returns:
- the integer value of the Preference preferenceName or 0 if preference is unknown
- See Also:
PreferenceConstants
-
getStringValue
public String getStringValue(String preferenceName)
- Parameters:
preferenceName
-PreferenceConstants
- Returns:
- the string value of the Preference preferenceName or an empty string if preference is unknown
- See Also:
PreferenceConstants
-
setStringValue
public void setStringValue(String preferenceName, String stringValue)
- Parameters:
preferenceName
-PreferenceConstants
stringValue
- sets the Preference preferenceName to the given value- See Also:
PreferenceConstants
-
getBooleanValue
public boolean getBooleanValue(String preferenceName)
- Parameters:
preferenceName
-PreferenceConstants
- Returns:
- the Boolean value of the Preference preferenceName or false if preference is unkown
- See Also:
PreferenceConstants
-
setIntValue
public void setIntValue(String preferenceName, int intValue)
- Parameters:
preferenceName
-PreferenceConstants
intValue
- sets the Preference preferenceName to the given value- See Also:
PreferenceConstants
-
setBooleanValue
public void setBooleanValue(String preferenceName, boolean booleanValue)
- Parameters:
preferenceName
-PreferenceConstants
booleanValue
- sets the Preference preferenceName to the given value- See Also:
PreferenceConstants
-
setScrollToChanges
public void setScrollToChanges(boolean booleanValue)
Set the scrolling behaviour.- Parameters:
booleanValue
-
-
scrollToChanges
public boolean scrollToChanges()
- Returns:
- the scrolling behaviour
-
getLocale
public Locale getLocale()
Gets the locale to be used for the UI.- Returns:
- The locale to be used for the UI.
-
-