Package ghidra.framework.main.logviewer.ui

# Class ViewportUtility

java.lang.Object
ghidra.framework.main.logviewer.ui.ViewportUtility

All Implemented Interfaces:
  `Observer`

public class ViewportUtility extends Object implements Observer
Utility class for managing the viewport in the `FVTable`. This viewport must be adjusted manually whenever `Chunk` objects are added to or removed from to the view, or whenever the `FVSlider` is moved.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ViewportUtility(FVEventListener eventListener)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getHeight()`
  Returns the height (in pixels) of the viewport.
  `int`
  `getNumRowsInViewport()`
  Returns the number of rows that are visible in the viewport.
  `int`
  `getViewportPositionAsRow()`
  Returns the table row associated with the top of the viewport.
  `boolean`
  `isInViewport(int row)`
  Returns true if the given row is in the viewport.
  `void`
  `moveViewportDown(int rows, boolean selection)`
  Moves the viewport down the number of rows specified.
  `void`
  `moveViewportToBottom()`
  Snaps the viewport to the bottom of the table.
  `void`
  `moveViewportToTop()`
  Snaps the viewport to the top of the table.
  `void`
  `moveViewportUp(int rows, boolean selection)`
  Moves the viewport up the number of rows specified.
  `void`
  `scrollViewportTo(int row)`
  Moves the viewport (top) to the given row in the current view.
  `void`
  `setModel(ChunkModel model)`
  `void`
  `setReader(ChunkReader reader)`
  `void`
  `setTable(FVTable table)`
  `void`
  `setViewport(JViewport viewport)`
  `void`
  `update(Observable o, Object arg)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ViewportUtility

    public ViewportUtility(FVEventListener eventListener)

- ## Method Details

  - ### setViewport

    public void setViewport(JViewport viewport)
    Parameters:
      `viewport` -

  - ### setTable

    public void setTable(FVTable table)
    Parameters:
      `table` -

  - ### setReader

    public void setReader(ChunkReader reader)
    Parameters:
      `reader` -

  - ### setModel

    public void setModel(ChunkModel model)
    Parameters:
      `model` -

  - ### getHeight

    public int getHeight()
    Returns the height (in pixels) of the viewport.
    Returns:

  - ### getViewportPositionAsRow

    public int getViewportPositionAsRow()
    Returns the table row associated with the top of the viewport.
    Returns:

  - ### isInViewport

    public boolean isInViewport(int row)
    Returns true if the given row is in the viewport.
    Parameters:
      `row` -
    Returns:

  - ### moveViewportToBottom

    public void moveViewportToBottom()
    Snaps the viewport to the bottom of the table.

  - ### moveViewportToTop

    public void moveViewportToTop()
    Snaps the viewport to the top of the table.

  - ### getNumRowsInViewport

    public int getNumRowsInViewport()
    Returns the number of rows that are visible in the viewport.
    Returns:

  - ### scrollViewportTo

    public void scrollViewportTo(int row)
    Moves the viewport (top) to the given row in the current view.
    Parameters:
      `row` -

  - ### moveViewportUp

    public void moveViewportUp(int rows, boolean selection)
    Moves the viewport up the number of rows specified. If moving up puts he view above the bounds of the first-visible chunk, load a previous chunk.
    Parameters:
      `rows` -
      `selection` -

  - ### moveViewportDown

    public void moveViewportDown(int rows, boolean selection)
    Moves the viewport down the number of rows specified. If moving down puts he view below the bounds of the first-visible chunk, load the next chunk.
    Parameters:
      `rows` -
      `selection` -

  - ### update

    public void update(Observable o, Object arg)
    Specified by:
      `update` in interface `Observer`
    Parameters:
      `o` -
      `arg` -