Package org.onosproject.ui.model.topo
Class UiTopoLayout
- java.lang.Object
- 
- org.onosproject.ui.model.topo.UiTopoLayout
 
- 
 public class UiTopoLayout extends java.lang.ObjectRepresents a specific "subset" of the UI model of the network topology that a user might wish to view. Backed by aRegion.These instances include information about which geo-map or grid-layout should be displayed, along with zoom and offset parameters. 
- 
- 
Constructor SummaryConstructors Constructor Description UiTopoLayout(UiTopoLayoutId id)Created a new UI topology layout.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringgeomap()Returns the symbolic name for the geomap for this layout.UiTopoLayoutgeomap(java.lang.String geomap)Sets the name of the geomap for this layout.UiTopoLayoutIdid()Returns the UI layout identifier.booleanisRoot()Returns true if this layout instance is at the top of the hierarchy tree.doubleoffsetX()Returns the x-offset value.UiTopoLayoutoffsetX(double offsetX)Sets the x-offset value.doubleoffsetY()Returns the y-offset value.UiTopoLayoutoffsetY(double offsetY)Sets the y-offset value.UiTopoLayoutIdparent()Returns the parent layout identifier.UiTopoLayoutparent(UiTopoLayoutId parentId)Sets the identity of this layout's parent.Regionregion()Returns the backing region with which this layout is associated.UiTopoLayoutregion(Region region)Sets the backing region for this layout.RegionIdregionId()Returns the identifier of the backing region.doublescale()Returns the scale for the geomap / sprite image.UiTopoLayoutscale(double scale)Sets the scale for the geomap / sprite image.java.lang.Stringsprites()Returns the symbolic name for the sprites definition for this layout.UiTopoLayoutsprites(java.lang.String sprites)Sets the name of the sprites definition for this layout.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
UiTopoLayoutpublic UiTopoLayout(UiTopoLayoutId id) Created a new UI topology layout.- Parameters:
- id- layout identifier
 
 
- 
 - 
Method Detail- 
isRootpublic boolean isRoot() Returns true if this layout instance is at the top of the hierarchy tree.- Returns:
- true if this is the root layout
 
 - 
idpublic UiTopoLayoutId id() Returns the UI layout identifier.- Returns:
- identifier of the layout
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
regionpublic UiTopoLayout region(Region region) Sets the backing region for this layout. Note that an exception will be thrown if this is the root layout.- Parameters:
- region- the backing region
- Returns:
- self, for chaining
- Throws:
- java.lang.IllegalArgumentException- if this is the root layout
 
 - 
regionpublic Region region() Returns the backing region with which this layout is associated. Note that this may be null (for the root layout).- Returns:
- backing region
 
 - 
regionIdpublic RegionId regionId() Returns the identifier of the backing region. If this is the default layout, the null-region ID will be returned, otherwise the ID of the backing region for this layout will be returned; null in the case that there is no backing region.- Returns:
- backing region identifier
 
 - 
parentpublic UiTopoLayout parent(UiTopoLayoutId parentId) Sets the identity of this layout's parent. May be null to unset. Note that an exception will be thrown if this is the root layout, since the parent of the root is always itself, and cannot be changed.- Parameters:
- parentId- parent layout identifier
- Returns:
- self, for chaining
- Throws:
- java.lang.IllegalArgumentException- if this instance is the root layout
 
 - 
parentpublic UiTopoLayoutId parent() Returns the parent layout identifier.- Returns:
- parent layout identifier
 
 - 
geomappublic UiTopoLayout geomap(java.lang.String geomap) Sets the name of the geomap for this layout. This is the symbolic name for a "topojson" file containing a geographic map projection, to be displayed in the topology view, for this layout.Since the geomap and sprites fields are mutually exclusive, this method will throw an exception if the sprites field is already set. - Parameters:
- geomap- the geomap name
- Returns:
- self, for chaining
- Throws:
- java.lang.IllegalArgumentException- if the sprites field is not null
 
 - 
geomappublic java.lang.String geomap() Returns the symbolic name for the geomap for this layout.- Returns:
- name of geomap
 
 - 
spritespublic UiTopoLayout sprites(java.lang.String sprites) Sets the name of the sprites definition for this layout. This is the symbolic name for a definition of sprites, which render as a symbolic background (e.g. a campus, or floor plan), to be displayed in the topology view, for this layout.Since the geomap and sprites fields are mutually exclusive, this method will throw an exception if the geomap field is already set. - Parameters:
- sprites- the sprites definition name
- Returns:
- self, for chaining
- Throws:
- java.lang.IllegalArgumentException- if the geomap field is not null
 
 - 
spritespublic java.lang.String sprites() Returns the symbolic name for the sprites definition for this layout.- Returns:
- name of sprites definition
 
 - 
scalepublic UiTopoLayout scale(double scale) Sets the scale for the geomap / sprite image. Note that the acceptable bounds are from 0.01 to 100.0.- Parameters:
- scale- the scale
- Returns:
- self for chaining
- Throws:
- java.lang.IllegalArgumentException- if the value is out of bounds
 
 - 
scalepublic double scale() Returns the scale for the geomap / sprite image.- Returns:
- the scale
 
 - 
offsetXpublic UiTopoLayout offsetX(double offsetX) Sets the x-offset value.- Parameters:
- offsetX- x-offset
- Returns:
- self, for chaining
 
 - 
offsetXpublic double offsetX() Returns the x-offset value.- Returns:
- the x-offset
 
 - 
offsetYpublic UiTopoLayout offsetY(double offsetY) Sets the y-offset value.- Parameters:
- offsetY- y-offset
- Returns:
- self, for chaining
 
 - 
offsetYpublic double offsetY() Returns the y-offset value.- Returns:
- the y-offset
 
 
- 
 
-