Class LayoutOptionControlFactory

java.lang.Object
de.cau.cs.kieler.klighd.ui.internal.options.LayoutOptionControlFactory

public class LayoutOptionControlFactory extends Object
A factory for controls for layout options.
Author:
msp, chsch
  • Constructor Summary

    Constructors
    Constructor
    Description
    LayoutOptionControlFactory(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit formToolkit)
    Create an option control factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the previously created option controls.
    void
    Create a control for the given layout option identifier.
    void
    createControl(String optionId, Float minValue, Float maxValue)
    Create a control for the given layout option identifier with given bounds.
    void
    createControl(String optionId, Collection<?> availableValues)
    Create a control for the given layout option identifier with given available option values.
    org.eclipse.elk.core.LayoutConfigurator
    Provides the LayoutConfigurator with layout settings from the controls created by this factory.
    void
    initialize(ViewContext theViewContext)
    Clear the current layout configuration and reinitialize option values.
    void
    resetToDefaults(boolean doLayout)
    Reset all displayed layout options to their default values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 container
      formToolkit - the form toolkit used to create controls
  • Method Details

    • initialize

      public void initialize(ViewContext theViewContext)
      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 using clear().
      Parameters:
      theViewContext - the viewContext belonging to the current diagram
    • getLayoutConfig

      public org.eclipse.elk.core.LayoutConfigurator getLayoutConfig()
      Provides the LayoutConfigurator with 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

      public void createControl(String optionId)
      Create a control for the given layout option identifier.
      Parameters:
      optionId - a layout option identifier
    • createControl

      public void createControl(String optionId, Float minValue, Float maxValue)
      Create a control for the given layout option identifier with given bounds.
      Parameters:
      optionId - a layout option identifier
      minValue - the minimal value for the option
      maxValue - the maximal value for the option
    • createControl

      public void createControl(String optionId, Collection<?> availableValues)
      Create a control for the given layout option identifier with given available option values.
      Parameters:
      optionId - a layout option identifier
      availableValues - the set of values to offer
    • resetToDefaults

      public void resetToDefaults(boolean doLayout)
      Reset all displayed layout options to their default values.
      Parameters:
      doLayout - if true a subsequent layout run will be triggered