- Since:
- 100.0.0
-
Property Summary
PropertiesTypePropertyDescriptionThe background color of the grid.The color of the grid lines. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a background grid with default values.BackgroundGrid
(int color, int gridLineColor, float gridLineWidth, float gridSize) Deprecated, for removal: This API element is subject to removal in a future version.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. -
Method Summary
Modifier and TypeMethodDescriptionThe background color of the grid.getColor()
Gets the value of the property color.Gets the value of the property gridLineColor.float
Gets the background grid line width in device-independent pixels (DIP).float
Gets the size of each background grid square, in device-independent pixels (DIP).The color of the grid lines.boolean
Gets whether the grid lines are visible or not.void
setColor
(int argb) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetColor(Color)
void
Sets the value of the property color.void
setGridLineColor
(int argb) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetGridLineColor(Color)
void
setGridLineColor
(Color color) Sets the value of the property gridLineColor.void
setGridLineWidth
(float gridLineWidth) Sets the background grid line width in device-independent pixels (DIP).void
setGridSize
(float gridSize) Sets the size of each background grid square, in device-independent pixels (DIP).void
setVisible
(boolean visible) Sets the grid lines visible or not.
-
Property Details
-
color
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.
- Since:
- 200.0.0
- See Also:
-
gridLineColor
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.
- Since:
- 200.0.0
- See Also:
-
-
Constructor Details
-
BackgroundGrid
public BackgroundGrid()Creates a background grid with default values.- Since:
- 100.0.0
-
BackgroundGrid
Creates a new instance of BackgroundGrid with the specified color, grid line color, grid line width and grid size.- Parameters:
color
- a background colorgridLineColor
- a grid line colorgridLineWidth
- the grid line width in device-independent pixels (DIP)gridSize
- the grid size in device-independent pixels (DIP)- Throws:
IllegalArgumentException
- if color is nullIllegalArgumentException
- if gridLineColor is nullIllegalArgumentException
- if gridLineWidth is less than zeroIllegalArgumentException
- 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.as of 200.0.0, replaced byBackgroundGrid(Color, Color, float, float)
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 0xAARRGGBBgridLineColor
- an integer representing the grid line color as 0xAARRGGBBgridLineWidth
- 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 zeroIllegalArgumentException
- if the gridSize is less than or equal to one- Since:
- 100.0.0
-
-
Method Details
-
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.
- Since:
- 200.0.0
- See Also:
-
getColor
Gets the value of the property color.- 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.
- Since:
- 200.0.0
-
setColor
Sets the value of the property color.- 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.
- Since:
- 200.0.0
-
setColor
Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetColor(Color)
Sets the color of the background.- Parameters:
argb
- the color in the format 0xAARRGGBB- Since:
- 100.0.0
- See Also:
-
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.
- Since:
- 200.0.0
- See Also:
-
getGridLineColor
Gets the value of the property gridLineColor.- 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.
- Since:
- 200.0.0
-
setGridLineColor
Sets the value of the property gridLineColor.- 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.
- Since:
- 200.0.0
-
setGridLineColor
Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetGridLineColor(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 thegridLineColorProperty()
is visible.In the context of
SceneView
, this value indicates if both theBackgroundGrid.colorProperty()
and theBackgroundGrid.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 thegridLineColorProperty()
is visible.In the context of
SceneView
, this value indicates if both theBackgroundGrid.colorProperty()
and theBackgroundGrid.gridLineColorProperty()
are visible.- Parameters:
visible
- true if grid lines are to be visible on theBackgroundGrid.colorProperty()
, false otherwise- Since:
- 100.7.0
- See Also:
-
BackgroundGrid(Color, Color, float, float)