Class OrgChart
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.flowingcode.vaadin.addons.orgchart.OrgChart
- All Implemented Interfaces:
AttachNotifier,ClickNotifier<Div>,DetachNotifier,HasComponents,HasElement,HasEnabled,HasOrderedComponents,HasSize,HasStyle,HasText,Serializable
@NpmPackage(value="orgchart",version="3.7.0") @NpmPackage(value="html2canvas",version="1.4.1") @NpmPackage(value="jquery",version="3.6.2") @NpmPackage(value="json-digger",version="2.0.2")
@JsModule("jquery/dist/jquery.js") @JsModule("orgchart/dist/js/jquery.orgchart.js") @JsModule("./fc-orgchart.js")
@CssImport("orgchart/dist/css/jquery.orgchart.min.css") @CssImport("./fc-orgchart-styles.css")
@Tag("fc-orgchart")
public class OrgChart
extends Div
OrgChart component definition.
Uses JQuery library OrgChart to show an organization chart.
More information about this library at https://github.com/dabeng/OrgChart
Uses JQuery library OrgChart to show an organization chart.
More information about this library at https://github.com/dabeng/OrgChart
- Author:
- pbartolo
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvent thrown when a node is dragged and dropped.static classEvent thrown when a node is clicked. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aOrgChart.DragAndDropEventlistener to the component.protected voidfireDragAndDropEvent(OrgChartItem draggedItem, boolean fromClient) Fires aOrgChart.DragAndDropEvent.protected voidfireNodeClickEvent(OrgChartItem clickedItem, boolean fromClient) Fires aOrgChart.NodeClickEvent.Returns latest value of the orgchart element.protected OrgChartStategetState()voidDeprecated.This method is no longer needed.protected voidonAttach(AttachEvent attachEvent) voidFires event on node click.voidsetChartDepth(Integer chartDepth) orgchart visibleLevel optionvoidsetChartDirection(String chartDirection) voidsetChartDraggable(Boolean chartDraggable) voidsetChartExpandCollapse(Boolean chartExpandCollapse) voidsetChartExportButton(Boolean chartExportButton) voidsetChartExportFileExtension(String chartExportFileExtension) voidsetChartExportFileName(String chartExportFileName) voidsetChartNodeContent(String chartNodeContent) voidsetChartNodeTitle(String chartNodeTitle) voidsetChartPan(Boolean chartPan) voidsetChartTitle(String chartTitle) voidsetChartToggleSiblingsResp(Boolean chartToggleSiblingsResp) voidsetChartVerticalDepth(Integer chartVerticalDepth) orgchart verticalLevel optionvoidsetChartZoom(Boolean chartZoom) voidsetChartZoominLimit(Double chartZoominLimit) voidsetChartZoomoutLimit(Double chartZoomoutLimit) voidCollapses all nodes except the rootvoidsetNodeTemplate(String parameterName, String functionBody) Sets the template generation function used to customize the internal structure of nodes.voidsetValue(OrgChartItem orgChartItem) voidupdateDraggedNode(String draggedNode, String dragZone, String dropZone) Updates chart after drag and drop event.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, 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.ClickNotifier
addClickListener, addClickShortcutMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods 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
-
Constructor Details
-
OrgChart
-
-
Method Details
-
onAttach
-
initializeChart
Deprecated.This method is no longer needed. Initialization is done inonAttach(AttachEvent). -
setValue
-
getState
-
setChartNodeTitle
-
setChartNodeContent
-
setChartDirection
-
setChartTitle
-
setChartZoom
-
setChartExportButton
-
setChartExportFileName
-
setChartExportFileExtension
-
setChartPan
-
setChartZoominLimit
-
setChartZoomoutLimit
-
setChartDepth
orgchart visibleLevel option -
setChartVerticalDepth
orgchart verticalLevel option -
setChartToggleSiblingsResp
-
setChartExpandCollapse
-
setChartDraggable
-
getOrgChartItem
Returns latest value of the orgchart element. -
onClick
Fires event on node click.- Parameters:
nodeId-
-
updateDraggedNode
Updates chart after drag and drop event.- Parameters:
draggedNode-dragZone-dropZone-
-
setNodeTemplate
Sets the template generation function used to customize the internal structure of nodes.functionBodyis the body of a javascript function that recieves one parameter (the JSON datasoure representing a node) and returns an HTML snippet. The name of this parameter is given byparameterName.Example:
setNodeTemplate("item","return ''+item.name+'';")configures the following JS function as node template:function(item) { return ''+item.name+''; }custom properties are accessible throughitem.data- Parameters:
parameterName- the name of the parameter of a javascript functionfunctionBody- the body of a javascript function
-
addDragAndDropListener
Adds aOrgChart.DragAndDropEventlistener to the component.- Parameters:
listener- the listener to be added.
-
fireDragAndDropEvent
Fires aOrgChart.DragAndDropEvent.- Parameters:
draggedItem- the item being dragged.
-
addOnNodeClickListener
public Registration addOnNodeClickListener(ComponentEventListener<OrgChart.NodeClickEvent> listener) -
fireNodeClickEvent
Fires aOrgChart.NodeClickEvent.- Parameters:
clickedItem- the item being clicked.
-
setCollapsedNodes
public void setCollapsedNodes()Collapses all nodes except the root
-