Package com.illumon.iris.db.plot
Class AxisImpl
java.lang.Object
com.illumon.iris.db.plot.AxisImpl
- All Implemented Interfaces:
Axis
,PlotExceptionCause
,Serializable
public class AxisImpl extends Object implements Axis, PlotExceptionCause
Represents an axis.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AxisImpl.Type
-
Field Summary
Fields Modifier and Type Field Description Set<OneClickChartModifier>
oneClickChartModifiers
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
addOneClickChartModifier(OneClickChartModifier oneClickChartModifier)
void
addSwappableTable(SwappableTable st)
void
addTableMapHandle(TableMapHandle map)
AxisImpl
axisColor(Paint color)
Sets the color for this Axis line and tick marks.AxisImpl
axisColor(String color)
Sets the color for this Axis line and tick marks.AxisImpl
axisFormat(AxisFormat format)
Sets theAxisFormat
for this Axis.AxisImpl
axisFormatPattern(String pattern)
Sets the format pattern for this Axis's labels.AxisImpl
axisLabel(String label)
Sets the label for this Axis.AxisImpl
axisLabelFont(Font font)
Sets the font for this Axis's label.AxisImpl
axisLabelFont(String family, String style, int size)
Sets the font for this Axis's label.AxisImpl
businessTime()
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.AxisImpl
businessTime(SelectableDataSet sds, String valueColumn)
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.AxisImpl
businessTime(BusinessCalendar calendar)
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.CategoryIndex
categoryIndex()
Gets theCategoryIndex
of this Axis.ChartImpl
chart()
Gets this AxisImpl's id.AxisImpl
copy(ChartImpl chart)
Creates a copy of this Axis using a different chart.int
dim()
Gets the dimensionality of this AxisImpl.AxisTransform
getAxisTransform()
Gets theAxisTransform
of this AxisImpl.Paint
getColor()
Gets this AxisImpl's color.AxisFormat
getFormat()
Gets theAxisFormat
of this AxisImpl.String
getFormatPattern()
Gets the format pattern for this AxisImpl's tick labels.double
getGapBetweenMajorTicks()
Gets the gap between consecutive major ticks.boolean
getInvert()
Gets whether to invert this AxisImpl.String
getLabel()
Gets this AxisImpl's label.Font
getLabelFont()
Gets theFont
of this AxisImpl's label.double[]
getMajorTickLocations()
Gets the locations of the major ticks.double
getMaxRange()
Gets the maximum of this AxisImpl's range.int
getMinorTickCount()
Gets the number of minor ticks between consecutive major ticks.double
getMinRange()
Gets the minimum of this AxisImpl's range.Set<OneClickChartModifier>
getOneClickChartModifiers()
PlotInfo
getPlotInfo()
Set<SwappableTable>
getSwappableTables()
Set<TableMapHandle>
getTableMapHandles()
double
getTickLabelAngle()
Gets the angle in degrees at which the tick label text will be drawn.Font
getTicksFont()
Gets theFont
of this AxisImpl's tick labels.AxisImpl.Type
getType()
Gets the type of axis.int
id()
Gets this AxisImpl's id.AxisImpl
invert()
Inverts this Axis so that larger values are closer to the origin.AxisImpl
invert(boolean invert)
Inverts this Axis so that larger values are closer to the origin.boolean
isLog()
Whether this is a logarithmic axis.boolean
isMajorTicksVisible()
Whether the major ticks are drawn.boolean
isMinorTicksVisible()
Whether the minor ticks are drawn.boolean
isTimeAxis()
Whether this axis is time axis.AxisImpl
log()
Sets the AxisTransform as log base 10.AxisImpl
max(double max)
Sets the maximum range of this Axis.AxisImpl
max(SelectableDataSet sds, String valueColumn)
Sets the maximum range of this Axis.AxisImpl
min(double min)
Sets the minimum range of this Axis.AxisImpl
min(SelectableDataSet sds, String valueColumn)
Sets the minimum range of this Axis.AxisImpl
minorTicks(int count)
Sets the number of minor ticks between consecutive major ticks.AxisImpl
minorTicksVisible(boolean visible)
Sets whether minor ticks are drawn on this Axis.void
onClose()
AxisImpl
range(double min, double max)
Sets the range of this Axis to [min
,max
] inclusive.void
setTimeAxis(boolean timeAxis)
Sets the boolean representing whether this axis is time axisAxisImpl
tickLabelAngle(double angle)
Sets the angle the tick labels of this Axis are drawn at.AxisImpl
ticks(double gapBetweenTicks)
Sets the tick locations.AxisImpl
ticks(double[] tickLocations)
Sets the tick locations.AxisImpl
ticksFont(Font font)
Sets the font for this Axis's ticks.AxisImpl
ticksFont(String family, String style, int size)
Sets the font for this Axis's ticks.AxisImpl
ticksVisible(boolean visible)
Sets whether ticks are drawn on this Axis.AxisImpl
transform(AxisTransform transform)
Sets theAxisTransform
for this Axis.CategoryIndex
transformedCategoryIndex()
Gets the transformedCategoryIndex
of this Axis.
-
Field Details
-
Constructor Details
-
AxisImpl
Creates a copy of an Axis using a different chart.- Parameters:
axis
- axis to copy.chart
- new chart.
-
-
Method Details
-
copy
Creates a copy of this Axis using a different chart.- Parameters:
chart
- new chart.- Returns:
- axis copy.
-
getPlotInfo
- Specified by:
getPlotInfo
in interfacePlotExceptionCause
-
dim
public int dim()Gets the dimensionality of this AxisImpl.- Returns:
- this AxisImpl's dimensionality
-
id
public int id()Gets this AxisImpl's id.- Returns:
- this AxisImpl's id
-
getColor
Gets this AxisImpl's color.- Returns:
- this AxisImpl's color
-
chart
Gets this AxisImpl's id.- Returns:
- this AxisImpl's id
-
getType
Gets the type of axis.- Returns:
- type of axis.
-
isLog
public boolean isLog()Whether this is a logarithmic axis.- Returns:
- if this is a logarithmic axis, true; false otherwise
-
getLabel
Gets this AxisImpl's label.- Returns:
- this AxisImpl's label
-
getLabelFont
Gets theFont
of this AxisImpl's label.- Returns:
- this AxisImpl's label's
Font
-
getTicksFont
Gets theFont
of this AxisImpl's tick labels.- Returns:
- this AxisImpl's tick label's
Font
-
getFormat
Gets theAxisFormat
of this AxisImpl.- Returns:
- this AxisImpl's
AxisFormat
-
getFormatPattern
Gets the format pattern for this AxisImpl's tick labels.- Returns:
- this AxisImpl's tick labels' format pattern
-
getInvert
public boolean getInvert()Gets whether to invert this AxisImpl.- Returns:
- whether to invert this AxisImpl.
-
getMinRange
public double getMinRange()Gets the minimum of this AxisImpl's range.- Returns:
- minimum of this AxisImpl's range
-
getMaxRange
public double getMaxRange()Gets the maximum of this AxisImpl's range.- Returns:
- maximum of this AxisImpl's range
-
isMinorTicksVisible
public boolean isMinorTicksVisible()Whether the minor ticks are drawn.- Returns:
- if the minor ticks will be drawn, true; otherwise false
-
isMajorTicksVisible
public boolean isMajorTicksVisible()Whether the major ticks are drawn.- Returns:
- if the major ticks will be drawn, true; otherwise false
-
getMinorTickCount
public int getMinorTickCount()Gets the number of minor ticks between consecutive major ticks.- Returns:
- number of minor ticks between consecutive major ticks
-
getGapBetweenMajorTicks
public double getGapBetweenMajorTicks()Gets the gap between consecutive major ticks.- Returns:
- the gap between consecutive major ticks
-
getMajorTickLocations
public double[] getMajorTickLocations()Gets the locations of the major ticks.- Returns:
- the locations of the major ticks
-
getTickLabelAngle
public double getTickLabelAngle()Gets the angle in degrees at which the tick label text will be drawn.- Returns:
- angle at which the tick label text will be drawn
-
getAxisTransform
Gets theAxisTransform
of this AxisImpl.- Returns:
- this AxisImpl's
AxisTransform
-
categoryIndex
Gets theCategoryIndex
of this Axis.- Returns:
- this Axis's
CategoryIndex
-
transformedCategoryIndex
Gets the transformedCategoryIndex
of this Axis.- Returns:
- this Axis's transformed
CategoryIndex
-
isTimeAxis
public boolean isTimeAxis()Whether this axis is time axis.- Returns:
- boolean informing whether this axis is time axis
-
setTimeAxis
public void setTimeAxis(boolean timeAxis)Sets the boolean representing whether this axis is time axis- Parameters:
timeAxis
- boolean representing whether this axis is time axis
-
addTableMapHandle
-
getSwappableTables
-
getTableMapHandles
-
addSwappableTable
-
addOneClickChartModifier
-
getOneClickChartModifiers
-
onClose
public void onClose() -
axisFormat
Description copied from interface:Axis
Sets theAxisFormat
for this Axis.- Specified by:
axisFormat
in interfaceAxis
- Parameters:
format
- axis format- Returns:
- this Axis
-
axisFormatPattern
Description copied from interface:Axis
Sets the format pattern for this Axis's labels.- Specified by:
axisFormatPattern
in interfaceAxis
- Parameters:
pattern
- axis format pattern- Returns:
- this Axis
-
axisColor
Description copied from interface:Axis
Sets the color for this Axis line and tick marks. -
axisColor
Description copied from interface:Axis
Sets the color for this Axis line and tick marks. -
axisLabel
Description copied from interface:Axis
Sets the label for this Axis. -
axisLabelFont
Description copied from interface:Axis
Sets the font for this Axis's label.- Specified by:
axisLabelFont
in interfaceAxis
- Parameters:
font
- font- Returns:
- this Axis
-
axisLabelFont
Description copied from interface:Axis
Sets the font for this Axis's label.- Specified by:
axisLabelFont
in interfaceAxis
- Parameters:
family
- font family; if null, set to Arialstyle
- font style; if null, set toFont.FontStyle
PLAINsize
- the point size of the Font- Returns:
- this Axis
-
ticksFont
Description copied from interface:Axis
Sets the font for this Axis's ticks. -
ticksFont
Description copied from interface:Axis
Sets the font for this Axis's ticks.- Specified by:
ticksFont
in interfaceAxis
- Parameters:
family
- font family; if null, set to Arialstyle
- font style; if null, set toFont.FontStyle
PLAINsize
- the point size of the Font- Returns:
- this Axis
-
transform
Description copied from interface:Axis
Sets theAxisTransform
for this Axis. -
log
Description copied from interface:Axis
Sets the AxisTransform as log base 10. -
businessTime
Description copied from interface:Axis
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.- Specified by:
businessTime
in interfaceAxis
- Parameters:
calendar
- business calendar of theAxisTransformBusinessCalendar
- Returns:
- this Axis using the specified business calendar.
-
businessTime
Description copied from interface:Axis
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.- Specified by:
businessTime
in interfaceAxis
- Parameters:
sds
- selectable data set (e.g. OneClick filterable table) containing the business calendar.valueColumn
- name of a column containing String values, where each value is the name of aBusinessCalendar
.- Returns:
- this Axis using the business calendar from row 0 of the filtered
sds
for the business calendar. If no value is found, no transform will be applied.
-
businessTime
Description copied from interface:Axis
Sets this Axis'sAxisTransform
as anAxisTransformBusinessCalendar
.- Specified by:
businessTime
in interfaceAxis
- Returns:
- this Axis using the default business calendar.
-
invert
Description copied from interface:Axis
Inverts this Axis so that larger values are closer to the origin. -
invert
Description copied from interface:Axis
Inverts this Axis so that larger values are closer to the origin. -
range
Description copied from interface:Axis
Sets the range of this Axis to [min
,max
] inclusive. -
min
Description copied from interface:Axis
Sets the minimum range of this Axis. -
max
Description copied from interface:Axis
Sets the maximum range of this Axis. -
min
Description copied from interface:Axis
Sets the minimum range of this Axis. -
max
Description copied from interface:Axis
Sets the maximum range of this Axis. -
ticksVisible
Description copied from interface:Axis
Sets whether ticks are drawn on this Axis.- Specified by:
ticksVisible
in interfaceAxis
- Parameters:
visible
- whether ticks are drawn on this Axis- Returns:
- this Axis
-
ticks
Description copied from interface:Axis
Sets the tick locations. -
ticks
Description copied from interface:Axis
Sets the tick locations. -
minorTicksVisible
Description copied from interface:Axis
Sets whether minor ticks are drawn on this Axis.- Specified by:
minorTicksVisible
in interfaceAxis
- Parameters:
visible
- whether minor ticks are drawn on this Axis- Returns:
- this Axis
-
minorTicks
Description copied from interface:Axis
Sets the number of minor ticks between consecutive major ticks. These minor ticks are equally spaced.- Specified by:
minorTicks
in interfaceAxis
- Parameters:
count
- number of minor ticks between consecutive major ticks.- Returns:
- this Axis
-
tickLabelAngle
Description copied from interface:Axis
Sets the angle the tick labels of this Axis are drawn at.- Specified by:
tickLabelAngle
in interfaceAxis
- Parameters:
angle
- angle in degrees- Returns:
- this Axis
-