Class LayoutOptionControlFactory
java.lang.Object
de.cau.cs.kieler.klighd.ui.internal.options.LayoutOptionControlFactory
A factory for controls for layout options.
- Author:
- msp, chsch
-
Constructor Summary
ConstructorsConstructorDescriptionLayoutOptionControlFactory(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit formToolkit) Create an option control factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the previously created option controls.voidcreateControl(String optionId) Create a control for the given layout option identifier.voidcreateControl(String optionId, Float minValue, Float maxValue) Create a control for the given layout option identifier with given bounds.voidcreateControl(String optionId, Collection<?> availableValues) Create a control for the given layout option identifier with given available option values.org.eclipse.elk.core.LayoutConfiguratorProvides theLayoutConfiguratorwith layout settings from the controls created by this factory.voidinitialize(ViewContext theViewContext) Clear the current layout configuration and reinitialize option values.voidresetToDefaults(boolean doLayout) Reset all displayed layout options to their default values.
-
Constructor Details
-
LayoutOptionControlFactory
public LayoutOptionControlFactory(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit formToolkit) Create an option control factory.- Parameters:
parent- the parent containerformToolkit- the form toolkit used to create controls
-
-
Method Details
-
initialize
Clear the current layout configuration and reinitialize option values. These values are used when new controls are created. If any controls have been created before, they should be removed first usingclear().- Parameters:
theViewContext- the viewContext belonging to the current diagram
-
getLayoutConfig
public org.eclipse.elk.core.LayoutConfigurator getLayoutConfig()Provides theLayoutConfiguratorwith layout settings from the controls created by this factory. The returned config can change, so don't attempt to cache it.- Returns:
- the employed
LayoutConfigurator
-
clear
public void clear()Clear the previously created option controls. -
createControl
Create a control for the given layout option identifier.- Parameters:
optionId- a layout option identifier
-
createControl
Create a control for the given layout option identifier with given bounds.- Parameters:
optionId- a layout option identifierminValue- the minimal value for the optionmaxValue- the maximal value for the option
-
createControl
Create a control for the given layout option identifier with given available option values.- Parameters:
optionId- a layout option identifieravailableValues- the set of values to offer
-
resetToDefaults
public void resetToDefaults(boolean doLayout) Reset all displayed layout options to their default values.- Parameters:
doLayout- iftruea subsequent layout run will be triggered
-