Class BackgroundGrid

java.lang.Object
com.esri.arcgisruntime.mapping.view.BackgroundGrid

public final class BackgroundGrid extends Object
BackgroundGrid determines what a view looks like without anything in it.
Since:
100.0.0
  • Property Details

  • Constructor Details

    • BackgroundGrid

      public BackgroundGrid()
      Creates a background grid with default values.
      Since:
      100.0.0
    • BackgroundGrid

      public BackgroundGrid(Color color, Color gridLineColor, float gridLineWidth, float gridSize)
      Creates a new instance of BackgroundGrid with the specified color, grid line color, grid line width and grid size.
      Parameters:
      color - a background color
      gridLineColor - a grid line color
      gridLineWidth - the grid line width in device-independent pixels (DIP)
      gridSize - the grid size in device-independent pixels (DIP)
      Throws:
      IllegalArgumentException - if color is null
      IllegalArgumentException - if gridLineColor is null
      IllegalArgumentException - if gridLineWidth is less than zero
      IllegalArgumentException - if the gridSize is less than or equal to one
      Since:
      200.0.0
    • BackgroundGrid

      @Deprecated(since="200.0.0", forRemoval=true) public BackgroundGrid(int color, int gridLineColor, float gridLineWidth, float gridSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new instance of BackgroundGrid with the specified color, grid line color, grid line width and grid size.
      Parameters:
      color - an integer representing the background color as 0xAARRGGBB
      gridLineColor - an integer representing the grid line color as 0xAARRGGBB
      gridLineWidth - the grid line width in device-independent pixels (DIP)
      gridSize - the grid size in device-independent pixels (DIP)
      Throws:
      IllegalArgumentException - if gridLineWidth is less than zero
      IllegalArgumentException - if the gridSize is less than or equal to one
      Since:
      100.0.0
  • Method Details

    • colorProperty

      public ObjectProperty<Color> colorProperty()
      The background color of the grid.

      The default value is Color.SILVER - RGBA(192,192,192,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the color property
      Since:
      200.0.0
      See Also:
    • getColor

      public Color getColor()
      Gets the value of the color property.
      Property description:
      The background color of the grid.

      The default value is Color.SILVER - RGBA(192,192,192,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the value of the color property
      Since:
      200.0.0
      See Also:
    • setColor

      public void setColor(Color color)
      Sets the value of the color property.
      Property description:
      The background color of the grid.

      The default value is Color.SILVER - RGBA(192,192,192,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Parameters:
      color - the value for the color property
      Since:
      200.0.0
      See Also:
    • setColor

      @Deprecated(since="200.0.0", forRemoval=true) public void setColor(int argb)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 200.0.0, replaced by setColor(Color)
      Sets the color of the background.
      Parameters:
      argb - the color in the format 0xAARRGGBB
      Since:
      100.0.0
      See Also:
    • gridLineColorProperty

      public ObjectProperty<Color> gridLineColorProperty()
      The color of the grid lines.

      The default value is Color.BLACK - RGBA(0,0,0,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the gridLineColor property
      Since:
      200.0.0
      See Also:
    • getGridLineColor

      public Color getGridLineColor()
      Gets the value of the gridLineColor property.
      Property description:
      The color of the grid lines.

      The default value is Color.BLACK - RGBA(0,0,0,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the value of the gridLineColor property
      Since:
      200.0.0
      See Also:
    • setGridLineColor

      public void setGridLineColor(Color color)
      Sets the value of the gridLineColor property.
      Property description:
      The color of the grid lines.

      The default value is Color.BLACK - RGBA(0,0,0,255).

      Attempting to set the color to null will throw a NullPointerException exception.

      Parameters:
      color - the value for the gridLineColor property
      Since:
      200.0.0
      See Also:
    • setGridLineColor

      @Deprecated(since="200.0.0", forRemoval=true) public void setGridLineColor(int argb)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 200.0.0, replaced by setGridLineColor(Color)
      Sets the background grid line color.
      Parameters:
      argb - the color in the format 0xAARRGGBB
      Since:
      100.0.0
      See Also:
    • getGridLineWidth

      public float getGridLineWidth()
      Gets the background grid line width in device-independent pixels (DIP).
      Returns:
      the grid line width in dp. Default is 0.1.
      Since:
      100.0.0
      See Also:
    • setGridLineWidth

      public void setGridLineWidth(float gridLineWidth)
      Sets the background grid line width in device-independent pixels (DIP).
      Parameters:
      gridLineWidth - grid line width in dp. Must be greater than or equal to 0. Setting to 0 makes grid lines invisible.
      Throws:
      IllegalArgumentException - if the gridLineWidth is less than 0
      Since:
      100.0.0
      See Also:
    • getGridSize

      public float getGridSize()
      Gets the size of each background grid square, in device-independent pixels (DIP).
      Returns:
      the grid size in dp. Default is 20 * 20 pixels.
      Since:
      100.0.0
    • setGridSize

      public void setGridSize(float gridSize)
      Sets the size of each background grid square, in device-independent pixels (DIP). The background grid size must be greater than 1.
      Parameters:
      gridSize - the size of each grid square in device-independent pixels (DIP)
      Throws:
      IllegalArgumentException - if the gridSize is less than or equal to one
      Since:
      100.0.0
    • isVisible

      public boolean isVisible()
      Gets whether the grid lines are visible or not.

      In the context of MapView, this value indicates if the gridLineColorProperty() is visible.

      In the context of SceneView, this value indicates if both the BackgroundGrid.colorProperty() and the BackgroundGrid.gridLineColorProperty() are visible.

      The default value is true.

      Returns:
      true if grid lines are visible on the BackgroundGrid.colorProperty(), false otherwise
      Since:
      100.7.0
      See Also:
    • setVisible

      public void setVisible(boolean visible)
      Sets the grid lines visible or not.

      In the context of MapView, this value indicates if the gridLineColorProperty() is visible.

      In the context of SceneView, this value indicates if both the BackgroundGrid.colorProperty() and the BackgroundGrid.gridLineColorProperty() are visible.

      Parameters:
      visible - true if grid lines are to be visible on the BackgroundGrid.colorProperty(), false otherwise
      Since:
      100.7.0
      See Also: