public class GridModel extends java.lang.Object implements IPropertyChangeNotifier
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.| 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 |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
double |
getGridCellHeight()
Returns the grid cell height.
|
double |
getGridCellWidth()
Returns 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 |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
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.
|
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 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IPropertyChangeNotifierpublic double getGridCellHeight()
public double getGridCellWidth()
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 removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface IPropertyChangeNotifierpublic 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.Copyright (c) 2014 itemis AG and others. All rights reserved.