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
geomap
andsprites
fields 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.String
geomap()
Returns the identifier for the background geo-map.BasicUiTopoLayoutConfig
geomap(java.lang.String geomap)
Sets the name of the geomap (topojson file) to use for this layout.boolean
isValid()
Indicates whether or not the backing JSON node contains valid data.double
offsetX()
Returns the x-offset for the geomap / sprites background.BasicUiTopoLayoutConfig
offsetX(java.lang.Double offsetX)
Sets the x-offset for the geomap / sprites background.double
offsetY()
Returns the y-offset for the geomap / sprites background.BasicUiTopoLayoutConfig
offsetY(java.lang.Double offsetY)
Sets the scale for the geomap / sprites background.UiTopoLayoutId
parent()
Returns the identifier of the parent layout.BasicUiTopoLayoutConfig
parent(UiTopoLayoutId id)
Sets the identifier of the parent layout.RegionId
region()
Returns the identifier of the backing region.BasicUiTopoLayoutConfig
region(RegionId id)
Sets the identifier of the backing region.double
scale()
Returns the scale for the geomap / sprites background.BasicUiTopoLayoutConfig
scale(java.lang.Double scale)
Sets the scale for the geomap / sprites background.java.lang.String
sprites()
Returns the identifier for the background sprites.BasicUiTopoLayoutConfig
sprites(java.lang.String sprites)
Sets the name of the sprites definition to use for this layout.java.lang.String
toString()
-
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:Config
Indicates 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:
isValid
in classConfig<UiTopoLayoutId>
- Returns:
- true if the data is valid; false otherwise
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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
-
-