Package hec.gfx2d
Class PlotLayout
java.lang.Object
hec.gfx2d.PlotLayout
Title: Hec Java Development
Description: This is a simple class that allows the user to configure a layout to apply to the plots
Copyright: Copyright (c) 2003
Company:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddViewport
(double weight) Adds a viewport to the list with a given wieght.void
addViewport
(ViewportLayout viewport, double weight) getTitle()
int
Returns the number if viewports that have been stored in this viewport.Returns the list of of viewports contained in the layout.double
getViewportWeight
(ViewportLayout vLayout) get the viewport weight for the specified viewportdouble[]
Returns the weights that have been assigned to each viewport.boolean
boolean
boolean
removeViewport
(ViewportLayout vLayout) remove the ViewportLayout vLayout from the PlotLayoutvoid
setHasLegend
(boolean b) void
void
void
setHasToolbar
(boolean b) void
void
void
void
setToolbarProperties
(ViewportToolbarProp properties) Sets the properties to use when creating toolbar buttons.If the value is NULL or never been set, default properties will be created during the construction of the plot.
-
Constructor Details
-
PlotLayout
public PlotLayout()
-
-
Method Details
-
setTitle
-
getTitle
-
setToolbarProperties
Sets the properties to use when creating toolbar buttons.If the value is NULL or never been set, default properties will be created during the construction of the plot.- Parameters:
properties
-
-
getToolbarProperties
-
setToolbarOn
public void setToolbarOn() -
setToolbarOff
public void setToolbarOff() -
setHasToolbar
public void setHasToolbar(boolean b) -
hasToolbar
public boolean hasToolbar() -
setHasLegendOn
public void setHasLegendOn() -
setHasLegendOff
public void setHasLegendOff() -
setHasLegend
public void setHasLegend(boolean b) -
hasLegend
public boolean hasLegend() -
addViewport
-
addViewport
Adds a viewport to the list with a given wieght. The weight is measured in % of total height of the plot window.- Parameters:
weight
-
-
addViewport
-
getViewportWeights
public double[] getViewportWeights()Returns the weights that have been assigned to each viewport. The values are in %, i.e. 10, 50,100. The sum of these weights is not guaranteed to be equal to 100% The user of these values should try an normalize these values.- Returns:
- a double array containing the weights. They are in the same order as the viewports
-
getViewports
Returns the list of of viewports contained in the layout. The list is guaranteed to be of type ViewportLayout and not NULL. The size of the list is also guaranteed to be the same size as value returned from getViewportCount();- Returns:
-
getViewportCount
public int getViewportCount()Returns the number if viewports that have been stored in this viewport. This value is guaranteed to be 0 or greater.- Returns:
- an integer value representing the number of viewports.
-
removeViewport
remove the ViewportLayout vLayout from the PlotLayout- Parameters:
vLayout
- the ViewportLayout to remove- Returns:
- true if the ViewportLayout was removed
-
getViewportWeight
get the viewport weight for the specified viewport- Parameters:
vLayout
- the viewport- Returns:
- the viewport weight or -1 if not found
-