Class BpmnViewerImpl

java.lang.Object
com.vaadin.flow.component.Component
io.jmix.bpmflowui.uicomponent.bpmnviewer.BpmnViewerImpl
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, BpmnViewer, Serializable

@Tag("jmix-bpmn-viewer") @NpmPackage(value="bpmn-js", version="12.1.0") @CssImport("bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css") @CssImport("bpmn-js/dist/assets/bpmn-js.css") @CssImport("bpmn-js/dist/assets/diagram-js.css") @JsModule("./src/bpmn-modeler/bpmn-viewer.ts") public class BpmnViewerImpl extends com.vaadin.flow.component.Component implements BpmnViewer, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static final record 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected boolean
     

    Fields inherited from interface io.jmix.bpmflowui.uicomponent.bpmnviewer.BpmnViewer

    NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addBpmnXmlImportedListener(com.vaadin.flow.component.ComponentEventListener<BpmnXmlImportedEvent> listener)
    Adds a listener for the BpmnXmlImportedEvent.
    void
    Adds a marker to a BPMN element using the specified command.
    void
    addSelectedElementChangedListener(com.vaadin.flow.component.ComponentEventListener<SelectionChangedEvent> listener)
    Adds a listener to handle BPMN diagram element selection changes.
    protected void
    callJsFunction(String functionName, Serializable... args)
     
    protected void
    executePendingJs(com.vaadin.flow.internal.ExecutionContext context)
     
    void
    Fits current schema to the center of the viewer.
     
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    void
    Removes a marker from a BPMN element using the specified command.
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    setBpmnXml(String bpmnXml)
    Sets the BPMN XML to be displayed.
    void
    setBpmnXml(String bpmnXml, com.vaadin.flow.function.SerializableConsumer<elemental.json.JsonValue> callback)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use setBpmnXml(String) instead
    void
    Sets the color of a BPMN element using the specified command.
    void
    zoomByStep(int step)
    Zooms to the given step.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

  • Constructor Details

    • BpmnViewerImpl

      public BpmnViewerImpl()
  • Method Details

    • setBpmnXml

      public void setBpmnXml(@Nullable String bpmnXml)
      Sets the BPMN XML to be displayed.
      Parameters:
      bpmnXml - the BPMN XML to be set
    • getBpmnXmlFromState

      @Nullable public String getBpmnXmlFromState()
      Returns:
      currently set BPMN XML or null if not set
    • requestForBpmnXml

      @Deprecated(since="2.8.0", forRemoval=true) public CompletableFuture<String> requestForBpmnXml()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      currently set BPMN XML
    • setBpmnXml

      @Deprecated(since="2.8.0", forRemoval=true) public void setBpmnXml(@Nullable String bpmnXml, com.vaadin.flow.function.SerializableConsumer<elemental.json.JsonValue> callback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use setBpmnXml(String) instead
      Sets the BPMN XML to be displayed.
      Specified by:
      setBpmnXml in interface BpmnViewer
      Parameters:
      bpmnXml - the BPMN XML to be set
      callback - a callback to be invoked after the BPMN XML is set
    • setElementColor

      public void setElementColor(SetElementColorCmd cmd)
      Description copied from interface: BpmnViewer
      Sets the color of a BPMN element using the specified command.

      Usage example:

       bpmnViewer.setElementColor(new SetElementColorCmd(elementId,
          "#000", //stroke color
          "#c2d5ed" //fill color
       ));
       
      Specified by:
      setElementColor in interface BpmnViewer
      Parameters:
      cmd - The command to set the element color.
    • addMarker

      public void addMarker(AddMarkerCmd cmd)
      Description copied from interface: BpmnViewer
      Adds a marker to a BPMN element using the specified command.

      A style for the "highlighted" marker is already defined in the viewer component css file.

      Specified by:
      addMarker in interface BpmnViewer
      Parameters:
      cmd - The command to add a marker to an element.
    • removeMarker

      public void removeMarker(RemoveMarkerCmd cmd)
      Description copied from interface: BpmnViewer
      Removes a marker from a BPMN element using the specified command.
      Specified by:
      removeMarker in interface BpmnViewer
      Parameters:
      cmd - The command to remove a marker from an element.
    • addSelectedElementChangedListener

      public void addSelectedElementChangedListener(com.vaadin.flow.component.ComponentEventListener<SelectionChangedEvent> listener)
      Description copied from interface: BpmnViewer
      Adds a listener to handle BPMN diagram element selection changes.
      Specified by:
      addSelectedElementChangedListener in interface BpmnViewer
      Parameters:
      listener - The listener to handle selection changes.
    • addBpmnXmlImportedListener

      public com.vaadin.flow.shared.Registration addBpmnXmlImportedListener(com.vaadin.flow.component.ComponentEventListener<BpmnXmlImportedEvent> listener)
      Adds a listener for the BpmnXmlImportedEvent.
      Parameters:
      listener - listener to be added
      Returns:
      a registration object for removing the listener
    • zoomByStep

      public void zoomByStep(int step)
      Zooms to the given step. Positive values zoom in, negative values zoom out.
      Parameters:
      step - the step to zoom
    • fitSchema

      public void fitSchema()
      Fits current schema to the center of the viewer.
    • callJsFunction

      protected void callJsFunction(String functionName, Serializable... args)
    • executePendingJs

      protected void executePendingJs(com.vaadin.flow.internal.ExecutionContext context)
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component