public class VisatApp extends BasicApp implements AppContext
VisatApp
class represents the VISAT application.Modifier and Type | Class and Description |
---|---|
static interface |
VisatApp.ViewUpdateMethod
A method used to update a
ProductSceneView . |
BasicApp.MainFrame, BasicApp.ToolBarListener
Modifier and Type | Field and Description |
---|---|
static String |
ALL_FILES_IDENTIFIER |
static String |
ANALYSIS_TOOL_BAR_ID |
static String |
APP_DEFAULT_PLUGIN_DIR
Deprecated.
since BEAM 4.11, plugin directory is not used anymore
|
static boolean |
DEFAULT_VALUE_SAVE_INCREMENTAL
default value for preference incremental mode at save
|
static boolean |
DEFAULT_VALUE_SAVE_PRODUCT_ANNOTATIONS
default value for preference save product annotations (ADS) or not
|
static boolean |
DEFAULT_VALUE_SAVE_PRODUCT_HEADERS
default value for preference save product headers (MPH, SPH) or not
|
static boolean |
DEFAULT_VALUE_SAVE_PRODUCT_HISTORY
default value for preference save product history (History) or not
|
static String |
INTERACTIONS_TOOL_BAR_ID |
static String |
LAYERS_TOOL_BAR_ID |
static String |
MAIN_TOOL_BAR_ID |
static boolean |
PROPERTY_DEFAULT_DISPLAY_GEOLOCATION_AS_DECIMAL
Default value for display style of geo-locations.
|
static double |
PROPERTY_DEFAULT_GEOLOCATION_EPS
Preferences key for geo-location epsilon
|
static float |
PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY
Default value for pixel offset's for display pixel positions
|
static boolean |
PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY_SHOW_DECIMALS
Default value for pixel offset's for display pixel positions
|
static String |
PROPERTY_KEY_AUTO_SHOW_MAGNIFIER
Preferences key for automatically showing magnifier
|
static String |
PROPERTY_KEY_AUTO_SHOW_NAVIGATION
Preferences key for automatically showing navigation
|
static String |
PROPERTY_KEY_AUTO_SHOW_NEW_BANDS
Preferences key for automatically showing new bands
|
static String |
PROPERTY_KEY_DISPLAY_GEOLOCATION_AS_DECIMAL
Preferences key for display style of geo-locations
|
static String |
PROPERTY_KEY_GEOLOCATION_EPS
Preferences key for geo-location epsilon
|
static String |
PROPERTY_KEY_JAI_TILE_CACHE_CAPACITY
Preferences key for the memory capacity of the JAI tile cache in megabytes
|
static String |
PROPERTY_KEY_LOW_MEMORY_LIMIT
Preferences key for low memory size
|
static String |
PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_SHOW_DECIMALS
Preferences key for pixel offset-Y for display pixel positions
|
static String |
PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_X
Preferences key for pixel offset-X for display pixel positions
|
static String |
PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_Y
Preferences key for pixel offset-Y for display pixel positions
|
static String |
PROPERTY_KEY_SAVE_INCREMENTAL
Preferences key for incremental mode at save
|
static String |
PROPERTY_KEY_SAVE_PRODUCT_ANNOTATIONS
Preferences key for save product annotations (ADS) or not
|
static String |
PROPERTY_KEY_SAVE_PRODUCT_HEADERS
Preferences key for save product headers (MPH, SPH) or not
|
static String |
PROPERTY_KEY_SAVE_PRODUCT_HISTORY
Preferences key for save product history or not
|
static String |
PROPERTY_KEY_VERSION_CHECK_DONT_ASK
Preferences key for on-line version question
|
static String |
PROPERTY_KEY_VERSION_CHECK_ENABLED
Preferences key for on-line version check
|
static String |
VIEWS_TOOL_BAR_ID |
MESSAGE_STATUS_BAR_ITEM_KEY, POSITION_STATUS_BAR_ITEM_KEY, PROPERTY_KEY_APP_DEBUG_ENABLED, PROPERTY_KEY_APP_LAST_OPEN_DIR, PROPERTY_KEY_APP_LAST_OPEN_FORMAT, PROPERTY_KEY_APP_LAST_SAVE_DIR, PROPERTY_KEY_APP_LOG_ECHO, PROPERTY_KEY_APP_LOG_ENABLED, PROPERTY_KEY_APP_LOG_LEVEL, PROPERTY_KEY_APP_LOG_PREFIX, PROPERTY_KEY_APP_UI_FONT_NAME, PROPERTY_KEY_APP_UI_FONT_SIZE, PROPERTY_KEY_APP_UI_LAF, PROPERTY_KEY_APP_UI_USE_SYSTEM_FONT_SETTINGS, uiDefaultsInitialized
Constructor and Description |
---|
VisatApp(ApplicationDescriptor applicationDescriptor)
Constructs the VISAT application instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addInternalFrameListener(InternalFrameListener listener)
Adds an internal frame listener to VISAT.
|
void |
addProduct(Product product)
Adds the given product to VISAT's internal open product list.
|
void |
addProductTreeListener(ProductTreeListener listener)
Adds a product tree listener to VISAT.
|
void |
addPropertyMapChangeListener(PropertyMapChangeListener listener)
Adds a property map change listener to VISAT.
|
protected void |
applyPreferences() |
void |
clearStatusBarMessage()
Clears the status bar message.
|
void |
closeAllAssociatedFrames(Product product)
Closes all (internal) frames associated with the given product.
|
void |
closeAllProducts()
Closes the all open products.
|
void |
closeProduct(Product product)
Closes the given product.
|
void |
closeSelectedProduct()
Closes the currently selected product.
|
protected ModalDialog |
createAboutBox() |
JInternalFrame |
createInternalFrame(String title,
Icon icon,
JComponent content,
String helpId)
Deprecated.
Since BEAM 4.10, use
createInternalFrame(String, javax.swing.Icon, javax.swing.JComponent, String, boolean) instead |
JInternalFrame |
createInternalFrame(String title,
Icon icon,
JComponent content,
String helpId,
boolean maximizeFrame)
Creates an internal frame and adds it to VISAT's desktop.
|
protected com.jidesoft.action.CommandBar |
createMainMenuBar()
Overrides the base class version in order to creates the menu bar for VISAT.
|
protected JComponent |
createMainPane()
Overrides the base class version in order to create and configure the VISAT's main pane.
|
protected com.jidesoft.action.CommandBar |
createMainToolBar()
Overrides the base class version in order to create a tool bar for VISAT.
|
protected com.jidesoft.status.StatusBar |
createStatusBar()
Creates a standard status bar for this application.
|
AbstractButton |
createToolButton(String commandID)
Creates a tool button for the tool-command with the given command ID.
|
void |
disposeProduct(Product product)
Removes and disposes the given product and performs a garbage collection.
|
JInternalFrame |
findInternalFrame(MetadataElement metadataElement)
Finds the (internal) frame for the given meta data element.
|
JInternalFrame |
findInternalFrame(ProductNode productNode)
Finds the (internal) frame for the given product node.
|
JInternalFrame |
findInternalFrame(RasterDataNode raster)
Finds the any internal frame for the given raster data node.
|
JInternalFrame[] |
findInternalFrames(RasterDataNode raster)
Finds the (internal) frames for the given raster data node.
|
JInternalFrame[] |
findInternalFrames(RasterDataNode raster,
int numBands)
Finds the (internal) frames for the given raster data node.
|
com.bc.ceres.swing.figure.Interactor |
getActiveInteractor() |
JInternalFrame[] |
getAllInternalFrames()
Returns all open (internal) frames VISAT currently has.
|
static VisatApp |
getApp()
Returns the one and only VISAT application instance (singleton).
|
String |
getApplicationName() |
VisatApplicationPage |
getApplicationPage() |
Window |
getApplicationWindow() |
com.bc.swing.desktop.TabbedDesktopPane |
getDesktopPane() |
ExecutorService |
getExecutorService() |
Product |
getOpenProduct(File file)
Finds the product associated with the given file.
|
VisatPreferencesDialog |
getPreferencesDialog() |
ProductManager |
getProductManager()
Returns the product manager which holds the list of currently open products.
|
static ProductNode |
getProductNode(JInternalFrame frame)
Returns the product node cuurrently displayed in the given internal frame.
|
ProductTree |
getProductTree()
Returns VISAT's product tree browser.
|
JInternalFrame |
getSelectedInternalFrame() |
Product |
getSelectedProduct()
Returns the currently selected product.
|
ProductMetadataView |
getSelectedProductMetadataView()
Returns the selected product metadata view.
|
ProductNode |
getSelectedProductNode()
Returns the currently selected node within a product.
|
ProductNodeView |
getSelectedProductNodeView()
Returns the selected product node view.
|
ProductSceneView |
getSelectedProductSceneView()
Returns the selected product scene view.
|
File |
getSessionFile() |
void |
handleError(String message,
Throwable t) |
protected void |
handleImminentExit()
Resets the singleton application instance so that
getApp() will return null after this method has been called. |
boolean |
hasRasterProductSceneView(RasterDataNode raster)
Returns true if the given raster data node is used in any product scene view.
|
protected void |
historyPush(File file) |
protected void |
initClient(com.bc.ceres.core.ProgressMonitor pm)
Starts up the client application.
|
protected void |
initClientUI(com.bc.ceres.core.ProgressMonitor pm)
Initializes the client user interface.
|
protected void |
insertCommandMenuItems() |
Product |
newProduct() |
void |
openProduct(File file) |
void |
openProductSceneView(RasterDataNode raster)
Creates a new product scene view and opens an internal frame for it.
|
void |
openProductSceneViewRGB(Product product,
String helpId)
Asks the user to select or define a RGB profile from which the product scene view will be
created and opend as internal frame.
|
void |
removeInternalFrameListener(InternalFrameListener listener)
Removes an internal frame listener from VISAT.
|
void |
removeProduct(Product product)
Removes the given product from VISAT's internal open product list.
|
void |
removeProductTreeListener(ProductTreeListener listener)
Removes a product tree listener from VISAT.
|
void |
removePropertyMapChangeListener(PropertyMapChangeListener listener)
Removes a property map change listener from VISAT.
|
void |
saveProduct(Product product)
Saves the given product using its current file path.
|
void |
saveProductAs(Product product)
Prompts the user to enter a new file name and saves the given product under this new file name.
|
void |
saveSelectedProduct()
Saves the currently selected product using its current file path.
|
void |
saveSelectedProductAs()
Prompts the user to enter a new file name and saves the currently selected product under this new file name.
|
void |
setActiveInteractor(com.bc.ceres.swing.figure.Interactor interactor) |
void |
setSelectedProductNode(JInternalFrame frame)
Sets the selected product node to the node displyed in the given internal frame.
|
void |
setSelectedProductNode(ProductNode selectedNode)
Sets the currently selected node.
|
void |
setSessionFile(File sessionFile)
Sets the file of the current session.
|
void |
setVisatExitConfirmed(boolean visatExitConfirmed) |
void |
showAboutBox()
Shows VISAT's about box.
|
void |
showPreferencesDialog(String helpId) |
void |
shutDown()
Exits the application.
|
void |
unloadAllAssociatedBands(Product product)
Unloads all bands of the given product.
|
void |
updateAssociatedViews(RasterDataNode[] rasters,
VisatApp.ViewUpdateMethod updateMethod) |
protected void |
updateComponentTreeUI()
Called after the look & feel has changed.
|
void |
updateImage(ProductSceneView view) |
void |
updateImages(RasterDataNode[] rasters) |
void |
updateMainFrameTitle()
Updates the main frame's document title.
|
boolean |
writeProduct(Product product,
File file,
String formatName) |
addHelp, applyLookAndFeelPreferences, center, configureCommandsByResourceBundle, createFrameIcon, createJMenu, createNewMenu, createToolBar, findMainMenu, findMenu, findMenu, getAppBuildInfo, getAppCopyright, getApplicationDescriptor, getAppName, getAppSymbolicName, getAppVersion, getCloseHandler, getCommandManager, getCommandUIFactory, getDefaultLookAndFeelClassName, getFileHistory, getImageResourcePath, getLogger, getMainFrame, getMainFrameTitle, getMainToolBar, getMouseOverActionHandler, getPreferences, getPreferencesFile, getResourceBundle, getStatusBar, getStatusBarMessage, getSuppressibleOptionPane, getToolBar, getToolBarGroups, handleUnknownException, initLookAndFeel, insertCommandMenuItem, insertCommandToolBarButtons, isFrameBoundsRestored, isShuttingDown, isStartedUp, isStatusBarVisible, isToolBarVisible, loadJideExtension, loadPreferences, promptForOverwrite, registerJob, savePreferences, setCloseHandler, setCommandManager, setCurrentDocTitle, setPreferences, setShuttingDown, setStatusBarMessage, setStatusBarVisible, setToolBarVisible, showErrorDialog, showErrorDialog, showFileOpenDialog, showFileOpenDialog, showFileSaveDialog, showFileSaveDialog, showInfoDialog, showInfoDialog, showMessageDialog, showOutOfMemoryErrorDialog, showQuestionDialog, showQuestionDialog, showQuestionDialog, showWarningDialog, showWarningDialog, showWarningsDialog, startUp, unregisterJob, updateState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferences
@Deprecated public static final String APP_DEFAULT_PLUGIN_DIR
public static final String PROPERTY_KEY_SAVE_PRODUCT_HEADERS
public static final String PROPERTY_KEY_SAVE_PRODUCT_HISTORY
public static final String PROPERTY_KEY_SAVE_PRODUCT_ANNOTATIONS
public static final String PROPERTY_KEY_GEOLOCATION_EPS
public static final double PROPERTY_DEFAULT_GEOLOCATION_EPS
public static final String PROPERTY_KEY_SAVE_INCREMENTAL
public static final String PROPERTY_KEY_LOW_MEMORY_LIMIT
public static final String PROPERTY_KEY_JAI_TILE_CACHE_CAPACITY
public static final String PROPERTY_KEY_AUTO_SHOW_NEW_BANDS
public static final String PROPERTY_KEY_AUTO_SHOW_MAGNIFIER
public static final String PROPERTY_KEY_AUTO_SHOW_NAVIGATION
public static final String PROPERTY_KEY_VERSION_CHECK_ENABLED
public static final String PROPERTY_KEY_VERSION_CHECK_DONT_ASK
public static final String PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_X
public static final String PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_Y
public static final float PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY
public static final String PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_SHOW_DECIMALS
public static final boolean PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY_SHOW_DECIMALS
public static final String PROPERTY_KEY_DISPLAY_GEOLOCATION_AS_DECIMAL
public static final boolean PROPERTY_DEFAULT_DISPLAY_GEOLOCATION_AS_DECIMAL
public static final boolean DEFAULT_VALUE_SAVE_PRODUCT_ANNOTATIONS
public static final boolean DEFAULT_VALUE_SAVE_INCREMENTAL
public static final boolean DEFAULT_VALUE_SAVE_PRODUCT_HEADERS
public static final boolean DEFAULT_VALUE_SAVE_PRODUCT_HISTORY
public static final String ALL_FILES_IDENTIFIER
public static final String MAIN_TOOL_BAR_ID
public static final String VIEWS_TOOL_BAR_ID
public static final String INTERACTIONS_TOOL_BAR_ID
public static final String ANALYSIS_TOOL_BAR_ID
public static final String LAYERS_TOOL_BAR_ID
public VisatApp(ApplicationDescriptor applicationDescriptor)
applicationDescriptor
- The application descriptor.protected void initClient(com.bc.ceres.core.ProgressMonitor pm)
BasicApp
BasicApp.startUp(com.bc.ceres.core.ProgressMonitor)
before
BasicApp.initClientUI(com.bc.ceres.core.ProgressMonitor)
is called.
Clients should override this method in order to initialize non-UI components, e.g. load plugins.
The default implementation does nothing.initClient
in class BasicApp
pm
- a progress monitor, can be used to signal progresspublic com.bc.ceres.swing.figure.Interactor getActiveInteractor()
public void setActiveInteractor(com.bc.ceres.swing.figure.Interactor interactor)
public String getApplicationName()
getApplicationName
in interface AppContext
public Window getApplicationWindow()
getApplicationWindow
in interface AppContext
public void handleError(String message, Throwable t)
handleError
in interface AppContext
protected void initClientUI(com.bc.ceres.core.ProgressMonitor pm)
BasicApp
BasicApp.startUp(com.bc.ceres.core.ProgressMonitor)
after
BasicApp.initClient(com.bc.ceres.core.ProgressMonitor)
is called.
Clients should override this method in order to initialize their UI components.
The default implementation does nothing.initClientUI
in class BasicApp
pm
- a progress monitor, can be used to signal progresspublic VisatApplicationPage getApplicationPage()
getApplicationPage
in interface AppContext
protected void handleImminentExit()
getApp()
will return null
after this method has been called.handleImminentExit
in class BasicApp
BasicApp.savePreferences()
public static VisatApp getApp()
null
is returned.public VisatPreferencesDialog getPreferencesDialog()
public com.bc.swing.desktop.TabbedDesktopPane getDesktopPane()
public File getSessionFile()
public void setSessionFile(File sessionFile)
sessionFile
- The file of the current session.public void addInternalFrameListener(InternalFrameListener listener)
listener
- the listener to be addedpublic void removeInternalFrameListener(InternalFrameListener listener)
listener
- the listener to be removedpublic void addProductTreeListener(ProductTreeListener listener)
listener
- the listener to be addedpublic void removeProductTreeListener(ProductTreeListener listener)
listener
- the listener to be removedpublic void addPropertyMapChangeListener(PropertyMapChangeListener listener)
listener
- the listener to be addedpublic void removePropertyMapChangeListener(PropertyMapChangeListener listener)
listener
- the listener to be removedpublic void addProduct(Product product)
product
- the product to be addedpublic void removeProduct(Product product)
product
- the product to be removedpublic void disposeProduct(Product product)
product
- the product to be disposedProduct.dispose()
public ProductManager getProductManager()
getProductManager
in interface AppContext
public ProductTree getProductTree()
public Product getSelectedProduct()
getSelectedProduct
in interface AppContext
null
public void setSelectedProductNode(JInternalFrame frame)
frame
- the internal frame which assigns a product nodepublic static ProductNode getProductNode(JInternalFrame frame)
null
if the product node cannot be identified.public ProductNode getSelectedProductNode()
null
public void setSelectedProductNode(ProductNode selectedNode)
The method does nothing if the given selected node is already the selected one The method calls
updateState()
if the selected node changes.
selectedNode
- the product node, can be null
public ProductNodeView getSelectedProductNodeView()
null
if no product scene view is selectedpublic ProductSceneView getSelectedProductSceneView()
getSelectedProductSceneView
in interface AppContext
null
if no product scene view is selectedpublic ProductMetadataView getSelectedProductMetadataView()
null
if no product metadata view is selectedpublic JInternalFrame[] getAllInternalFrames()
null
.public JInternalFrame[] findInternalFrames(RasterDataNode raster, int numBands)
The content panes of the returned frames are always instances of ProductSceneView
.
raster
- the raster for which to perform the lookupnumBands
- the number of bands in the view, pass -1 for all view types, 1 for single band type and 3 for RGB
viewsnull
.public JInternalFrame findInternalFrame(RasterDataNode raster)
The content pane of the returned frame is always an instance of ProductSceneView
.
raster
- the raster for which to perform the lookupnull
if no frame was foundpublic JInternalFrame[] findInternalFrames(RasterDataNode raster)
The content pane of the returned frame is always an instance of ProductSceneView
.
raster
- the raster for which to perform the lookupnull
.public JInternalFrame findInternalFrame(MetadataElement metadataElement)
The content pane of the returned frame is always an instance of ProductMetadataView
.
metadataElement
- the metadata element for which to perform the lookupnull
if no frame was foundpublic JInternalFrame findInternalFrame(ProductNode productNode)
The content pane of the returned frame is always an instance of ProductMetadataView
.
productNode
- the product node for which to perform the lookupnull
if no frame was foundpublic Product getOpenProduct(File file)
file
- the filenull
if no such exists.public void closeAllAssociatedFrames(Product product)
product
- The product to close the internal frames for.public void unloadAllAssociatedBands(Product product)
public boolean hasRasterProductSceneView(RasterDataNode raster)
raster
- the raster for which to perform the lookuppublic void updateAssociatedViews(RasterDataNode[] rasters, VisatApp.ViewUpdateMethod updateMethod)
public void updateImages(RasterDataNode[] rasters)
public void updateImage(ProductSceneView view)
public void shutDown()
BasicApp
The base class implementation calls setShuttingDown(true)
, calls
BasicApp.handleImminentExit()
and disposes the main frame.
When this method is overridden, this base class's implementation should always be called last. However, the
preferred way to change the shutdown behaviour is to override the BasicApp.handleImminentExit()
method.
public Product newProduct()
public void openProduct(File file)
public void closeSelectedProduct()
public void closeProduct(Product product)
product
- the product to be closedpublic void closeAllProducts()
public void saveSelectedProductAs()
public void saveProductAs(Product product)
product
- the product to be savedpublic void saveSelectedProduct()
saveSelectedProductAs()
method.public void saveProduct(Product product)
saveSelectedProductAs()
method.product
- the product to be savedpublic void openProductSceneView(RasterDataNode raster)
public void openProductSceneViewRGB(Product product, String helpId)
public void showAboutBox()
protected ModalDialog createAboutBox()
public void updateMainFrameTitle()
public ExecutorService getExecutorService()
protected void applyPreferences()
applyPreferences
in class BasicApp
protected void historyPush(File file)
historyPush
in class BasicApp
public JInternalFrame getSelectedInternalFrame()
public void showPreferencesDialog(String helpId)
protected void updateComponentTreeUI()
SwingUtilities.updateComponentTreeUI(getMainFrame())
in order to reflect changes of the look-and-feel.
You might want to override this method in order to call SwingUtilities.updateComponentTreeUI()
on
other top-level containers beside the main frame.
updateComponentTreeUI
in class BasicApp
public void clearStatusBarMessage()
BasicApp
setStatusBarMessage(" Ready.")
.clearStatusBarMessage
in class BasicApp
protected JComponent createMainPane()
createMainPane
in class BasicApp
protected com.jidesoft.action.CommandBar createMainToolBar()
createMainToolBar
in class BasicApp
protected com.jidesoft.status.StatusBar createStatusBar()
createStatusBar
in class BasicApp
public AbstractButton createToolButton(String commandID)
A command with the given ID must already been registered using any of the createToolCommand
methods of VisatApp, or directly using the createToolCommand
method of VISAT's CommandManager
. Otherwise an IllegalArgumentException
will be thrown.
The new button is which is automatically added to VISAT's tool button group to ensure that a only single tool is selected.
commandID
- the command IDBasicApp.getCommandManager()
protected com.jidesoft.action.CommandBar createMainMenuBar()
createMainMenuBar
in class BasicApp
protected void insertCommandMenuItems()
insertCommandMenuItems
in class BasicApp
@Deprecated public JInternalFrame createInternalFrame(String title, Icon icon, JComponent content, String helpId)
createInternalFrame(String, javax.swing.Icon, javax.swing.JComponent, String, boolean)
insteadtitle
- a frame titleicon
- a frame icon, can be nullcontent
- the frame's content panehelpId
- the id for help systempublic JInternalFrame createInternalFrame(String title, Icon icon, JComponent content, String helpId, boolean maximizeFrame)
title
- a frame titleicon
- a frame icon, can be nullcontent
- the frame's content panehelpId
- the id for help systemmaximizeFrame
- flag indicating whether the frame is to be maximizedpublic void setVisatExitConfirmed(boolean visatExitConfirmed)
Copyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.