jhplot
Class HPlotter
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jhplot.HPlotter
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
public class HPlotter extends javax.swing.JFrame implements java.awt.event.ActionListener
Create a canvas using the JAS plotter API. It has different look & feel than HPlot. Can also be used to show data, histograms, functions, 2D density plots. Several plot regions can be used.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor and Description HPlotter()
Construct a HPlot canvas with a single plot with the size 600x400.HPlotter(java.lang.String title)
Construct a HPlot canvas with a plot with the size 600x400.HPlotter(java.lang.String title, int xs, int ys)
Construct a HPlot canvas with a single plot.HPlotter(java.lang.String title, int xs, int ys, boolean set)
Construct a HPlot canvas with a single plot.HPlotter(java.lang.String title, int xsize, int ysize, int n1, int n2)
Create HPlot canvas with several plots.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
actionPerformed(java.awt.event.ActionEvent actionEvent)
Actionsboolean
cd(int cols, int rows)
Navigate to a selected plot.void
clear(int i1, int i2)
Clear the graph characterised by an index in X and Y.void
close()
Close the canvas (and dispose all components).void
createRegion(double x, double y, double w, double h)
Create a new plotting regionvoid
distroy()
Close the frame (as close).void
doc()
Show online documentation.void
draw(Cloud1D c1d)
Draw a cloud using AIDA.void
draw(Cloud1D c1d, IDataStyle datastyle)
Draw Aida cloud with some data stylevoid
draw(Cloud1D c1d, IPlotterStyle style)
Draw Aida cloud with some style.void
draw(Cloud2D c2d)
Draw Aida 2D cloudvoid
draw(Cloud2D c2d, IDataStyle datastyle)
Draw Aida cloud with some data stylevoid
draw(Cloud2D c2d, IPlotterStyle style)
Draw Aida 2D cloud with some stylevoid
draw(F1D f1d)
Draw a function.void
draw(H1D h1)
Plot 1D histogram.void
draw(H1D h1, IPlotterStyle style)
Plot 1D histogram.void
draw(H2D h2)
Draw 2D histogram as a density plot.void
draw(H2D h2, IPlotterStyle style)
Plot 2D histogram.void
draw(H2D h2, java.lang.String style_str)
Plot 2D histogram.void
draw(Histogram1D h1)
Draw Aida histogram with default stylevoid
draw(Histogram1D h1, IDataStyle datastyle)
Draw Aida histogram with some data stylevoid
draw(Histogram1D h1, IPlotterStyle style)
Draw Aida histogram with some plotter stylevoid
draw(Histogram2D h2)
Draw 2D histogram as a density plot.void
draw(Histogram2D h2, IDataStyle datastyle)
Draw 2D Aida histogram with some dat stylevoid
draw(Histogram2D h2, IPlotterStyle style)
Draw 2D Aida histogram with some plotter stylevoid
draw(IDataPointSet p1d)
Plot AIDA data points.void
draw(IDataPointSet p1d, IDataStyle datastyle)
Draw Aida data set with some data stylevoid
draw(IDataPointSet p1d, IPlotterStyle style)
Draw Aida data set with some stylevoid
draw(IFunction f1d)
Draw a function using AIDA.void
draw(IFunction f1d, IDataStyle datastyle)
Draw Aida function with some data stylevoid
draw(IFunction f1d, IPlotterStyle style)
Draw Aida data set with some stylevoid
draw(P1D p1d)
Plot data pointsvoid
export(java.lang.String file)
Fast export of the canvas to an image file (depends on the extension, i.e.java.awt.Color
getAxesColor()
Returns the actual color of the axes of the graph.IAxisStyle
getAxisStyle(int axis)
Return style of axis of the current regionint
getCdX()
Get location of the graph in the main canvas in Xint
getCdY()
Get location of the graph on the main canvas in YIDataStyle
getDataStyle()
Get current data style.ILegendBoxStyle
getLegendStyle()
Get legend box of the current draw area (navigated with the cd() method).double
getMaxValue(int axis)
Returns the maximum data value for the specified axis.double
getMinValue(int axis)
Returns the minimum data value for the specified axis.int
getNtotX()
Get the total number of graphs in Xint
getNtotY()
Get the total number of the graphs in Yjava.util.List<java.lang.String>
getOptAxis(java.lang.String parameter)
Get options for available parametersjava.util.List<java.lang.String>
getOptRegion(java.lang.String parameter)
Get options for available parameters of the plotting region.java.util.List<java.lang.String>
getParAxis()
Get available parameters for axis.java.util.List<java.lang.String>
getParPlotter()
Get available parameters for this canvas.java.util.List<java.lang.String>
getParRegion()
Get available parameters for this canvas.java.util.List<java.lang.String>
getParText()
Get available parameters to draw textIPlotter
getPlotter()
Return JAS plotterIPlotterStyle
getPlotterStyle()
Get current plotter style.IPlotterStyle
getRegionStyle()
Get style of the current plotting region.int
getSizeX()
Get the width of the main panel which keeps all margins and the central panel (in pixels)int
getSizeY()
Get the height of the main panel which keeps all margins and the central panel (in pixels)IStatisticsBoxStyle
getStatBoxStyle()
Get statistical box of the current draw area (navigated with the cd() method).IPlotterStyle
getStyle()
Get style of the current graph.java.util.List<java.lang.String>
getTextFonts()
Get available fonts to draw textjava.lang.String
getTitle()
Return title of this plotter.void
setAutoRange()
Set autorange in X and Y at the same time for the current plotvoid
setAutoRange(boolean b)
Set autorange in X and Y at the same timevoid
setAxesColor(java.awt.Color c)
Sets the actual color of the axes of the graph.void
setBackgColor(java.awt.Color c)
Sets the actual background color for current plot region.void
setBackgColorGraph(java.awt.Color c)
Sets the background color of the current graph.void
setGTitle(java.lang.String sname)
Set the global title with default attributes.void
setGTitle(java.lang.String sname, java.awt.Color c)
Set the global title with default attributes.void
setGTitle(java.lang.String sname, java.awt.Font f, java.awt.Color c)
Set global title and its attributesvoid
setLegend(boolean set)
Sets whether or not to draw the legend for the current plot.void
setLegendFont(java.awt.Font f)
Set legend fontsvoid
setLegendPos(double x, double y)
Set position for the current statistical boxvoid
setLogScale(int axis, boolean b)
Sets true or false to plot on a log scale.void
setName(java.lang.String name)
Sets a title for the current plot.void
setName(java.lang.String s, java.awt.Font f)
Sets a title for the current plot with all attributesvoid
setName(java.lang.String s, java.awt.Font f, java.awt.Color c)
Sets a title for the current plot with all attributesvoid
setNameX(java.lang.String s)
Sets the name for X axis.void
setNameX(java.lang.String s, java.awt.Font f)
Sets the name for X axis.void
setNameX(java.lang.String s, java.awt.Font f, java.awt.Color c)
Set the label for the axis in X for the current region.void
setNameY(java.lang.String s)
Sets the name for Y axis.void
setNameY(java.lang.String s, java.awt.Font f)
Sets the name for Y axis.void
setNameY(java.lang.String s, java.awt.Font f, java.awt.Color c)
Sets the Title for Y-axisboolean
setParAxis(int axis, java.lang.String par, java.lang.String opt)
Set parameters for the axis using stringsboolean
setParRegion(int axis, java.lang.String par, java.lang.String opt)
Set parameters for the current region.void
setRange(double minX, double maxX, double minY, double maxY)
Sets the range for the current plotvoid
setRange(int axis, double min, double max)
Sets the range (min-max) displayed on the axis for the current plot.void
setRangeAll(double minX, double maxX, double minY, double maxY)
Sets the range for all plotsvoid
setRangeAll(int axis, double min, double max)
Sets the range (min-max) displayed on all axises.void
setRangeX(double min, double max)
Sets the range (min-max) displayed on Xvoid
setRangeY(double min, double max)
Sets the range (min-max) displayed on Yvoid
setStatBox(boolean set)
Set statistical box to the current draw area (navigated with the cd() method.void
setStatBoxPos(double x, double y)
Set position for the current statistical boxvoid
setStatColor(java.awt.Color foreg, java.awt.Color backg)
Set colors of statistical box.void
setStatFont(java.awt.Font f)
Set position for the current statistical boxvoid
setTicColor(java.awt.Color c)
Sets the color used by the labels drawn at each tick (for all axes).void
setTicFont(java.awt.Font f)
Sets the color used by the labels drawn at each tick (for all axises).void
setTicStyle(int axis, java.awt.Font f, java.awt.Color c)
Sets the color used by the labels drawn at each tick.void
update()
Update the current canvas.void
updateAll()
Refresh all the plots on the same canvas HPLOTvoid
visible()
Set the canvas frame visiblevoid
visible(boolean vs)
Set the canvas frame visible or not-
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
HPlotter
public HPlotter(java.lang.String title, int xsize, int ysize, int n1, int n2)
Create HPlot canvas with several plots.- Parameters:
title
- Titlexsize
- size in x directionysize
- size in y directionn1
- number of plots/graphs in xn2
- number of plots/graphs in y
-
HPlotter
public HPlotter(java.lang.String title, int xs, int ys)
Construct a HPlot canvas with a single plot.- Parameters:
title
- Title for the canvasxs
- size in xys
- size in y
-
HPlotter
public HPlotter(java.lang.String title, int xs, int ys, boolean set)
Construct a HPlot canvas with a single plot.- Parameters:
title
- Title for the canvasxs
- size in xys
- size in yset
- set or not the graph (boolean)
-
HPlotter
public HPlotter(java.lang.String title)
Construct a HPlot canvas with a plot with the size 600x400.- Parameters:
title
- Title
-
HPlotter
public HPlotter()
Construct a HPlot canvas with a single plot with the size 600x400.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent actionEvent)
Actions- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
createRegion
public void createRegion(double x, double y, double w, double h)
Create a new plotting region- Parameters:
x
- X positiony
- Y positionw
- widthh
- height
-
cd
public boolean cd(int cols, int rows)
Navigate to a selected plot. This is necessary if there are a several plots on the same canvas.- Parameters:
cols
- Set the location of the current plot in x (horizontal)rows
- Set the location of the current plot in y (vertical)return
- false if error.
-
getCdX
public int getCdX()
Get location of the graph in the main canvas in X- Returns:
- location of the graph in X
-
getCdY
public int getCdY()
Get location of the graph on the main canvas in Y- Returns:
- location in Y
-
getNtotX
public int getNtotX()
Get the total number of graphs in X- Returns:
- Total number of graphs in X
-
getNtotY
public int getNtotY()
Get the total number of the graphs in Y- Returns:
- Total number of graphs in Y
-
visible
public void visible(boolean vs)
Set the canvas frame visible or not- Parameters:
vs
- (boolean) true: visible, false: not visible
-
visible
public void visible()
Set the canvas frame visible
-
getPlotter
public IPlotter getPlotter()
Return JAS plotter- Returns:
-
updateAll
public void updateAll()
Refresh all the plots on the same canvas HPLOT
-
update
public void update()
Update the current canvas.
-
export
public void export(java.lang.String file)
Fast export of the canvas to an image file (depends on the extension, i.e. PNG, PDF, EPS, PS). No questions will be asked, an existing file will be rewritten- Parameters:
file
- Output file with the proper extension. If no extension, PNG file is assumed.
-
doc
public void doc()
Show online documentation.
-
getTitle
public java.lang.String getTitle()
Return title of this plotter.- Overrides:
getTitle
in classjava.awt.Frame
- Returns:
-
close
public void close()
Close the canvas (and dispose all components).
-
draw
public void draw(H1D h1, IPlotterStyle style)
Plot 1D histogram. Use external graphical options from Jaida.- Parameters:
h1
- Input H1D histogramstyle
- Plotter style.
-
draw
public void draw(H2D h2, IPlotterStyle style)
Plot 2D histogram. Use external graphical options from Jaida.- Parameters:
h2
- Input H2D histogramstyle
- Plotter style.
-
draw
public void draw(H2D h2, java.lang.String style_str)
Plot 2D histogram. Use external graphical options from Jaida as strings: ColorMap, style2D, Box.- Parameters:
h2
- Input H2D histogramstyle
- Plotter style as a string: ColorMap, style2D, Box
-
draw
public void draw(H1D h1)
Plot 1D histogram. Use graphical options of H1D histogram to use some style.- Parameters:
h1
- Input H1D histogram
-
draw
public void draw(Histogram1D h1, IPlotterStyle style)
Draw Aida histogram with some plotter style- Parameters:
h1
- input Aida histogramstyle
- style
-
draw
public void draw(Histogram2D h2, IPlotterStyle style)
Draw 2D Aida histogram with some plotter style- Parameters:
h1
- input Aida histogramstyle
- style
-
draw
public void draw(Histogram1D h1)
Draw Aida histogram with default style- Parameters:
h1
- Aida histogramdatastyle
- data style
-
draw
public void draw(Histogram1D h1, IDataStyle datastyle)
Draw Aida histogram with some data style- Parameters:
h1
- Aida histogramdatastyle
- data style
-
draw
public void draw(Histogram2D h2, IDataStyle datastyle)
Draw 2D Aida histogram with some dat style- Parameters:
h2
- Aida histogramdatastyle
- data style
-
draw
public void draw(H2D h2)
Draw 2D histogram as a density plot.- Parameters:
h2
- Input H2D histogram
-
draw
public void draw(Histogram2D h2)
Draw 2D histogram as a density plot.- Parameters:
h2
- Input 2D histogram
-
draw
public void draw(IDataPointSet p1d)
Plot AIDA data points.- Parameters:
p1d
- input data points.
-
getPlotterStyle
public IPlotterStyle getPlotterStyle()
Get current plotter style.- Returns:
-
getDataStyle
public IDataStyle getDataStyle()
Get current data style.- Returns:
-
draw
public void draw(IDataPointSet p1d, IPlotterStyle style)
Draw Aida data set with some style- Parameters:
p1d
- Aida data setstyle
- style
-
draw
public void draw(IDataPointSet p1d, IDataStyle datastyle)
Draw Aida data set with some data style- Parameters:
p1d
-datastyle
-
-
draw
public void draw(P1D p1d)
Plot data points- Parameters:
p1d
- input data points.
-
draw
public void draw(F1D f1d)
Draw a function. F1D should be created from AIDA.- Parameters:
f1d
- input function;
-
draw
public void draw(IFunction f1d)
Draw a function using AIDA.- Parameters:
f1d
- input function;
-
draw
public void draw(IFunction f1d, IPlotterStyle style)
Draw Aida data set with some style- Parameters:
f1d
- function.style
- style
-
draw
public void draw(IFunction f1d, IDataStyle datastyle)
Draw Aida function with some data style- Parameters:
f1d
- function.datastyle
-
-
draw
public void draw(Cloud1D c1d)
Draw a cloud using AIDA.- Parameters:
c1d
- input cloud;
-
draw
public void draw(Cloud1D c1d, IPlotterStyle style)
Draw Aida cloud with some style.- Parameters:
c1d
- cloud.style
- style
-
draw
public void draw(Cloud1D c1d, IDataStyle datastyle)
Draw Aida cloud with some data style- Parameters:
c1d
- cloud.datastyle
-
-
draw
public void draw(Cloud2D c2d)
Draw Aida 2D cloud- Parameters:
c2d
- 2D cloud
-
draw
public void draw(Cloud2D c2d, IPlotterStyle style)
Draw Aida 2D cloud with some style- Parameters:
c2d
- cloud.style
- style
-
draw
public void draw(Cloud2D c2d, IDataStyle datastyle)
Draw Aida cloud with some data style- Parameters:
c2d
- cloud.datastyle
-
-
setBackgColor
public void setBackgColor(java.awt.Color c)
Sets the actual background color for current plot region.- Parameters:
c
- background color.
-
setStatBox
public void setStatBox(boolean set)
Set statistical box to the current draw area (navigated with the cd() method.- Parameters:
set
- true if set.
-
getStatBoxStyle
public IStatisticsBoxStyle getStatBoxStyle()
Get statistical box of the current draw area (navigated with the cd() method).
-
getLegendStyle
public ILegendBoxStyle getLegendStyle()
Get legend box of the current draw area (navigated with the cd() method).
-
getRegionStyle
public IPlotterStyle getRegionStyle()
Get style of the current plotting region.
-
getAxisStyle
public IAxisStyle getAxisStyle(int axis)
Return style of axis of the current region- Parameters:
axis
- 0 for X, 1 for Y, 2 for Z- Returns:
-
setStatColor
public void setStatColor(java.awt.Color foreg, java.awt.Color backg)
Set colors of statistical box.- Parameters:
foreg
- foreground color;backg
- background color;
-
setStatFont
public void setStatFont(java.awt.Font f)
Set position for the current statistical box- Parameters:
x
- X positiony
- Y position
-
setStatBoxPos
public void setStatBoxPos(double x, double y)
Set position for the current statistical box- Parameters:
x
- X positiony
- Y position
-
setLegendPos
public void setLegendPos(double x, double y)
Set position for the current statistical box- Parameters:
x
- X positiony
- Y position
-
setLegend
public void setLegend(boolean set)
Sets whether or not to draw the legend for the current plot.- Parameters:
set
- true if you want to show the legend.
-
setLegendFont
public void setLegendFont(java.awt.Font f)
Set legend fonts- Parameters:
x
- X positiony
- Y position
-
getStyle
public IPlotterStyle getStyle()
Get style of the current graph.- Returns:
-
setAutoRange
public void setAutoRange()
Set autorange in X and Y at the same time for the current plot
-
setAutoRange
public void setAutoRange(boolean b)
Set autorange in X and Y at the same time- Parameters:
b
- if true, sets autorange
-
setRange
public void setRange(int axis, double min, double max)
Sets the range (min-max) displayed on the axis for the current plot.
-
setRangeX
public void setRangeX(double min, double max)
Sets the range (min-max) displayed on X- Parameters:
min
- minimum value on the axismax
- maximum value on the axis
-
setRangeY
public void setRangeY(double min, double max)
Sets the range (min-max) displayed on Y- Parameters:
min
- minimum value on the axismax
- maximum value on the axis
-
setRangeAll
public void setRangeAll(int axis, double min, double max)
Sets the range (min-max) displayed on all axises.
-
setRange
public void setRange(double minX, double maxX, double minY, double maxY)
Sets the range for the current plot- Parameters:
minX
- Min value in XmaxX
- Max value in XminY
- Min value in YmaxY
- Max value in Y
-
setRangeAll
public void setRangeAll(double minX, double maxX, double minY, double maxY)
Sets the range for all plots- Parameters:
minX
- Min value in XmaxX
- Max value in XminY
- Min value in YmaxY
- Max value in Y
-
setParAxis
public boolean setParAxis(int axis, java.lang.String par, java.lang.String opt)
Set parameters for the axis using strings- Parameters:
axis
- axis 0=X, 1=Ypar
- parameter nameopt
- option name- Returns:
- true if no error
-
setParRegion
public boolean setParRegion(int axis, java.lang.String par, java.lang.String opt)
Set parameters for the current region.- Parameters:
axis
- axis 0=X, 1=Ypar
- parameter nameopt
- option name- Returns:
- true if no error
-
getParAxis
public java.util.List<java.lang.String> getParAxis()
Get available parameters for axis.- Returns:
- list of parameters to set style
-
getOptRegion
public java.util.List<java.lang.String> getOptRegion(java.lang.String parameter)
Get options for available parameters of the plotting region.- Parameters:
parameter
- input parameter- Returns:
-
getOptAxis
public java.util.List<java.lang.String> getOptAxis(java.lang.String parameter)
Get options for available parameters- Parameters:
parameter
- input parameter- Returns:
-
setGTitle
public void setGTitle(java.lang.String sname, java.awt.Font f, java.awt.Color c)
Set global title and its attributes- Parameters:
sname
- namef
- fontc
- color
-
setGTitle
public void setGTitle(java.lang.String sname, java.awt.Color c)
Set the global title with default attributes. The default color is black. The default font is ("Arial", Font.BOLD, 20)- Parameters:
sname
- Title
-
getSizeX
public int getSizeX()
Get the width of the main panel which keeps all margins and the central panel (in pixels)- Returns:
- size in X direction (width)
-
getSizeY
public int getSizeY()
Get the height of the main panel which keeps all margins and the central panel (in pixels)- Returns:
- size in Y direction (height)
-
setGTitle
public void setGTitle(java.lang.String sname)
Set the global title with default attributes. The default color is black. The default font is ("Arial", Font.BOLD, 18)- Parameters:
sname
- Title
-
distroy
public void distroy()
Close the frame (as close).
-
clear
public void clear(int i1, int i2)
Clear the graph characterised by an index in X and Y. This method cleans the data and all graph settings.- Parameters:
i1
- location of the graph in Xi2
- location of the graph in Y
-
setNameX
public void setNameX(java.lang.String s)
Sets the name for X axis. The color is black, the font is ("Arial", Font.BOLD, 14)- Parameters:
s
- Title for X axis.
-
setBackgColorGraph
public void setBackgColorGraph(java.awt.Color c)
Sets the background color of the current graph. This is the area between the axes (hence not the entire panel area).- Parameters:
c
- color.
-
setLogScale
public void setLogScale(int axis, boolean b)
Sets true or false to plot on a log scale.
-
setNameX
public void setNameX(java.lang.String s, java.awt.Font f)
Sets the name for X axis. The color is black, the font is ("Arial", Font.BOLD, 14)- Parameters:
s
- Title for X axis.f
- Font
-
setNameX
public void setNameX(java.lang.String s, java.awt.Font f, java.awt.Color c)
Set the label for the axis in X for the current region.- Parameters:
s
- label titlef
- Fontc
- Color
-
getMinValue
public double getMinValue(int axis)
Returns the minimum data value for the specified axis.
-
getMaxValue
public double getMaxValue(int axis)
Returns the maximum data value for the specified axis.
-
getParPlotter
public java.util.List<java.lang.String> getParPlotter()
Get available parameters for this canvas.- Returns:
- list of fonts
-
getParRegion
public java.util.List<java.lang.String> getParRegion()
Get available parameters for this canvas.- Returns:
- list of fonts
-
getTextFonts
public java.util.List<java.lang.String> getTextFonts()
Get available fonts to draw text- Returns:
- list of fonts
-
getParText
public java.util.List<java.lang.String> getParText()
Get available parameters to draw text- Returns:
- list of parameters
-
setNameY
public void setNameY(java.lang.String s)
Sets the name for Y axis. The color is black, the font is ("Arial", Font.BOLD, 14)- Parameters:
s
- Title for Y axis.
-
setNameY
public void setNameY(java.lang.String s, java.awt.Font f)
Sets the name for Y axis. The color is black, the font is ("Arial", Font.BOLD, 14)- Parameters:
s
- Title for Y axis.f
- Font
-
setNameY
public void setNameY(java.lang.String s, java.awt.Font f, java.awt.Color c)
Sets the Title for Y-axis- Parameters:
s
- Label namef
- Fontc
- Color
-
setName
public void setName(java.lang.String name)
Sets a title for the current plot. The default color is black, the font is ("Arial", Font.BOLD, 18),- Overrides:
setName
in classjava.awt.Component
- Parameters:
name
- Title
-
setName
public void setName(java.lang.String s, java.awt.Font f, java.awt.Color c)
Sets a title for the current plot with all attributes- Parameters:
s
- Titlef
- Fontc
- Color
-
setName
public void setName(java.lang.String s, java.awt.Font f)
Sets a title for the current plot with all attributes- Parameters:
s
- Titlef
- Font
-
setTicStyle
public void setTicStyle(int axis, java.awt.Font f, java.awt.Color c)
Sets the color used by the labels drawn at each tick.
-
setTicColor
public void setTicColor(java.awt.Color c)
Sets the color used by the labels drawn at each tick (for all axes).- Parameters:
c
- the new color for each axis.
-
setTicFont
public void setTicFont(java.awt.Font f)
Sets the color used by the labels drawn at each tick (for all axises).- Parameters:
c
- the new color for each axis.
-
getAxesColor
public java.awt.Color getAxesColor()
Returns the actual color of the axes of the graph.- Returns:
- actual color used to draw the axes.
-
setAxesColor
public void setAxesColor(java.awt.Color c)
Sets the actual color of the axes of the graph.- Parameters:
c
- new color to draw the axes.
-
-
DMelt 3.0 © DataMelt by jWork.ORG