public class BasicUiTopoLayoutConfig extends Config<UiTopoLayoutId>
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
and sprites
fields are
mutually exclusive.
Config.FieldPresence
Constructor and Description |
---|
BasicUiTopoLayoutConfig() |
Modifier and Type | Method and 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() |
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
public boolean isValid()
Config
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.
isValid
in class Config<UiTopoLayoutId>
public java.lang.String toString()
toString
in class Config<UiTopoLayoutId>
public RegionId region()
public BasicUiTopoLayoutConfig region(RegionId id)
id
- backing region identifier, or null to unsetpublic UiTopoLayoutId parent()
public BasicUiTopoLayoutConfig parent(UiTopoLayoutId id)
id
- parent ui-topo-layout identifier, or null to unsetpublic java.lang.String geomap()
public BasicUiTopoLayoutConfig geomap(java.lang.String geomap)
geomap
- geomap name; null to clearInvalidFieldException
- if the sprites field is already setpublic java.lang.String sprites()
public BasicUiTopoLayoutConfig sprites(java.lang.String sprites)
sprites
- sprites definition name; null to clearInvalidFieldException
- if the geomap field is already setpublic double scale()
public BasicUiTopoLayoutConfig scale(java.lang.Double scale)
scale
- the scale to setpublic double offsetX()
public BasicUiTopoLayoutConfig offsetX(java.lang.Double offsetX)
offsetX
- the x-offset to setpublic double offsetY()
public BasicUiTopoLayoutConfig offsetY(java.lang.Double offsetY)
offsetY
- the y-offset to set