public class BooleanGridPane extends javafx.scene.Group implements GridListener<java.lang.Boolean>
Constructor and Description |
---|
BooleanGridPane()
Construct an empty BooleanGridPane with no model
|
Modifier and Type | Method and Description |
---|---|
javafx.scene.shape.Rectangle |
cellAtGridCoords(int row,
int col)
Returns the Rectangle at the given (row, col)
|
void |
cellChanged(int row,
int col,
java.lang.Boolean oldVal,
java.lang.Boolean newVal)
Updates a cell in response to a change in the model.
|
int |
colForXPos(double x)
Returns the column that contains the given x coordinate
|
javafx.scene.paint.Color |
getFalseColor()
Get the color to show in cells that have a value of false in the model
|
double |
getTileSize()
Get the size of each tile in pixels.
|
javafx.scene.paint.Color |
getTrueColor()
Get the color to show in cells that have a value of true in the model
|
void |
gridReplaced()
Responds to the entire grid being replaced in the model by redrawing the whole grid.
|
void |
resetCells()
This removes all previous cells and redraws the grid using the data
from the model (if there is one)
|
int |
rowForYPos(double y)
Returns the row that contains the given y coordinate
|
void |
setFalseColor(javafx.scene.paint.Color color)
Set the color to show in cells that have a value of false in the model
and update the cells to reflect the change.
|
void |
setModel(GridModel<java.lang.Boolean> model)
Sets the model to reflect in the grid.
|
void |
setTileSize(double size)
Set the size of each tile in pixels.
|
void |
setTrueColor(javafx.scene.paint.Color color)
Set the color to show in cells that have a value of true in the model
and update the cells to reflect the change.
|
double |
xPosForCol(int col)
Returns the x coordinate of the left edge of the given column.
|
double |
yPosForRow(int row)
Returns the y coordinate of the top edge of the given row.
|
autoSizeChildrenProperty, getChildren, isAutoSizeChildren, minHeight, minWidth, prefHeight, prefWidth, setAutoSizeChildren
getBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getStylesheets, impl_computeGeomBounds, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, impl_updatePeer, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, setImpl_traversalEngine
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_findStyles, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_isShowMnemonics, impl_isTreeVisible, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, maxHeight, maxWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setEffect, setEventDispatcher, setFocusTraversable, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public BooleanGridPane()
public void setTrueColor(javafx.scene.paint.Color color)
color
- the color to show in cells that have a value of true in the modelpublic javafx.scene.paint.Color getTrueColor()
public void setFalseColor(javafx.scene.paint.Color color)
color
- the color to show in cells that have a value of false in the modelpublic javafx.scene.paint.Color getFalseColor()
public void setTileSize(double size)
size
- the size of each tile in pixelspublic double getTileSize()
public void setModel(GridModel<java.lang.Boolean> model)
model
- the new modelpublic void resetCells()
public javafx.scene.shape.Rectangle cellAtGridCoords(int row, int col)
row
- the rowcol
- the columnpublic double xPosForCol(int col)
col
- the columnpublic double yPosForRow(int row)
row
- the rowpublic int colForXPos(double x)
x
- the x coordinatepublic int rowForYPos(double y)
y
- the y coordinatepublic void cellChanged(int row, int col, java.lang.Boolean oldVal, java.lang.Boolean newVal)
cellChanged
in interface GridListener<java.lang.Boolean>
row
- the rowcol
- the columnoldVal
- the old valuenewVal
- the new valuepublic void gridReplaced()
gridReplaced
in interface GridListener<java.lang.Boolean>