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

public class DistrGraph2D extends PopGraph2D
Specialized graph for 2D lattice-based trait distributions.

Content is shifted/zoomed, while the frame and axis decorations remain fixed.

  • Constructor Details

    • DistrGraph2D

      public DistrGraph2D(Distribution view, Module<?> module)
      Create a graph for 2D distribution rendering.
      Parameters:
      view - the owning distribution view
      module - the module backing the graph
  • Method Details

    • populateGraphContextMenu

      protected void populateGraphContextMenu(ContextMenu menu, int x, int y)
      Description copied from class: GenericPopGraph
      Opportunity for subclasses to contribute menu items after graph-local entries such as clear/debug and before the generic zoom/view items.
      Overrides:
      populateGraphContextMenu in class GenericPopGraph<String, Network2D>
      Parameters:
      menu - the context menu to populate
      x - the x-coordinate where the menu was invoked
      y - the y-coordinate where the menu was invoked
    • drawLattice

      protected void drawLattice()
      Description copied from class: GenericPopGraph
      Draws structures with static layout of lattices.
      Overrides:
      drawLattice in class PopGraph2D
      See Also:
    • getTooltipAt

      public String getTooltipAt(int x, int y)
      Description copied from interface: Tooltip.Provider
      Get the tooltip information for the location with coordinates (x, y). The returned string may include HTML elements for formatting.
      Specified by:
      getTooltipAt in interface Tooltip.Provider
      Overrides:
      getTooltipAt in class PopGraph2D
      Parameters:
      x - the x-coordinate for the tooltip
      y - the y-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:
      true if 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 minimum
      baseXMax - baseline x maximum
      baseYMin - baseline y minimum
      baseYMax - baseline y maximum