Class DistrGraph2D
- 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
Specialized graph for 2D lattice-based trait distributions.
Content is shifted/zoomed, while the frame and axis decorations remain fixed.
-
Nested Class Summary
Nested classes/interfaces inherited from class GenericPopGraph
GenericPopGraph.HasDebugMenuNested 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
Fields inherited from class PopGraph2D
dh, dh3, dR, dw, dw2, HIERARCHY_GAP, hitDragged, hLevels, hPeriods, isHierarchy, legend, MIN_DH, MIN_DR, MIN_DW, sideFields 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, markerColors, markers, message, MIN_BUFFER_SIZE, MIN_CURVATURE_STEP_SQ, MIN_NORM_DELTA, MIN_NORM_DIST_SQ, module, mouseDownHandler, mouseMoveHandler, mouseOutHandler, mouseUpHandler, mouseWheelHandler, mouseX, mouseY, msgFontSize, msgLabel, msgLineHeight, PIHALF, pinchDist, pinchX, pinchY, scale, shifter, style, tooltip, tooltipProvider, touchEndHandler, touchEndTime, touchMoveHandler, touchStartHandler, TURN_COS_THRESHOLD, view, viewCorner, wrapper, yAxisLabelTickSkip, zoomer, zoomFactor, zoomInertiaTimerFields inherited from class UIObject
DEBUG_ID_PREFIXFields inherited from interface AbstractGraph.Zooming
ZOOM_INCR, ZOOM_MAX -
Constructor Summary
ConstructorsConstructorDescriptionDistrGraph2D(Distribution view, Module<?> module) Create a graph for 2D distribution rendering. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyViewportRanges(double baseXMin, double baseXMax, double baseYMin, double baseYMax) Map current pan/zoom state to visible axis ranges for frame labels/ticks.private voidDraw frame and axis decorations without pan/zoom transforms.protected voidDraws structures with static layout of lattices.private voidDraw 2D distribution content as a plain square grid, without frame.getTooltipAt(int x, int y) Get the tooltip information for the location with coordinates(x, y).protected voidpopulateGraphContextMenu(ContextMenu menu, int x, int y) Opportunity for subclasses to contribute menu items after graph-local entries such as clear/debug and before the generic zoom/view items.private booleanPrepare canvas so only content participates in pan/zoom transforms.Methods inherited from class PopGraph2D
activate, addZoomMenu, adjustBoundsForLegend, calcBounds, drawFrameOverlay, drawNetwork, ensureData, export, findNodeAt, getCSSColorAt, getMaxViewCornerX, getMaxViewCornerY, inside, onLoad, onMouseDown, onMouseMove, onMouseUp, onResize, onTouchEnd, onTouchMove, onUnload, paint, rebinGraphData, setGeometry, setLegendSpecs, shiftNodeBy, supportsNodeDraggingMethods inherited from class GenericPopGraph
getColorMap, getData, getGeometry, getNetwork, hasAnimatedLayout, hasMessage, hasStaticLayout, invalidate, layoutComplete, layoutNetwork, layoutUpdate, onDoubleClick, onTouchStart, populateContextMenuAt, reset, setColorMap, setGraphLabel, updateMethods inherited from class AbstractGraph
addClearMenu, addContextMenuHandler, addLogScaleMenu, autoscale, calcBounds, clearCanvas, clearGraph, clearHistory, clearMessage, contains, convertToScaledCoordinates, convertToScaledCoordinates, deactivate, displayMessage, displayMessage, drawFrame, drawFrame, fill, fillCircle, fillCircle, fillCircle, fillRect, fillTextVertical, getBuffer, getModule, getStyle, getYAxisLabelTickSkip, hasHistory, hasSignificantTurn, init, keepSample, maxDelta, normDelta, normDeltaSq, onMessageCleared, onMessageDisplayed, onMouseOut, onMouseWheel, paint, parse, populateLocalAxesMenu, populateZoomMenu, prependTime2Data, resetTransforms, 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
-
Constructor Details
-
DistrGraph2D
Create a graph for 2D distribution rendering.- Parameters:
view- the owning distribution viewmodule- the module backing the graph
-
-
Method Details
-
populateGraphContextMenu
Description copied from class:GenericPopGraphOpportunity for subclasses to contribute menu items after graph-local entries such as clear/debug and before the generic zoom/view items.- Overrides:
populateGraphContextMenuin classGenericPopGraph<String, Network2D>- Parameters:
menu- the context menu to populatex- the x-coordinate where the menu was invokedy- the y-coordinate where the menu was invoked
-
drawLattice
protected void drawLattice()Description copied from class:GenericPopGraphDraws structures with static layout of lattices.- Overrides:
drawLatticein classPopGraph2D- See Also:
-
getTooltipAt
Description copied from interface:Tooltip.ProviderGet the tooltip information for the location with coordinates(x, y). The returned string may include HTML elements for formatting.- Specified by:
getTooltipAtin interfaceTooltip.Provider- Overrides:
getTooltipAtin classPopGraph2D- Parameters:
x- thex-coordinate for the tooltipy- they-coordinate for the tooltip- Returns:
- the (formatted) string with the tooltip info
-
prepContentCanvas
private boolean prepContentCanvas()Prepare canvas so only content participates in pan/zoom transforms.- Returns:
trueif canvas is ready for drawing
-
drawSquareContent
private void drawSquareContent()Draw 2D distribution content as a plain square grid, without frame. -
drawFrameOverlay
private void drawFrameOverlay()Draw frame and axis decorations without pan/zoom transforms. -
applyViewportRanges
private void applyViewportRanges(double baseXMin, double baseXMax, double baseYMin, double baseYMax) Map current pan/zoom state to visible axis ranges for frame labels/ticks.- Parameters:
baseXMin- baseline x minimumbaseXMax- baseline x maximumbaseYMin- baseline y minimumbaseYMax- baseline y maximum
-