Class KanbanBoard
- All Implemented Interfaces:
Animation, Editable, StyleListener
A Kanban board: columns of cards, dragged from one stage to the next.
DefaultKanbanModel model = new DefaultKanbanModel();
model.addColumn(new KanbanColumn("todo", "To do"));
model.addColumn(new KanbanColumn("doing", "Doing").setWipLimit(3));
model.addColumn(new KanbanColumn("done", "Done"));
model.addCard("todo", new KanbanCard("c1", "Write the release notes").addTag("docs"));
Form form = new Form("Board", new BorderLayout());
KanbanBoard board = new KanbanBoard(model);
form.add(BorderLayout.CENTER, board);
form.show();
The whole board scrolls as one surface, both ways, under column titles
that stay in view. A card is dragged with a mouse, or after a long press
with a finger, which leaves a plain drag free to scroll; the other cards
make room where it would land. Column titles are dragged the same way to
reorder the columns, and the mark at the end of a title folds the column
to a strip. With KanbanLanes in the model the board has swimlanes, each
under a title that folds it.
A column shows how many cards it holds, against its limit when it has
one, and is marked when it is over. A model that enforces its limits
(DefaultKanbanModel.setEnforceWipLimits) shows the refusal while the
card is still held over the column.
On a narrow screen setColumnSnap brings scrolling to rest on a column.
A KanbanCardFactory puts a component in each card; it is drawn with the
card, and a tap on it reaches it.
The row under the cards of a column adds a card, typed in place, and a
double tap renames one. Every edit is offered to the KanbanListeners
and then to the model, and with setUndoHistory can be undone. With a
keyboard, Delete removes the selected card, and with Control or Command,
C, X, V and D copy, cut, paste and duplicate it, Z undoes and Shift-Z
redoes.
Styling
The UIIDs are KanbanBoard, KanbanColumn, KanbanColumnHeader,
KanbanColumnOverLimit, KanbanCard, KanbanCardSelected,
KanbanCardTag, KanbanLane, KanbanAddCard and KanbanDropSlot. A
theme that defines none of them gets defaults that follow its light or
dark mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class ScrollSurface
ScrollSurface.EditTrigger, ScrollSurface.PageGrid -
Field Summary
Fields inherited from class ScrollSurface
HOVER_MS, LIFT_MS, SETTLE_MSFields inherited from class Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR -
Constructor Summary
ConstructorsConstructorDescriptionAn empty board backed by a newDefaultKanbanModel.KanbanBoard(KanbanModel model) A board showingmodel. -
Method Summary
Modifier and TypeMethodDescriptionaddCard(KanbanColumn column, KanbanLane lane, String title) Adds a card with a title at the end of a cell, as typing it into the row under the column does: offered to the listeners, then to the model, recorded for undo and selected.voidAdds a listener.protected booleanAdvances the view's own motion.protected DimensionCalculates the preferred size based on component content.booleanPuts the selected card on the clipboard, as JSON.booleanCopies the selected card and removes it.protected voidInvoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.booleanAdds a copy of the selected card under it.protected voideditEnded(boolean committed) The edit is over.protected voideditMoved(int x, int y) The pointer of an edit moved, or the surface scrolled under it.protected booleaneditStarted(int x, int y, ScrollSurface.EditTrigger trigger) Asked when a drag or a long press begins, at the point where the pointer went down, in the component's coordinates.voidEnds the typing of a title and applies it.The text of the row that adds a card.int[]getCardBounds(KanbanCard card) The rectangle of a card in the board's own coordinates, as it is laid out now, or null when it is not shown.getCardComponent(KanbanCard card) The component the factory made for a card, or null.intThe height, in pixels, the component of a card takes at the bottom of it; 0 for a card without one.Makes the components inside the cards, or null.Paints the cards.int[]getColumnHeaderBounds(KanbanColumn column) The rectangle of a column's title in the board's own coordinates, or null for a column that is not in the model.floatThe width of a column, in millimetres.protected intThe height of what scrolls, in pixels, without the top header.protected intThe width of what scrolls, in pixels, without the left header.getModel()The model shown.The selected card, or null.The history edits are recorded in, or null.booleanTrue when the columns can be dragged into another order.booleanTrue when scrolling comes to rest on a column.booleanTrue while a title is being typed in place.booleanTrue when the user can move, add, rename and remove cards.booleanTrue when every column ends in a row that adds a card.booleanTrue when a double tap renames a card in place.voidkeyPressed(int keyCode) If this Component is focused, the key pressed event will call this methodprotected voidlayoutSurface(int width, int height) Lays the surface out for a size: sets the header sizes and whatever the content's size depends on.voidThe model changed: the board is laid out again before it is next painted or asked where something is.booleanmoveCard(KanbanCard card, KanbanColumn column, KanbanLane lane, int index) Moves a card to an index of a cell, as a drop there does: offered to the listeners, then to the model, and recorded for undo.booleanmoveColumn(KanbanColumn column, int index) Moves a column to an index, counted without it, as dragging its title does.protected voidpaintContent(Graphics g, int x, int y) Paints what scrolls.protected voidpaintOverlay(Graphics g, int x, int y) Paints over everything, in the component's own bounds, whose top left isx,y.protected voidpaintTopHeader(Graphics g, int x, int y) Paints the pinned top row.booleanpaste()Adds the card on the clipboard under the selected card, or at the end of the first column when none is selected.voidpointerReleased(int x, int y) If this Component is focused, the pointer released event will call this methodprotected voidpressStarted(int x, int y) The pointer went down at a point, in the component's coordinates.booleanredo()Makes the last undone edit again.booleanremoveCard(KanbanCard card) Removes a card, as Delete on it does.voidRemoves a listener.booleanrenameCard(KanbanCard card, String title) Gives a card another title, as renaming it in place does.protected voidThe scroll position changed.voidscrollToCard(KanbanCard card) Scrolls so a card is in view.voidscrollToColumn(KanbanColumn column) Scrolls so a column is at the leading edge of the view.voidselect(KanbanCard card) Selects a card, or with null none.voidsetAddCardText(String addCardText) Sets the text of the row that adds a card, for another language.voidsetCardFactory(KanbanCardFactory cardFactory) Puts a real component inside each card; null, the default, for cards that are only painted.voidsetCardRenderer(KanbanCardRenderer renderer) Sets the renderer of the cards.voidsetColumnReorderEnabled(boolean columnReorder) Lets the user drag a column by its title to another place; on by default.voidsetColumnSnap(boolean columnSnap) Makes scrolling across the board come to rest with a column at its leading edge, so a narrow screen shows one whole column at a time and not the halves of two.voidsetColumnWidth(float millimetres) Sets the width of a column, in millimetres; 42 by default.voidsetEditingEnabled(boolean editable) Lets the user edit the board, the default, or only look at it.voidsetInlineAdd(boolean inlineAdd) Shows a row under the cards of each column that adds a card typed in place; on by default.voidsetInlineEditing(boolean inlineEditing) Makes a double tap on a card rename it in place, the default, or only tell the listeners the card was opened.voidsetModel(KanbanModel model) Shows another model.voidsetUndoHistory(UndoHistory undoHistory) Records every edit the user makes in a history, so it can be undone.voidWrites the user data of a copied card to the clipboard and reads it back on paste; without one, a pasted card has no user data.voidstartAddCard(KanbanColumn column, KanbanLane lane) Opens the row that adds a card to a cell for typing; the card is added byaddCardwhen editing ends with a title in it.voidstartCardEdit(KanbanCard card) Renames a card in place, in a text field over it; the title goes torenameCardwhen editing ends.protected voidtapped(int x, int y, boolean doubleTap) A tap that was not a drag or a long press.toImage(int maxWidth, int maxHeight) Paints the whole board, every column and card of it, into a new image no larger than the given size, without the selection.booleanundo()Takes back the last edit in the history.Methods inherited from class ScrollSurface
animate, applySettle, cancelEdit, currentTime, getBodyHeight, getBodyWidth, getBodyX, getContentOriginX, getFadingHoverTarget, getHeaderHeight, getHeaderWidth, getHeaderX, getHoverLevel, getHoverTarget, getLiftLevel, getMaxOffsetX, getMaxOffsetY, getOffsetX, getOffsetY, getPageGrid, getPageStep, hasHoverFeedback, hoverAt, hoverGone, initComponent, isBounded, isDragEdits, isEditAutoScroll, isEditInProgress, isMirrored, isPrinting, longPointerPress, longPressed, mouseWheel, paint, paintCorner, paintLeftHeader, paintPage, pinch, pinchReleased, pointerDragged, pointerHover, pointerPressed, refreshLayout, requestAnimation, restoreZoomState, saveZoomState, scrollTo, setAnimationTime, setBounded, setDragEdits, setHeaderSize, setHovered, setHoverTarget, setHoverTooltip, setOffsets, shouldBlockSideSwipe, startSettle, stopFling, zoomByMethods inherited from class Component
accessibilityChanged, accessibilityChanged, addContextMenuListener, addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addMouseWheelListener, addNativeDragOverListener, addNativeDropListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, addStylusListener, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, canAcceptNativeDrop, cancelRepaints, clearClientProperties, consumesRawTextInput, contains, containsOrOwns, createNativeDragOperation, createStyleAnimation, deinitializeCustomStyle, deregisterFromAnimation, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAcceptedDropActions, getAcceptedDropMimeTypes, getAccessibilityNode, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBottomGap, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getContextMenuCommands, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getHoverStyle, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeDragOperation, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSemantics, getSideGap, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getTopLevelContainer, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initLaf, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isHovered, isHScrollThumbGrabbed, isHScrollThumbHover, isIgnorePointerEvents, isInClippingRegion, isInitialized, isNativeDragSource, isNativeDropTarget, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, isVScrollThumbGrabbed, isVScrollThumbHover, keyReleased, keyRepeated, laidOut, longKeyPress, nativeDragEnter, nativeDragExit, nativeDragOver, nativeDrop, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, paramString, parsePreferredSize, pinch, pointerDragged, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, refreshTheme, registerForAnimation, remove, removeContextMenuListener, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removeMouseWheelListener, removeNativeDragOverListener, removeNativeDropListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, removeStylusListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, rotation, scrollRectToVisible, scrollRectToVisible, setAcceptedDropActions, setAcceptedDropMimeTypes, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setContextMenuCommands, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setHorizontalScrollBounds, setHoverStyle, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNativeDragOperation, setNativeDragSource, setNativeDropTarget, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setPullToRefresh, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVerticalScrollBounds, setVisible, setWidth, setX, setY, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stopScrollMomentum, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
-
Constructor Details
-
KanbanBoard
public KanbanBoard()An empty board backed by a newDefaultKanbanModel. -
KanbanBoard
A board showingmodel.
-
-
Method Details
-
getModel
The model shown. -
setModel
Shows another model. An edit under way ends, and the undo history is cleared: its steps belong to the model that was shown. That is the whole history, the steps of another component sharing it included. -
modelChanged
public void modelChanged()The model changed: the board is laid out again before it is next painted or asked where something is. Called by the model's listener, and by an application that changed a card behind the model's back, such as its tags.
Nothing is measured here, so filling a model a card at a time while a board shows it costs one layout and not one per card.
-
getCardRenderer
Paints the cards. Never null. -
setCardRenderer
Sets the renderer of the cards. -
getCardFactory
Makes the components inside the cards, or null. -
setCardFactory
Puts a real component inside each card; null, the default, for cards that are only painted. -
getCardComponent
The component the factory made for a card, or null. -
getCardComponentHeight
The height, in pixels, the component of a card takes at the bottom of it; 0 for a card without one. -
addKanbanListener
Adds a listener. -
removeKanbanListener
Removes a listener. -
isEditingEnabled
public boolean isEditingEnabled()True when the user can move, add, rename and remove cards. -
setEditingEnabled
public void setEditingEnabled(boolean editable) Lets the user edit the board, the default, or only look at it. A board that is not editable still folds its columns and lanes. -
isColumnReorderEnabled
public boolean isColumnReorderEnabled()True when the columns can be dragged into another order. -
setColumnReorderEnabled
public void setColumnReorderEnabled(boolean columnReorder) Lets the user drag a column by its title to another place; on by default. -
isInlineAdd
public boolean isInlineAdd()True when every column ends in a row that adds a card. -
setInlineAdd
public void setInlineAdd(boolean inlineAdd) Shows a row under the cards of each column that adds a card typed in place; on by default. -
isInlineEditing
public boolean isInlineEditing()True when a double tap renames a card in place. -
setInlineEditing
public void setInlineEditing(boolean inlineEditing) Makes a double tap on a card rename it in place, the default, or only tell the listeners the card was opened. -
isColumnSnap
public boolean isColumnSnap()True when scrolling comes to rest on a column. -
setColumnSnap
public void setColumnSnap(boolean columnSnap) Makes scrolling across the board come to rest with a column at its leading edge, so a narrow screen shows one whole column at a time and not the halves of two. Off by default. -
getAddCardText
The text of the row that adds a card. -
setAddCardText
Sets the text of the row that adds a card, for another language. -
getColumnWidth
public float getColumnWidth()The width of a column, in millimetres. -
setColumnWidth
public void setColumnWidth(float millimetres) Sets the width of a column, in millimetres; 42 by default. On a screen narrower than that a column takes the screen, less a strip that shows there is a next one. -
getSelectedCard
The selected card, or null. -
select
Selects a card, or with null none. -
scrollToColumn
Scrolls so a column is at the leading edge of the view. -
scrollToCard
Scrolls so a card is in view. -
getUndoHistory
The history edits are recorded in, or null. -
setUndoHistory
Records every edit the user makes in a history, so it can be undone. The application's history,UndoHistory.getGlobal(), by default; null records nothing. An undone or redone step brings the board back into view (ComponentEdit). Changes the application makes to the model directly are not recorded. -
undo
public boolean undo()Takes back the last edit in the history.
Returns
false when there is no history, nothing to undo, editing is off, or a card or column is being dragged
-
redo
public boolean redo()Makes the last undone edit again.
Returns
false when there is no history, nothing to redo, editing is off, or a card or column is being dragged
-
moveCard
Moves a card to an index of a cell, as a drop there does: offered to the listeners, then to the model, and recorded for undo.
laneis null on a board without lanes. The index counts the cell without the card.Returns
false when a listener or the model refused
-
moveColumn
Moves a column to an index, counted without it, as dragging its title does.
Returns
false when a listener or the model refused
-
addCard
Adds a card with a title at the end of a cell, as typing it into the row under the column does: offered to the listeners, then to the model, recorded for undo and selected.
laneis null on a board without lanes.Returns
the card, or null when it was refused
-
renameCard
Gives a card another title, as renaming it in place does.
Returns
false when a listener or the model refused
-
removeCard
Removes a card, as Delete on it does.
Returns
false when a listener or the model refused
-
duplicateSelection
public boolean duplicateSelection()Adds a copy of the selected card under it.
Returns
false when no card is selected or the copy was refused
-
setUserDataCodec
Writes the user data of a copied card to the clipboard and reads it back on paste; without one, a pasted card has no user data. -
copySelection
public boolean copySelection()Puts the selected card on the clipboard, as JSON.
Returns
false when no card is selected
-
cutSelection
public boolean cutSelection()Copies the selected card and removes it.
Returns
false when no card is selected or it could not be removed
-
paste
public boolean paste()Adds the card on the clipboard under the selected card, or at the end of the first column when none is selected.
Returns
false when the clipboard holds no card or it was refused
-
isEditing
-
startCardEdit
Renames a card in place, in a text field over it; the title goes torenameCardwhen editing ends. -
startAddCard
Opens the row that adds a card to a cell for typing; the card is added byaddCardwhen editing ends with a title in it. -
finishEditing
public void finishEditing()Ends the typing of a title and applies it. -
getCardBounds
The rectangle of a card in the board's own coordinates, as it is laid out now, or null when it is not shown. For a popup placed by a card, and for tests. -
getColumnHeaderBounds
The rectangle of a column's title in the board's own coordinates, or null for a column that is not in the model. -
toImage
Paints the whole board, every column and card of it, into a new image no larger than the given size, without the selection. For a thumbnail, a share sheet or a printout. -
layoutSurface
protected void layoutSurface(int width, int height) Description copied from class:ScrollSurfaceLays the surface out for a size: sets the header sizes and whatever the content's size depends on. Called before every paint and every pointer event, so it has to return at once when nothing has changed.- Specified by:
layoutSurfacein classScrollSurface
-
getContentWidth
protected int getContentWidth()Description copied from class:ScrollSurfaceThe width of what scrolls, in pixels, without the left header.- Specified by:
getContentWidthin classScrollSurface
-
getContentHeight
protected int getContentHeight()Description copied from class:ScrollSurfaceThe height of what scrolls, in pixels, without the top header.- Specified by:
getContentHeightin classScrollSurface
-
paintContent
Description copied from class:ScrollSurfacePaints what scrolls.xandyare where the content's own origin is on screen, which is off screen once it has scrolled. The graphics is clipped to the content region.- Specified by:
paintContentin classScrollSurface
-
paintTopHeader
Description copied from class:ScrollSurfacePaints the pinned top row.xis where the content's origin is;yis the top of the row.- Overrides:
paintTopHeaderin classScrollSurface
-
paintOverlay
Description copied from class:ScrollSurfacePaints over everything, in the component's own bounds, whose top left isx,y. Not painted on a printed page: it is for what a gesture in progress shows.- Overrides:
paintOverlayin classScrollSurface
-
calcPreferredSize
Description copied from class:ComponentCalculates the preferred size based on component content. This method is invoked lazily by getPreferred size.
Returns
the calculated preferred size based on component content
- Overrides:
calcPreferredSizein classScrollSurface
-
scrollChanged
protected void scrollChanged()Description copied from class:ScrollSurfaceThe scroll position changed.- Overrides:
scrollChangedin classScrollSurface
-
pointerReleased
public void pointerReleased(int x, int y) Description copied from class:ComponentIf this Component is focused, the pointer released event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerReleasedin classScrollSurface
-
-
pressStarted
protected void pressStarted(int x, int y) Description copied from class:ScrollSurfaceThe pointer went down at a point, in the component's coordinates. Whatever it turns into -- a tap, a drag, a long press -- follows.- Overrides:
pressStartedin classScrollSurface
-
editStarted
Description copied from class:ScrollSurfaceAsked when a drag or a long press begins, at the point where the pointer went down, in the component's coordinates.
Parameters
trigger: what kind of gesture it is
Returns
true when an edit has begun and the drag belongs to it; false to pan
- Overrides:
editStartedin classScrollSurface
-
editMoved
protected void editMoved(int x, int y) Description copied from class:ScrollSurfaceThe pointer of an edit moved, or the surface scrolled under it.- Overrides:
editMovedin classScrollSurface
-
editEnded
protected void editEnded(boolean committed) Description copied from class:ScrollSurfaceThe edit is over.committedis false when it was cancelled: bycancelEdit, a second finger, or the surface leaving the form.- Overrides:
editEndedin classScrollSurface
-
tapped
protected void tapped(int x, int y, boolean doubleTap) Description copied from class:ScrollSurfaceA tap that was not a drag or a long press.- Overrides:
tappedin classScrollSurface
-
animateSurface
protected boolean animateSurface()Description copied from class:ScrollSurfaceAdvances the view's own motion. Called every frame while the surface animates; call
requestAnimationto start the frames.Returns
true while the view still has something moving
- Overrides:
animateSurfacein classScrollSurface
-
deinitialize
protected void deinitialize()Description copied from class:ComponentInvoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. This allows the component to deregister animators and cleanup after itself. This method is the opposite of the initComponent() method.- Overrides:
deinitializein classScrollSurface
-
keyPressed
public void keyPressed(int keyCode) Description copied from class:ComponentIf this Component is focused, the key pressed event will call this method
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyPressedin classComponent
-