public interface IXYPlot
Modifier and Type | Method and Description |
---|---|
boolean |
addDataHandler(XYPlotData dh)
Add an already existing data set
|
boolean |
evalKey(int key)
Method to be called by the owner of the plot to inform about a key stroke.
|
boolean |
evalMouseEvent(IXYGraphLib.MouseEvent event,
int x,
int y)
Method to be called by the owner of the plot to inform about mouse click
events.
|
java.util.ArrayList<XYPlotData> |
getDataHandlers()
Get list of used data handlers
|
IXYGraphLib.Rect |
getRedrawArea()
Get the area which needs to be redrawn.
|
java.lang.String |
getXAxisText()
Get the text for the X axis
|
double |
getXMax()
Get the maximum X value
|
double |
getXMin()
Get the minimum X value
|
java.lang.String |
getXUnitText()
Get the text for the X axis unit
|
int |
getZoomBoxLacyUpdateDelay()
Returns the current value of the zoom box delay (See
setZoomBoxLacyUpdateDelay ) |
void |
initXRange(double xmin,
double xmax)
Same as setXRange but is always executed independent of the graphs current
paused state.
|
boolean |
isAllowPauseOnDataClick()
Returns the current state of the flag.
|
boolean |
isLegendExpanded()
Status, expanded (true) ore collapsed (false), of the legend box
|
boolean |
isOutdated()
Returns true if the graph needs to be repainted.
|
boolean |
moveByPixels(int pixelNum)
Move visible data to the right
|
void |
moveLeft()
Move visible data to the left
|
void |
moveRight()
Move visible data to the right
|
void |
registerEventHandler(IXYPlotEvent h)
Register a handler to receive clicks on the start/stop, pause keys.
|
boolean |
removeDataHandler(XYPlotData dh)
Remove data set
|
void |
removeDataHandlers()
Remove all data sets
|
void |
setAllowPauseOnDataClick(boolean allowPauseOnDataClick)
Allow that a click into the graph switches the state to pause mode.
|
void |
setAxisColor(int r,
int g,
int b)
Set color of axis
|
void |
setAxisLabels(boolean value)
Turn on/off of axis labels and legend.
|
void |
setBgColor(int r,
int g,
int b)
Set color of global background
|
void |
setBounds(IXYGraphLib.Rect bounds)
Set the boundaries of the component in absolute coordinates of the canvas
|
void |
setClearButtonVisible(boolean value)
Set the delete plot button to visible or invisible.
|
void |
setCursorBgColor(int r,
int g,
int b)
Set color of cursor box background
|
void |
setCursorColor(int r,
int g,
int b)
Set color of cursor
|
void |
setDataHandlers(XYPlotData[] dhs)
Add a set of data handlers to the graph.
|
void |
setDrawAreaBgColor(int r,
int g,
int b)
Set color of curve draw area background
|
void |
setFontSize(int labelFontSize,
int titleFontSize)
Set size of font for labels and title
|
void |
setFontSize(java.lang.String fontName,
int labelFontSize,
int titleFontSize)
Set name and size of font for labels and title
|
void |
setLegendBgColor(int r,
int g,
int b)
Set background color of the legend area.
|
void |
setLegendExpanded(boolean value)
Expand (true) ore collapse (false) the legend box
|
void |
setLegendSelectBgColor(int r,
int g,
int b)
Set background color of selected data in legend.
|
void |
setLegendVisible(boolean value)
Set the legend box to visible or invisible.
|
void |
setOptimizedLineDrawing(boolean optimizedDraw)
Large data sets consume a lot of time for drawing the lines.
|
void |
setPaused(boolean paused)
Set graph in paused mode.
|
void |
setSaveButtonVisible(boolean value)
Set the save button to visible or invisible.
|
void |
setSmoothScroll(boolean smoothScroll)
Set smooth scrolling.
|
void |
setStartButtonVisible(boolean value)
Set the run/pause button to visible or invisible.
|
void |
setUpdateDelay(long delay)
Set the delay of the repaint operation.
|
void |
setXAxisText(java.lang.String s)
Set the text for the X axis unit
|
void |
setXRange(double xmin,
double xmax)
Set the range for the X axis.
|
void |
setXUnitText(java.lang.String s)
Set the text for the X axis unit
|
void |
setZoomBoxLacyUpdateDelay(int zoomBoxLacyUpdateDelay)
This value in [ms] is used to delay the update of the zoom box when changing
the size.
|
boolean |
zoomAt(int position,
double factor)
Zoom x-Axis at given position by a factor
|
void |
zoomIn()
Zoom x-Axis around cursor position
|
void registerEventHandler(IXYPlotEvent h)
h
- Receiver object for the eventsjava.util.ArrayList<XYPlotData> getDataHandlers()
void setDataHandlers(XYPlotData[] dhs)
boolean addDataHandler(XYPlotData dh)
boolean removeDataHandler(XYPlotData dh)
void removeDataHandlers()
void setUpdateDelay(long delay)
delay
- Value in [ms]void setFontSize(int labelFontSize, int titleFontSize)
labelFontSize
- titleFontSize
- void setFontSize(java.lang.String fontName, int labelFontSize, int titleFontSize)
labelFontSize
- titleFontSize
- void setBgColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setDrawAreaBgColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setAxisColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setCursorColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setCursorBgColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setLegendBgColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBvoid setLegendSelectBgColor(int r, int g, int b)
r
- R value of RGBg
- G value of RGBb
- B value of RGBjava.lang.String getXUnitText()
void setXUnitText(java.lang.String s)
s
- Unit text i.e. "s" for seconds. Do not add brackets [] herejava.lang.String getXAxisText()
void setXAxisText(java.lang.String s)
s
- Unit text i.e. "s" for seconds. Do not use brackets [] here, they
are added automaticallyvoid setXRange(double xmin, double xmax)
xmin
- Minimum x value to be displayedxmax
- Maximum x value to be displayedvoid initXRange(double xmin, double xmax)
xmin
- Minimum x value to be displayedxmax
- Maximum x value to be displayeddouble getXMin()
double getXMax()
boolean evalKey(int key)
boolean evalMouseEvent(IXYGraphLib.MouseEvent event, int x, int y)
x
- x coordinate of the mouse down clicky
- y coordinate of the mouse down clickIXYGraphLib.Rect getRedrawArea()
boolean isOutdated()
void setBounds(IXYGraphLib.Rect bounds)
bounds
- Outer rectangle defining the plotting areint getZoomBoxLacyUpdateDelay()
setZoomBoxLacyUpdateDelay
)void setZoomBoxLacyUpdateDelay(int zoomBoxLacyUpdateDelay)
zoomBoxLacyUpdateDelay
- boolean isAllowPauseOnDataClick()
setAllowPauseOnDataClick
.void setAllowPauseOnDataClick(boolean allowPauseOnDataClick)
allowPauseOnDataClick
- New statevoid setPaused(boolean paused)
paused
- true/falsevoid setLegendExpanded(boolean value)
value
- boolean isLegendExpanded()
void setLegendVisible(boolean value)
value
- true/falsevoid setSaveButtonVisible(boolean value)
value
- true/falsevoid setStartButtonVisible(boolean value)
value
- true/falsevoid setClearButtonVisible(boolean value)
value
- true/falsevoid setAxisLabels(boolean value)
value
- true (default) or falsevoid moveLeft()
void moveRight()
boolean moveByPixels(int pixelNum)
void zoomIn()
boolean zoomAt(int position, double factor)
position
- X-position on the screen in pixelsfactor
- Factor to scalevoid setSmoothScroll(boolean smoothScroll)
smoothScroll
- True to scroll smoothlyvoid setOptimizedLineDrawing(boolean optimizedDraw)
optimizedDraw
- True to optimize drawing