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 -
Field Summary
FieldsFields inherited from interface io.jmix.bpmflowui.uicomponent.bpmnviewer.BpmnViewer
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddBpmnXmlImportedListener(com.vaadin.flow.component.ComponentEventListener<BpmnXmlImportedEvent> listener) Adds a listener for theBpmnXmlImportedEvent.voidaddMarker(AddMarkerCmd cmd) Adds a marker to a BPMN element using the specified command.voidaddSelectedElementChangedListener(com.vaadin.flow.component.ComponentEventListener<SelectionChangedEvent> listener) Adds a listener to handle BPMN diagram element selection changes.protected voidcallJsFunction(String functionName, Serializable... args) protected voidexecutePendingJs(com.vaadin.flow.internal.ExecutionContext context) voidFits current schema to the center of the viewer.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidRemoves a marker from a BPMN element using the specified command.Deprecated, for removal: This API element is subject to removal in a future version.voidsetBpmnXml(String bpmnXml) Sets the BPMN XML to be displayed.voidsetBpmnXml(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.usesetBpmnXml(String)insteadvoidSets the color of a BPMN element using the specified command.voidzoomByStep(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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
pendingJses
-
rendered
protected boolean rendered
-
-
Constructor Details
-
BpmnViewerImpl
public BpmnViewerImpl()
-
-
Method Details
-
setBpmnXml
Sets the BPMN XML to be displayed.- Parameters:
bpmnXml- the BPMN XML to be set
-
getBpmnXmlFromState
- Returns:
- currently set BPMN XML or
nullif not set
-
requestForBpmnXml
Deprecated, for removal: This API element is subject to removal in a future version.usegetBpmnXmlFromState()instead- 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.usesetBpmnXml(String)insteadSets the BPMN XML to be displayed.- Specified by:
setBpmnXmlin interfaceBpmnViewer- Parameters:
bpmnXml- the BPMN XML to be setcallback- a callback to be invoked after the BPMN XML is set
-
setElementColor
Description copied from interface:BpmnViewerSets 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:
setElementColorin interfaceBpmnViewer- Parameters:
cmd- The command to set the element color.
-
addMarker
Description copied from interface:BpmnViewerAdds 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:
addMarkerin interfaceBpmnViewer- Parameters:
cmd- The command to add a marker to an element.
-
removeMarker
Description copied from interface:BpmnViewerRemoves a marker from a BPMN element using the specified command.- Specified by:
removeMarkerin interfaceBpmnViewer- 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:BpmnViewerAdds a listener to handle BPMN diagram element selection changes.- Specified by:
addSelectedElementChangedListenerin interfaceBpmnViewer- 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 theBpmnXmlImportedEvent.- 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
-
executePendingJs
protected void executePendingJs(com.vaadin.flow.internal.ExecutionContext context) -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
getBpmnXmlFromState()instead