@JavaScript(value={"jquery-3.2.1.min.js","html2canvas.js","jquery.orgchart.js","orgchart-connector.js"})
@StyleSheet(value={"jquery.orgchart.css","orgchart.css","font-awesome.css"})
public class OrgChart
extends com.vaadin.ui.AbstractJavaScriptComponent
Modifier and Type | Class and Description |
---|---|
static class |
OrgChart.DragAndDropEvent
Event thrown when a node is dragged and dropped.
|
static interface |
OrgChart.DragAndDropListener
Interface for listening for a
OrgChart.DragAndDropEvent . |
static class |
OrgChart.NodeClickEvent
Event thrown when a node is clicked.
|
static interface |
OrgChart.OnNodeClickListener
Interface for listening for a
OrgChart.NodeClickEvent . |
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Constructor and Description |
---|
OrgChart(OrgChartItem orgChartItem) |
Modifier and Type | Method and Description |
---|---|
void |
addDragAndDropListener(OrgChart.DragAndDropListener dragAndDropListener)
Adds a
OrgChart.DragAndDropListener to the component. |
void |
addOnNodeClickListener(OrgChart.OnNodeClickListener onNodeClickListener)
Adds a
OrgChart.OnNodeClickListener to the component. |
protected void |
fireDragAndDropEvent(OrgChartItem draggedItem)
Fires a
OrgChart.DragAndDropEvent . |
protected void |
fireNodeClickEvent(OrgChartItem clickedItem)
Fires a
OrgChart.NodeClickEvent . |
OrgChartItem |
getOrgChartItem()
Returns latest value of the orgchart element.
|
protected OrgChartState |
getState() |
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) |
addFunction, callFunction, getState, registerRpc
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesign
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
public OrgChart(OrgChartItem orgChartItem)
public void setValue(OrgChartItem orgChartItem)
protected OrgChartState getState()
getState
in class com.vaadin.ui.AbstractJavaScriptComponent
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()
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(OrgChart.DragAndDropListener dragAndDropListener)
OrgChart.DragAndDropListener
to the component.dragAndDropListener
- the listener to be added.protected void fireDragAndDropEvent(OrgChartItem draggedItem)
OrgChart.DragAndDropEvent
.draggedItem
- the item being dragged.public void addOnNodeClickListener(OrgChart.OnNodeClickListener onNodeClickListener)
OrgChart.OnNodeClickListener
to the component.onNodeClickListener
- the listener to be added.protected void fireNodeClickEvent(OrgChartItem clickedItem)
OrgChart.NodeClickEvent
.clickedItem
- the item being clicked.Copyright © 2017–2019 FlowingCode S.A.. All rights reserved.