Class RackView
- java.lang.Object
-
- org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView<com.neotropic.flow.component.mxgraph.MxGraph>
-
- org.neotropic.kuwaiba.modules.optional.physcon.views.RackView
-
public class RackView extends AbstractView<com.neotropic.flow.component.mxgraph.MxGraph>
Rack view, shows the front view of the rack the way it should look like in the real world.- Author:
- Orlando Paz <orlando.paz@kuwaiba.org>
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_BORDER_COLORstatic StringPROPERTY_BORDER_WIDTHstatic StringPROPERTY_COLORstatic StringPROPERTY_ELLIPSE_COLORstatic StringPROPERTY_HEIGHTstatic StringPROPERTY_INTERIOR_COLORstatic StringPROPERTY_IS_EQUIPMENTstatic StringPROPERTY_IS_SLOTstatic StringPROPERTY_NAMEstatic StringPROPERTY_NUM_OF_SIDESstatic StringPROPERTY_OPAQUEstatic StringPROPERTY_OUTLINE_COLORstatic StringPROPERTY_OVAL_COLORstatic StringPROPERTY_TYPEstatic StringPROPERTY_WIDTHstatic StringPROPERTY_Xstatic StringPROPERTY_Ystatic StringSHAPE_ELLIPSEstatic StringSHAPE_LABELstatic StringSHAPE_POLYGONstatic StringSHAPE_RECTANGLEstatic intUNIT_HEIGHTstatic intUNIT_WIDTH-
Fields inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView
lstDeselectEvents, lstSelectionEvents, properties, viewMap
-
-
Constructor Summary
Constructors Constructor Description RackView(BusinessObjectLight businessObject, boolean showLayouts, BusinessEntityManager bem, ApplicationEntityManager aem, MetadataEntityManager mem, TranslationService ts, PortSummaryVisualAction portSummaryVisualAction, LoggingService log)
-
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)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.byte[]getAsImage(AbstractImageExporter exporter)Exports the view as image using the given exporter.com.neotropic.flow.component.mxgraph.MxGraphgetAsUiElement()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.HashMap<BusinessObjectLight,List<BusinessObjectLight>>getMapChildrensCache()HashMap<BusinessObjectLight,com.neotropic.flow.component.mxgraph.MxGraphNode>getMapNamedObjects()voidinitialize(BusinessObjectLight businessObject)Builds a view from scratch.booleanisOrderDescending()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 viewMapvoidsetMapChildrensCache(HashMap<BusinessObjectLight,List<BusinessObjectLight>> mapChildrensCache)voidsetMapNamedObjects(HashMap<BusinessObjectLight,com.neotropic.flow.component.mxgraph.MxGraphNode> mapNamedObjects)voidsetOrderDescending(boolean orderDescending)-
Methods inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.views.AbstractView
addDeselectionListener, addSelectionListener, fireDeselectEvents, fireSelectionEvents, getAsViewMap, getProperties, removeDeselectListener, removeSelectionListener
-
-
-
-
Field Detail
-
PROPERTY_TYPE
public static String PROPERTY_TYPE
-
PROPERTY_NAME
public static String PROPERTY_NAME
-
PROPERTY_X
public static String PROPERTY_X
-
PROPERTY_Y
public static String PROPERTY_Y
-
PROPERTY_WIDTH
public static String PROPERTY_WIDTH
-
PROPERTY_HEIGHT
public static String PROPERTY_HEIGHT
-
PROPERTY_COLOR
public static String PROPERTY_COLOR
-
PROPERTY_BORDER_WIDTH
public static String PROPERTY_BORDER_WIDTH
-
PROPERTY_BORDER_COLOR
public static String PROPERTY_BORDER_COLOR
-
PROPERTY_IS_EQUIPMENT
public static String PROPERTY_IS_EQUIPMENT
-
PROPERTY_OPAQUE
public static String PROPERTY_OPAQUE
-
SHAPE_RECTANGLE
public static String SHAPE_RECTANGLE
-
SHAPE_POLYGON
public static String SHAPE_POLYGON
-
SHAPE_ELLIPSE
public static String SHAPE_ELLIPSE
-
SHAPE_LABEL
public static String SHAPE_LABEL
-
PROPERTY_IS_SLOT
public static final String PROPERTY_IS_SLOT
- See Also:
- Constant Field Values
-
PROPERTY_ELLIPSE_COLOR
public static String PROPERTY_ELLIPSE_COLOR
-
PROPERTY_OVAL_COLOR
public static String PROPERTY_OVAL_COLOR
-
PROPERTY_NUM_OF_SIDES
public static String PROPERTY_NUM_OF_SIDES
-
PROPERTY_OUTLINE_COLOR
public static String PROPERTY_OUTLINE_COLOR
-
PROPERTY_INTERIOR_COLOR
public static String PROPERTY_INTERIOR_COLOR
-
UNIT_WIDTH
public static int UNIT_WIDTH
-
UNIT_HEIGHT
public static int UNIT_HEIGHT
-
-
Constructor Detail
-
RackView
public RackView(BusinessObjectLight businessObject, boolean showLayouts, BusinessEntityManager bem, ApplicationEntityManager aem, MetadataEntityManager mem, TranslationService ts, PortSummaryVisualAction portSummaryVisualAction, LoggingService log)
-
-
Method Detail
-
isOrderDescending
public boolean isOrderDescending()
-
setOrderDescending
public void setOrderDescending(boolean orderDescending)
-
getMapChildrensCache
public HashMap<BusinessObjectLight,List<BusinessObjectLight>> getMapChildrensCache()
-
setMapChildrensCache
public void setMapChildrensCache(HashMap<BusinessObjectLight,List<BusinessObjectLight>> mapChildrensCache)
-
getMapNamedObjects
public HashMap<BusinessObjectLight,com.neotropic.flow.component.mxgraph.MxGraphNode> getMapNamedObjects()
-
setMapNamedObjects
public void setMapNamedObjects(HashMap<BusinessObjectLight,com.neotropic.flow.component.mxgraph.MxGraphNode> mapNamedObjects)
-
getAsXml
public 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 classAbstractView<com.neotropic.flow.component.mxgraph.MxGraph>- 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.neotropic.flow.component.mxgraph.MxGraph>- Parameters:
exporter- The exporter used to generate the byte array.- Returns:
- A byte array with a formated byte array of the view.
-
getAsUiElement
public com.neotropic.flow.component.mxgraph.MxGraph 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.neotropic.flow.component.mxgraph.MxGraph>- Returns:
- An embeddable component (Panel, VerticalLayout, etc)
- Throws:
InvalidArgumentException- If the component could not be created for some reason (most likely, misconfiguration).
-
initialize
public void initialize(BusinessObjectLight businessObject)
Builds a view from scratch.- Parameters:
businessObject- The rack.
-
buildFromSavedView
public void buildFromSavedView(byte[] view)
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 classAbstractView<com.neotropic.flow.component.mxgraph.MxGraph>- Parameters:
view- The view to be rendered.
-
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.neotropic.flow.component.mxgraph.MxGraph>- 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.neotropic.flow.component.mxgraph.MxGraph>- 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.neotropic.flow.component.mxgraph.MxGraph>- 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.neotropic.flow.component.mxgraph.MxGraph>- Parameters:
businessObject- The business object behind the edge to be removed
-
nodeClickListener
public void nodeClickListener(ViewEventListener listener)
Description copied from class:AbstractViewAdds a listener to the node click events.- Specified by:
nodeClickListenerin classAbstractView<com.neotropic.flow.component.mxgraph.MxGraph>- 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.neotropic.flow.component.mxgraph.MxGraph>- Parameters:
listener- The listener object.
-
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.neotropic.flow.component.mxgraph.MxGraph>
-
-