Class BasicUiTopoLayoutConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<UiTopoLayoutId>
-
- org.onosproject.net.config.basics.BasicUiTopoLayoutConfig
-
public class BasicUiTopoLayoutConfig extends Config<UiTopoLayoutId>
Basic configuration for UI topology layouts.Note that a layout configuration will include information about which background map (or sprites definition) to use, and at what relative scale and offset.
Note also that the
geomapandspritesfields are mutually exclusive.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.config.Config
Config.FieldPresence
-
-
Constructor Summary
Constructors Constructor Description BasicUiTopoLayoutConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringgeomap()Returns the identifier for the background geo-map.BasicUiTopoLayoutConfiggeomap(java.lang.String geomap)Sets the name of the geomap (topojson file) to use for this layout.booleanisValid()Indicates whether or not the backing JSON node contains valid data.doubleoffsetX()Returns the x-offset for the geomap / sprites background.BasicUiTopoLayoutConfigoffsetX(java.lang.Double offsetX)Sets the x-offset for the geomap / sprites background.doubleoffsetY()Returns the y-offset for the geomap / sprites background.BasicUiTopoLayoutConfigoffsetY(java.lang.Double offsetY)Sets the scale for the geomap / sprites background.UiTopoLayoutIdparent()Returns the identifier of the parent layout.BasicUiTopoLayoutConfigparent(UiTopoLayoutId id)Sets the identifier of the parent layout.RegionIdregion()Returns the identifier of the backing region.BasicUiTopoLayoutConfigregion(RegionId id)Sets the identifier of the backing region.doublescale()Returns the scale for the geomap / sprites background.BasicUiTopoLayoutConfigscale(java.lang.Double scale)Sets the scale for the geomap / sprites background.java.lang.Stringsprites()Returns the identifier for the background sprites.BasicUiTopoLayoutConfigsprites(java.lang.String sprites)Sets the name of the sprites definition to use for this layout.java.lang.StringtoString()-
Methods inherited from class org.onosproject.net.config.Config
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject
-
-
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from class:ConfigIndicates whether or not the backing JSON node contains valid data.Default implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.
- Overrides:
isValidin classConfig<UiTopoLayoutId>- Returns:
- true if the data is valid; false otherwise
-
toString
public java.lang.String toString()
- Overrides:
toStringin classConfig<UiTopoLayoutId>
-
region
public RegionId region()
Returns the identifier of the backing region. This will be null if there is no backing region.- Returns:
- backing region identifier
-
region
public BasicUiTopoLayoutConfig region(RegionId id)
Sets the identifier of the backing region.- Parameters:
id- backing region identifier, or null to unset- Returns:
- config for UI topology layout
-
parent
public UiTopoLayoutId parent()
Returns the identifier of the parent layout.- Returns:
- layout identifier of parent
-
parent
public BasicUiTopoLayoutConfig parent(UiTopoLayoutId id)
Sets the identifier of the parent layout.- Parameters:
id- parent ui-topo-layout identifier, or null to unset- Returns:
- config for UI topology layout
-
geomap
public java.lang.String geomap()
Returns the identifier for the background geo-map.- Returns:
- geo-map identifier
-
geomap
public BasicUiTopoLayoutConfig geomap(java.lang.String geomap)
Sets the name of the geomap (topojson file) to use for this layout.- Parameters:
geomap- geomap name; null to clear- Returns:
- config for UI topology layout
- Throws:
InvalidFieldException- if the sprites field is already set
-
sprites
public java.lang.String sprites()
Returns the identifier for the background sprites.- Returns:
- sprites identifier
-
sprites
public BasicUiTopoLayoutConfig sprites(java.lang.String sprites)
Sets the name of the sprites definition to use for this layout.- Parameters:
sprites- sprites definition name; null to clear- Returns:
- config for UI topology layout
- Throws:
InvalidFieldException- if the geomap field is already set
-
scale
public double scale()
Returns the scale for the geomap / sprites background.- Returns:
- scale of background map / diagram
-
scale
public BasicUiTopoLayoutConfig scale(java.lang.Double scale)
Sets the scale for the geomap / sprites background.- Parameters:
scale- the scale to set- Returns:
- config for UI topology layout
-
offsetX
public double offsetX()
Returns the x-offset for the geomap / sprites background.- Returns:
- x-offset of background map / diagram
-
offsetX
public BasicUiTopoLayoutConfig offsetX(java.lang.Double offsetX)
Sets the x-offset for the geomap / sprites background.- Parameters:
offsetX- the x-offset to set- Returns:
- config for UI topology layout
-
offsetY
public double offsetY()
Returns the y-offset for the geomap / sprites background.- Returns:
- y-offset of background map / diagram
-
offsetY
public BasicUiTopoLayoutConfig offsetY(java.lang.Double offsetY)
Sets the scale for the geomap / sprites background.- Parameters:
offsetY- the y-offset to set- Returns:
- config for UI topology layout
-
-