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 |
snapToGrid
Returns a boolean property whose value indicates whether snap-to-grid is
enabled.
|
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 java.lang.String |
GRID_CELL_HEIGHT_PROPERTY
Name of the "grid cell height" property.
|
static java.lang.String |
GRID_CELL_WIDTH_PROPERTY
Name of the "grid cell width" property.
|
static java.lang.String |
SHOW_GRID_PROPERTY
Name of the "show grid" property.
|
static java.lang.String |
SNAP_TO_GRID_PROPERTY
Name of the "snap to grid" property.
|
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 |
isSnapToGrid()
Returns
true if snap to grid is enabled, 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 |
setSnapToGrid(boolean snapToGrid)
Enables/Disables snap to 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 |
snapToGridProperty()
Returns a boolean property whose value indicates whether snap-to-grid is
enabled.
|
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 snapToGridProperty
isSnapToGrid()
,
setSnapToGrid(boolean)
public javafx.beans.property.BooleanProperty zoomGridProperty
isZoomGrid()
,
setZoomGrid(boolean)
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 static final java.lang.String SNAP_TO_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 isSnapToGrid()
true
if snap to grid is enabled, otherwise
false
.true
if snap to grid is enabled, 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 setSnapToGrid(boolean snapToGrid)
snapToGrid
- true
in order to enable snap-to-grid, or
false
in order to disable 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 snapToGridProperty()
isSnapToGrid()
,
setSnapToGrid(boolean)
public javafx.beans.property.BooleanProperty zoomGridProperty()
isZoomGrid()
,
setZoomGrid(boolean)
Copyright (c) 2014 itemis AG and others. All rights reserved.