Class 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 and sprites fields are mutually exclusive.

    • Constructor Detail

      • BasicUiTopoLayoutConfig

        public BasicUiTopoLayoutConfig()
    • 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 class Config<UiTopoLayoutId>
        Returns:
        true if the data is valid; false otherwise
      • 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