EspressChart
v 5.5

quadbase.util
Interface ICanvas


public interface ICanvas

This interface is used to set/get properties associated with the main drawing canvas containing the chart. A handle to an object that implements this interface can be obtained by calling the gethCanvas method in QbChart.


Field Summary
static int SCROLLBARS_ALWAYS
           
static int SCROLLBARS_AS_NEEDED
           
static int SCROLLBARS_NEVER
           
 
Method Summary
 java.awt.Color getBackgroundColor()
          This function returns the color of the desktop background.
 java.net.URL getBackgroundImageURL()
          Returns the URL of the background image drawn on the canvas.
 java.awt.Component getCanvasArea()
          Returns canvas area component
 float getFontResizeRatio()
          Returns the ratio of font auto-resize to the chart canvas size change.
 int getImageMode()
          Returns the mode of the background image.
 int getScrollBarOption()
          Returns the scrollbar option for the main chart panel.
 java.awt.Dimension getSize()
          Returns the size of the main canvas containing the chart as a Dimension object.
 boolean isBackgroundVisible()
          Determines whether the desktop background area drawing (i.e., the rest of canvas other than the chart plot area) is enabled or not.
 boolean isChartVisible()
          Determines whether chart is visible or not.
 boolean isFitOnCanvas()
          Returns whether reposition chart location or reduce chart size in order to fit chart on canvas.
 boolean isReferenceAtTop()
          Returns whether the reference position of legend and annotation text is top or not
 void setBackgroundColor(java.awt.Color c)
          Sets the color of the desktop background.
 void setBackgroundImageURL(java.net.URL l)
          Sets the URL of the image drawn on the background.
 void setBackgroundVisible(boolean b)
          Sets whether the desktop background area drawing (i.e., the rest of canvas other than the chart plot area) is enabled or not.
 void setChartVisible(boolean b)
          Sets the visibility of chart.
 void setFitOnCanvas(boolean state)
          Try to fit a chart on canvas.
 void setFontResizeRatio(float ratio)
          Sets the ratio of font auto-resize to the chart canvas size change.
 void setImageMode(int x)
          Sets the display option for the background image.
 void setReferenceAtTop(boolean state)
          Sets the reference position of legend and annotation text to the top
 void setScrollBarOption(int option)
          Sets the scrollbar option for the main chart panel.
 void setSize(java.awt.Dimension d)
          Sets the size of the main canvas containing the chart.
 

Field Detail

SCROLLBARS_AS_NEEDED

public static final int SCROLLBARS_AS_NEEDED

SCROLLBARS_ALWAYS

public static final int SCROLLBARS_ALWAYS

SCROLLBARS_NEVER

public static final int SCROLLBARS_NEVER
Method Detail

getSize

public java.awt.Dimension getSize()
Returns the size of the main canvas containing the chart as a Dimension object.
Returns:
The size of the main canvas, in a Dimension object.

setSize

public void setSize(java.awt.Dimension d)
Sets the size of the main canvas containing the chart.

Associated QbChart property: SIZE

Parameters:
d - The Dimension object containing the new size for the drawing canvas.

getFontResizeRatio

public float getFontResizeRatio()
Returns the ratio of font auto-resize to the chart canvas size change.

setFontResizeRatio

public void setFontResizeRatio(float ratio)
Sets the ratio of font auto-resize to the chart canvas size change. Default value is 0.0f--no change in font size. A value of 1.0f would mean that the font size would increase/decrease the same percentage as the change in canvas size. A value of 2.0 would mean the degree of font resize is twice that of canvas resize.
Parameters:
ratio - valid range 0.0f to 3.0f, inclusive.

getScrollBarOption

public int getScrollBarOption()
Returns the scrollbar option for the main chart panel.

setScrollBarOption

public void setScrollBarOption(int option)
Sets the scrollbar option for the main chart panel.
Parameters:
option - Possible scrollbar option. Choices are:
	ICanvas.SCROLLBARS_ALWAYS
	ICanvas.SCROLLBARS_AS_NEEDED
 	ICanvas.SCROLLBARS_NEVER

isFitOnCanvas

public boolean isFitOnCanvas()
Returns whether reposition chart location or reduce chart size in order to fit chart on canvas.
Parameters:
boolean - isFitOnCanvas

setFitOnCanvas

public void setFitOnCanvas(boolean state)
Try to fit a chart on canvas. If TRUE, try to reposition chart location or reduce chart size until able to fit a whole chart on canvas. Default value is FALSE
Parameters:
state - is Fit On Canvas

isChartVisible

public boolean isChartVisible()
Determines whether chart is visible or not.
Returns:
True if chart is visible false otherwise.

setChartVisible

public void setChartVisible(boolean b)
Sets the visibility of chart.
Parameters:
b - The boolean state of chart.

isBackgroundVisible

public boolean isBackgroundVisible()
Determines whether the desktop background area drawing (i.e., the rest of canvas other than the chart plot area) is enabled or not.
Returns:
True if desktop background area drawing is enabled, false otherwise.

setBackgroundVisible

public void setBackgroundVisible(boolean b)
Sets whether the desktop background area drawing (i.e., the rest of canvas other than the chart plot area) is enabled or not.

Associated QbChart property: DRAW_DESKTOPBACKGROUND

Parameters:
b - The boolean state of desktop background drawing.

getBackgroundColor

public java.awt.Color getBackgroundColor()
This function returns the color of the desktop background. The color is returned as a java.awt.Color object.
Returns:
The Color object containing the rgb color value for the desktop background.

setBackgroundColor

public void setBackgroundColor(java.awt.Color c)
Sets the color of the desktop background.

Associated QbChart property: DESKTOP_BACKGROUNDCOLOR

Parameters:
c - The Color object containing the color for the background.

getBackgroundImageURL

public java.net.URL getBackgroundImageURL()
Returns the URL of the background image drawn on the canvas.
Returns:
The URL object for the background image.

setBackgroundImageURL

public void setBackgroundImageURL(java.net.URL l)
Sets the URL of the image drawn on the background.

Associated QbChart property: DESKTOPIMAGE

Parameters:
l - The URL for the background image.

getImageMode

public int getImageMode()
Returns the mode of the background image.
Returns:
The image background display option.
See Also:
setImageMode(int)

setImageMode

public void setImageMode(int x)
Sets the display option for the background image.

Associated QbChart property: DESKTOPIMAGE_OPTION

Parameters:
x - The display option for the background image. Available options are:
   QbChart.TILE
   QbChart.FIT
   QbChart.CENTER
   QbChart.NONE
 

getCanvasArea

public java.awt.Component getCanvasArea()
Returns canvas area component

isReferenceAtTop

public boolean isReferenceAtTop()
Returns whether the reference position of legend and annotation text is top or not

setReferenceAtTop

public void setReferenceAtTop(boolean state)
Sets the reference position of legend and annotation text to the top
Parameters:
state - The state of the reference position

EspressChart
v 5.5