Class PopGraph2D
- All Implemented Interfaces:
DoubleClickHandler, HasAllDragAndDropHandlers, HasAllFocusHandlers, HasAllGestureHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasBlurHandlers, HasClickHandlers, HasContextMenuHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasFocusHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, MouseDownHandler, MouseMoveHandler, MouseOutHandler, MouseUpHandler, MouseWheelHandler, TouchEndHandler, TouchMoveHandler, TouchStartHandler, HasAttachHandlers, EventHandler, HasHandlers, EventListener, AcceptsOneWidget, Focusable, HasFocus, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IsWidget, RequiresResize, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, SourcesMouseWheelEvents, Iterable<Widget>, AbstractGraph.Shifter, AbstractGraph.Shifting, AbstractGraph.Zoomer, AbstractGraph.Zooming, Network.LayoutListener, ContextMenu.Listener, ContextMenu.Provider, Tooltip.Provider
Responsibilities
- Calculate layout bounds and element sizes for a variety of geometry types based on the current canvas size and configuration.
- Render lattice cells or network nodes and links to a canvas using an internal graphics context.
- Maintain an optional history buffer for linear (time-series) lattices, enabling visualization of past states.
- Map input coordinates (mouse/touch) to node indices for selection and dragging, with geometry-specific hit-test logic.
- Allow interactive shifting of individual network nodes (dragging) and shifting of lattice views.
- Expose export capability to draw into an external MyContext2d context (e.g., for image export or printing).
Supported Geometry Types
- TRIANGULAR — drawn as interleaved up/down triangles
- HONEYCOMB — drawn as regular hexagons
- SQUARE, SQUARE_MOORE, SQUARE_NEUMANN, SQUARE_NEUMANN_2ND — drawn as square grids with several decoration/neighbor variations; supports hierarchical gaps when geometry describes a HIERARCHY
- LINEAR — drawn as rows of cells where the vertical axis can represent time; uses an internal RingBuffer to store historical states
- Generic network — uses Node2D positions and a radius-based scaling to draw nodes and links; supports manual node shifting
Key Concepts & Fields
- data: a String[] holding per-node CSS color values used to paint each cell/node.
- buffer: an optional RingBuffer<String[]> used by linear geometry to retain previous states for history visualization. Capacity is based on visible steps and MAX_LINEAR_SIZE.
- Bounds and sizing: internal fields such as side, dw, dw2, dh, dh3 and dR compute per-cell/node sizes and are recalculated in calcBounds.
- Hierarchy support: when geometry indicates a HIERARCHY, the component accounts for hierarchical gaps and levels (hLevels, hPeriods).
- Interaction flags: hitNode tracks the currently selected node index, hitDragged indicates whether a node is currently being dragged.
Interaction & Events
- Mouse Down: left-click resolves a node via findNodeAt and sets up dragging state and CSS cursor classes.
- Mouse Move: when dragging a selected node, the node position is updated (network nodes) or the view is shifted (lattices). CSS classes are toggled during drag.
- Mouse Up / Touch End: releases dragging state, restores classes, and can update tooltips as needed.
Rendering
The paint method orchestrates drawing:- When a static lattice layout is available it delegates to dedicated drawXxx methods (drawTriangular, drawHoneycomb, drawSquareLattice, drawSquareNeumann2nd, drawLinearLattice).
- For arbitrary networks the drawNetwork method scales the universe, draws links and nodes (with per-node color optimization) and supports node diameter computation (dR).
- prepCanvas prepares the canvas transform (scale, translation and zoom) and manages a saved graphics state so drawing is isolated.
Sizing & Limits
- MIN_DW, MIN_DH and MIN_DR define minimum drawable dimensions; if elements would be smaller than these thresholds, the graph is disabled and a message is displayed.
- MAX_LINEAR_SIZE controls the maximum retained history length for linear geometries; callers must ensure MAX_LINEAR_SIZE is adequate for their configured canvas/steps, otherwise an exception is thrown during setup.
Performance
Drawing operations use batching and occasional optimizations (e.g., reusing fill style until it changes) but may still be expensive for very large populations or frequent updates. For linear geometries the history buffer size is chosen to balance memory and visible steps; it is lazily allocated.Extensibility & Limitations
- 3D geometries (CUBE) are not represented graphically in this class and will display an informational message.
- Hit-testing for networks uses node bounding checks (Node2D.isHit) and returns the top-most node when overlaps occur.
- Layouts flagged as LAYOUT_IN_PROGRESS are treated as invalid for hit-testing until the layout completes.
Styling
CSS classes used by the component:- .evoludo-PopGraph2D — primary graph element
- .evoludo-Label2D — label element
- .evoludo-cursorGrabNode — added while a node is grabbed
- .evoludo-cursorMoveNode — added while a node is being dragged
Usage
Instantiate via the view/module infrastructure this project provides. Ensure to callactivate() and allow AbstractGraph.calcBounds() to run with the
appropriate canvas size; Tooltip.update() should be invoked whenever the
underlying population state changes to refresh the visualization. For linear
geometries, ensure the MAX_LINEAR_SIZE accommodates the expected
width of the viewport.- Author:
- Christoph Hauert
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractGraph
AbstractGraph.HasLogScaleY, AbstractGraph.HasTrajectory, AbstractGraph.MyContext2d, AbstractGraph.Shifter, AbstractGraph.Shifting, AbstractGraph.ZoomCommand, AbstractGraph.Zoomer, AbstractGraph.ZoomingNested classes/interfaces inherited from class UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface HasWidgets
HasWidgets.ForIsWidget -
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThe height of a node for lattices.(package private) intConvenience variable.(package private) doubleThe diameter of nodes for networks.(package private) intThe width of a node for lattices.(package private) intConvenience variable.(package private) static final intConvenience variable.protected booleanThe flag to indicate whetherGenericPopGraph.hitNodeis being dragged.(package private) intConvenience variable.(package private) int[]Convenience variable.(package private) booleanConvenience variable.static final intThe maximum size of a linear graph.(package private) static final intThe minimum height of a node in pixels.(package private) static final doubleThe minimum diameter of a node in pixels.(package private) static final intThe minimum width of a node in pixels.(package private) intThe size of the graph for lattices.Fields inherited from class GenericPopGraph
animate, colorMap, data, EVOLUDO_CURSOR_NODE, FINDNODEAT_OUT_OF_BOUNDS, FINDNODEAT_UNIMPLEMENTED, geometry, hitNode, invalidated, label, MAX_ANIMATE_LAYOUT_LINKS_DEFAULT, MAX_ANIMATE_LAYOUT_VERTICES_DEFAULT, network, noGraphFields inherited from class AbstractGraph
bounds, buffer, canvas, colors, contextMenu, CSS_CURSOR_MOVE_VIEW, CURSOR_GRAB_NODE_CLASS, CURSOR_MOVE_NODE_CLASS, CURSOR_ZOOM_IN_CLASS, CURSOR_ZOOM_OUT_CLASS, DEFAULT_BUFFER_SIZE, doubleClickHandler, element, g, hasMessage, hasZoom, leftMouseButton, logger, logYMenu, markerColors, markers, MIN_BUFFER_SIZE, MIN_MSEC_BETWEEN_UPDATES, module, mouseDownHandler, mouseMoveHandler, mouseOutHandler, mouseUpHandler, mouseWheelHandler, mouseX, mouseY, PIHALF, pinchDist, pinchX, pinchY, scale, shifter, style, tooltip, tooltipProvider, touchEndHandler, touchEndTime, touchMoveHandler, touchStartHandler, updatetime, view, viewCorner, wrapper, zoomer, zoomFactor, zoomInertiaTimer, zoomInMenu, zoomOutMenu, zoomResetMenuFields inherited from class UIObject
DEBUG_ID_PREFIXFields inherited from interface AbstractGraph.Zooming
ZOOM_INCR, ZOOM_MAX -
Constructor Summary
ConstructorsConstructorDescriptionPopGraph2D(AbstractView<?> view, Module<?> module) Create a graph for graphically visualizing the structure of a network (or population). -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Perform necessary preparations to show the graph in the GUI.voidcalcBounds(int width, int height) Calculate bounds of drawing area.private voidDraw honeycomb lattice.protected voidDraws structures with static layout of lattices.private voidDraw linear lattice with history.protected voidDraws the network.private voidDraw square (hierarchical) lattice (SQUARE, SQUARE_MOORE, SQUARE_NEUMANN).private voidDraw the special SQUARE_NEUMANN_2ND lattice.private voidDraw triangular lattice.voidExport the graphical contextctx.private intfindHoneycombNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a honeycomb lattice.private intfindLinearNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a linear lattice.private intfindNetworkNode(int sx, int sy) Locate the node under the given screen coordinates for general network layouts.intfindNodeAt(int x, int y) Find the index of the node at the location with coordinates(x, y).private intfindSquareNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a (hierarchical) square lattice.private intfindTriangularNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a triangular lattice.getCSSColorAt(int node) Get the color of the node at indexnodeas a CSS color string.private voidhandleHoneycomb(int width, int height) Handle honeycomb lattice geometry.private voidhandleLinear(int width, int height) Handle linear lattice geometry with history.private voidhandleNetwork(int width, int height) Handle generic network geometry.private voidHandle geometries without graphical representation.private voidhandleSquare(int width, int height) Handle square lattice geometry.private voidhandleTriangular(int width, int height) Handle triangular lattice geometry.private inthierarchyGapAt(int idx) Compute number of hierarchy gaps that occur before the given index.protected voidonLoad()voidonMouseDown(MouseDownEvent event) voidonMouseMove(MouseMoveEvent event) voidonMouseUp(MouseUpEvent event) .evoludo-cursorGrabNode removed from graph element. .evoludo-cursorMoveNode removed from graph element.voidonTouchEnd(TouchEndEvent event) voidonTouchMove(TouchMoveEvent event) move one finger on node shift node.booleanpaint(boolean force) Draw the graph.private booleanHelper method to get the canvas ready for drawing the graph.voidsetGeometry(AbstractGeometry geometry) Set the geometry backing the graph.voidshiftNodeBy(int nodeidx, int dx, int dy) Shift a single node with indexnodeidxby(dx, dy).voidupdate(boolean isNext) Update the graph.Methods inherited from class GenericPopGraph
getColorMap, getData, getGeometry, getNetwork, getTooltipAt, hasAnimatedLayout, hasMessage, hasStaticLayout, invalidate, layoutComplete, layoutNetwork, layoutUpdate, onDoubleClick, onResize, onTouchStart, onUnload, populateContextMenuAt, reset, setColorMap, setDebugEnabled, setGraphLabelMethods inherited from class AbstractGraph
addContextMenuHandler, autoscale, calcBounds, clearCanvas, clearGraph, clearHistory, clearMessage, contains, convertToScaledCoordinates, convertToScaledCoordinates, deactivate, displayMessage, doUpdate, drawFrame, drawFrame, fill, fillCircle, fillCircle, fillCircle, fillRect, fillTextVertical, getBuffer, getModule, getStyle, hasHistory, init, onMouseOut, onMouseWheel, paint, parse, prependTime2Data, resetTransforms, setBufferCapacity, setColors, setFont, setLogY, setMarkers, setMarkers, setStrokeStyleAt, setTooltipProvider, shift, stroke, strokeCircle, strokeCircle, strokeCircle, strokeLine, strokeLine, strokeRect, zoom, zoom, zoom, zoomMethods inherited from class FocusPanel
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getTabIndex, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setFocus, setTabIndexMethods inherited from class SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidgetMethods inherited from class Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeMethods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AbstractGraph.Shifter
shiftMethods inherited from interface AbstractGraph.Zoomer
zoomMethods inherited from interface AbstractGraph.Zooming
zoom, zoomMethods inherited from interface ContextMenu.Listener
getAbsoluteLeft, getAbsoluteTopMethods inherited from interface HasHandlers
fireEventMethods inherited from interface HasTouchCancelHandlers
addTouchCancelHandlerMethods inherited from interface HasTouchEndHandlers
addTouchEndHandlerMethods inherited from interface HasTouchMoveHandlers
addTouchMoveHandlerMethods inherited from interface HasTouchStartHandlers
addTouchStartHandlerMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface MouseOutHandler
onMouseOutMethods inherited from interface MouseWheelHandler
onMouseWheelMethods inherited from interface TouchStartHandler
onTouchStart
-
Field Details
-
MAX_LINEAR_SIZE
public static final int MAX_LINEAR_SIZEThe maximum size of a linear graph. This affects memory allocation to retain the history of the graph.- See Also:
-
side
int sideThe size of the graph for lattices. -
dw
int dwThe width of a node for lattices. -
dw2
int dw2Convenience variable. One half of the width of a node for lattices,dw/2. -
dh
int dhThe height of a node for lattices. -
dh3
int dh3Convenience variable. One third of the height of a node for lattices,dh/3. -
dR
double dRThe diameter of nodes for networks. -
MIN_DW
static final int MIN_DWThe minimum width of a node in pixels.- See Also:
-
MIN_DH
static final int MIN_DHThe minimum height of a node in pixels.- See Also:
-
MIN_DR
static final double MIN_DRThe minimum diameter of a node in pixels.- See Also:
-
isHierarchy
boolean isHierarchyConvenience variable. The flag indicating whether the backing geometry is a hierarchical structure. -
hLevels
int hLevelsConvenience variable. The number of hierarchical levels. -
hPeriods
int[] hPeriodsConvenience variable. The number of units in each hierarchical level. -
HIERARCHY_GAP
static final int HIERARCHY_GAPConvenience variable. The gap between subsequent units in hierarchical structures.- See Also:
-
hitDragged
protected boolean hitDraggedThe flag to indicate whetherGenericPopGraph.hitNodeis being dragged.
-
-
Constructor Details
-
PopGraph2D
Create a graph for graphically visualizing the structure of a network (or population). Allocates the canvas and the label and retrieves the shared tooltip and context menu.CSS Style Rules
- .evoludo-PopGraph2D
- the graph element.
- .evoludo-Label2D
- the label element.
- Parameters:
view- the view of this graphmodule- the module backing the graph
-
-
Method Details
-
onLoad
protected void onLoad()- Overrides:
onLoadin classGenericPopGraph<String, Network2D>
-
setGeometry
Description copied from class:GenericPopGraphSet the geometry backing the graph.- Overrides:
setGeometryin classGenericPopGraph<String, Network2D>- Parameters:
geometry- the structure of the population
-
activate
public void activate()Description copied from class:AbstractGraphPerform necessary preparations to show the graph in the GUI. Attaches mouse and touch handlers for graphs that implementAbstractGraph.ZoomingorAbstractGraph.Shiftinginterfaces.- Overrides:
activatein classGenericPopGraph<String, Network2D>- See Also:
-
update
public void update(boolean isNext) Description copied from class:GenericPopGraphUpdate the graph.- Overrides:
updatein classGenericPopGraph<String, Network2D>- Parameters:
isNext-trueif the state has changed
-
paint
public boolean paint(boolean force) Draw the graph. For re-drawing the graph, setforcetotrue.Depending on the backing geometry this either
- shows a message, if no graphical representation is available, e.g. for 3D cubic lattices, or if there are too many nodes so that each node becomes too small to display on screen.
- shows lattice geometries.
- initiates the generic layouting process for arbitrary network structures.
- Overrides:
paintin classGenericPopGraph<String, Network2D>- Parameters:
force-trueto force re-drawing of graph- Returns:
trueif painting skipped- See Also:
-
drawLattice
protected void drawLattice()Description copied from class:GenericPopGraphDraws structures with static layout of lattices.- Specified by:
drawLatticein classGenericPopGraph<String, Network2D>- See Also:
-
drawTriangular
private void drawTriangular()Draw triangular lattice. -
drawHoneycomb
private void drawHoneycomb()Draw honeycomb lattice. -
drawSquareLattice
private void drawSquareLattice()Draw square (hierarchical) lattice (SQUARE, SQUARE_MOORE, SQUARE_NEUMANN). -
hierarchyGapAt
private int hierarchyGapAt(int idx) Compute number of hierarchy gaps that occur before the given index. This encapsulates the previous inline loop that counted levels until the first non-divisor was encountered.- Parameters:
idx- the row or column index- Returns:
- total gap in pixels to subtract/add for this index
-
drawSquareNeumann2nd
private void drawSquareNeumann2nd()Draw the special SQUARE_NEUMANN_2ND lattice. -
drawLinearLattice
private void drawLinearLattice()Draw linear lattice with history. -
drawNetwork
protected void drawNetwork()Description copied from class:GenericPopGraphDraws the network.- Specified by:
drawNetworkin classGenericPopGraph<String, Network2D>
-
prepCanvas
private boolean prepCanvas()Helper method to get the canvas ready for drawing the graph.- Returns:
trueif the canvas is ready for drawing
-
calcBounds
public void calcBounds(int width, int height) Description copied from class:AbstractGraphCalculate bounds of drawing area.- Overrides:
calcBoundsin classAbstractGraph<String[]>- Parameters:
width- the width of the drawing areaheight- the height of the drawing area
-
handleNoRepresentation
Handle geometries without graphical representation.- Parameters:
type- the geometry type
-
handleTriangular
private void handleTriangular(int width, int height) Handle triangular lattice geometry.- Parameters:
width- the width of the canvasheight- the height of the canvas
-
handleHoneycomb
private void handleHoneycomb(int width, int height) Handle honeycomb lattice geometry.- Parameters:
width- the width of the canvasheight- the height of the canvas
-
handleSquare
private void handleSquare(int width, int height) Handle square lattice geometry.- Parameters:
width- the width of the canvasheight- the height of the canvas
-
handleLinear
private void handleLinear(int width, int height) Handle linear lattice geometry with history.- Parameters:
width- the width of the canvasheight- the height of the canvas
-
handleNetwork
private void handleNetwork(int width, int height) Handle generic network geometry.- Parameters:
width- the width of the canvasheight- the height of the canvas
-
getCSSColorAt
Get the color of the node at indexnodeas a CSS color string.- Specified by:
getCSSColorAtin classGenericPopGraph<String, Network2D>- Parameters:
node- the index of the node- Returns:
- the color of the node
-
findNodeAt
public int findNodeAt(int x, int y) Find the index of the node at the location with coordinates(x, y).- Specified by:
findNodeAtin classGenericPopGraph<String, Network2D>- Parameters:
x- thex-coordinate of the locationy- they-coordinate of the location- Returns:
- the index of the node
-
findTriangularNode
private int findTriangularNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a triangular lattice.- Parameters:
x- thex-coordinate of the locationy- they-coordinate of the location- Returns:
- the index of the node
-
findHoneycombNode
private int findHoneycombNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a honeycomb lattice.- Parameters:
x- thex-coordinate of the locationy- they-coordinate of the location- Returns:
- the index of the node
-
findSquareNode
private int findSquareNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a (hierarchical) square lattice.- Parameters:
x- thex-coordinate of the locationy- they-coordinate of the location- Returns:
- the index of the node
-
findLinearNode
private int findLinearNode(int x, int y) Find the index of the node at the location with coordinates(x, y)in a linear lattice.- Parameters:
x- thex-coordinate of the locationy- they-coordinate of the location- Returns:
- the index of the node
-
findNetworkNode
private int findNetworkNode(int sx, int sy) Locate the node under the given screen coordinates for general network layouts.- Parameters:
sx- screen x-coordinatesy- screen y-coordinate- Returns:
- node index or
-1if none hit
-
onMouseDown
If a node has been hit by a left-click, remember the node's index and the current mouse coordinates. This information might be used by subsequent
MouseMoveEvents.If a node has been hit by a left-click, remember the node's index and the current mouse coordinates. This information might be used by subsequent
MouseMoveEvents.CSS Style Rules
- .evoludo-cursorGrabNode
- added to graph element.
- Specified by:
onMouseDownin interfaceMouseDownHandler- Overrides:
onMouseDownin classAbstractGraph<String[]>- See Also:
-
onMouseUp
Cancel all interactions with the graph and reset node and mouse information.
CSS Style Rules
- .evoludo-cursorMoveView
- removed from graph element.
- .evoludo-cursorGrabNode
- removed from graph element.
- .evoludo-cursorMoveNode
- removed from graph element.
- Specified by:
onMouseUpin interfaceMouseUpHandler- Overrides:
onMouseUpin classAbstractGraph<String[]>- See Also:
-
onMouseMove
If the left mouse-key is pressed the graph is shifted within its viewport. Note this requires that the zoom level of the graph exceeds
1.CSS Style Rules
- .evoludo-cursorMoveView
- added to graph element when shifting the view.
If a node has been hit by a
MouseDownEventand is being dragged, the position of the node is shifted. This allows to customize the display of the graph.CSS Style Rules
- .evoludo-cursorMoveNode
- added to graph element when dragging a node.
- Specified by:
onMouseMovein interfaceMouseMoveHandler- Overrides:
onMouseMovein classAbstractGraph<String[]>- See Also:
-
onTouchEnd
The number of touches on the graph changed.
The number of touches on the graph changed.
- Specified by:
onTouchEndin interfaceTouchEndHandler- Overrides:
onTouchEndin classAbstractGraph<String[]>
-
onTouchMove
The graph reacts to different kinds of touch moves:
- Move one finger
- Shift view
- Pinch two fingers
- Zoom view
- move one finger on node
- shift node.
- Specified by:
onTouchMovein interfaceTouchMoveHandler- Overrides:
onTouchMovein classAbstractGraph<String[]>
-
shiftNodeBy
public void shiftNodeBy(int nodeidx, int dx, int dy) Shift a single node with indexnodeidxby(dx, dy). Positivedxshift the node to the right and positivedyshift upwards.- Parameters:
nodeidx- the index of the nodedx- the horizontal shift of the nodedy- the vertical shift of the node
-
export
Description copied from class:AbstractGraphExport the graphical contextctx.- Specified by:
exportin classAbstractGraph<String[]>- Parameters:
ctx- the graphical context to export
-