hep.aida
Interface IPlotter


public interface IPlotter

User level interface for plotting histograms, clounds and functions. IPlotter allows the user to define multiple plotting regions within the page. At any time one region is the "current region". Regions can be arranged in a grid, or can be set to arbitrary sizes.

When initially created the IPlotter has a single region that covers the entire area.

Version:
$Id: IPlotter.html,v 1.1 2002/10/08 00:51:18 tonyj Exp $
Author:
Guy Barrand
Source Code:
IPlotter.java

Method Summary
 void clearPage()
          Clear all regions.
 void clearRegion()
          Clear the list of things to plot for the current region.
 int createRegion(double x, double y, double w, double h)
          Create a new region.
 void createRegions(int columns, int rows)
          Create a grid of regions, replacing any existing regions.
 void createRegions(int columns, int rows, int start)
          Create a grid of regions, replacing any existing regions.
 int currentRegion()
          Get the current region
 void hide()
          Unmap the plotter on the screen.
 void interact()
          Give control to the plotter GUI.
 void next()
          Set current region to be the "next" one.
 void plot(ICloud cloud)
          Add a cloud to the list of things to plot in the current region.
 void plot(IFunction function)
          Add a function to the list of things to plot in the current region.
 void plot(IHistogram histogram)
          Add a histogram to the list of things to plot in the current region.
 void refresh()
          Refresh the screen window(s).
 void remove(ICloud cloud)
          Remove a cloud from the list of objects to display in the current region
 void remove(IFunction function)
          Remove a function from the list of objects to display in the current region
 void remove(IHistogram histogram)
          Remove a histogram from the list of objects to display in the current region
 void setCurrentRegion(int index)
          Set current region by giving its index [0,n-1]
 void setParameter(String parameter, String value)
           
 void show()
          Map the plotter on the screen.
 void write(String filename, String type)
          Dump the contents of the page to a file.
 

Method Detail

createRegion

public int createRegion(double x,
                        double y,
                        double w,
                        double h)
Create a new region. The new region is added after any existing regions. Coordinate are specified in the range [0-1]. A region with (x=0,y=0,w=1,h=1) will fill the entire plot area. If the new region is created successfully it becomes the new default region.
Parameters:
x - The x coordinate in the range 0 (left) to 1(right)
y - The y coordinate in the range 0=bottom to y=top
w - The width (0-1)
h - The height (0-1)
Returns:
The index of the newly created region. C++ returns IConstatns::NOT_FOUND in case of error

createRegions

public void createRegions(int columns,
                          int rows)
Create a grid of regions, replacing any existing regions. Regions are indexed from zero, with increasing order left to right, top to bottom. The current region is set to 0. Use createRegions(0,0) to create a blank page with no regions.
Parameters:
columns - The number of columns
rows - The number of rows
start - The region which will become the default region

createRegions

public void createRegions(int columns,
                          int rows,
                          int start)
Create a grid of regions, replacing any existing regions. Regions are indexed from zero, with increasing order left to right, top to bottom.
Parameters:
columns - The number of columns
rows - The number of rows
start - The region which will become the default region

plot

public void plot(IHistogram histogram)
Add a histogram to the list of things to plot in the current region.
Parameters:
histogram - The histogram to add

plot

public void plot(IFunction function)
Add a function to the list of things to plot in the current region.
Parameters:
function - The function to add

plot

public void plot(ICloud cloud)
Add a cloud to the list of things to plot in the current region.
Parameters:
cloud - The cloud to add

remove

public void remove(IHistogram histogram)
Remove a histogram from the list of objects to display in the current region
Parameters:
histogram - The histogram to remove

remove

public void remove(IFunction function)
Remove a function from the list of objects to display in the current region
Parameters:
function - The function to remove

remove

public void remove(ICloud cloud)
Remove a cloud from the list of objects to display in the current region
Parameters:
cloud - The cloud to remove

next

public void next()
Set current region to be the "next" one. If exceeding the number of regions, the current region index return to 0.

setCurrentRegion

public void setCurrentRegion(int index)
Set current region by giving its index [0,n-1]
Parameters:
index - The new region index

currentRegion

public int currentRegion()
Get the current region
Returns:
current region index.

clearRegion

public void clearRegion()
Clear the list of things to plot for the current region. The clearing of all regions could be done by reissuing a setRegions.

clearPage

public void clearPage()
Clear all regions. It does not reset the number and position of regions. This can be done through a createRegions(0,0,).
See Also:
createRegions(int,int)

setParameter

public void setParameter(String parameter,
                         String value)

write

public void write(String filename,
                  String type)
Dump the contents of the page to a file.
Parameters:
type - A string to describe the type of the output : "PS" or "PostScript" for PostScript, "JPEG" for JPEG. If nothing is given, the type is guessed from the file suffix (.ps for PostScript, .jpg for JPEG, etc...).
filename - The file to create

show

public void show()
Map the plotter on the screen.

hide

public void hide()
Unmap the plotter on the screen.

refresh

public void refresh()
Refresh the screen window(s). May be used when a plotted data analysis object receives new data.

interact

public void interact()
Give control to the plotter GUI. The plotter must be able to return from this function from a user action in its GUI.


Copyright © 2000, 2001 AIDA Team, All Rights Reserved.