Class MplsView
- java.lang.Object
- 
- org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView<com.vaadin.flow.component.Component>
- 
- com.neotropic.kuwaiba.modules.commercial.mpls.MplsView
 
 
- 
 public class MplsView extends AbstractView<com.vaadin.flow.component.Component> Custom view implementation for MPLS view module with a mxgraph component as canvas.- Author:
- Orlando Paz <orlando.paz@kuwaiba.org>
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringSAVED_VIEW_VERSIONThe version of the format of the XML document used to store the view in the database.- 
Fields inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractViewlstDeselectEvents, lstSelectionEvents, properties, viewMap
 
- 
 - 
Constructor SummaryConstructors Constructor Description MplsView(MetadataEntityManager mem, ApplicationEntityManager aem, BusinessEntityManager bem, TranslationService ts, ResourceFactory resourceFactory, LoggingService log)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractViewEdgeaddEdge(BusinessObjectLight businessObject, BusinessObjectLight sourceBusinessObject, BusinessObjectLight targetBusinessObject, Properties properties)Adds an edge to views that are not generated automatically.AbstractViewNodeaddNode(BusinessObjectLight businessObject, Properties properties)Adds a node to views that are not generated automatically.voidbuildFromSavedView(byte[] structure)Builds the view.voidclean()Cleans the view so some other thing can be painted on the canvas.voidedgeClickListener(ViewEventListener listener)Adds a listener to the edge click events.com.neotropic.flow.component.mxgraph.MxGraphEdgefindMxGraphEdge(BusinessObjectLight businessObject)byte[]getAsImage(AbstractImageExporter exporter)Exports the view as image using the given exporter.com.vaadin.flow.component.ComponentgetAsUiElement()Gets an embeddable visual component that can be rendered in a dashboard.It most likely will have to be called after calling#build()or#build(java.lang.Object).byte[]getAsXml()Exports the view to XML.MxGraphCanvas<BusinessObjectLight,BusinessObjectLight>getMxgraphCanvas()voidnodeClickListener(ViewEventListener listener)Adds a listener to the node click events.voidremoveEdge(BusinessObjectLight businessObject)remove a edge from the viewMapvoidremoveNode(BusinessObjectLight businessObject)remove a node from the viewMapvoidsetMxgraphCanvas(MxGraphCanvas<BusinessObjectLight,BusinessObjectLight> mxgraphCanvas)voidsyncViewMap()The view map is created originally by calling the#buildWithSavedView(byte[])method, but it can change due to user interactions, so it's necessary to update it in order to export it in other formats.- 
Methods inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractViewaddDeselectionListener, addSelectionListener, fireDeselectEvents, fireSelectionEvents, getAsViewMap, getProperties, removeDeselectListener, removeSelectionListener
 
- 
 
- 
- 
- 
Field Detail- 
SAVED_VIEW_VERSIONpublic static final String SAVED_VIEW_VERSION The version of the format of the XML document used to store the view in the database.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
MplsViewpublic MplsView(MetadataEntityManager mem, ApplicationEntityManager aem, BusinessEntityManager bem, TranslationService ts, ResourceFactory resourceFactory, LoggingService log) 
 
- 
 - 
Method Detail- 
getMxgraphCanvaspublic MxGraphCanvas<BusinessObjectLight,BusinessObjectLight> getMxgraphCanvas() 
 - 
setMxgraphCanvaspublic void setMxgraphCanvas(MxGraphCanvas<BusinessObjectLight,BusinessObjectLight> mxgraphCanvas) 
 - 
getAsXmlpublic byte[] getAsXml() Description copied from class:AbstractViewExports the view to XML. It most likely will have to be called after calling#build()or#build(java.lang.Object).- Specified by:
- getAsXmlin class- AbstractView<com.vaadin.flow.component.Component>
- Returns:
- A byte array with an XML document representing the view. The format of the document must follow the Standard Kuwaiba View Text Format (SKTF)
 
 - 
getAsImagepublic byte[] getAsImage(AbstractImageExporter exporter) Description copied from class:AbstractViewExports the view as image using the given exporter. It most likely will have to be called after calling#build()or#build(java.lang.Object).- Specified by:
- getAsImagein class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- exporter- The exporter used to generate the byte array.
- Returns:
- A byte array with a formated byte array of the view.
 
 - 
getAsUiElementpublic com.vaadin.flow.component.Component getAsUiElement() Description copied from class:AbstractViewGets an embeddable visual component that can be rendered in a dashboard.It most likely will have to be called after calling#build()or#build(java.lang.Object).- Specified by:
- getAsUiElementin class- AbstractView<com.vaadin.flow.component.Component>
- Returns:
- An embeddable component (Panel, VerticalLayout, etc)
 
 - 
buildFromSavedViewpublic void buildFromSavedView(byte[] structure) Description copied from class:AbstractViewBuilds the view. Call this method if no business object is required to build the view. It just loads the elements from an view definition structure (like an XML document).- Specified by:
- buildFromSavedViewin class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- structure- The view to be rendered.
 
 - 
cleanpublic void clean() Description copied from class:AbstractViewCleans the view so some other thing can be painted on the canvas. Typically this is used in refresh buttons.- Specified by:
- cleanin class- AbstractView<com.vaadin.flow.component.Component>
 
 - 
addNodepublic AbstractViewNode addNode(BusinessObjectLight businessObject, Properties properties) Description copied from class:AbstractViewAdds a node to views that are not generated automatically.- Specified by:
- addNodein class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- businessObject- The business object behind the node to be added. Nodes that already exist will not be added.
- properties- The properties associated to this object, such as the location that will be used to place it or the URL of the icon that will represent the node.
- Returns:
- A reference to the newly added node.
 
 - 
addEdgepublic AbstractViewEdge addEdge(BusinessObjectLight businessObject, BusinessObjectLight sourceBusinessObject, BusinessObjectLight targetBusinessObject, Properties properties) Description copied from class:AbstractViewAdds an edge to views that are not generated automatically.- Specified by:
- addEdgein class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- businessObject- The business object behind the edge to be added. Edges that already exist will not be added.
- sourceBusinessObject- The business object behind the source node to the edge to be created.
- targetBusinessObject- The business object behind the target node to the edge to be created.
- properties- The properties associated to this object, such as the control points of the edge, or its color.
- Returns:
- A reference to the newly added edge.
 
 - 
syncViewMappublic void syncViewMap() The view map is created originally by calling the#buildWithSavedView(byte[])method, but it can change due to user interactions, so it's necessary to update it in order to export it in other formats. This method wipes the existing view map and builds it again from whatever it is on the map currently
 - 
removeNodepublic void removeNode(BusinessObjectLight businessObject) Description copied from class:AbstractViewremove a node from the viewMap- Specified by:
- removeNodein class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- businessObject- The business object behind the node to be removed
 
 - 
removeEdgepublic void removeEdge(BusinessObjectLight businessObject) Description copied from class:AbstractViewremove a edge from the viewMap- Specified by:
- removeEdgein class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- businessObject- The business object behind the edge to be removed
 
 - 
findMxGraphEdgepublic com.neotropic.flow.component.mxgraph.MxGraphEdge findMxGraphEdge(BusinessObjectLight businessObject) 
 - 
nodeClickListenerpublic void nodeClickListener(ViewEventListener listener) Description copied from class:AbstractViewAdds a listener to the node click events.- Specified by:
- nodeClickListenerin class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- listener- The listener object.
 
 - 
edgeClickListenerpublic void edgeClickListener(ViewEventListener listener) Description copied from class:AbstractViewAdds a listener to the edge click events.- Specified by:
- edgeClickListenerin class- AbstractView<com.vaadin.flow.component.Component>
- Parameters:
- listener- The listener object.
 
 
- 
 
-