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 SummaryPropertiesTypePropertyDescriptionjavafx.beans.property.DoublePropertyReturns a double property representing the grid cell height.javafx.beans.property.DoublePropertyReturns a double property representing the grid cell width.javafx.beans.property.BooleanPropertyReturns a boolean property whose value indicates whether grid is to be shown.javafx.beans.property.BooleanPropertyReturns a boolean property whose value indicates whether grid is to be zoomed.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final doubleThe default grid cell height.static final StringName of the "grid cell height" property.static final doubleThe default grid cell width.static final StringName of the "grid cell width" property.static final booleanThe default value forisShowGrid().static final StringName of the "show grid" property.static final booleanThe default value forisZoomGrid().static final StringName of the "zoom grid" property.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondoubleReturns the grid cell height.doubleReturns the grid cell width.javafx.beans.property.DoublePropertyReturns a double property representing the grid cell height.javafx.beans.property.DoublePropertyReturns a double property representing the grid cell width.booleanReturnstrueif the grid is visible, otherwisefalse.booleanReturnstrueif the grid is zooming with the contents, otherwisefalse.voidsetGridCellHeight(double gridCellHeight) Sets the grid cell height to the given value.voidsetGridCellWidth(double gridCellWidth) Sets the grid cell width to the given value.voidsetShowGrid(boolean showGrid) Shows/Hides the grid depending on the given value.voidsetZoomGrid(boolean zoomGrid) Enables/Disables grid zooming depending on the given value.javafx.beans.property.BooleanPropertyReturns a boolean property whose value indicates whether grid is to be shown.javafx.beans.property.BooleanPropertyReturns a boolean property whose value indicates whether grid is to be zoomed.
- 
Property Details- 
gridCellHeightpublic javafx.beans.property.DoubleProperty gridCellHeightPropertyReturns a double property representing the grid cell height.- See Also:
 
- 
gridCellWidthpublic javafx.beans.property.DoubleProperty gridCellWidthPropertyReturns a double property representing the grid cell width.- See Also:
 
- 
showGridpublic javafx.beans.property.BooleanProperty showGridPropertyReturns a boolean property whose value indicates whether grid is to be shown.- See Also:
 
- 
zoomGridpublic javafx.beans.property.BooleanProperty zoomGridPropertyReturns a boolean property whose value indicates whether grid is to be zoomed.- See Also:
 
 
- 
- 
Field Details- 
ZOOM_GRID_DEFAULTpublic static final boolean ZOOM_GRID_DEFAULTThe default value forisZoomGrid().- See Also:
 
- 
SHOW_GRID_DEFAULTpublic static final boolean SHOW_GRID_DEFAULTThe default value forisShowGrid().- See Also:
 
- 
GRID_CELL_HEIGHT_DEFAULTpublic static final double GRID_CELL_HEIGHT_DEFAULTThe default grid cell height.- See Also:
 
- 
GRID_CELL_WIDTH_DEFAULTpublic static final double GRID_CELL_WIDTH_DEFAULTThe default grid cell width.- See Also:
 
- 
GRID_CELL_WIDTH_PROPERTYName of the "grid cell width" property.- See Also:
 
- 
GRID_CELL_HEIGHT_PROPERTYName of the "grid cell height" property.- See Also:
 
- 
SHOW_GRID_PROPERTYName of the "show grid" property.- See Also:
 
- 
ZOOM_GRID_PROPERTYName of the "zoom grid" property.- See Also:
 
 
- 
- 
Constructor Details- 
GridModelpublic GridModel()
 
- 
- 
Method Details- 
getGridCellHeightpublic double getGridCellHeight()Returns the grid cell height.- Returns:
- The grid cell height.
 
- 
getGridCellWidthpublic double getGridCellWidth()Returns the grid cell width.- Returns:
- The grid cell width.
 
- 
gridCellHeightPropertypublic javafx.beans.property.DoubleProperty gridCellHeightProperty()Returns a double property representing the grid cell height.- See Also:
 
- 
gridCellWidthPropertypublic javafx.beans.property.DoubleProperty gridCellWidthProperty()Returns a double property representing the grid cell width.- See Also:
 
- 
isShowGridpublic boolean isShowGrid()Returnstrueif the grid is visible, otherwisefalse.- Returns:
- trueif the grid is visible, otherwise- false.
 
- 
isZoomGridpublic boolean isZoomGrid()Returnstrueif the grid is zooming with the contents, otherwisefalse.- Returns:
- trueif the grid is zooming with the contents, otherwise- false.
 
- 
setGridCellHeightpublic void setGridCellHeight(double gridCellHeight) Sets the grid cell height to the given value.- Parameters:
- gridCellHeight- The new grid cell height.
 
- 
setGridCellWidthpublic void setGridCellWidth(double gridCellWidth) Sets the grid cell width to the given value.- Parameters:
- gridCellWidth- The new grid cell width.
 
- 
setShowGridpublic void setShowGrid(boolean showGrid) Shows/Hides the grid depending on the given value.- Parameters:
- showGrid-- truein order to show the grid, or- falsein order to hide it.
 
- 
setZoomGridpublic void setZoomGrid(boolean zoomGrid) Enables/Disables grid zooming depending on the given value.- Parameters:
- zoomGrid-- truein order to zoom the grid with the contents, or- falsein order to not zoom the grid.
 
- 
showGridPropertypublic javafx.beans.property.BooleanProperty showGridProperty()Returns a boolean property whose value indicates whether grid is to be shown.- See Also:
 
- 
zoomGridPropertypublic javafx.beans.property.BooleanProperty zoomGridProperty()Returns a boolean property whose value indicates whether grid is to be zoomed.- See Also:
 
 
-