hep.analysis
Class Page
java.lang.Object
|
+--hep.analysis.AbstractNamedObject
|
+--hep.analysis.Page
- All Implemented Interfaces:
- NamedObject, java.io.Serializable
- public class Page
- extends AbstractNamedObject
A Page represents a viewable page onto which plots can be placed. It allows the author of
an analysis routine to specify a default way for the created histograms to be displayed.
A Page is a NamedObject, so it must be given a name when it is created, and can be arranged
within a heirarchy of PageFolders.
A Page supports two sorts of layouts:
- Automatic Grid Layout. Plots added to the page will be layed out in a grid. By default the size
of the grid will depend on the number of plots added, but this can be overriden by using the setGrid
method.
- Manual layout, where the position of each plot is specified as it is added to the page.
Generally it is not a good idea to mix these two methods within a single page.
- See Also:
setGrid(int x, int y)
,
add(Plot p)
,
add(Plot p, double x, double y, double width, double height)
, Serialized Form
Constructor Summary |
Page(java.lang.String name)
Creates a blank page with the specified name in the default folder. |
Page(java.lang.String name,
PageFolder parent)
Creates a blank page with the specified name in the specified folder. |
Method Summary |
void |
add(Plot plot)
Adds a plot with the default layout |
void |
add(Plot plot,
double x,
double y,
double width,
double height)
Adds a plot with a specific position on the page. |
protected Folder |
getDefaultParent()
Get default parent is called when an object is read
in with no parent Folder. |
int |
getGridX()
|
int |
getGridY()
|
int |
getNPlots()
|
java.util.Enumeration |
plots()
Returns an enumeration of the Plots on the page. |
void |
remove(Plot plot)
Removes a plot from the page |
void |
removeAll()
Clears the page |
void |
setGrid(int gridX,
int gridY)
Set the default layout for plots added to the page without
any specific positioning. |
void |
show()
Requests that this page be made visible to the user. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Page
public Page(java.lang.String name)
- Creates a blank page with the specified name in the default folder.
The page is attached to the current job
and persists until the job is deleted, or the delete method for the page is called.
- Parameters:
name
- The name of the page. If a page by this name already exists in this folder it is replaced.
Page
public Page(java.lang.String name,
PageFolder parent)
- Creates a blank page with the specified name in the specified folder.
The page is attached to the current job
and persists until the job is deleted, or the delete method for the page is called.
- Parameters:
name
- The name of the page. If a page by this name already exists in this folder it is replaced.parent
- the PageFolder in which to store this Page
add
public void add(Plot plot)
- Adds a plot with the default layout
- Parameters:
plot
- The plot to be added
add
public void add(Plot plot,
double x,
double y,
double width,
double height)
- Adds a plot with a specific position on the page.
Positions and sizes are specified as percentages relative
to the size of the page. E.g. add(plot,50,50,50,50) will
produce a plot in the lower right quarter of the page.
- Parameters:
plot
- The plot to be addedx
- The x offset of the plot (0-100)y
- The y offset of the plot (0-100)width
- The width of the plot (0-100)height
- The height of the plot (0-100)
remove
public void remove(Plot plot)
- Removes a plot from the page
- Parameters:
plot
- The Plot to be removed
removeAll
public void removeAll()
- Clears the page
setGrid
public void setGrid(int gridX,
int gridY)
- Set the default layout for plots added to the page without
any specific positioning. By default the plots will be layed
out in a grid whose size will be determined by the number of
plots on the page. By calling setGrid you can manually set
the size of the grid
- Parameters:
gridX
- The number of cells in the X direction (or 0 for automatic)gridY
- The number of cells in the Y direction (or 0 for automatic)
show
public void show()
- Requests that this page be made visible to the user.
The effectiveness of the request will depend on the environment
in which the job is running.
getGridX
public int getGridX()
getGridY
public int getGridY()
plots
public java.util.Enumeration plots()
- Returns an enumeration of the Plots on the page.
Each element of the Enumeration is either a Plot or a ConstrainedPlot
depending on whether the user specified constraints.
- See Also:
Page.ConstrainedPlot
getNPlots
public int getNPlots()
getDefaultParent
protected Folder getDefaultParent()
- Description copied from class:
AbstractNamedObject
- Get default parent is called when an object is read
in with no parent Folder. Concrete classes must provide
an implementation of this method.
- Overrides:
getDefaultParent
in class AbstractNamedObject
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object