public class GridModel
extends java.lang.Object
GridModel
stores information about a background grid, i.e. cell
width and cell height. It also stores flags indicating if the grid should be
visible, if the grid should zoom with the contents, and if contents should
snap to the grid.Type | Property and Description |
---|---|
javafx.beans.property.DoubleProperty |
gridCellHeight
Returns a double property representing the grid cell height.
|
javafx.beans.property.DoubleProperty |
gridCellWidth
Returns a double property representing the grid cell width.
|
javafx.beans.property.BooleanProperty |
showGrid
Returns a boolean property whose value indicates whether grid is to be
shown.
|
javafx.beans.property.BooleanProperty |
zoomGrid
Returns a boolean property whose value indicates whether grid is to be
zoomed.
|
Modifier and Type | Field and Description |
---|---|
static double |
GRID_CELL_HEIGHT_DEFAULT
The default grid cell height.
|
static java.lang.String |
GRID_CELL_HEIGHT_PROPERTY
Name of the "grid cell height" property.
|
static double |
GRID_CELL_WIDTH_DEFAULT
The default grid cell width.
|
static java.lang.String |
GRID_CELL_WIDTH_PROPERTY
Name of the "grid cell width" property.
|
static boolean |
SHOW_GRID_DEFAULT
The default value for
isShowGrid() . |
static java.lang.String |
SHOW_GRID_PROPERTY
Name of the "show grid" property.
|
static boolean |
ZOOM_GRID_DEFAULT
The default value for
isZoomGrid() . |
static java.lang.String |
ZOOM_GRID_PROPERTY
Name of the "zoom grid" property.
|
Constructor and Description |
---|
GridModel() |
Modifier and Type | Method and Description |
---|---|
double |
getGridCellHeight()
Returns the grid cell height.
|
double |
getGridCellWidth()
Returns the grid cell width.
|
javafx.beans.property.DoubleProperty |
gridCellHeightProperty()
Returns a double property representing the grid cell height.
|
javafx.beans.property.DoubleProperty |
gridCellWidthProperty()
Returns a double property representing the grid cell width.
|
boolean |
isShowGrid()
Returns
true if the grid is visible, otherwise
false . |
boolean |
isZoomGrid()
Returns
true if the grid is zooming with the contents,
otherwise false . |
void |
setGridCellHeight(double gridCellHeight)
Sets the grid cell height to the given value.
|
void |
setGridCellWidth(double gridCellWidth)
Sets the grid cell width to the given value.
|
void |
setShowGrid(boolean showGrid)
Shows/Hides the grid depending on the given value.
|
void |
setZoomGrid(boolean zoomGrid)
Enables/Disables grid zooming depending on the given value.
|
javafx.beans.property.BooleanProperty |
showGridProperty()
Returns a boolean property whose value indicates whether grid is to be
shown.
|
javafx.beans.property.BooleanProperty |
zoomGridProperty()
Returns a boolean property whose value indicates whether grid is to be
zoomed.
|
public javafx.beans.property.DoubleProperty gridCellHeightProperty
getGridCellHeight()
,
setGridCellHeight(double)
public javafx.beans.property.DoubleProperty gridCellWidthProperty
getGridCellWidth()
,
setGridCellWidth(double)
public javafx.beans.property.BooleanProperty showGridProperty
isShowGrid()
,
setShowGrid(boolean)
public javafx.beans.property.BooleanProperty zoomGridProperty
isZoomGrid()
,
setZoomGrid(boolean)
public static final boolean ZOOM_GRID_DEFAULT
isZoomGrid()
.public static final boolean SHOW_GRID_DEFAULT
isShowGrid()
.public static final double GRID_CELL_HEIGHT_DEFAULT
public static final double GRID_CELL_WIDTH_DEFAULT
public static final java.lang.String GRID_CELL_WIDTH_PROPERTY
public static final java.lang.String GRID_CELL_HEIGHT_PROPERTY
public static final java.lang.String SHOW_GRID_PROPERTY
public static final java.lang.String ZOOM_GRID_PROPERTY
public double getGridCellHeight()
public double getGridCellWidth()
public javafx.beans.property.DoubleProperty gridCellHeightProperty()
getGridCellHeight()
,
setGridCellHeight(double)
public javafx.beans.property.DoubleProperty gridCellWidthProperty()
getGridCellWidth()
,
setGridCellWidth(double)
public boolean isShowGrid()
true
if the grid is visible, otherwise
false
.true
if the grid is visible, otherwise
false
.public boolean isZoomGrid()
true
if the grid is zooming with the contents,
otherwise false
.true
if the grid is zooming with the contents,
otherwise false
.public void setGridCellHeight(double gridCellHeight)
gridCellHeight
- The new grid cell height.public void setGridCellWidth(double gridCellWidth)
gridCellWidth
- The new grid cell width.public void setShowGrid(boolean showGrid)
showGrid
- true
in order to show the grid, or
false
in order to hide it.public void setZoomGrid(boolean zoomGrid)
zoomGrid
- true
in order to zoom the grid with the contents,
or false
in order to not zoom the grid.public javafx.beans.property.BooleanProperty showGridProperty()
isShowGrid()
,
setShowGrid(boolean)
public javafx.beans.property.BooleanProperty zoomGridProperty()
isZoomGrid()
,
setZoomGrid(boolean)
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.