|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectComponent
Container
JComponent
MosaicBuilderEditor
public class MosaicBuilderEditor
Configures a MosaicBuilder according the input provided by a user. The caller can
invoke one of the one-argument constructors (optional but recommended) in order to initialize
the widgets with a set of default values. After the widget has been displayed, the caller can
invoke getTileManager() in order to get the user's choices in an object ready for use.
Example:
MosaicBuilderEditor editor = new MosaicBuilderEditor(boundsOfTheWholeMosaic);
if (editor.showDialog(null, "Define pyramid tiling")) {
TileManager mosaic = editor.getTileManager();
// Process here.
}
| display/geotk-widgets-swing (download) | View source code for this class |
| Nested Class Summary |
|---|
| 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 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 | |
|---|---|
MosaicBuilderEditor()
Creates a new panel for configuring a default mosaic builder. |
|
MosaicBuilderEditor(MosaicBuilder builder)
Creates a new panel for configuring the given mosaic builder. |
|
MosaicBuilderEditor(Rectangle bounds)
Creates a new panel suitable for tiles in a mosaic of the given size. |
|
MosaicBuilderEditor(TileManager... managers)
Creates a new panel suitable for the given tiles, specified as TileManager objects. |
|
| Method Summary | |
|---|---|
void |
commitEdit()
Forces the current value to be taken from the editable fields and set them as the current values. |
void |
done(TileManager mosaic)
Notifies that a TileManager has been created from the parameter edited in this widget. |
void |
failed(Throwable exception)
Notifies that the creation of a TileManager failed with the given exception. |
MosaicBuilder |
getMosaicBuilder()
Configures the MosaicBuilder with the informations provided by the user
and return it. |
TileManager |
getTileManager()
Configures the MosaicBuilder with the informations provided by the user
and create the mosaic. |
void |
initializeForBounds(Rectangle bounds)
Proposes default values suitable for tiles in a mosaic of the given size. |
void |
initializeForTiles(TileManager... managers)
Proposes default values suitable for the given tiles, specified as TileManager
objects. |
protected void |
plotEfficiency(long delay)
Refreshes the plot of estimated efficiency. |
boolean |
showDialog(Component owner,
String title)
Shows a dialog box requesting input from the user. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MosaicBuilderEditor()
public MosaicBuilderEditor(Rectangle bounds)
bounds - The bounds of the whole mosaic.
public MosaicBuilderEditor(TileManager... managers)
throws IOException
TileManager objects.
Only one tile manager is usually provided. However more managers can be provided if, for
example, TileManagerFactory failed to create only
one instance from a set of tiles.
managers - The tiles for which to setup default values.
IOException - If an I/O operation was necessary and failed.public MosaicBuilderEditor(MosaicBuilder builder)
builder - The mosaic builder to be configured by this panel.| Method Detail |
|---|
public void initializeForTiles(TileManager... managers)
throws IOException
TileManager
objects. Only one tile manager is usually provided. However more managers can be provided
if, for example, TileManagerFactory failed to create
only one instance from a set of tiles.
managers - The tiles for which to setup default values.
IOException - If an I/O operation was necessary and failed.public void initializeForBounds(Rectangle bounds)
bounds - The bounds of the whole mosaic.protected void plotEfficiency(long delay)
delay - How long to wait (in milliseconds) before to perform the calculation.
public MosaicBuilder getMosaicBuilder()
throws IOException
MosaicBuilder with the informations provided by the user
and return it.
Note: Use this method when the widget state will not change anymore. If the user is still editing the values in the widget, then invokinggetTileManager()is preferable thangetTileBuilder().getTileManager()for synchronization reasons.
IOException - if an I/O operation was required and failed.
public TileManager getTileManager()
throws IOException
MosaicBuilder with the informations provided by the user
and create the mosaic. This method is automatically invoked when a graph is about to be
plot. It can also be invoked directly by the user, but may block if the builder is
currently in use by an other thread.
getTileManager in interface MosaicPerformanceGraph.DelayedTileManager object.
IOException - if an I/O operation was required and failed.public void done(TileManager mosaic)
TileManager has been created from the parameter edited in this widget.
This method is invoked automatically after the fields in this widget has been edited.
It can also be invoked directly by the user. Current implementation does nothing, but
subclasses can override this method for remembering the TileManager.
done in interface MosaicPerformanceGraph.Delayedmosaic - The mosaic created from the information provided in this widget,
or null if the TileManager creation has been canceled
before completion.public void failed(Throwable exception)
TileManager failed with the given exception. This
method is invoked instead than done(TileManager) if an exception occurred during
the execution of MosaicPerformanceGraph.plotEfficiency(String, TileManager).
The default implementation does nothing. Subclasses can override this method in order to report the error in the way that best suite their application.
failed in interface MosaicPerformanceGraph.Delayedexception - The exception which occurred.
public void commitEdit()
throws ParseException
This method is typically invoked after Dialog.showDialog(Component, String)
returned true and before to read the values from the dialog widget.
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 | |||||||||