jhplot
Class HPlotJa

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jhplot.HPlotJa
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
SHPlotJa

public class HPlotJa
extends javax.swing.JComponent

A canvas to display all graphical objects including Feynman diagrams. Can be used for drawing Feynman diagrams using JaxoDraw, H1D, P1D and H2D objects.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int Exponent
           
static java.lang.String JAVA_CLASSPATH
          The current Java class path.
static java.lang.String JAVA_HOME
          The directory where Java is installed on the current machine.
static java.lang.String JAVA_RUNTIME_VERSION
          The current Java runtime version.
static java.lang.String JAVA_VERSION
          The current Java version.
static int Key
           
static int LabelX
           
static int LabelY
           
static java.lang.String OS_ARCH
          The architecture of the current operating system.
static java.lang.String OS_NAME
          The name of the current operating system.
static java.lang.String OS_VERSION
          The version of the current operating system.
static java.lang.String PREFS_FILENAME
          The file where user-selected preferences will be stored.
static int StatBox
           
static int Title
           
static java.lang.String USER_HOME
          The current user's home directory.
static java.lang.String USER_NAME
          The current user.
static java.lang.String VERSION
          The current version of japlot.jaxodraw.
static java.lang.String VERSION_NUMBER
          The version number of this release of japlot.jaxodraw.
static java.lang.String WEB_SITE
          The japlot.jaxodraw web site.
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HPlotJa()
          Default constructor
HPlotJa(java.lang.String title)
          Construct a japlot.jaxodraw canvas with a plot with the default parameters 600 by 400, and 10% space for the global title
HPlotJa(java.lang.String title, int n1, int n2)
          Construct a japlot.jaxodraw with a single plot/graph.
HPlotJa(java.lang.String title, int xsize, int ysize, int n1, int n2)
          Create HPlotJa canvas with several pads and axes.
HPlotJa(java.lang.String title, int xsize, int ysize, int n1, int n2, boolean setgraph)
          Create HPlotJa canvas with several pads.
 
Method Summary
 void add(JaObject ob)
          Add an object to the frame
 void addKey(jplot.DataArray data, int padx, int pady)
           
 void addStatBox(int padx, int pady)
           
 void addToBack(JaObject ob)
          Add an object to background.
 void addToFront(JaObject ob)
          Add an object to foreground.
 hep.aida.IAnalysisFactory analF()
          Return IAnalysisFactory associated with the plot
 void buildPads(int n1, int n2)
          Build axes frames and show them.
 void cd(int cols, int rows)
          Navigate to a selected plot.
 void clearAll()
          Clear the canvas from all objects
 void clearAllData()
          Clear all data from all graphs.
 void clearData()
          Clear the axis frame from the data for the current pad.
 void clearData(int padx, int pady)
          Clear the axis frame from the data
 void close()
          Close the canvas (and dispose all components).
 void doc()
          Show online documentation.
 void draw(jplot.DataArray inputDA, java.lang.String title)
          Draw data represented by DataArray on the current pad.
 void draw(F1D f1)
          Draw an one-dimensional function on the current pad.
 void draw(F1D[] f)
          Draw array of F1D holders
 void draw(F1D f1, int padx, int pady)
          Draw an one-dimensional function on the current pad.
 void draw(FND f1)
          Draw an one-dimensional function on the current pad.
 void draw(FND f1, int padx, int pady)
          Draw an one-dimensional function on the current pad.
 void draw(H1D h1)
          Draw H1D histogram on the current pad.
 void draw(H1D h1, int padx, int pady)
          Draw H1D histogram on pad X and pad Y
 void draw(H2D h2d)
          Draw H2D histogram on the current pad.
 void draw(H2D h2, int padx, int pady)
          Draw 2D histogram on pads given by X and Y
 void draw(JaObject jo)
          Draw JaObject.
 void draw(P1D p1d)
          Draw H2D histogram on the current pad.
 void draw(P1D[] d)
          Draw array of P1D holders
 void draw(P1D p1d, int padx, int pady)
          Draw P1D object on the pad
 void export(java.lang.String file)
          Fast export of the canvas to an image file (depends on the extension, i.e.
 void factories()
          Create various JAIDA factories: IAnalysisFactory, ITree, IFitFactory, IFunctionFactory
 int fit(H1D h1, java.lang.String predefFunc, java.lang.String method)
          Fit 1D histogram with the function F1D
 hep.aida.IFitFactory fitF()
          Return FitFactory associated with the plot
 hep.aida.IFunctionFactory funcF()
          Return FunctionFactory associated with the plot
 java.util.ArrayList getArrayList()
          Get list of all objects on the frame.
 int getCdX()
          Get location of the graph in the main canvas in X
 int getCdY()
          Get location of the graph on the main canvas in Y
static java.lang.String getCurDir()
          Returns the current working directory.
 java.util.Vector<jplot.DataArray> getData()
          Get the vector which keeps all the data
 JaAxes getJaAxes()
          Get the current JaAxes frame
 double getKeyTextSpace()
          Get current space between the key symbol and the text for legends
 JaText[][] getLabelX()
          Get labels on X
 double getLabelXshift()
          Get distance between X axis and label
 JaText[][] getLabelY()
          Get label on Y
 double getLabelYshift()
          Distance between an axis and a Y label
 double getMarginBottom()
          Get size of bottom margin
 double getMarginLeft()
          Get margin from left side
 double getMarginRight()
          Get margin from right
 double getMarginTop()
          Get the size of the top margin
 double getMarginX()
          Get margin in X between pads
 double getMarginY()
          Get space between any 2 plots in Y
 int getNtotX()
          Get the total number of graphs in X
 int getNtotY()
          Get the total number of the graphs in Y
 JaAxes getPad()
          Get current pad
 JaAxes getPad(int n1, int n2)
          Get pad characterised by n1 and n2
static void getPreferences()
          Checks whether preferences have been saved from an earlier session and if yes, imports them.
 int getSizeX()
          get X size
 int getSizeY()
          get Y size
 java.lang.String[] getStatistics(H1D h1)
          Get statistics in form of strings
 java.lang.String[] getStatistics(P1D h1)
          Get strings representing the statistics for the given object
static int getSymbol(jplot.DataArray d)
           
 hep.aida.IHistogramFactory histF()
          Return IHistogramFactory associated with the plot
 boolean isShowStatBox()
          Is stat box is shown on the current pad?
static void main(java.lang.String[] args)
          The main method of japlot.jaxodraw: determines system properties, preferences and command line arguments, before bringing up the graphical user interface.
 void removeAxes()
          remove X and Y axes, tics, axis labels on the current plot.
 void removeObject(int type, int padx, int pady)
          Remove a particular object
 void setAntiAlias(boolean setit)
          Set antialiasing for the graphics of the current plot
 void setAutoRange()
          Set autorange in X and Y at the same time for the current plot
 void setAutoRange(boolean b)
          Set autorange in X and Y at the same time
 void setAutoRange(int axis, boolean b)
          Sets true or false to use automatic scaling for the current plot.
 void setAutoRangeAll()
          Set autorange in X and Y at the same time for all plots
 void setAutoRangeAll(boolean b)
          Set auto-range in X and Y at the same time for all plots
 void setAutoRangeAll(int axis, boolean b)
          Sets true or false to use automatic scaling for all plots.
 void setAxesFrame(int n1, int n2)
          Set axes frames or pads.
 void setAxisAll(boolean show)
          Sets whether all axis lines will be drawn or not.
static void setCurDir(java.lang.String newDir)
          Sets the current working directory.
 void setGridAll(int axis, boolean b)
          Sets or not the grid lines for all plots on the same canvas
 void setGTitle(java.lang.String sname)
          Set the global title with default attributes.
 void setGTitle(java.lang.String sname, java.awt.Color color)
          Set the global title with default attributes.
 void setGTitle(java.lang.String sname, java.awt.Font f)
          Sets the global title using black color.
 void setGTitle(java.lang.String sname, java.awt.Font f, java.awt.Color c)
          Sets the global title
 void setKeyTextSpace(double space)
          Set space between the key symbol and the text in a legend.
 void setLabelX(java.lang.String label, int n1, int n2)
          Sets a label for X at the default location
 void setLabelXshift(double labelXshift)
          Distance between an axis and a X label
 void setLabelY(JaText[][] labelY)
          Set labels on Y
 void setLabelY(java.lang.String label, int n1, int n2)
           
 void setLabelYshift(double labelYshift)
          Distance between an axis and a Y label
 void setLegendFont(java.awt.Font font)
          Sets the actual font of the legend.
 void setLegendFont(java.lang.String name)
          Set the label font, which is used for axis labels and legend labels.
 void setLocationAtCenter(JaText text)
          Sets the location of a text object at the center of the canvas
 void setLogScale(int axis, boolean b)
          Sets true or false to plot on a log scale.
 void setMarginBottom(double marginBottom)
          Margin from bottom.
 void setMarginLeft(double marginLeft)
          Margin from left
 void setMarginRight(double marginRight)
          Set margin from right
 void setMarginTop(double marginTop)
          Margin from top
 void setMarginX(double marginX)
          Margin in X between pads
 void setMarginY(double marginY)
          Margin in Y between pads
 void 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
 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)
          Set the label for the axis in Y
 void setRange(double minX, double maxX, double minY, double maxY)
          Set ranges on X and Y on the current pad.
 void setRangeX(double min, double max)
          Set range on X.
 void setRangeX(double min, double max, int padx, int pady)
          Set X range on pad defined by x and y on the canvas.
 void setRangeY(double min, double max)
          Set range on Y on the current pad.
 void setRangeY(double min, double max, int padx, int pady)
          Set Y range on pad defined by x and y on the canvas.
 void setShowStatBox(boolean showStatBox)
          Show a box with statistics (only for last plotted object) on the current pad
 void setStatBox(java.lang.String[] label, int n1, int n2)
           
 void setTicFont(java.awt.Font font)
          Sets the font used by the labels drawn at each tick.
 void showAxis(int axis)
          Show a particular axis (no mirror)
 void showBrowser(java.lang.String file)
          Show a browser with objects loaded from ROOT or AIDA objects.
 void showEditor()
          Show object editor on the left of the canvas.
 void showEditor(boolean show)
          Show object editor (or not)
 void showKey(boolean show)
          Show or not keys for the current plot
 hep.aida.ITree treeF()
          Return TreeFactory associated with the plot
 void update()
          Update the canvas by repainting all objects
 void visible()
          Set the canvas frame visible
 void visible(boolean vs)
          Set the canvas frame visible or not
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LabelX

public static final int LabelX
See Also:
Constant Field Values

LabelY

public static final int LabelY
See Also:
Constant Field Values

Title

public static final int Title
See Also:
Constant Field Values

StatBox

public static final int StatBox
See Also:
Constant Field Values

Exponent

public static final int Exponent
See Also:
Constant Field Values

Key

public static final int Key
See Also:
Constant Field Values

VERSION_NUMBER

public static final java.lang.String VERSION_NUMBER
The version number of this release of japlot.jaxodraw.

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
The current version of japlot.jaxodraw.

See Also:
Constant Field Values

WEB_SITE

public static final java.lang.String WEB_SITE
The japlot.jaxodraw web site.

See Also:
Constant Field Values

USER_NAME

public static final java.lang.String USER_NAME
The current user.


USER_HOME

public static final java.lang.String USER_HOME
The current user's home directory.


OS_NAME

public static final java.lang.String OS_NAME
The name of the current operating system.


OS_ARCH

public static final java.lang.String OS_ARCH
The architecture of the current operating system.


OS_VERSION

public static final java.lang.String OS_VERSION
The version of the current operating system.


JAVA_VERSION

public static final java.lang.String JAVA_VERSION
The current Java version.


JAVA_RUNTIME_VERSION

public static final java.lang.String JAVA_RUNTIME_VERSION
The current Java runtime version.


JAVA_HOME

public static final java.lang.String JAVA_HOME
The directory where Java is installed on the current machine.


JAVA_CLASSPATH

public static final java.lang.String JAVA_CLASSPATH
The current Java class path.


PREFS_FILENAME

public static java.lang.String PREFS_FILENAME
The file where user-selected preferences will be stored.

Constructor Detail

HPlotJa

public HPlotJa(java.lang.String title,
               int xsize,
               int ysize,
               int n1,
               int n2,
               boolean setgraph)
Create HPlotJa canvas with several pads.

Parameters:
title - Title
xsize - size in x direction
ysize - size in y direction
n1 - number of plots/graphs in x
n2 - number of plots/graphs in y
setgraph - true if initials graph with axes should be set Set to false if you want just empty canvas.

HPlotJa

public HPlotJa(java.lang.String title,
               int xsize,
               int ysize,
               int n1,
               int n2)
Create HPlotJa canvas with several pads and axes.

Parameters:
title - Title
xsize - size in x direction
ysize - size in y direction
n1 - number of plots/graphs in x
n2 - number of plots/graphs in y

HPlotJa

public HPlotJa(java.lang.String title,
               int n1,
               int n2)
Construct a japlot.jaxodraw with a single plot/graph. It uses 10% of the space from the top for the global title

Parameters:
title - title for the canvas
n1 - pads in X
n2 - pads in Y

HPlotJa

public HPlotJa(java.lang.String title)
Construct a japlot.jaxodraw canvas with a plot with the default parameters 600 by 400, and 10% space for the global title

Parameters:
title - Title

HPlotJa

public HPlotJa()
Default constructor

Method Detail

setAxesFrame

public void setAxesFrame(int n1,
                         int n2)
Set axes frames or pads. Before creating pad, clear the canvas, i.e. call clearAll(0 and clearData(). One should also call update() to show the pads.

Parameters:
n1 - number of pads in X
n2 - number of pads in Y

buildPads

public void buildPads(int n1,
                      int n2)
Build axes frames and show them. In fact, it calls the methods: clearAllData(); clearAll(); setAxesFrame(n1,n2); update();.

Parameters:
n1 - number of pads in X
n2 - number of pads in Y

cd

public void 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
rows - Set the location of the current plot in y

getCdX

public int getCdX()
Get location of the graph in the main canvas in X

Returns:
location of the graph in X

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

getCdY

public int getCdY()
Get location of the graph on the main canvas in Y

Returns:
location in Y

getJaAxes

public JaAxes getJaAxes()
Get the current JaAxes frame

Returns:
frame

add

public void add(JaObject ob)
Add an object to the frame

Parameters:
ob - input object

addToBack

public void addToBack(JaObject ob)
Add an object to background.

Parameters:
ob - input object

addToFront

public void addToFront(JaObject ob)
Add an object to foreground.

Parameters:
ob - input object

clearAll

public void clearAll()
Clear the canvas from all objects


clearAllData

public void clearAllData()
Clear all data from all graphs.


clearData

public void clearData(int padx,
                      int pady)
Clear the axis frame from the data

Parameters:
padx - No of pads in X
pady - No of pads in Y

removeObject

public void removeObject(int type,
                         int padx,
                         int pady)
Remove a particular object

Parameters:
type - type of this object
padx - pad
pady - pad

getArrayList

public java.util.ArrayList getArrayList()
Get list of all objects on the frame.


clearData

public void clearData()
Clear the axis frame from the data for the current pad.


update

public void update()
Update the canvas by repainting all objects


close

public void close()
Close the canvas (and dispose all components).


setLocationAtCenter

public void setLocationAtCenter(JaText text)
Sets the location of a text object at the center of the canvas

Parameters:
text - input text object

setAxisAll

public void setAxisAll(boolean show)
Sets whether all axis lines will be drawn or not.

Parameters:
show - toggle, true if the axis should be drawn.

removeAxes

public void removeAxes()
remove X and Y axes, tics, axis labels on the current plot.


showAxis

public void showAxis(int axis)
Show a particular axis (no mirror)

Parameters:
axis - 0 for X, 1 for Y

setGridAll

public void setGridAll(int axis,
                       boolean b)
Sets or not the grid lines for all plots on the same canvas

Parameters:
axis - Axis (0 means X, 1 means Y)
b - true is grid is shown

setLabelX

public void setLabelX(java.lang.String label,
                      int n1,
                      int n2)
Sets a label for X at the default location

Parameters:
label - current label
n1 - pad position in X
n2 - pad position in Y

setStatBox

public void setStatBox(java.lang.String[] label,
                       int n1,
                       int n2)

setLabelY

public void setLabelY(java.lang.String label,
                      int n1,
                      int n2)

getPreferences

public static void getPreferences()
Checks whether preferences have been saved from an earlier session and if yes, imports them.


getSizeX

public int getSizeX()
get X size


getSizeY

public int getSizeY()
get Y size


getCurDir

public static java.lang.String getCurDir()
Returns the current working directory.

Returns:
The current working directory.

setCurDir

public static void setCurDir(java.lang.String newDir)
Sets the current working directory.

Parameters:
newDir - The new working directory.

setRangeX

public void setRangeX(double min,
                      double max)
Set range on X. Call update method to redraw.

Parameters:
min - min value on X
max - max value ob X

setRangeY

public void setRangeY(double min,
                      double max)
Set range on Y on the current pad. Call update method to redraw.

Parameters:
min - min value on Y
max - max value on Y

setRange

public void setRange(double minX,
                     double maxX,
                     double minY,
                     double maxY)
Set ranges on X and Y on the current pad. Call update method to redraw.

Parameters:
minX - min value on X
maxX - max value on X
minY - min value on Y
maxY - max value on Y

setRangeX

public void setRangeX(double min,
                      double max,
                      int padx,
                      int pady)
Set X range on pad defined by x and y on the canvas.

Parameters:
min - Min value on X
max - Max vallue on X
padx - pad in X
pady - pad in Y

setRangeY

public void setRangeY(double min,
                      double max,
                      int padx,
                      int pady)
Set Y range on pad defined by x and y on the canvas.

Parameters:
min - Min value on Y
max - Max vallue on Y
padx - pad in X
pady - pad in Y

setLogScale

public void setLogScale(int axis,
                        boolean b)
Sets true or false to plot on a log scale.

Parameters:
axis - defines to which axis this function applies (0 if X, 1 if Y).
b - toggle, true if the scaling is logarithmic

setTicFont

public void setTicFont(java.awt.Font font)
Sets the font used by the labels drawn at each tick.

Parameters:
font - the new font

showBrowser

public void showBrowser(java.lang.String file)
Show a browser with objects loaded from ROOT or AIDA objects. ROOT file is assumed to have the extension .root, while AIDA file should have the extension .aida or .xml

Parameters:
file - String representing the full path to the file.

showEditor

public void showEditor()
Show object editor on the left of the canvas.


showEditor

public void showEditor(boolean show)
Show object editor (or not)

Parameters:
show - true then show it

export

public void export(java.lang.String file)
Fast export of the canvas to an image file (depends on the extension, i.e. PNG, JPG, 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.

getPad

public JaAxes getPad()
Get current pad

Returns:
pad

getKeyTextSpace

public double getKeyTextSpace()
Get current space between the key symbol and the text for legends

Returns:
space defined in NDC

setKeyTextSpace

public void setKeyTextSpace(double space)
Set space between the key symbol and the text in a legend.

Parameters:
space - space to be set in NDC

getPad

public JaAxes getPad(int n1,
                     int n2)
Get pad characterised by n1 and n2

Parameters:
n1 - location of pad in X
n2 - location of pad in Y
Returns:
pad

setMarginBottom

public void setMarginBottom(double marginBottom)
Margin from bottom.

Parameters:
marginBottom -

getMarginBottom

public double getMarginBottom()
Get size of bottom margin

Returns:
size

setMarginLeft

public void setMarginLeft(double marginLeft)
Margin from left

Parameters:
marginLeft -

getMarginLeft

public double getMarginLeft()
Get margin from left side

Returns:
marginLeft

setMarginRight

public void setMarginRight(double marginRight)
Set margin from right

Parameters:
marginRight -

getMarginRight

public double getMarginRight()
Get margin from right

Returns:
marginRight

setAntiAlias

public void setAntiAlias(boolean setit)
Set antialiasing for the graphics of the current plot

Parameters:
setit - true if antialiasing is set

setLegendFont

public void setLegendFont(java.awt.Font font)
Sets the actual font of the legend.

Parameters:
font - new font to draw the legend.

setLegendFont

public void setLegendFont(java.lang.String name)
Set the label font, which is used for axis labels and legend labels. The font names understood are those understood by java.awt.Font.decode().

Parameters:
name - A font name.

setMarginTop

public void setMarginTop(double marginTop)
Margin from top

Parameters:
marginTop -

getMarginTop

public double getMarginTop()
Get the size of the top margin

Returns:
top margin

setMarginX

public void setMarginX(double marginX)
Margin in X between pads

Parameters:
marginX -

getMarginX

public double getMarginX()
Get margin in X between pads

Returns:
margin in X

setMarginY

public void setMarginY(double marginY)
Margin in Y between pads

Parameters:
marginY - space in Y between pads

getMarginY

public double getMarginY()
Get space between any 2 plots in Y

Returns:
space between plots in Y

setLabelXshift

public void setLabelXshift(double labelXshift)
Distance between an axis and a X label

Parameters:
labelXshift - distance

setLabelYshift

public void setLabelYshift(double labelYshift)
Distance between an axis and a Y label

Parameters:
labelYshift - distance

getLabelXshift

public double getLabelXshift()
Get distance between X axis and label

Returns:

getLabelYshift

public double getLabelYshift()
Distance between an axis and a Y label

Parameters:
labelXshift - distance

getLabelY

public JaText[][] getLabelY()
Get label on Y

Returns:

setLabelY

public void setLabelY(JaText[][] labelY)
Set labels on Y

Parameters:
labelY -

getLabelX

public JaText[][] getLabelX()
Get labels on X

Returns:

draw

public void draw(H1D h1,
                 int padx,
                 int pady)
Draw H1D histogram on pad X and pad Y

Parameters:
h1 - input histogram
padx - No of pads in X
pady - No of pads in Y

showKey

public void showKey(boolean show)
Show or not keys for the current plot

Parameters:
show - true if shown

addKey

public void addKey(jplot.DataArray data,
                   int padx,
                   int pady)

setShowStatBox

public void setShowStatBox(boolean showStatBox)
Show a box with statistics (only for last plotted object) on the current pad

Parameters:
showStatBox -

isShowStatBox

public boolean isShowStatBox()
Is stat box is shown on the current pad?

Returns:
true if shown

addStatBox

public void addStatBox(int padx,
                       int pady)

getSymbol

public static int getSymbol(jplot.DataArray d)

draw

public void draw(H2D h2,
                 int padx,
                 int pady)
Draw 2D histogram on pads given by X and Y

Parameters:
h2 - input hitogram
padx - index of pad in X
pady - index of pad in Y

setGTitle

public void setGTitle(java.lang.String sname,
                      java.awt.Font f,
                      java.awt.Color c)
Sets the global title

Parameters:
sname - Title
f - Font
c - Color

setGTitle

public void setGTitle(java.lang.String sname,
                      java.awt.Font f)
Sets the global title using black color.

Parameters:
sname - Title name
f - Font

setGTitle

public void setGTitle(java.lang.String sname)
Set the global title with default attributes. The default color is black. The default font is ("Lucida Sans", Font.BOLD, 20)

Parameters:
sname - Title

setGTitle

public void setGTitle(java.lang.String sname,
                      java.awt.Color color)
Set the global title with default attributes. The default color is black. The default font is ("Lucida Sans", Font.BOLD, 20)

Parameters:
sname - Title
color - Color of the title

setNameX

public void setNameX(java.lang.String s,
                     java.awt.Font f,
                     java.awt.Color c)
Set the label for the axis in X

Parameters:
s - label title
f - Font
c - Color

setNameX

public void setNameX(java.lang.String s)
Sets the name for X axis. The color is black, the font is ("Lucida Sans", Font.BOLD, 14)

Parameters:
s - Title for X axis.

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 ("Lucida Sans", Font.BOLD, 14)

Parameters:
s - Title for X axis.
f - Font

setNameY

public void setNameY(java.lang.String s,
                     java.awt.Font f,
                     java.awt.Color c)
Set the label for the axis in Y

Parameters:
s - label title
f - Font
c - Color

setNameY

public void setNameY(java.lang.String s)
Sets the name for Y axis. The color is black, the font is ("Lucida Sans", 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 ("Lucida Sans", Font.BOLD, 14)

Parameters:
s - Title for Y axis.
f - Font

draw

public void draw(JaObject jo)
Draw JaObject. Use update() method to actually show it. This method is the same ad add method.

Parameters:
jo - input JaObject

draw

public void draw(P1D p1d)
Draw H2D histogram on the current pad. Use update() method to actually show it.

Parameters:
h2d - input histogram

draw

public void draw(H2D h2d)
Draw H2D histogram on the current pad.

Parameters:
h2d - input histogram

getStatistics

public java.lang.String[] getStatistics(H1D h1)
Get statistics in form of strings

Parameters:
h1 - input H1D
Returns:
lines with statistics

getStatistics

public java.lang.String[] getStatistics(P1D h1)
Get strings representing the statistics for the given object

Parameters:
h1 - input P1D
Returns:
lines with statistics

draw

public void draw(H1D h1)
Draw H1D histogram on the current pad. Use update() method to actually show it.

Parameters:
h1 - input histogram

draw

public void draw(F1D[] f)
Draw array of F1D holders

Parameters:
f - array of F1D functions

fit

public int fit(H1D h1,
               java.lang.String predefFunc,
               java.lang.String method)
Fit 1D histogram with the function F1D

Parameters:
h1 - H1D histogram
predefFunc - String predefined function
method - String - method for the fit
Returns:
int Fit results

factories

public void factories()
Create various JAIDA factories: IAnalysisFactory, ITree, IFitFactory, IFunctionFactory


analF

public hep.aida.IAnalysisFactory analF()
Return IAnalysisFactory associated with the plot

Returns:
IAnalysisFactory

treeF

public hep.aida.ITree treeF()
Return TreeFactory associated with the plot

Returns:
ITree

fitF

public hep.aida.IFitFactory fitF()
Return FitFactory associated with the plot

Returns:
IFitFactory

funcF

public hep.aida.IFunctionFactory funcF()
Return FunctionFactory associated with the plot

Returns:
IFunctionFactory

histF

public hep.aida.IHistogramFactory histF()
Return IHistogramFactory associated with the plot

Returns:
IHistogramFactory

draw

public void draw(jplot.DataArray inputDA,
                 java.lang.String title)
Draw data represented by DataArray on the current pad.

Parameters:
inputDA - input data container

draw

public void draw(F1D f1,
                 int padx,
                 int pady)
Draw an one-dimensional function on the current pad.

Parameters:
f1 - input function
padx - pad in X
pady - pad in Y

draw

public void draw(FND f1,
                 int padx,
                 int pady)
Draw an one-dimensional function on the current pad.

Parameters:
f1 - input function
padx - pad in X
pady - pad in Y

draw

public void draw(F1D f1)
Draw an one-dimensional function on the current pad.

Parameters:
f1 - input function

draw

public void draw(FND f1)
Draw an one-dimensional function on the current pad.

Parameters:
f1 - input function

draw

public void draw(P1D p1d,
                 int padx,
                 int pady)
Draw P1D object on the pad

Parameters:
p1d - input
padx - pad in X
pady - pad in Y

draw

public void draw(P1D[] d)
Draw array of P1D holders

Parameters:
d - array of P1D data holders

getData

public java.util.Vector<jplot.DataArray> getData()
Get the vector which keeps all the data

Returns:
Vector with the data

setAutoRange

public void setAutoRange(int axis,
                         boolean b)
Sets true or false to use automatic scaling for the current plot.

Parameters:
axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
b - toggle, true if the the automatic scaling feature is enabled.

setAutoRangeAll

public void setAutoRangeAll(int axis,
                            boolean b)
Sets true or false to use automatic scaling for all plots.

Parameters:
axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
b - toggle, true if the the automatic scaling feature is enabled.

setAutoRange

public void setAutoRange(boolean b)
Set autorange in X and Y at the same time

Parameters:
b - if true, sets autorange

setAutoRangeAll

public void setAutoRangeAll(boolean b)
Set auto-range in X and Y at the same time for all plots

Parameters:
b - if true, sets auto-range

setAutoRange

public void setAutoRange()
Set autorange in X and Y at the same time for the current plot


setAutoRangeAll

public void setAutoRangeAll()
Set autorange in X and Y at the same time for all plots


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


main

public static void main(java.lang.String[] args)
The main method of japlot.jaxodraw: determines system properties, preferences and command line arguments, before bringing up the graphical user interface.

Parameters:
args - The array of command line arguments.

doc

public void doc()
Show online documentation.



jHepWork 2.1 (C) S.Chekanov