|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectComponent
Container
JComponent
ZoomPane
Plot2D
MosaicPerformanceGraph
public class MosaicPerformanceGraph
A plot of the estimated efficiency of loading tiles using a given mosaic. Given a TileManager,
this method computes an estimation of the efficiency of loading tiles at different subsampling levels.
The details of the calculation is documented in the MosaicProfiler class.
The calculations are performed by the plotEfficiency method,
which may require a long execution time. Consequently this method should be invoked from a
background thread rather than the Swing thread. As a convenience, the
plotLater method is provided for delegating the calculation to a
background thread.
| display/geotk-widgets-swing (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static interface |
MosaicPerformanceGraph.Delayed
Specifies a mosaic to be profiled in a background thread. |
| Nested classes/interfaces inherited from class Plot2D |
|---|
Plot2D.Series |
| Nested classes/interfaces inherited from class JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class Plot2D |
|---|
DEFAULT_COLORS |
| Fields inherited from class ZoomPane |
|---|
DEFAULT_ZOOM, RESET, ROTATE, SCALE_X, SCALE_Y, TRANSLATE_X, TRANSLATE_Y, UNIFORM_SCALE, zoom |
| Fields inherited from class JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
MosaicPerformanceGraph()
Creates a default graph. |
|
| Method Summary | |
|---|---|
void |
commitEdit()
Forces the current values to be taken from the editable fields and set them as the current values. |
protected MosaicProfiler |
createProfiler(TileManager tiles)
Creates a profiler for the given mosaic. |
boolean |
getClearBeforePlot()
If true, any call to plotEfficiency will clear the previous plot
before to add the result of a new calculation. |
int |
getImagesPerSubsampling()
Returns the number of images to be requested for each subsampling level. |
JProgressBar |
getProgressBar()
Returns the progress bar given to the last to setProgressBar(JProgressBar). |
void |
plotEfficiency(String name,
TileManager tiles)
Adds a plot calculated for the given mosaic. |
void |
plotLater(String name,
MosaicPerformanceGraph.Delayed delayed,
long delay)
Adds a plot for the mosaic created by a given builder. |
void |
setClearBeforePlot(boolean clear)
Sets whatever the result of plotEfficiency should replace any previous plot. |
void |
setImagesPerSubsampling(int n)
Sets the number of images to be requested for each subsampling level. |
void |
setProgressBar(JProgressBar bar)
Sets the progress bar to inform of lengthly operation, or null if none. |
boolean |
showDialog(Component owner,
String title)
Shows a dialog box requesting input from the user. |
| Methods inherited from class Plot2D |
|---|
addSeries, addSeries, addSeries, addSeries, addXAxis, addYAxis, clear, getArea, getAxes, getGridColor, getMargin, getSeries, getZoomableBounds, paintComponent, reset, setGridColor, setMargin, transform |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MosaicPerformanceGraph()
| Method Detail |
|---|
protected MosaicProfiler createProfiler(TileManager tiles)
throws IOException
plotEfficiency(String, TileManager) when a new plot has been
requested. The default implementation creates a profiler with subsampling change allowed.
Subclasses can overwrite this method for configuring the profiler in a different way.
tiles - The mosaic to profile.
IOException - if an I/O operation was required and failed.public int getImagesPerSubsampling()
public void setImagesPerSubsampling(int n)
n - The new number of image loadings to be done or simulated per subsampling level.public JProgressBar getProgressBar()
setProgressBar(JProgressBar).
The default value is null, i.e. this widget do not provides any progress bar
by itself.
setProgressBar.public void setProgressBar(JProgressBar bar)
null if none.
The given progress bar is expected to accept a range of values from 0 to 100 inclusive.
If the progress bar accepts a wider range of values, only the [0 … 100] range
will be used.
The given progress bar is not displayed in this widget. It is caller responsibility to provide a progress bar visible in his own widget.
bar - The progress bar, or null if none.public boolean getClearBeforePlot()
true, any call to plotEfficiency will clear the previous plot
before to add the result of a new calculation. If false, then the result of
plotEfficiency will be a new series added to the existing ones.
The default value is true.
plotEfficiency will replace any previous plot.public void setClearBeforePlot(boolean clear)
plotEfficiency should replace any previous plot.
clear - Whatever the result of plotEfficiency should replace any previous plot.
public final void plotEfficiency(String name,
TileManager tiles)
throws IOException
This method can be invoked from any thread - it doesn't need to be the Swing one. Since this method may take a while, it is recommended to invoke it from a background thread.
name - The name to given to the plot, or null if none.tiles - The mosaic for which to plot the estimated cost of loading images.
IOException - if an I/O operation was required and failed.
public void plotLater(String name,
MosaicPerformanceGraph.Delayed delayed,
long delay)
name - The name to given to the plot, or null if none.delayed - Provides the TileManager and the methods to callback on success or failure.delay - How long to wait (in milliseconds) before to perform the calculation.
public void commitEdit()
throws ParseException
commitEdit in interface DialogParseException - If at least one values couldn't be commited.JFormattedTextField.commitEdit(),
JSpinner.commitEdit()
public boolean showDialog(Component owner,
String title)
owner. If owner is contained into a JDesktopPane,
the dialog box will appears as an internal frame.
Multi-threading
Geotk implementations allow this method to be invoked from any thread. If the caller
thread is not the Swing thread, then the execution of this method will be
registered in the AWT Event Queue and the caller thread will block until completion.
showDialog in interface Dialogowner - The parent component for the dialog box, or null if there is no parent.title - The dialog box title.
true if user pressed the "Ok" button, or false otherwise
(e.g. pressing "Cancel" or closing the dialog box from the title bar).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||