Package org.eclipse.gef.mvc.fx.models
Class GridModel
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.models.GridModel
-
public class GridModel extends java.lang.ObjectTheGridModelstores 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.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleGRID_CELL_HEIGHT_DEFAULTThe default grid cell height.static java.lang.StringGRID_CELL_HEIGHT_PROPERTYName of the "grid cell height" property.static doubleGRID_CELL_WIDTH_DEFAULTThe default grid cell width.static java.lang.StringGRID_CELL_WIDTH_PROPERTYName of the "grid cell width" property.static booleanSHOW_GRID_DEFAULTThe default value forisShowGrid().static java.lang.StringSHOW_GRID_PROPERTYName of the "show grid" property.static booleanZOOM_GRID_DEFAULTThe default value forisZoomGrid().static java.lang.StringZOOM_GRID_PROPERTYName of the "zoom grid" property.
-
Constructor Summary
Constructors Constructor Description GridModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetGridCellHeight()Returns the grid cell height.doublegetGridCellWidth()Returns the grid cell width.javafx.beans.property.DoublePropertygridCellHeightProperty()Returns a double property representing the grid cell height.javafx.beans.property.DoublePropertygridCellWidthProperty()Returns a double property representing the grid cell width.booleanisShowGrid()Returnstrueif the grid is visible, otherwisefalse.booleanisZoomGrid()Returnstrueif 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.BooleanPropertyshowGridProperty()Returns a boolean property whose value indicates whether grid is to be shown.javafx.beans.property.BooleanPropertyzoomGridProperty()Returns a boolean property whose value indicates whether grid is to be zoomed.
-
-
-
Field Detail
-
ZOOM_GRID_DEFAULT
public static final boolean ZOOM_GRID_DEFAULT
The default value forisZoomGrid().- See Also:
- Constant Field Values
-
SHOW_GRID_DEFAULT
public static final boolean SHOW_GRID_DEFAULT
The default value forisShowGrid().- See Also:
- Constant Field Values
-
GRID_CELL_HEIGHT_DEFAULT
public static final double GRID_CELL_HEIGHT_DEFAULT
The default grid cell height.- See Also:
- Constant Field Values
-
GRID_CELL_WIDTH_DEFAULT
public static final double GRID_CELL_WIDTH_DEFAULT
The default grid cell width.- See Also:
- Constant Field Values
-
GRID_CELL_WIDTH_PROPERTY
public static final java.lang.String GRID_CELL_WIDTH_PROPERTY
Name of the "grid cell width" property.- See Also:
- Constant Field Values
-
GRID_CELL_HEIGHT_PROPERTY
public static final java.lang.String GRID_CELL_HEIGHT_PROPERTY
Name of the "grid cell height" property.- See Also:
- Constant Field Values
-
SHOW_GRID_PROPERTY
public static final java.lang.String SHOW_GRID_PROPERTY
Name of the "show grid" property.- See Also:
- Constant Field Values
-
ZOOM_GRID_PROPERTY
public static final java.lang.String ZOOM_GRID_PROPERTY
Name of the "zoom grid" property.- See Also:
- Constant Field Values
-
-
Method Detail
-
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.- Returns:
- A double property named
GRID_CELL_HEIGHT_PROPERTY.
-
gridCellWidthProperty
public javafx.beans.property.DoubleProperty gridCellWidthProperty()
Returns a double property representing the grid cell width.- Returns:
- A double property named
GRID_CELL_WIDTH_PROPERTY.
-
isShowGrid
public boolean isShowGrid()
Returnstrueif the grid is visible, otherwisefalse.- Returns:
trueif the grid is visible, otherwisefalse.
-
isZoomGrid
public boolean isZoomGrid()
Returnstrueif the grid is zooming with the contents, otherwisefalse.- Returns:
trueif 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-truein order to show the grid, orfalsein order to hide it.
-
setZoomGrid
public void setZoomGrid(boolean zoomGrid)
Enables/Disables grid zooming depending on the given value.- Parameters:
zoomGrid-truein order to zoom the grid with the contents, orfalsein 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.- Returns:
- A boolean property named
SHOW_GRID_PROPERTY.
-
zoomGridProperty
public javafx.beans.property.BooleanProperty zoomGridProperty()
Returns a boolean property whose value indicates whether grid is to be zoomed.- Returns:
- A boolean property named
ZOOM_GRID_PROPERTY.
-
-