Class OutsidePlantView
- java.lang.Object
-
- org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView<com.vaadin.flow.component.Component>
-
- com.neotropic.kuwaiba.modules.commercial.ospman.widgets.OutsidePlantView
-
public class OutsidePlantView extends AbstractView<com.vaadin.flow.component.Component>
Graphically displays Outside Plant elements on a map.- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Field Summary
-
Fields inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView
lstDeselectEvents, lstSelectionEvents, properties, viewMap
-
-
Constructor Summary
-
Method Summary
All 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[] view)<view version=""> <class>OSPView</class> <center lon="" lat=""></center> <zoom>0</zoom> <nodes> <node lon="" lat="" class="businessObjectClass" overlayid="">businessObjectId</node> </nodes> <edge> <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass="" overlayid=""> <controlpoint lon="" lat=""></controlpoint> </edge> </edge> </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.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()<view version=""> <class>OSPView</class> <center lon="" lat=""></center> <zoom>0</zoom> <nodes> <node lon="" lat="" class="businessObjectClass">businessObjectId</node> </nodes> <edge> <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass=""> <controlpoint lon="" lat=""></controlpoint> </edge> </edge> </view>voidnewOspView()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 viewMap-
Methods inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView
addDeselectionListener, addSelectionListener, fireDeselectEvents, fireSelectionEvents, getAsViewMap, getProperties, removeDeselectListener, removeSelectionListener
-
-
-
-
Constructor Detail
-
OutsidePlantView
public OutsidePlantView(OutsidePlantManagerDashboard ospmanDashboard, ApplicationEntityManager aem, BusinessEntityManager bem, MetadataEntityManager mem, TranslationService ts, ResourceFactory resourceFactory, PhysicalConnectionsService physicalConnectionsService, NewBusinessObjectVisualAction newBusinessObjectVisualAction, NewBusinessObjectFromTemplateVisualAction newBusinessObjectFromTemplateVisualAction, NewMultipleBusinessObjectsVisualAction newMultipleBusinessObjectsVisualAction, ManagePortMirroringVisualAction managePortMirroringVisualAction, CoreActionsRegistry coreActionsRegistry, AdvancedActionsRegistry advancedActionsRegistry, ViewWidgetRegistry viewWidgetRegistry, ExplorerRegistry explorerRegistry, OutsidePlantAccordion ospAccordion, OutsidePlantExternalServicesProvider ospExternalServicesProvider, EditConnectionsVisualAction editConnectionEndPointsWidget, LoggingService log)
-
OutsidePlantView
public OutsidePlantView(ApplicationEntityManager aem, BusinessEntityManager bem, MetadataEntityManager mem, TranslationService ts, ResourceFactory resourceFactory, LoggingService log)
-
-
Method Detail
-
nodeClickListener
public void nodeClickListener(ViewEventListener listener)
Description copied from class:AbstractViewAdds a listener to the node click events.- Specified by:
nodeClickListenerin classAbstractView<com.vaadin.flow.component.Component>- Parameters:
listener- The listener object.
-
edgeClickListener
public void edgeClickListener(ViewEventListener listener)
Description copied from class:AbstractViewAdds a listener to the edge click events.- Specified by:
edgeClickListenerin classAbstractView<com.vaadin.flow.component.Component>- Parameters:
listener- The listener object.
-
getAsXml
public byte[] getAsXml()
<view version=""> <class>OSPView</class> <center lon="" lat=""></center> <zoom>0</zoom> <nodes> <node lon="" lat="" class="businessObjectClass">businessObjectId</node> </nodes> <edge> <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass=""> <controlpoint lon="" lat=""></controlpoint> </edge> </edge> </view>- Specified by:
getAsXmlin classAbstractView<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)
-
getAsImage
public 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 classAbstractView<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.
-
newOspView
public void newOspView()
-
getAsUiElement
public com.vaadin.flow.component.Component getAsUiElement() throws InvalidArgumentExceptionDescription 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 classAbstractView<com.vaadin.flow.component.Component>- Returns:
- An embeddable component (Panel, VerticalLayout, etc)
- Throws:
InvalidArgumentException- If the component could not be created for some reason (most likely, misconfiguration).
-
buildFromSavedView
public void buildFromSavedView(byte[] view)
<view version=""> <class>OSPView</class> <center lon="" lat=""></center> <zoom>0</zoom> <nodes> <node lon="" lat="" class="businessObjectClass" overlayid="">businessObjectId</node> </nodes> <edge> <edge id="" class="" asideid="" asideclass="" bsideid="" bsideclass="" overlayid=""> <controlpoint lon="" lat=""></controlpoint> </edge> </edge> </view>- Specified by:
buildFromSavedViewin classAbstractView<com.vaadin.flow.component.Component>- Parameters:
view- The view to be rendered.
-
clean
public 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 classAbstractView<com.vaadin.flow.component.Component>
-
addNode
public AbstractViewNode addNode(BusinessObjectLight businessObject, Properties properties)
Description copied from class:AbstractViewAdds a node to views that are not generated automatically.- Specified by:
addNodein classAbstractView<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.
-
addEdge
public 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 classAbstractView<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.
-
removeNode
public void removeNode(BusinessObjectLight businessObject)
Description copied from class:AbstractViewremove a node from the viewMap- Specified by:
removeNodein classAbstractView<com.vaadin.flow.component.Component>- Parameters:
businessObject- The business object behind the node to be removed
-
removeEdge
public void removeEdge(BusinessObjectLight businessObject)
Description copied from class:AbstractViewremove a edge from the viewMap- Specified by:
removeEdgein classAbstractView<com.vaadin.flow.component.Component>- Parameters:
businessObject- The business object behind the edge to be removed
-
-