|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.alchemist.AlchemistApplication
public class AlchemistApplication
| Nested Class Summary | |
|---|---|
static class |
AlchemistApplication.ExitApplicationAction
Default Exit Application Action |
static class |
AlchemistApplication.LicenseManagerAction
Default License Manager Action |
static class |
AlchemistApplication.NewDocumentAction
Default New Doucment Action |
static class |
AlchemistApplication.OpenDocumentAction
Default Open Document Action |
static class |
AlchemistApplication.SaveDocumentAction
Default Save Document Action |
static class |
AlchemistApplication.SaveDocumentAsAction
Default Save Document As Action |
| Field Summary | |
|---|---|
protected static java.lang.String |
DOCUMENT_CHANGED
document changed indicator |
protected AlchemistFileChooser |
fileChooser
the file chooser of the application |
protected chemaxon.marvin.uif.module.GUIModule |
guiModule
GUIModule for menus and toolbars |
protected chemaxon.alchemist.utils.menu.AlchemistAction |
LICENSE_MANAGER_CLOSE_ACTION
license dialog close action |
protected static java.lang.String |
NO_DOCUMENT
no document indicator |
protected static java.lang.String |
PROPERTY_KEY_APP_INSTANCE
the application instance |
static java.lang.String |
PROPERTY_KEY_CONTENT_ENABLED
|
static java.lang.String |
PROPERTY_VALUE_CONTENT_DISABLED
|
static java.lang.String |
PROPERTY_VALUE_CONTENT_DISABLED_WITH_ANIMATION
|
static java.lang.String |
PROPERTY_VALUE_CONTENT_ENABLED
|
| Constructor Summary | |
|---|---|
AlchemistApplication()
Constructor. |
|
AlchemistApplication(java.lang.String appTitle)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
createDisabledImage()
|
protected void |
disableContent(boolean showWaitAnim)
|
protected void |
enableContent()
|
protected void |
exitProgramActionHandler()
Raises confirmation dialog and exits application if it is confirmed, and application is not in disabled state |
protected boolean |
frameClosing()
This function is being called when frame is about to close. |
javax.swing.JFrame |
getApplicationFrame()
This method returns the application frame instance The contentPane should not be modified, components should be handled via getContentPane() |
AlchemistState |
getApplicationState()
This function returns the main state object of the application |
protected java.lang.String |
getApplicationTitle()
Returns the application title |
AlchemistBanner |
getBanner()
This function returns a banner instance for this application. |
java.awt.Container |
getContentPane()
This function returns the content pane of the AlchemistApplication |
protected java.awt.Dimension |
getDefaultWindowSize()
This function returns the default application frame size Default implementation returns null, indicating frame size will be the 80% of the screen |
protected java.lang.String |
getDocumentFormat()
Returns the format of current document, or null |
protected java.lang.String |
getDocumentPath()
Returns the path of current document, or null |
protected int |
getMinimumWindowHeight()
This function returns the minimum height of the application frame Default implementation returns 600 |
protected int |
getMinimumWindowWidth()
This function returns the minimum width of the application frame Default implementation returns 800 |
protected java.lang.String |
getOpenFileChooserTitle()
This function returns the title of the open file chooser, or null for default JFileChooser title |
protected javax.swing.filechooser.FileFilter[] |
getOpenFileFilters()
This function returns the FileFilters used in open file dialogs. |
protected java.lang.String |
getPropertyFilePath()
This function returns the path to property file. |
protected java.lang.String |
getSaveFileChooserTitle()
This function returns the title of the save file chooser, or null for default JFileChooser title |
protected javax.swing.filechooser.FileFilter[] |
getSaveFileFilters()
This function returns the FileFilters used in save file dialogs. |
protected javax.swing.filechooser.FileFilter |
getSaveFilter()
Returns the last save file filter selected, or null if last save call canceled |
protected java.lang.String |
getSaveFilterFormat()
Returns the format of last save filter selected, or null if filter is not a MolFileFilter or XMLFileFilter instance |
protected javax.swing.JToolBar |
getToolbar(java.lang.String toolBarID)
Returns a toolbar instance with specified id |
void |
hide()
This method hides the application frame |
void |
hideInnerDialog()
Disposes the inner dialog previously set by showInnerDialog. |
void |
hideProgressBar()
This method replaces progress bar with bottom text Releases progress monitor associated with progress bar (if any) |
protected boolean[] |
isActionsEnabled(java.lang.String[] actionIDs)
Returns if the specified actions are enabled |
protected boolean |
isDocumentChanged()
Returns the dirty bit of current document |
protected boolean |
isDocumentPathInFrameTitle()
Returns if doucment path in frame title is shown |
protected void |
licenseManagerActionHandler()
Default License Manager Action Handler Raises an inner dialog with license handler |
protected void |
licenseManagerClosed()
Invoked when license manager is closed. |
protected void |
newDocumentActionHandler()
Invoked by new document action Default implementation resets document file path document format, and dirty bit |
protected void |
openDocumentActionHandler(java.lang.String path)
Invoked by open document action |
protected void |
refreshDocumentHeader()
|
protected void |
restoreToolbar()
Restore action states on toolbar from previous suspend |
protected void |
saveDocumentActionHandler()
Invoked by save document action Default implementation clears dirty bit |
protected void |
saveDocumentAsActionHandler()
Invoked by save document as action Default implementation opens save dialog, if file accepted sets path and format, and calls saveDocumentActionHandler |
protected void |
setActionEnabled(java.lang.String actionID,
boolean enabled)
Sets the action enabled status for the specific action |
protected void |
setActionsEnabled(java.lang.String[] actionIDs,
boolean enabled)
Sets the action enabled status for an array of actions |
protected void |
setActionsEnabled(java.lang.String[] actionIDs,
boolean[] enabled)
Sets the action enabled status for an array of actions |
void |
setBanner(AlchemistBanner banner)
This method sets a banner for the application |
void |
setCustomWaitAnimation(java.lang.String path)
This method sets a custom animation as loading animation Passing null removes custom animation |
protected void |
setDocumentChanged(boolean changed)
Sets the dirty bit of current document |
protected void |
setDocumentFormat(java.lang.String format)
Sets the format of current document |
protected void |
setDocumentPath(java.lang.String path)
Sets the path of current document |
protected void |
setDocumentPathInFrameTitle(boolean value)
Sets if document path is shown in header |
static void |
setLookAndFeel()
This method tries to set the look and feel to com.jgoodies.looks.plastic.PlasticXPLookAndFeel with SkyBluer theme (falls back to system default) |
protected void |
setMenubar()
Deprecated. This method is no longer need to be called. Menu will automatically added when calling setMenuResources |
protected void |
setMenuResources(java.lang.String configPath)
Sets the menu resources and initializes inner GUIModule instance |
protected void |
setMenuResources(java.lang.String configPath,
java.lang.String bundleBaseName)
Sets the menu resources and initializes inner GUIModule instance |
protected void |
setMenuResources(java.lang.String configPath,
java.lang.String bundleBaseName,
chemaxon.alchemist.utils.menu.AlchemistActionConfigurer configurer)
Sets the menu resources and initializes inner GUIModule instance |
void |
setProgressBarText(java.lang.String progressLabelText)
This method sets the displayed progress bar text |
void |
show()
This method shows the application frame |
protected void |
showError(java.lang.String message,
java.lang.Exception exception)
Shows an error message dialog |
void |
showInnerDialog(AlchemistPage page)
Shows a modal inner dialog |
void |
showInnerDialog(javax.swing.JPanel panel)
Shows a modal inner dialog |
java.lang.String |
showOpenDialog()
This function pops up the open file dialog in single file selection mode, and returns the path of selected file |
java.lang.String |
showOpenDialog(java.lang.String function)
This function pops up the open file dialog in single file selection mode, and returns the path of selected file |
java.lang.String[] |
showOpenDialogMultiSel()
This function pops up the open file dialog in multiple file selection mode, and returns the array of selected files' path |
java.lang.String[] |
showOpenDialogMultiSel(java.lang.String function)
This function pops up the open file dialog in multiple file selection mode, and returns the array of selected files' path |
void |
showProgressBar(AlchemistProgressMonitor monitor)
This method replaces bottom text with a progress bar |
void |
showProgressBar(AlchemistProgressMonitor monitor,
javax.swing.Action cancelAction)
This method replaces bottom text with a progress bar NOTE: this method resets progress bar value |
java.lang.String |
showSaveDialog()
This function pops up the save file dialog and returns the file path selected for save |
java.lang.String |
showSaveDialog(java.lang.String function)
This function pops up the save file dialog and returns the file path selected for save |
protected void |
suspendedToolbar(java.lang.String[] excludedActions)
Suspends all actions on toolbar, but the excluded actions NOTE: can not suspend a toolbar until previous suspend not restored |
protected void |
suspendToolbar()
Suspends all actions on toolbar NOTE: can not suspend a toolbar until previous suspend not restored |
protected void |
suspendToolbar(java.lang.String excludedAction)
Suspends all actions on toolbar, but the excluded action NOTE: can not suspend a toolbar until previous suspend not restored |
void |
updateProgressBar(int percent)
This method updates progress bar to the given percent NOTE: calling showProgressBar(String progressLabelText) resets value |
protected void |
virtualHide()
Moves application window offscreen |
protected void |
virtualShow()
Moves application center screen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String PROPERTY_KEY_APP_INSTANCE
public static final java.lang.String PROPERTY_KEY_CONTENT_ENABLED
public static final java.lang.String PROPERTY_VALUE_CONTENT_ENABLED
public static final java.lang.String PROPERTY_VALUE_CONTENT_DISABLED
public static final java.lang.String PROPERTY_VALUE_CONTENT_DISABLED_WITH_ANIMATION
protected static final java.lang.String NO_DOCUMENT
protected static final java.lang.String DOCUMENT_CHANGED
protected AlchemistFileChooser fileChooser
protected chemaxon.marvin.uif.module.GUIModule guiModule
protected chemaxon.alchemist.utils.menu.AlchemistAction LICENSE_MANAGER_CLOSE_ACTION
| Constructor Detail |
|---|
public AlchemistApplication()
public AlchemistApplication(java.lang.String appTitle)
appTitle - is the title of the application| Method Detail |
|---|
public javax.swing.JFrame getApplicationFrame()
getContentPane()public java.awt.Container getContentPane()
protected boolean frameClosing()
protected java.lang.String getPropertyFilePath()
public java.lang.String showOpenDialog(java.lang.String function)
function - is the name of custom function this open dialog used by
Last open dialog path and selected extesion will be restored and stored under this function name
public java.lang.String showOpenDialog()
public java.lang.String[] showOpenDialogMultiSel(java.lang.String function)
function - is the name of custom function this open dialog used by
Last open dialog path and selected extesion will be restored and stored under this function name
public java.lang.String[] showOpenDialogMultiSel()
public java.lang.String showSaveDialog(java.lang.String function)
function - is the name of custom function this save dialog used by
Last save dialog path and selected extesion will be restored and stored under this function name
public java.lang.String showSaveDialog()
protected javax.swing.filechooser.FileFilter getSaveFilter()
protected java.lang.String getSaveFilterFormat()
public void showProgressBar(AlchemistProgressMonitor monitor)
monitor - is the progress monitor associated with progress bar
public void showProgressBar(AlchemistProgressMonitor monitor,
javax.swing.Action cancelAction)
monitor - is the progress monitor associated with progress barcancelAction - is the action will be fired when pressing cancel buttonpublic void setProgressBarText(java.lang.String progressLabelText)
progressLabelText - is the new textpublic void hideProgressBar()
public void updateProgressBar(int percent)
percent - is the new percentageshowProgressBar(AlchemistProgressMonitor),
showProgressBar(AlchemistProgressMonitor, Action)protected javax.swing.filechooser.FileFilter[] getOpenFileFilters()
protected javax.swing.filechooser.FileFilter[] getSaveFileFilters()
protected java.lang.String getOpenFileChooserTitle()
protected java.lang.String getApplicationTitle()
protected java.lang.String getSaveFileChooserTitle()
protected int getMinimumWindowWidth()
protected int getMinimumWindowHeight()
protected java.awt.Dimension getDefaultWindowSize()
public AlchemistBanner getBanner()
public void setBanner(AlchemistBanner banner)
banner - is the banner instancepublic void show()
public void hide()
protected void createDisabledImage()
protected void disableContent(boolean showWaitAnim)
protected void enableContent()
public void setCustomWaitAnimation(java.lang.String path)
path - is the path to animated image file (gif)public AlchemistState getApplicationState()
public void showInnerDialog(javax.swing.JPanel panel)
panel - is the JPanel object will be shown as dialogpublic void showInnerDialog(AlchemistPage page)
page - is the AlchemistPage object will be shown as dialogpublic void hideInnerDialog()
showInnerDialog(AlchemistPage),
showInnerDialog(JPanel panel)protected void virtualHide()
protected void virtualShow()
public static void setLookAndFeel()
protected void setMenuResources(java.lang.String configPath,
java.lang.String bundleBaseName,
chemaxon.alchemist.utils.menu.AlchemistActionConfigurer configurer)
configPath - is the path to configuration xmlbundleBaseName - is the path to bundle basenameconfigurer - is an optional configurer
protected void setMenuResources(java.lang.String configPath,
java.lang.String bundleBaseName)
configPath - is the path to configuration xmlbundleBaseName - is the path to bundle basenameprotected void setMenuResources(java.lang.String configPath)
configPath - is the path to configuration xmlprotected void setMenubar()
setMenuResources
setMenuResources(String),
setMenuResources(String, String),
setMenuResources(String, String, AlchemistActionConfigurer)protected javax.swing.JToolBar getToolbar(java.lang.String toolBarID)
toolBarID - is the toolbar id
protected void setActionEnabled(java.lang.String actionID,
boolean enabled)
actionID - is the id of the actionenabled - is the new value
protected void setActionsEnabled(java.lang.String[] actionIDs,
boolean enabled)
actionIDs - is an array of action id-senabled - is the new value
protected void setActionsEnabled(java.lang.String[] actionIDs,
boolean[] enabled)
actionIDs - is an array of action id-senabled - is the array of new valueprotected void suspendToolbar()
restoreToolbar()protected void suspendToolbar(java.lang.String excludedAction)
excludedAction - will not be suspendedrestoreToolbar()protected void suspendedToolbar(java.lang.String[] excludedActions)
excludedActions - will not be suspendedrestoreToolbar()protected void restoreToolbar()
suspendToolbar()protected boolean[] isActionsEnabled(java.lang.String[] actionIDs)
actionIDs - is an array of action id-s
protected void newDocumentActionHandler()
protected void openDocumentActionHandler(java.lang.String path)
path - is the path of file to be opened
Default implementation sets the document path,
and clears dirty bitprotected void refreshDocumentHeader()
protected void saveDocumentActionHandler()
protected void saveDocumentAsActionHandler()
protected void licenseManagerActionHandler()
protected void exitProgramActionHandler()
protected void licenseManagerClosed()
protected void setDocumentChanged(boolean changed)
changed - protected boolean isDocumentChanged()
true dirty bit is trueprotected java.lang.String getDocumentPath()
protected void setDocumentPath(java.lang.String path)
path - is the new pathprotected java.lang.String getDocumentFormat()
protected void setDocumentFormat(java.lang.String format)
format - is the new pathprotected void setDocumentPathInFrameTitle(boolean value)
value - protected boolean isDocumentPathInFrameTitle()
protected void showError(java.lang.String message,
java.lang.Exception exception)
message - is the human readable error messageexception - is the exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||