Package quadbase.util
Class ControlRange
java.lang.Object
quadbase.util.ControlRange
- All Implemented Interfaces:
IGradientPropertySet,IGradientSupport
This class is used to draw control range area for charts. A control range is created using the
constructor and then added to the chart using the addElement method in IControlRangeSet.
-
ControlRange range1 = new ControlRange(0, 4, "LOWER", false);
range1.setColor(Color.lightGray);
chart.gethControlRanges().addElement(range1);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionControlRange(double startScale, double endScale, Color color, String title, boolean showInLegend) Creates a new control range area.ControlRange(double startScale, double endScale, Color color, String title, int appear, int depth, boolean showInLegend) Creates a new control range area.ControlRange(double startScale, double endScale, Color color, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend) Creates a new control range area for dial chart.ControlRange(double startScale, double endScale, Color color, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend, boolean showAxis) Creates a new control range area for dial chart.ControlRange(double startScale, double endScale, String title, boolean legend) Creates a new control range area.ControlRange(double startScale, double endScale, String title, int appear, int depth, boolean showInLegend) Creates a new control range area.ControlRange(double startScale, double endScale, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend) Creates a new control range area.ControlRange(double startScale, double endScale, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend, boolean showAxis) Creates a new control range area. -
Method Summary
Modifier and TypeMethodDescriptionstatic Vectorvoidcopy(ControlRange cr) intReturns the background appearance for the control ranges.Returns center of the control range (for dial chart only) The percentage of the radius from 0 to 100 and dial center is (0, 0)getColor()Returns color of the control rangeintgetDepth()Returns the control range area depth.intReturns the direction of the control range (Dial chart does not support this feature) Only coordinates system charts support this featureReturns end label offset of the control rangedoubleReturns end scale of the control range for column/bar type: scale of value axisdoublegetEndScale(quadbase.chart.Chart chart) doubleReturns end scale 2 of the control range for column/bar type: scale of category axis not used for dial chartdoublegetEndScale2(quadbase.chart.Chart chart) doubledoubleintdoubledoubleReturns color of the control rangeReturns label font of the control rangestatic doublegetMaxScaleOnAxis(quadbase.chart.Chart chart) static doublegetMaxValueOnCategoryAxis(quadbase.chart.Chart chart) static doublegetMaxValueOnValueAxis(quadbase.chart.Chart chart) intReturns offset of the control range (for dial chart only) The percentage of the radius from 0 to 100Returns start label offset of the control rangedoubleReturns start scale of the control range for column/bar type: scale of value axisdoublegetStartScale(quadbase.chart.Chart chart) doubleReturns start scale 2 of the control rangedoublegetStartScale2(quadbase.chart.Chart chart) intReturns thickness of the control range (for dial chart only) The percentage of the radius from 0 to 100getTitle()Returns title of the control rangeintgetX1(quadbase.chart.Chart chart) For internal use onlyintgetX2(quadbase.chart.Chart chart) For internal use onlyintgetY1(quadbase.chart.Chart chart) For internal use onlyintgetY2(quadbase.chart.Chart chart) For internal use onlybooleanbooleanReturns whether border is drawn (for dial chart only)booleanReturns whether full border is drawn (for dial chart only)booleanbooleanbooleanisHorizontalRange(quadbase.chart.Chart chart) For internal use onlybooleanReturns whether overlap area is highlightedbooleanbooleanReturns whether scale 1 is enabled for column/bar type: scale 1 is category axisbooleanReturns whether scale 2 is enabled for column/bar type: scale 2 is value axis not used for dial chartbooleanbooleanReturns whether title of the control range is displayed in the legendbooleanReturns whether label of the control range is displayedstatic ControlRangeFor internal use onlyvoidset3DShadingEnabled(boolean b) voidsetAppearance(int appear) Sets the background appearance for the control range.voidSets center of the control range (for dial chart only) The percentage of the radius from 0 to 100 and dial center is (0, 0)voidSets color of the control rangevoidsetDepth(int depth) Sets the control range area depth.voidsetDirection(int direction) Sets the direction of the control range (Dial chart does not support this feature) Only coordinates system charts support this featurevoidsetDrawBorder(boolean state) Sets whether border is drawn (for dial chart only)voidsetDrawFullBorder(boolean state) Sets whether full border is drawn (for dial chart only)voidSets end label offset of the control rangevoidsetEndScale(double scale) Sets end scale of the control range for column/bar type: scale of value axisvoidsetEndScale2(double scale) Sets end scale 2 of the control range for column/bar type: scale of category axis not used for dial chartvoidsetGradientCyclic(boolean c) voidvoidsetGradientEnabled(boolean b) voidsetGradientEndX(double x) voidsetGradientEndY(double y) voidsetGradientShade(int s) voidsetGradientStartX(double x) voidsetGradientStartY(double y) voidSets label color of the control rangevoidsetLabelFont(Font f) Sets label font of the control rangevoidsetOffset(int offset) Sets offset of the control range (for dial chart only) The percentage of the radius from 0 to 100voidsetOverlapAreaHighlighted(boolean b) Highlights overlap areavoidsetPercentage(boolean percentage) voidsetScale1Enabled(boolean b) Sets scale 1 enabled for column/bar type: scale 1 is category axisvoidsetScale2Enabled(boolean b) Sets scale 2 enabled for column/bar type: scale 2 is category axis not used for dial chartvoidsetShowAxis(boolean b) voidsetShowInLegend(boolean showInLegend) Sets whether title of the control range is displayed in the legendvoidsetShowLabel(boolean b) Sets whether label of the control range is displayed.voidSets start label offset of the control rangevoidsetStartScale(double scale) Sets start scale of the control range for column/bar type: scale of value axisvoidsetStartScale2(double scale) Sets start scale 2 of the control rangevoidsetThickness(int t) Sets thickness of the control range (for dial chart only) The percentage of the radius from 0 to 100voidSets title of the control rangetoString()voidwrite(DataOutput dout) For internal use only
-
Constructor Details
-
ControlRange
Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangetitle- title of the control rangelegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend) Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangetitle- title of the control rangethickness- thickness of the control rangeoffset- offset of the control rangecenter- center of control rangedrawBorder- draw line bordershowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend, boolean showAxis) Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangetitle- title of the control rangethickness- thickness of the control rangeoffset- offset of the control rangecenter- center of control rangedrawBorder- draw line bordershowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, Color color, String title, boolean showInLegend) Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangecolor- control range colortitle- title of the control rangeshowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, Color color, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend) Creates a new control range area for dial chart.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangecolor- control range colortitle- title of the control rangethickness- thickness of the control rangeoffset- offset of the control rangecenter- center of control rangedrawBorder- draw line bordershowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, Color color, String title, int thickness, int offset, Point center, boolean drawBorder, boolean showInLegend, boolean showAxis) Creates a new control range area for dial chart.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangecolor- control range colortitle- title of the control rangethickness- thickness of the control rangeoffset- offset of the control rangecenter- center of control rangedrawBorder- draw line bordershowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, String title, int appear, int depth, boolean showInLegend) Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangetitle- title of the control rangeappear- appearance of the control range. Valid values are QbChart.PLAIN, QbChart.LOWER, QbChart.RAISE, QbChart.SHADOW and QbChart.NONEdepth- depth of the control rangeshowInLegend- show title in legend
-
ControlRange
public ControlRange(double startScale, double endScale, Color color, String title, int appear, int depth, boolean showInLegend) Creates a new control range area.- Parameters:
startScale- lower scale of the control rangeendScale- upper scale of the control rangecolor- control range colortitle- title of the control rangeappear- appearance of the control range. Valid values are QbChart.PLAIN, QbChart.LOWER, QbChart.RAISE, QbChart.SHADOW and QbChart.NONEdepth- depth of the control rangeshowInLegend- show title in legend
-
ControlRange
-
-
Method Details
-
copy
-
copy
-
getStartScale
public double getStartScale()Returns start scale of the control range for column/bar type: scale of value axis- Returns:
- lower scale of the control range
-
getStartScale
public double getStartScale(quadbase.chart.Chart chart) -
setStartScale
public void setStartScale(double scale) Sets start scale of the control range for column/bar type: scale of value axis- Parameters:
scale- lower scale of the control range
-
getEndScale
public double getEndScale()Returns end scale of the control range for column/bar type: scale of value axis- Returns:
- upper scale of the control range
-
getEndScale
public double getEndScale(quadbase.chart.Chart chart) -
setEndScale
public void setEndScale(double scale) Sets end scale of the control range for column/bar type: scale of value axis- Parameters:
scale- upper scale of the control range
-
getStartScale2
public double getStartScale2()Returns start scale 2 of the control rangefor column/bar type: scale of category axis
not used for dial chart
- Returns:
- lower scale 2 of the control range
-
getStartScale2
public double getStartScale2(quadbase.chart.Chart chart) -
setStartScale2
public void setStartScale2(double scale) Sets start scale 2 of the control rangefor column/bar type: scale of category axis
not used for dial chart
- Parameters:
scale- lower scale of the control range
-
getEndScale2
public double getEndScale2()Returns end scale 2 of the control range for column/bar type: scale of category axis not used for dial chart- Returns:
- upper scale 2 of the control range
-
getEndScale2
public double getEndScale2(quadbase.chart.Chart chart) -
setEndScale2
public void setEndScale2(double scale) Sets end scale 2 of the control range for column/bar type: scale of category axis not used for dial chart- Parameters:
scale- upper scale of the control range
-
isScale1Enabled
public boolean isScale1Enabled()Returns whether scale 1 is enabled for column/bar type: scale 1 is category axis- Returns:
- the state of scale 1
-
setScale1Enabled
public void setScale1Enabled(boolean b) Sets scale 1 enabled for column/bar type: scale 1 is category axis- Parameters:
b- the state of scale 1
-
isScale2Enabled
public boolean isScale2Enabled()Returns whether scale 2 is enabled for column/bar type: scale 2 is value axis not used for dial chart- Returns:
- the state of scale 2
-
setScale2Enabled
public void setScale2Enabled(boolean b) Sets scale 2 enabled for column/bar type: scale 2 is category axis not used for dial chart- Parameters:
b- the state of scale 2
-
isOverlapAreaHighlighted
public boolean isOverlapAreaHighlighted()Returns whether overlap area is highlightednot used for dial chart
-
setOverlapAreaHighlighted
public void setOverlapAreaHighlighted(boolean b) Highlights overlap areanot used for dial chart
-
getColor
Returns color of the control range- Returns:
- color of the control range
-
setColor
Sets color of the control range- Parameters:
color- color of the control range
-
getTitle
Returns title of the control range- Returns:
- title of the control range
-
setTitle
Sets title of the control range- Parameters:
title- control range title
-
getThickness
public int getThickness()Returns thickness of the control range (for dial chart only) The percentage of the radius from 0 to 100- Returns:
- thickness of the control range
-
setThickness
public void setThickness(int t) Sets thickness of the control range (for dial chart only) The percentage of the radius from 0 to 100- Parameters:
t- - thickness of the control range
-
getOffset
public int getOffset()Returns offset of the control range (for dial chart only) The percentage of the radius from 0 to 100- Returns:
- offset of the control range
-
setOffset
public void setOffset(int offset) Sets offset of the control range (for dial chart only) The percentage of the radius from 0 to 100- Parameters:
offset- offset of the control range
-
getCenter
Returns center of the control range (for dial chart only) The percentage of the radius from 0 to 100 and dial center is (0, 0)- Returns:
- center of the control range
-
setCenter
Sets center of the control range (for dial chart only) The percentage of the radius from 0 to 100 and dial center is (0, 0)- Parameters:
center- center of the control range
-
isDrawBorder
public boolean isDrawBorder()Returns whether border is drawn (for dial chart only)- Returns:
- the state
-
setDrawBorder
public void setDrawBorder(boolean state) Sets whether border is drawn (for dial chart only)- Parameters:
state- the new state of drawing border
-
isDrawFullBorder
public boolean isDrawFullBorder()Returns whether full border is drawn (for dial chart only)- Returns:
- the state
-
setDrawFullBorder
public void setDrawFullBorder(boolean state) Sets whether full border is drawn (for dial chart only)- Parameters:
state- the new state of drawing full border
-
isShowInLegend
public boolean isShowInLegend()Returns whether title of the control range is displayed in the legend- Returns:
- the state
-
setShowInLegend
public void setShowInLegend(boolean showInLegend) Sets whether title of the control range is displayed in the legend- Parameters:
showInLegend- the new state of show title in legend
-
getAppearance
public int getAppearance()Returns the background appearance for the control ranges. (Dial chart does not support this feature)- Returns:
- the background appearance. Valid values are:
QbChart.RAISE QbChart.LOWER QbChart.PLAIN QbChart.SHADOW QbChart.NONE
-
setAppearance
public void setAppearance(int appear) Sets the background appearance for the control range. (Dial chart does not support this feature)- Parameters:
appear- The background appearance. Valid values are:QbChart.RAISE QbChart.LOWER QbChart.PLAIN QbChart.SHADOW QbChart.NONE
- See Also:
-
getDepth
public int getDepth()Returns the control range area depth. (Dial chart does not support this feature)- Returns:
- The control range area depth
-
setDepth
public void setDepth(int depth) Sets the control range area depth. (Dial chart does not support this feature)- Parameters:
depth- The control range area depth value.- See Also:
-
getDirection
public int getDirection()Returns the direction of the control range (Dial chart does not support this feature) Only coordinates system charts support this feature- Returns:
- The direction as: QbChart.HORIZONTAL or QbChart.VERTICAL
-
setDirection
public void setDirection(int direction) Sets the direction of the control range (Dial chart does not support this feature) Only coordinates system charts support this feature- Parameters:
direction- QbChart.VERTICAL or QbChart.HORIZONTAL
-
write
For internal use only- Throws:
IOException
-
read
For internal use only- Throws:
IOException
-
isHorizontalRange
public boolean isHorizontalRange(quadbase.chart.Chart chart) For internal use only -
getX1
public int getX1(quadbase.chart.Chart chart) For internal use only -
getX2
public int getX2(quadbase.chart.Chart chart) For internal use only -
getY1
public int getY1(quadbase.chart.Chart chart) For internal use only -
getY2
public int getY2(quadbase.chart.Chart chart) For internal use only -
getMaxValueOnValueAxis
public static double getMaxValueOnValueAxis(quadbase.chart.Chart chart) -
getMaxValueOnCategoryAxis
public static double getMaxValueOnCategoryAxis(quadbase.chart.Chart chart) -
getMaxScaleOnAxis
public static double getMaxScaleOnAxis(quadbase.chart.Chart chart) -
setShowLabel
public void setShowLabel(boolean b) Sets whether label of the control range is displayed. This is for Dial Charts only.- Parameters:
b- the new state of label
-
isShowLabel
public boolean isShowLabel()Returns whether label of the control range is displayed- Returns:
- the state of show label
-
getStartLabelOffset
Returns start label offset of the control range- Returns:
- start label offset of the control range
-
setStartLabelOffset
Sets start label offset of the control range -
getEndLabelOffset
Returns end label offset of the control range- Returns:
- end label offset of the control range
-
setEndLabelOffset
Sets end label offset of the control range -
getLabelColor
Returns color of the control range- Returns:
- label color of the control range
-
setLabelColor
Sets label color of the control range- Parameters:
c- label color of the control range
-
getLabelFont
Returns label font of the control range- Returns:
- label font of the control range
-
setLabelFont
Sets label font of the control range- Parameters:
f- font of the control range
-
toString
-
setShowAxis
public void setShowAxis(boolean b) -
isShowAxis
public boolean isShowAxis() -
isGradientEnabled
public boolean isGradientEnabled()- Specified by:
isGradientEnabledin interfaceIGradientSupport
-
setGradientEnabled
public void setGradientEnabled(boolean b) - Specified by:
setGradientEnabledin interfaceIGradientPropertySet
-
is3DShadingEnabled
public boolean is3DShadingEnabled()- Specified by:
is3DShadingEnabledin interfaceIGradientSupport
-
set3DShadingEnabled
public void set3DShadingEnabled(boolean b) - Specified by:
set3DShadingEnabledin interfaceIGradientPropertySet
-
getGradientStartX
public double getGradientStartX()- Specified by:
getGradientStartXin interfaceIGradientSupport
-
getGradientStartY
public double getGradientStartY()- Specified by:
getGradientStartYin interfaceIGradientSupport
-
getGradientEndX
public double getGradientEndX()- Specified by:
getGradientEndXin interfaceIGradientSupport
-
getGradientEndY
public double getGradientEndY()- Specified by:
getGradientEndYin interfaceIGradientSupport
-
getGradientDesColor
- Specified by:
getGradientDesColorin interfaceIGradientSupport
-
getGradientShade
public int getGradientShade()- Specified by:
getGradientShadein interfaceIGradientSupport
-
isGradientCyclic
public boolean isGradientCyclic()- Specified by:
isGradientCyclicin interfaceIGradientSupport
-
setGradientStartX
public void setGradientStartX(double x) - Specified by:
setGradientStartXin interfaceIGradientPropertySet
-
setGradientStartY
public void setGradientStartY(double y) - Specified by:
setGradientStartYin interfaceIGradientPropertySet
-
setGradientEndX
public void setGradientEndX(double x) - Specified by:
setGradientEndXin interfaceIGradientPropertySet
-
setGradientEndY
public void setGradientEndY(double y) - Specified by:
setGradientEndYin interfaceIGradientPropertySet
-
setGradientDesColor
- Specified by:
setGradientDesColorin interfaceIGradientPropertySet
-
setGradientShade
public void setGradientShade(int s) - Specified by:
setGradientShadein interfaceIGradientPropertySet
-
setGradientCyclic
public void setGradientCyclic(boolean c) - Specified by:
setGradientCyclicin interfaceIGradientPropertySet
-
isPercentage
public boolean isPercentage() -
setPercentage
public void setPercentage(boolean percentage)
-