Class BaseFigureImpl

java.lang.Object
io.deephaven.plot.BaseFigureImpl
All Implemented Interfaces:
BaseFigure, PlotExceptionCause, Serializable

public class BaseFigureImpl extends Object implements BaseFigure, PlotExceptionCause
Container for Charts.
See Also:
  • Constructor Details

    • BaseFigureImpl

      public BaseFigureImpl()
      Creates a new Figure instance with a 1x1 grid. If newChart() with no arguments is called on this new Figure, the Figure will resize itself to hold the new Chart.
    • BaseFigureImpl

      public BaseFigureImpl(int numRows, int numCols)
      Creates a new Figure instance with a numRows x numCols grid.
      Parameters:
      numRows - number of rows
      numCols - number of columns
    • BaseFigureImpl

      protected BaseFigureImpl(BaseFigureImpl figure)
      Creates a copy of a Figure.
      Parameters:
      figure - figure to copy.
  • Method Details

    • copy

      public BaseFigureImpl copy()
      Creates a copy of this Figure.
      Returns:
      copy of this Figure.
    • getWidth

      public int getWidth()
      Gets the width of this Figure. This is equal to the number of columns.
      Returns:
      this Figure's width
    • getHeight

      public int getHeight()
      Gets the numRows of this Figure. This is equal to the number of rows.
      Returns:
      this Figure's height
    • getTitle

      public String getTitle()
      Gets the title of this Figure.
      Returns:
      this Figure's title
    • getTitleFont

      public Font getTitleFont()
      Gets the Font of this Figure's title.
      Returns:
      this Figure's title's Font
    • getTitleColor

      public Paint getTitleColor()
      Gets the Paint of this Figure's title.
      Returns:
      this Figure's title's Paint
    • isResizable

      public boolean isResizable()
      Whether this Figure's height and width are changeable.
      Returns:
      true if this Figure's height and width are changeable, false otherwise
    • getCharts

      public ChartArray getCharts()
      Gets this Figure's Charts.
      Returns:
      this Figure's Charts
    • getUpdateInterval

      public long getUpdateInterval()
      Gets the updateInterval, in milliseconds, for this Figure.
      Returns:
      update interval of this Figure, in milliseconds
    • getTableHandles

      public Set<TableHandle> getTableHandles()
      Gets the table handles associated with this figure.
      Returns:
      table handles associated with this figure.
    • getPartitionedTableHandles

      public Set<PartitionedTableHandle> getPartitionedTableHandles()
      Gets the partitioned tables associated with this figure.
      Returns:
      table handles associated with this figure.
    • figureRemoveSeries

      public BaseFigureImpl figureRemoveSeries(String... removeSeriesNames)
      Description copied from interface: BaseFigure
      Removes all series with names from this Figure.
      Specified by:
      figureRemoveSeries in interface BaseFigure
      Parameters:
      removeSeriesNames - series names
      Returns:
      this Figure
    • registerTableFunction

      public void registerTableFunction(Table t, Function<Table,Table> function)
    • getTableFunctionMap

      public Map<Table,Set<Function<Table,Table>>> getTableFunctionMap()
    • registerPartitionedTableFunction

      public void registerPartitionedTableFunction(PartitionedTableHandle partitionedTableHandle, Function<Table,Table> tableTransform)
    • getPartitionedTableFunctionMap

      public Map<PartitionedTable,Set<Function<PartitionedTable,PartitionedTable>>> getPartitionedTableFunctionMap()
    • registerFigureFunction

      public void registerFigureFunction(FigureImplFunction function)
    • getFigureFunctionList

      public List<FigureImplFunction> getFigureFunctionList()
    • updateInterval

      public BaseFigureImpl updateInterval(long updateIntervalMillis)
      Description copied from interface: BaseFigure
      Sets the update interval of this Figure. The plot will be redrawn at this update interval.
      Specified by:
      updateInterval in interface BaseFigure
      Parameters:
      updateIntervalMillis - update interval, in milliseconds
      Returns:
      this Figure
    • figureTitle

      public BaseFigureImpl figureTitle(String title)
      Description copied from interface: BaseFigure
      Sets the title of this Figure
      Specified by:
      figureTitle in interface BaseFigure
      Parameters:
      title - title
      Returns:
      this Figure
    • figureTitleFont

      public BaseFigureImpl figureTitleFont(Font font)
      Description copied from interface: BaseFigure
      Sets the font of this Figure's title
      Specified by:
      figureTitleFont in interface BaseFigure
      Parameters:
      font - font
      Returns:
      this Figure
    • figureTitleFont

      public BaseFigureImpl figureTitleFont(String family, String style, int size)
      Description copied from interface: BaseFigure
      Sets the font of this Figure's title
      Specified by:
      figureTitleFont in interface BaseFigure
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
      Returns:
      this Figure
    • figureTitleColor

      public BaseFigureImpl figureTitleColor(Paint color)
      Description copied from interface: BaseFigure
      Sets the color of this Figure's title
      Specified by:
      figureTitleColor in interface BaseFigure
      Parameters:
      color - color
      Returns:
      this Figure
    • figureTitleColor

      public BaseFigureImpl figureTitleColor(String color)
      Description copied from interface: BaseFigure
      Sets the color of this Figure's title
      Specified by:
      figureTitleColor in interface BaseFigure
      Parameters:
      color - color
      Returns:
      this Figure
    • newChart

      public ChartImpl newChart()
      Description copied from interface: BaseFigure
      Adds a new Chart to this figure.
      Specified by:
      newChart in interface BaseFigure
      Returns:
      the new Chart. The Chart is placed in the next available grid space, starting at the upper left hand corner of the grid, going left to right, top to bottom. If no available space is found in the grid:
      • if this Figure was created with no specified grid size, then the Figure will resize itself to add the new Chart;
      • if not, a RuntimeException will be thrown.
    • newChart

      public ChartImpl newChart(int index)
      Description copied from interface: BaseFigure
      Adds a new Chart to this figure.
      Specified by:
      newChart in interface BaseFigure
      Parameters:
      index - index from the Figure's grid to remove. The index starts at 0 in the upper left hand corner of the grid and increases going left to right, top to bottom. E.g. for a 2x2 Figure, the indices would be [0, 1] [2, 3].
      Returns:
      the new Chart. The Chart is placed at the grid space indicated by the index.
    • newChart

      public ChartImpl newChart(int rowNum, int colNum)
      Description copied from interface: BaseFigure
      Adds a new Chart to this figure.
      Specified by:
      newChart in interface BaseFigure
      Parameters:
      rowNum - row index in this Figure's grid. The row index starts at 0.
      colNum - column index in this Figure's grid. The column index starts at 0.
      Returns:
      the new Chart. The Chart is placed at the grid space [rowNum, colNum.
    • removeChart

      public BaseFigureImpl removeChart(int removeChartIndex)
      Description copied from interface: BaseFigure
      Removes a chart from the Figure's grid.
      Specified by:
      removeChart in interface BaseFigure
      Parameters:
      removeChartIndex - index from the Figure's grid to remove. The index starts at 0 in the upper left hand corner of the grid and increases going left to right, top to bottom. E.g. for a 2x2 Figure, the indices would be [0, 1] [2, 3].
      Returns:
      this Figure with the chart removed.
    • removeChart

      public BaseFigureImpl removeChart(int removeChartRowNum, int removeChartColNum)
      Description copied from interface: BaseFigure
      Removes a chart from the Figure's grid.
      Specified by:
      removeChart in interface BaseFigure
      Parameters:
      removeChartRowNum - row index in this Figure's grid. The row index starts at 0.
      removeChartColNum - column index in this Figure's grid. The column index starts at 0.
      Returns:
      this Figure with the chart removed.
    • chart

      public ChartImpl chart(int index)
      Description copied from interface: BaseFigure
      Returns a chart from this Figure's grid.
      Specified by:
      chart in interface BaseFigure
      Parameters:
      index - index from the Figure's grid. The index starts at 0 in the upper left hand corner of the grid and increases going left to right, top to bottom. E.g. for a 2x2 Figure, the indices would be [0, 1] [2, 3].
      Returns:
      selected Chart
    • chart

      public ChartImpl chart(int rowNum, int colNum)
      Description copied from interface: BaseFigure
      Returns a chart from this Figure's grid.
      Specified by:
      chart in interface BaseFigure
      Parameters:
      rowNum - row index in this Figure's grid. The row index starts at 0.
      colNum - column index in this Figure's grid. The column index starts at 0.
      Returns:
      selected Chart
    • validateInitialization

      public void validateInitialization()
      Checks if the figure can be instantiated. Throws an error if not.
      Throws:
      RuntimeException - if no charts or no plots have been created
    • getPlotInfo

      public PlotInfo getPlotInfo()
      Specified by:
      getPlotInfo in interface PlotExceptionCause
    • setName

      public void setName(String figureName)
    • setSessionId

      public void setSessionId(int sessionId)
    • getName

      public String getName()
    • getSessionId

      public int getSessionId()
    • consolidatePartitionedTables

      public void consolidatePartitionedTables()
    • consolidateTables

      public void consolidateTables()