Package org.eclipse.gef.mvc.fx.models
Class GridModel
java.lang.Object
org.eclipse.gef.mvc.fx.models.GridModel
The
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.-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.DoubleProperty
Returns a double property representing the grid cell height.javafx.beans.property.DoubleProperty
Returns a double property representing the grid cell width.javafx.beans.property.BooleanProperty
Returns a boolean property whose value indicates whether grid is to be shown.javafx.beans.property.BooleanProperty
Returns a boolean property whose value indicates whether grid is to be zoomed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
The default grid cell height.static final String
Name of the "grid cell height" property.static final double
The default grid cell width.static final String
Name of the "grid cell width" property.static final boolean
The default value forisShowGrid()
.static final String
Name of the "show grid" property.static final boolean
The default value forisZoomGrid()
.static final String
Name of the "zoom grid" property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the grid cell height.double
Returns the grid cell width.javafx.beans.property.DoubleProperty
Returns a double property representing the grid cell height.javafx.beans.property.DoubleProperty
Returns a double property representing the grid cell width.boolean
Returnstrue
if the grid is visible, otherwisefalse
.boolean
Returnstrue
if the grid is zooming with the contents, otherwisefalse
.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
Returns a boolean property whose value indicates whether grid is to be shown.javafx.beans.property.BooleanProperty
Returns a boolean property whose value indicates whether grid is to be zoomed.
-
Property Details
-
gridCellHeight
public javafx.beans.property.DoubleProperty gridCellHeightPropertyReturns a double property representing the grid cell height.- See Also:
-
gridCellWidth
public javafx.beans.property.DoubleProperty gridCellWidthPropertyReturns a double property representing the grid cell width.- See Also:
-
showGrid
public javafx.beans.property.BooleanProperty showGridPropertyReturns a boolean property whose value indicates whether grid is to be shown.- See Also:
-
zoomGrid
public javafx.beans.property.BooleanProperty zoomGridPropertyReturns a boolean property whose value indicates whether grid is to be zoomed.- See Also:
-
-
Field Details
-
ZOOM_GRID_DEFAULT
public static final boolean ZOOM_GRID_DEFAULTThe default value forisZoomGrid()
.- See Also:
-
SHOW_GRID_DEFAULT
public static final boolean SHOW_GRID_DEFAULTThe default value forisShowGrid()
.- See Also:
-
GRID_CELL_HEIGHT_DEFAULT
public static final double GRID_CELL_HEIGHT_DEFAULTThe default grid cell height.- See Also:
-
GRID_CELL_WIDTH_DEFAULT
public static final double GRID_CELL_WIDTH_DEFAULTThe default grid cell width.- See Also:
-
GRID_CELL_WIDTH_PROPERTY
Name of the "grid cell width" property.- See Also:
-
GRID_CELL_HEIGHT_PROPERTY
Name of the "grid cell height" property.- See Also:
-
SHOW_GRID_PROPERTY
Name of the "show grid" property.- See Also:
-
ZOOM_GRID_PROPERTY
Name of the "zoom grid" property.- See Also:
-
-
Constructor Details
-
GridModel
public GridModel()
-
-
Method Details
-
getGridCellHeight
public double getGridCellHeight()Returns the grid cell height.- Returns:
- The grid cell height.
-
getGridCellWidth
public double getGridCellWidth()Returns the grid cell width.- Returns:
- The grid cell width.
-
gridCellHeightProperty
public javafx.beans.property.DoubleProperty gridCellHeightProperty()Returns a double property representing the grid cell height.- See Also:
-
gridCellWidthProperty
public javafx.beans.property.DoubleProperty gridCellWidthProperty()Returns a double property representing the grid cell width.- See Also:
-
isShowGrid
public boolean isShowGrid()Returnstrue
if the grid is visible, otherwisefalse
.- Returns:
true
if the grid is visible, otherwisefalse
.
-
isZoomGrid
public boolean isZoomGrid()Returnstrue
if the grid is zooming with the contents, otherwisefalse
.- Returns:
true
if the grid is zooming with the contents, otherwisefalse
.
-
setGridCellHeight
public void setGridCellHeight(double gridCellHeight) Sets the grid cell height to the given value.- Parameters:
gridCellHeight
- The new grid cell height.
-
setGridCellWidth
public void setGridCellWidth(double gridCellWidth) Sets the grid cell width to the given value.- Parameters:
gridCellWidth
- The new grid cell width.
-
setShowGrid
public void setShowGrid(boolean showGrid) Shows/Hides the grid depending on the given value.- Parameters:
showGrid
-true
in order to show the grid, orfalse
in order to hide it.
-
setZoomGrid
public void setZoomGrid(boolean zoomGrid) Enables/Disables grid zooming depending on the given value.- Parameters:
zoomGrid
-true
in order to zoom the grid with the contents, orfalse
in order to not zoom the grid.
-
showGridProperty
public javafx.beans.property.BooleanProperty showGridProperty()Returns a boolean property whose value indicates whether grid is to be shown.- See Also:
-
zoomGridProperty
public javafx.beans.property.BooleanProperty zoomGridProperty()Returns a boolean property whose value indicates whether grid is to be zoomed.- See Also:
-