public class BaseGridWidget extends com.ait.lienzo.client.core.shape.Group implements GridWidget
com.ait.lienzo.client.core.shape.Group.GroupFactory
com.ait.lienzo.client.core.shape.GroupOf.GroupOfFactory<T extends com.ait.lienzo.client.core.shape.IPrimitive<?>,C extends com.ait.lienzo.client.core.shape.GroupOf<T,C>>
Modifier and Type | Field and Description |
---|---|
protected List<GridColumn<?>> |
allColumns |
protected com.ait.lienzo.client.core.shape.Group |
body |
protected List<GridColumn<?>> |
bodyColumns |
protected com.ait.lienzo.client.core.shape.Group |
bodySelections |
protected SelectionsTransformer |
bodyTransformer |
protected com.ait.lienzo.client.core.shape.Group |
boundary |
protected com.ait.lienzo.client.core.shape.Group |
floatingBody |
protected com.ait.lienzo.client.core.shape.Group |
floatingBodySelections |
protected List<GridColumn<?>> |
floatingColumns |
protected SelectionsTransformer |
floatingColumnsTransformer |
protected com.ait.lienzo.client.core.shape.Group |
floatingHeader |
protected com.ait.lienzo.client.core.shape.Group |
floatingHeaderSelections |
protected com.ait.lienzo.client.core.shape.Group |
header |
protected com.ait.lienzo.client.core.shape.Group |
headerSelections |
protected GridData |
model |
protected GridRenderer |
renderer |
protected BaseGridRendererHelper |
rendererHelper |
protected BaseGridRendererHelper.RenderingInformation |
renderingInformation |
protected Queue<Map.Entry<com.ait.lienzo.client.core.shape.Group,List<GridRenderer.RendererCommand>>> |
renderQueue |
Constructor and Description |
---|
BaseGridWidget(GridData model,
GridSelectionManager selectionManager,
GridPinnedModeManager pinnedModeManager,
GridRenderer renderer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCommandsToRenderQueue(com.ait.lienzo.client.core.shape.Group parent,
List<GridRenderer.RendererCommand> commands) |
protected void |
addCommandToRenderQueue(com.ait.lienzo.client.core.shape.Group parent,
GridRenderer.RendererCommand command) |
boolean |
adjustSelection(SelectionExtension direction,
boolean isShiftKeyDown)
Adjusts an existing selection, based on the selection origin, depending on the
provided parameters.
|
void |
deselect()
Deselects the Widget; i.e. another GridWidget has been clicked on, so hide
any visual indicator that this Widget was selected.
|
protected void |
drawBody(BaseGridRendererHelper.RenderingInformation renderingInformation) |
protected void |
drawHeader(BaseGridRendererHelper.RenderingInformation renderingInformation) |
protected void |
drawWithoutTransforms(com.ait.lienzo.client.core.Context2D context,
double alpha,
com.ait.lienzo.client.core.types.BoundingBox bb)
Intercept the normal Lienzo draw mechanism to calculate and hence draw only the visible
columns and rows for the Grid; being those within the bounds of the GridLayer.
|
protected void |
executeRenderQueueCommands(boolean isSelectionLayer) |
protected BaseGridRendererHelper |
getBaseGridRendererHelper() |
com.ait.lienzo.client.core.shape.Group |
getBody()
Returns the Group representing the GridWidget's Body
|
CellSelectionManager |
getCellSelectionManager()
Returns the
CellSelectionManager associated with the GridWidget |
protected com.ait.lienzo.client.core.event.NodeMouseClickHandler |
getGridMouseClickHandler(GridSelectionManager selectionManager) |
protected com.ait.lienzo.client.core.event.NodeMouseDoubleClickHandler |
getGridMouseDoubleClickHandler(GridSelectionManager selectionManager,
GridPinnedModeManager pinnedModeManager) |
com.ait.lienzo.client.core.shape.Group |
getHeader()
Returns the Group representing the GridWidget's Header
|
double |
getHeight()
Returns the height of the whole Widget, including Header and Body.
|
GridData |
getModel()
Returns the Model backing the Widget.
|
protected List<NodeMouseEventHandler> |
getNodeMouseClickEventHandlers(GridSelectionManager selectionManager) |
protected List<NodeMouseEventHandler> |
getNodeMouseDoubleClickEventHandlers(GridSelectionManager selectionManager,
GridPinnedModeManager pinnedModeManager) |
GridRenderer |
getRenderer()
Returns the Renderer used to render the Widget.
|
BaseGridRendererHelper |
getRendererHelper()
Returns helper for rendering the Widget.
|
double |
getWidth()
Returns the width of the whole Widget.
|
boolean |
isSelected()
Returns the selected state of the Widget.
|
boolean |
onGroupingToggle(double cellX,
double cellY,
double cellWidth,
double cellHeight)
Checks whether a cell-relative coordinate is "on" the hot-spot to toggle the collapsed/expanded state.
|
void |
onNodeMouseClick(com.ait.lienzo.client.core.event.NodeMouseClickEvent event) |
protected List<GridRenderer.RendererCommand> |
renderGridBodyWidget(List<GridColumn<?>> blockColumns,
double absoluteColumnOffsetX,
int minVisibleRowIndex,
int maxVisibleRowIndex,
SelectionsTransformer transformer,
BaseGridRendererHelper.RenderingInformation renderingInformation)
Render the Widget's Body and append to this Group.
|
protected GridRenderer.RendererCommand |
renderGridBoundary(BaseGridRendererHelper.RenderingInformation renderingInformation)
Render the selected ranges and append to the Body Group.
|
protected List<GridRenderer.RendererCommand> |
renderGridHeaderWidget(List<GridColumn<?>> allColumns,
List<GridColumn<?>> blockColumns,
BaseGridRendererHelper.RenderingInformation renderingInformation)
Render the Widget's Header and append to this Group.
|
protected GridRenderer.RendererCommand |
renderSelectedRanges(List<GridColumn<?>> blockColumns,
double absoluteColumnOffsetX,
int minVisibleRowIndex,
int maxVisibleRowIndex,
SelectionsTransformer transformer,
BaseGridRendererHelper.RenderingInformation renderingInformation,
List<GridData.SelectedCell> selectedCells,
BiFunction<SelectedRange,Integer,Double> selectedCellsYOffsetStrategy,
Function<SelectedRange,Double> selectedCellsHeightStrategy)
Render the selected ranges and append to the Body Group.
|
void |
select()
Selects the Widget; i.e. it has been clicked on, so show some visual indicator that it has been selected.
|
boolean |
selectCell(int uiRowIndex,
int uiColumnIndex,
boolean isShiftKeyDown,
boolean isControlKeyDown)
Handles selection of a cell by delegating selection to a @{link CellSelectionStrategy} associated
with the cell being selected.
|
boolean |
selectCell(com.ait.lienzo.client.core.types.Point2D rp,
boolean isShiftKeyDown,
boolean isControlKeyDown)
Handles selection of a cell by delegating selection to a @{link CellSelectionStrategy} associated
with the cell being selected.
|
boolean |
selectHeaderCell(int uiHeaderRowIndex,
int uiHeaderColumnIndex,
boolean isShiftKeyDown,
boolean isControlKeyDown)
Handles selection of a cell in the Header by delegating selection to a @{link HeaderCellSelectionStrategy}
associated with the header cell being selected.
|
boolean |
selectHeaderCell(com.ait.lienzo.client.core.types.Point2D rp,
boolean isShiftKeyDown,
boolean isControlKeyDown)
Handles selection of a cell in the Header by delegating selection to a @{link HeaderCellSelectionStrategy}
associated with the header cell being selected.
|
void |
setRenderer(GridRenderer renderer)
Returns the Rendered used to render the Widget.
|
com.ait.lienzo.client.core.shape.Group |
setVisible(boolean visible) |
boolean |
showContextMenuForCell(int uiRowIndex,
int uiColumnIndex)
Show context menu of a cell at coordinates 'uiRowIndex' and 'uiColumnIndex'.
|
boolean |
showContextMenuForHeader(int uiHeaderRowIndex,
int uiHeaderColumnIndex)
Show context menu of a header cell at coordinates 'uiHeaderRowIndex' and 'uiHeaderColumnIndex'.
|
boolean |
startEditingCell(int uiRowIndex,
int uiColumnIndex)
Handles initiation of editing a cell.
|
boolean |
startEditingCell(com.ait.lienzo.client.core.types.Point2D rp)
Handles initiation of editing a cell.
|
asGroup, getDefaultStorageEngine
add, add, asContainer, asGroupOf, asPrimitive, attachToLayerColorMap, batch, destroy, destroy, detachFromLayerColorMap, draw, find, getAlpha, getBoundingBoxAttributes, getControlHandleFactory, getControlHandles, getControlHandles, getDragBounds, getDragConstraint, getDragConstraints, getDragMode, getEventPropagationMode, getFactory, getFillAlpha, getGroupType, getLocation, getOffset, getRotation, getRotationDegrees, getScale, getShear, getStrokeAlpha, getTransformingAttributes, getX, getY, isDraggable, isDragging, isEditable, moveDown, moveToBottom, moveToTop, moveUp, refresh, remove, removeAll, removeFromParent, setAlpha, setControlHandleFactory, setDragBounds, setDragConstraint, setDragConstraints, setDraggable, setDragging, setDragMode, setEditable, setEventPropagationMode, setFillAlpha, setGroupType, setLocation, setOffset, setOffset, setOffset, setRotation, setRotationDegrees, setScale, setScale, setScale, setShear, setShear, setStrokeAlpha, setX, setY, toJSONObject
asContainerNode, copy, find, findByID, getBoundingBox, getChildNodes, getChildNodes, getPathClipper, getStorageBounds, getStorageEngine, length, moveDown, moveToBottom, moveToTop, moveUp, setPathClipper, setStorageBounds, setStorageEngine
addAttributesChangedHandler, addEnsureHandler, addNodeDragEndHandler, addNodeDragMoveHandler, addNodeDragStartHandler, addNodeGestureChangeHandler, addNodeGestureEndHandler, addNodeGestureStartHandler, addNodeMouseClickHandler, addNodeMouseDoubleClickHandler, addNodeMouseDownHandler, addNodeMouseEnterHandler, addNodeMouseExitHandler, addNodeMouseMoveHandler, addNodeMouseOutHandler, addNodeMouseOverHandler, addNodeMouseUpHandler, addNodeMouseWheelHandler, addNodeTouchCancelHandler, addNodeTouchEndHandler, addNodeTouchMoveHandler, addNodeTouchStartHandler, addParentsLocations, animate, animate, asAttributes, asAttributes, asGuide, asLayer, asList, asMultiPointShape, asNode, asScene, asShape, asViewport, cancelAttributesChangedBatcher, cast, copyUnchecked, doAnimating, drawWithTransforms, drawWithTransforms, equals, fireEvent, getAbsoluteLocation, getAbsoluteTransform, getAttributes, getAttributeSheet, getBoundingPoints, getBoundingPoints, getComputedBoundingPoints, getComputedLocation, getID, getLayer, getMetaData, getName, getNodeType, getOverLayer, getParent, getPossibleNodeTransform, getRequiredAttributes, getScene, getScratchPad, getUserData, getViewport, hashCode, hasMetaData, isAnimating, isEventHandled, isEventHandledGlobally, isListening, isVisible, onWire, setAttributesChangedBatcher, setID, setListening, setName, setNodeType, setParent, setUserData, toJSONString, toString, unAnimating, uuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
onDragHandle
attachToLayerColorMap, detachFromLayerColorMap, getAlpha, getControlHandleFactory, getDragBounds, getDragConstraint, getDragConstraints, getDragMode, getEventPropagationMode, getFillAlpha, getLocation, getOffset, getRotation, getRotationDegrees, getScale, getShear, getStrokeAlpha, getX, getY, isDraggable, isDragging, isEditable, setAlpha, setControlHandleFactory, setDragBounds, setDragConstraint, setDragConstraints, setDraggable, setDragging, setDragMode, setEditable, setEventPropagationMode, setFillAlpha, setLocation, setOffset, setOffset, setOffset, setRotation, setRotationDegrees, setScale, setScale, setScale, setShear, setShear, setStrokeAlpha, setX, setY
addAttributesChangedHandler, addNodeDragEndHandler, addNodeDragMoveHandler, addNodeDragStartHandler, addNodeGestureChangeHandler, addNodeGestureEndHandler, addNodeGestureStartHandler, addNodeMouseClickHandler, addNodeMouseDoubleClickHandler, addNodeMouseDownHandler, addNodeMouseEnterHandler, addNodeMouseExitHandler, addNodeMouseMoveHandler, addNodeMouseOutHandler, addNodeMouseOverHandler, addNodeMouseUpHandler, addNodeMouseWheelHandler, addNodeTouchCancelHandler, addNodeTouchEndHandler, addNodeTouchMoveHandler, addNodeTouchStartHandler, animate, animate, asContainer, asContainerNode, asGroup, asGroupOf, asGuide, asLayer, asMultiPointShape, asNode, asPrimitive, asScene, asShape, asViewport, batch, cancelAttributesChangedBatcher, copy, draw, drawWithTransforms, fireEvent, getAbsoluteLocation, getAbsoluteTransform, getAttributes, getAttributeSheet, getBoundingBox, getBoundingBoxAttributes, getBoundingPoints, getComputedBoundingPoints, getComputedLocation, getID, getLayer, getMetaData, getName, getNodeType, getOverLayer, getParent, getRequiredAttributes, getScene, getScratchPad, getTransformingAttributes, getUserData, getViewport, hasMetaData, isEventHandled, isListening, isVisible, moveDown, moveToBottom, moveToTop, moveUp, refresh, removeFromParent, setAttributesChangedBatcher, setID, setListening, setName, setUserData, uuid
protected final SelectionsTransformer bodyTransformer
protected final SelectionsTransformer floatingColumnsTransformer
protected final BaseGridRendererHelper rendererHelper
protected final Queue<Map.Entry<com.ait.lienzo.client.core.shape.Group,List<GridRenderer.RendererCommand>>> renderQueue
protected final List<GridColumn<?>> allColumns
protected final List<GridColumn<?>> bodyColumns
protected final List<GridColumn<?>> floatingColumns
protected GridData model
protected GridRenderer renderer
protected com.ait.lienzo.client.core.shape.Group header
protected com.ait.lienzo.client.core.shape.Group headerSelections
protected com.ait.lienzo.client.core.shape.Group floatingHeader
protected com.ait.lienzo.client.core.shape.Group floatingHeaderSelections
protected com.ait.lienzo.client.core.shape.Group body
protected com.ait.lienzo.client.core.shape.Group bodySelections
protected com.ait.lienzo.client.core.shape.Group floatingBody
protected com.ait.lienzo.client.core.shape.Group floatingBodySelections
protected com.ait.lienzo.client.core.shape.Group boundary
protected BaseGridRendererHelper.RenderingInformation renderingInformation
public BaseGridWidget(GridData model, GridSelectionManager selectionManager, GridPinnedModeManager pinnedModeManager, GridRenderer renderer)
protected BaseGridRendererHelper getBaseGridRendererHelper()
public CellSelectionManager getCellSelectionManager()
GridWidget
CellSelectionManager
associated with the GridWidget
getCellSelectionManager
in interface GridWidget
protected com.ait.lienzo.client.core.event.NodeMouseClickHandler getGridMouseClickHandler(GridSelectionManager selectionManager)
protected List<NodeMouseEventHandler> getNodeMouseClickEventHandlers(GridSelectionManager selectionManager)
protected com.ait.lienzo.client.core.event.NodeMouseDoubleClickHandler getGridMouseDoubleClickHandler(GridSelectionManager selectionManager, GridPinnedModeManager pinnedModeManager)
protected List<NodeMouseEventHandler> getNodeMouseDoubleClickEventHandlers(GridSelectionManager selectionManager, GridPinnedModeManager pinnedModeManager)
public GridData getModel()
GridWidget
getModel
in interface GridWidget
public GridRenderer getRenderer()
GridWidget
getRenderer
in interface GridWidget
public void setRenderer(GridRenderer renderer)
GridWidget
setRenderer
in interface GridWidget
public BaseGridRendererHelper getRendererHelper()
GridWidget
getRendererHelper
in interface GridWidget
public com.ait.lienzo.client.core.shape.Group getBody()
GridWidget
getBody
in interface GridWidget
public com.ait.lienzo.client.core.shape.Group getHeader()
GridWidget
getHeader
in interface GridWidget
public double getWidth()
GridWidget
getWidth
in interface GridWidget
public double getHeight()
GridWidget
getHeight
in interface GridWidget
public void select()
GridWidget
select
in interface GridWidget
public void deselect()
GridWidget
deselect
in interface GridWidget
public boolean isSelected()
GridWidget
isSelected
in interface GridWidget
protected void drawWithoutTransforms(com.ait.lienzo.client.core.Context2D context, double alpha, com.ait.lienzo.client.core.types.BoundingBox bb)
drawWithoutTransforms
in class com.ait.lienzo.client.core.shape.ContainerNode<com.ait.lienzo.client.core.shape.IPrimitive<?>,com.ait.lienzo.client.core.shape.Group>
context
- alpha
- public com.ait.lienzo.client.core.shape.Group setVisible(boolean visible)
setVisible
in interface com.ait.lienzo.client.core.shape.IDrawable<com.ait.lienzo.client.core.shape.Group>
setVisible
in class com.ait.lienzo.client.core.shape.Node<com.ait.lienzo.client.core.shape.Group>
protected void drawHeader(BaseGridRendererHelper.RenderingInformation renderingInformation)
protected void drawBody(BaseGridRendererHelper.RenderingInformation renderingInformation)
protected void addCommandToRenderQueue(com.ait.lienzo.client.core.shape.Group parent, GridRenderer.RendererCommand command)
protected void addCommandsToRenderQueue(com.ait.lienzo.client.core.shape.Group parent, List<GridRenderer.RendererCommand> commands)
protected void executeRenderQueueCommands(boolean isSelectionLayer)
protected List<GridRenderer.RendererCommand> renderGridHeaderWidget(List<GridColumn<?>> allColumns, List<GridColumn<?>> blockColumns, BaseGridRendererHelper.RenderingInformation renderingInformation)
allColumns
- All columns in the model.blockColumns
- The columns to render for a block.protected List<GridRenderer.RendererCommand> renderGridBodyWidget(List<GridColumn<?>> blockColumns, double absoluteColumnOffsetX, int minVisibleRowIndex, int maxVisibleRowIndex, SelectionsTransformer transformer, BaseGridRendererHelper.RenderingInformation renderingInformation)
blockColumns
- The columns to render.absoluteColumnOffsetX
- Absolute offset from Grid's X co-ordinate to render first column in block.minVisibleRowIndex
- The index of the first visible row.maxVisibleRowIndex
- The index of the last visible row.transformer
- SelectionTransformer in operation.protected GridRenderer.RendererCommand renderGridBoundary(BaseGridRendererHelper.RenderingInformation renderingInformation)
renderingInformation
- Calculated rendering information supporting rendering.protected GridRenderer.RendererCommand renderSelectedRanges(List<GridColumn<?>> blockColumns, double absoluteColumnOffsetX, int minVisibleRowIndex, int maxVisibleRowIndex, SelectionsTransformer transformer, BaseGridRendererHelper.RenderingInformation renderingInformation, List<GridData.SelectedCell> selectedCells, BiFunction<SelectedRange,Integer,Double> selectedCellsYOffsetStrategy, Function<SelectedRange,Double> selectedCellsHeightStrategy)
blockColumns
- The columns to render.absoluteColumnOffsetX
- Absolute offset from Grid's X co-ordinate to render first column in block.minVisibleRowIndex
- The index of the first visible row.maxVisibleRowIndex
- The index of the last visible row.transformer
- SelectionTransformer in operation.public void onNodeMouseClick(com.ait.lienzo.client.core.event.NodeMouseClickEvent event)
onNodeMouseClick
in interface com.ait.lienzo.client.core.event.NodeMouseClickHandler
public boolean onGroupingToggle(double cellX, double cellY, double cellWidth, double cellHeight)
GridWidget
onGroupingToggle
in interface GridWidget
cellX
- The MouseEvent relative to the cell's x-coordinate.cellY
- The MouseEvent relative to the cell's y-coordinate.cellWidth
- Width of the containing cell.cellHeight
- Height of the containing cell.public boolean selectCell(com.ait.lienzo.client.core.types.Point2D rp, boolean isShiftKeyDown, boolean isControlKeyDown)
CellSelectionManager
selectCell
in interface CellSelectionManager
rp
- Canvas coordinate relative to the GridWidget.isShiftKeyDown
- True if the shift key is pressed.isControlKeyDown
- True if the control key is pressed.public boolean selectCell(int uiRowIndex, int uiColumnIndex, boolean isShiftKeyDown, boolean isControlKeyDown)
CellSelectionManager
selectCell
in interface CellSelectionManager
uiRowIndex
- Index of row as seen in the UIuiColumnIndex
- Index of the column as seen in the UIisShiftKeyDown
- True if the shift key is pressed.isControlKeyDown
- True if the control key is pressed.public boolean selectHeaderCell(com.ait.lienzo.client.core.types.Point2D rp, boolean isShiftKeyDown, boolean isControlKeyDown)
CellSelectionManager
selectHeaderCell
in interface CellSelectionManager
rp
- Canvas coordinate relative to the GridWidget.isShiftKeyDown
- True if the shift key is pressed.isControlKeyDown
- True if the control key is pressed.public boolean selectHeaderCell(int uiHeaderRowIndex, int uiHeaderColumnIndex, boolean isShiftKeyDown, boolean isControlKeyDown)
CellSelectionManager
selectHeaderCell
in interface CellSelectionManager
uiHeaderRowIndex
- Index of row as seen in the UI. 0-based index. Top row is 0.uiHeaderColumnIndex
- Index of the column as seen in the UI. 0-based index. Leftmost column is 0.isShiftKeyDown
- True if the shift key is pressed.isControlKeyDown
- True if the control key is pressed.public boolean adjustSelection(SelectionExtension direction, boolean isShiftKeyDown)
CellSelectionManager
adjustSelection
in interface CellSelectionManager
direction
- The proposed direction in which to extend the selection.isShiftKeyDown
- true if the shift key is pressed.public boolean startEditingCell(int uiRowIndex, int uiColumnIndex)
CellSelectionManager
startEditingCell
in interface CellSelectionManager
uiRowIndex
- Row index of cell being edited.uiColumnIndex
- Column index of cell being edited.public boolean startEditingCell(com.ait.lienzo.client.core.types.Point2D rp)
CellSelectionManager
startEditingCell
in interface CellSelectionManager
rp
- Canvas coordinate relative to the GridWidget.public boolean showContextMenuForHeader(int uiHeaderRowIndex, int uiHeaderColumnIndex)
GridWidget
showContextMenuForHeader
in interface GridWidget
uiHeaderRowIndex
- Header row index of cell to invoke context menuuiHeaderColumnIndex
- Header column index of cell to invoke context menupublic boolean showContextMenuForCell(int uiRowIndex, int uiColumnIndex)
GridWidget
showContextMenuForCell
in interface GridWidget
uiRowIndex
- Row index of cell to invoke context menuuiColumnIndex
- Column index of cell to invoke context menuCopyright © 2012–2020 JBoss by Red Hat. All rights reserved.