Package com.illumon.iris.db.plot
Class BaseFigureImpl
java.lang.Object
com.illumon.iris.db.plot.BaseFigureImpl
- All Implemented Interfaces:
BaseFigure,PlotExceptionCause,Serializable
Container for
Charts.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new Figure instance with a 1x1 grid.BaseFigureImpl(int numRows, int numCols) Creates a new Figure instance with anumRowsxnumColsgrid.protectedBaseFigureImpl(BaseFigureImpl figure) Creates a copy of a Figure. -
Method Summary
Modifier and TypeMethodDescriptionchart(int index) Returns a chart from this Figure's grid.chart(int rowNum, int colNum) Returns a chart from this Figure's grid.voidvoidcopy()Creates a copy of this Figure.figureRemoveSeries(String... names) Removes all series withnamesfrom this Figure.figureTitle(String title) Sets the title of this FigurefigureTitleColor(Paint color) Sets the color of this Figure's titlefigureTitleColor(String color) Sets the color of this Figure's titlefigureTitleFont(Font font) Sets the font of this Figure's titlefigureTitleFont(String family, String style, int size) Sets the font of this Figure's titleGets this Figure'sCharts.intGets the numRows of this Figure.getName()intGets the table handles associated with this figure.getTheme()Gets theThemeof this Figure.getTitle()Gets the title of this Figure.Gets thePaintof this Figure's title.Gets theFontof this Figure's title.longGets the updateInterval, in milliseconds, for this Figure.intgetWidth()Gets the width of this Figure.booleanbooleanWhether this Figure's height and width are changeable.newChart()Adds a newChartto this figure.newChart(int index) Adds a newChartto this figure.newChart(int rowNum, int colNum) Adds a newChartto this figure.voidonClose()Tear down once figure is closed.voidvoidregisterFigureFunction(FigureImplFunction function) voidregisterTableFunction(Table t, Function<Table, Table> function) voidregisterTableMapFunction(TableMapHandle tableMapHandle, Function<Table, Table> tableTransform) removeChart(int index) Removes a chart from the Figure's grid.removeChart(int rowNum, int colNum) Removes a chart from the Figure's grid.Saves the Figure as an image.Saves the Figure as an image.voidsetGovernor(LambdaGovernor newGovernor) voidsetManager(FigureTableSnapshotManager manager) voidvoidsetSessionId(int sessionId) voidSets theThemeof this FigureSets theThemeof this FigureupdateInterval(long updateIntervalMillis) Sets the update interval of this Figure.voidChecks if the figure can be instantiated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.plot.BaseFigure
save, save
-
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 newChart. -
BaseFigureImpl
public BaseFigureImpl(int numRows, int numCols) Creates a new Figure instance with anumRowsxnumColsgrid.- Parameters:
numRows- number of rowsnumCols- number of columns
-
BaseFigureImpl
Creates a copy of a Figure.- Parameters:
figure- figure to copy.
-
-
Method Details
-
copy
Creates a copy of this Figure.- Returns:
- copy of this Figure.
-
getTheme
Gets theThemeof this Figure.- Returns:
- this Figure's theme
-
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
Gets the title of this Figure.- Returns:
- this Figure's title
-
getTitleFont
Gets theFontof this Figure's title.- Returns:
- this Figure's title's
Font
-
getTitleColor
Gets thePaintof 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
Gets this Figure'sCharts.- 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
-
isDefaultTheme
public boolean isDefaultTheme() -
getTableHandles
Gets the table handles associated with this figure.- Returns:
- table handles associated with this figure.
-
getGovernor
-
setGovernor
-
getManager
-
setManager
-
setTableSnapshotsAndRegisterListeners
-
figureRemoveSeries
Description copied from interface:BaseFigureRemoves all series withnamesfrom this Figure.- Specified by:
figureRemoveSeriesin interfaceBaseFigure- Parameters:
names- series names- Returns:
- this Figure
-
onInflate
public void onInflate() -
onClose
public void onClose()Tear down once figure is closed. -
registerTableFunction
-
getTableFunctionMap
-
registerTableMapFunction
public void registerTableMapFunction(TableMapHandle tableMapHandle, Function<Table, Table> tableTransform) -
getTableMapFunctionMap
-
registerFigureFunction
-
getFigureFunctionList
-
theme
Description copied from interface:BaseFigureSets theThemeof this Figure- Specified by:
themein interfaceBaseFigure- Parameters:
theme- theme- Returns:
- this Figure
-
theme
Description copied from interface:BaseFigureSets theThemeof this Figure- Specified by:
themein interfaceBaseFigure- Parameters:
theme- theme name- Returns:
- this Figure
-
updateInterval
Description copied from interface:BaseFigureSets the update interval of this Figure. The plot will be redrawn at this update interval.- Specified by:
updateIntervalin interfaceBaseFigure- Parameters:
updateIntervalMillis- update interval, in milliseconds- Returns:
- this Figure
-
figureTitle
Description copied from interface:BaseFigureSets the title of this Figure- Specified by:
figureTitlein interfaceBaseFigure- Parameters:
title- title- Returns:
- this Figure
-
figureTitleFont
Description copied from interface:BaseFigureSets the font of this Figure's title- Specified by:
figureTitleFontin interfaceBaseFigure- Parameters:
font- font- Returns:
- this Figure
-
figureTitleFont
Description copied from interface:BaseFigureSets the font of this Figure's title- Specified by:
figureTitleFontin interfaceBaseFigure- Parameters:
family- font family; if null, set to Arialstyle- font style; if null, set toFont.FontStylePLAINsize- the point size of the Font- Returns:
- this Figure
-
figureTitleColor
Description copied from interface:BaseFigureSets the color of this Figure's title- Specified by:
figureTitleColorin interfaceBaseFigure- Parameters:
color- color- Returns:
- this Figure
-
figureTitleColor
Description copied from interface:BaseFigureSets the color of this Figure's title- Specified by:
figureTitleColorin interfaceBaseFigure- Parameters:
color- color- Returns:
- this Figure
-
newChart
Description copied from interface:BaseFigureAdds a newChartto this figure.- Specified by:
newChartin interfaceBaseFigure- Returns:
- the new
Chart. TheChartis 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.
- if this Figure was created with no specified grid size, then the Figure will resize itself to add the new
-
newChart
Description copied from interface:BaseFigureAdds a newChartto this figure.- Specified by:
newChartin interfaceBaseFigure- 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. TheChartis placed at the grid space indicated by theindex.
-
newChart
Description copied from interface:BaseFigureAdds a newChartto this figure.- Specified by:
newChartin interfaceBaseFigure- 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. TheChartis placed at the grid space [rowNum,colNum.
-
removeChart
Description copied from interface:BaseFigureRemoves a chart from the Figure's grid.- Specified by:
removeChartin interfaceBaseFigure- 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:
- this Figure with the chart removed.
-
removeChart
Description copied from interface:BaseFigureRemoves a chart from the Figure's grid.- Specified by:
removeChartin interfaceBaseFigure- 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:
- this Figure with the chart removed.
-
chart
Description copied from interface:BaseFigureReturns a chart from this Figure's grid.- Specified by:
chartin interfaceBaseFigure- 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:
- selected
Chart
-
chart
Description copied from interface:BaseFigureReturns a chart from this Figure's grid.- Specified by:
chartin interfaceBaseFigure- 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
-
save
Description copied from interface:BaseFigureSaves the Figure as an image.- Specified by:
savein interfaceBaseFigure- Parameters:
saveLocation- save location. Must not be nullwait- whether to hold the calling thread until the file is writtentimeoutSeconds- timeout in seconds to wait.- Returns:
- figure
-
save
public BaseFigure save(String saveLocation, int width, int height, boolean wait, long timeoutSeconds) Description copied from interface:BaseFigureSaves the Figure as an image.- Specified by:
savein interfaceBaseFigure- Parameters:
saveLocation- save location. Must not be nullwidth- image widthheight- image heightwait- whether to hold the calling thread until the file is writtentimeoutSeconds- timeout in seconds to wait.- Returns:
- figure
-
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
- Specified by:
getPlotInfoin interfacePlotExceptionCause
-
setName
-
setSessionId
public void setSessionId(int sessionId) -
getName
-
getSessionId
public int getSessionId() -
initializationGate
-
consolidateTableMaps
public void consolidateTableMaps() -
consolidateTables
public void consolidateTables()
-