@NpmPackage(value="html2canvas",version="^0.5.0-beta4") @NpmPackage(value="jquery",version="3.4.1")
@JsModule(value="jquery/dist/jquery.js") @JsModule(value="orgchart/dist/js/jquery.orgchart.js") @JsModule(value="./fc-orgchart.js")
@CssImport(value="orgchart/dist/css/jquery.orgchart.css")
@Tag(value="fc-orgchart")
public class OrgChart
extends com.vaadin.flow.component.html.Div
Modifier and Type | Class and Description |
---|---|
static class |
OrgChart.DragAndDropEvent
Event thrown when a node is dragged and dropped.
|
static class |
OrgChart.NodeClickEvent
Event thrown when a node is clicked.
|
Constructor and Description |
---|
OrgChart(OrgChartItem orgChartItem) |
Modifier and Type | Method and Description |
---|---|
void |
addDragAndDropListener(com.vaadin.flow.component.ComponentEventListener<OrgChart.DragAndDropEvent> listener)
Adds a
DragAndDropListener to the component. |
com.vaadin.flow.shared.Registration |
addOnNodeClickListener(com.vaadin.flow.component.ComponentEventListener<OrgChart.NodeClickEvent> listener) |
protected void |
fireDragAndDropEvent(OrgChartItem draggedItem,
boolean fromClient)
Fires a
OrgChart.DragAndDropEvent . |
protected void |
fireNodeClickEvent(OrgChartItem clickedItem,
boolean fromClient)
Fires a
OrgChart.NodeClickEvent . |
OrgChartItem |
getOrgChartItem()
Returns latest value of the orgchart element.
|
protected OrgChartState |
getState() |
void |
initializeChart() |
void |
onClick(String nodeId)
Fires event on node click.
|
void |
setChartDepth(Integer chartDepth)
orgchart visibleLevel option
|
void |
setChartDirection(String chartDirection) |
void |
setChartDraggable(Boolean chartDraggable) |
void |
setChartExpandCollapse(Boolean chartExpandCollapse) |
void |
setChartExportButton(Boolean chartExportButton) |
void |
setChartExportFileExtension(String chartExportFileExtension) |
void |
setChartExportFileName(String chartExportFileName) |
void |
setChartNodeContent(String chartNodeContent) |
void |
setChartNodeTitle(String chartNodeTitle) |
void |
setChartPan(Boolean chartPan) |
void |
setChartTitle(String chartTitle) |
void |
setChartToggleSiblingsResp(Boolean chartToggleSiblingsResp) |
void |
setChartVerticalDepth(Integer chartVerticalDepth)
orgchart verticalLevel option
|
void |
setChartZoom(Boolean chartZoom) |
void |
setChartZoominLimit(Double chartZoominLimit) |
void |
setChartZoomoutLimit(Double chartZoomoutLimit) |
void |
setNodeTemplate(String parameterName,
String functionBody)
Sets the template generation function used to customize the internal structure of nodes.
|
void |
setValue(OrgChartItem orgChartItem) |
void |
updateDraggedNode(String draggedNode,
String dragZone,
String dropZone)
Updates chart after drag and drop event.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClickListener, addClickShortcut
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
public OrgChart(OrgChartItem orgChartItem)
public void initializeChart()
public void setValue(OrgChartItem orgChartItem)
protected OrgChartState getState()
public void setChartNodeTitle(String chartNodeTitle)
public void setChartNodeContent(String chartNodeContent)
public void setChartDirection(String chartDirection)
public void setChartTitle(String chartTitle)
public void setChartZoom(Boolean chartZoom)
public void setChartExportButton(Boolean chartExportButton)
public void setChartExportFileName(String chartExportFileName)
public void setChartExportFileExtension(String chartExportFileExtension)
public void setChartPan(Boolean chartPan)
public void setChartZoominLimit(Double chartZoominLimit)
public void setChartZoomoutLimit(Double chartZoomoutLimit)
public void setChartDepth(Integer chartDepth)
public void setChartVerticalDepth(Integer chartVerticalDepth)
public void setChartToggleSiblingsResp(Boolean chartToggleSiblingsResp)
public void setChartExpandCollapse(Boolean chartExpandCollapse)
public void setChartDraggable(Boolean chartDraggable)
public OrgChartItem getOrgChartItem()
@ClientCallable public void onClick(String nodeId)
nodeId
- @ClientCallable public void updateDraggedNode(String draggedNode, String dragZone, String dropZone)
draggedNode
- dragZone
- dropZone
- public void setNodeTemplate(String parameterName, String functionBody)
functionBody
is 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 by parameterName
.
Example:
setNodeTemplate("item","return ''+item.name+'';")
configures the following JS function as node template:
function(item) { return ''+item.name+''; }
custom properties
are accessible through item.data
parameterName
- the name of the parameter of a javascript functionfunctionBody
- the body of a javascript functionpublic void addDragAndDropListener(com.vaadin.flow.component.ComponentEventListener<OrgChart.DragAndDropEvent> listener)
DragAndDropListener
to the component.dragAndDropListener
- the listener to be added.protected void fireDragAndDropEvent(OrgChartItem draggedItem, boolean fromClient)
OrgChart.DragAndDropEvent
.draggedItem
- the item being dragged.public com.vaadin.flow.shared.Registration addOnNodeClickListener(com.vaadin.flow.component.ComponentEventListener<OrgChart.NodeClickEvent> listener)
protected void fireNodeClickEvent(OrgChartItem clickedItem, boolean fromClient)
OrgChart.NodeClickEvent
.clickedItem
- the item being clicked.Copyright © 2017–2019 Flowing Code S.A.. All rights reserved.