|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.ceryle.ui.Desktop
public class Desktop
A singleton class that creates the ceryle UI application desktop. To obtain the instance of this class:
Desktop desktop = Desktop.getInstance();
Copyright 2001-2007 Murray Altheim. All Rights Reserved.
DocumentView,
GraphView,
Serialized Form| Nested Class Summary | |
|---|---|
class |
Desktop.WindowEventHandler
The listener class to handle the closing of a window. |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
ImageIcon |
addIcon
|
boolean |
autoSaveHistory
When true, automatically saves the find, replace, and location bar histories to ".ceryle.hist". |
boolean |
autoSaveSettings
When true, automatically saves the current settings to the preferences file. |
ImageIcon |
bookmarkIcon
|
ImageIcon |
browseIcon
|
protected HelpButton |
btn_help
|
ImageIcon |
colIcon
|
ImageIcon |
colOpenIcon
|
ImageIcon |
databaseIcon
|
ImageIcon |
dbrootIcon
|
protected int |
defWFHeight
|
ImageIcon |
dirtyDocIcon
|
ImageIcon |
dirtyGraphIcon
|
ImageIcon |
dirtyNoteIcon
|
ImageIcon |
dirtyProjIcon
|
ImageIcon |
docIcon
|
ImageIcon |
docPDFIcon
|
ImageIcon |
docPlainIcon
|
ImageIcon |
docWordIcon
|
protected JLabel |
editAlert
|
protected JLabel |
editState
|
StackSet |
findHistory
Contents of find (query string) history. |
ImageIcon |
folderIcon
|
ImageIcon |
folderOpenIcon
|
ImageIcon |
graphIcon
|
ImageIcon |
historyIcon
|
boolean |
m_confirmQuit
When true, pops up a confirm dialog prior to exiting the application. |
boolean |
m_confirmQuitHTTP
When true, pops up a confirm dialog prior to exiting the application, if the Web server is running. |
protected JPopupMenu |
m_dtpopup
The popup menu for the desktop. |
protected static HelpDialog |
m_help_dlog
The Help Dialog used by the Desktop. |
protected JScrollPane |
m_msgscroll
|
protected JSplitPane |
m_msgsplit
|
protected MessageView |
m_msgview
|
protected PreferencesDialog |
m_prefsDlog
|
protected ProgressBar |
m_progress
|
protected FrequencyModel |
m_recent_graph_list
The model behind the recently-opened graph list. |
protected JPanel |
m_statusArea
|
protected JLabel |
m_statusMsg1
|
protected JLabel |
m_statusMsg2
|
protected WebIndicator |
m_webIndicator
|
protected int |
maxWFHeight
|
protected int |
maxWFWidth
|
DesktopMenus |
menus
The utility that creates the Desktop menus. |
ImageIcon |
metadataHideIcon
|
ImageIcon |
metadataIcon
|
ImageIcon |
metaIcon
|
protected int |
minWFHeight
|
protected int |
minWFWidth
|
ImageIcon |
msgIcon
|
ImageIcon |
noteIcon
|
ImageIcon |
projIcon
|
static String |
PROPERTY_frameBounds
Ceryle property determining the bounds of the application desktop. |
static String |
PROPERTY_locationBarSearchVisible
Ceryle property determining the visibility of the location toolbar's search field. |
static String |
PROPERTY_locationBarVisible
Ceryle property determining the visibility of the location toolbar. |
static String |
PROPERTY_menubarHeight
Ceryle property for menubar height, assisting in determining the bounds of the application frame. |
static String |
PROPERTY_popupBounds
Ceryle property determining the bounds of the popup frames. |
static String |
PROPERTY_splitPaneLoc
Ceryle property determining the location of the message split pane. |
ImageIcon |
removeIcon
|
StackSet |
replaceHistory
Contents of replace history. |
ImageIcon |
rootIcon
|
StackSet |
searchLocHistory
Contents of search directory history. |
protected SourceProcessor |
sproc
The SourceProcessor used for source handling (I/O). |
ImageIcon |
status_dirtyDocIcon
|
ImageIcon |
status_dirtyGraphIcon
|
ImageIcon |
status_docIcon
|
ImageIcon |
status_errorIcon
|
ImageIcon |
status_graphIcon
|
ImageIcon |
status_noticeIcon
|
ImageIcon |
status_nullIcon
|
ImageIcon |
status_warnIcon
|
Cursor |
waitCursor
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
void |
addToRecentGraphList(String systemId)
Adds the system identifier at the top of the recent graph document list. |
void |
displayScriptConsole()
A convenience method that starts the GroovyService (if not already running), and then displays a GroovyConsole. |
void |
enableBackgroundClassifier(boolean enable)
Starts the BackgroundClassifier if it has not been started, or kills it if it has. |
void |
errorDialog(String title,
String message)
Displays an error containing the String message. |
protected void |
fireEvent()
Fires a ChangeEvent to all registered listeners, indicating some significant change in server status. |
BackgroundClassifier |
getBackgroundClassifier()
Returns the BackgroundClassifier, null if it has not been created. |
BookmarksMenu |
getBookmarksMenu()
Returns the current Bookmarks menu. |
ColorLookupTable |
getCLUT(String name)
Returns the ColorLookupTable corresponding to the name. |
FindReplaceDialog |
getFindReplaceDialog()
Returns a FindReplaceDialog, null if it has not been created. |
FindReplaceDialog |
getFindReplaceDialog(String defaultString,
boolean replace,
boolean show)
Returns a lazily-created FindReplaceDialog, either in Find or Replace mode. |
GroovyService |
getGroovyService()
Returns a GroovyService object, providing Groovy script and console services. |
static Desktop |
getInstance()
As this is a singleton class, this returns the single instance of this class using the available Services object. |
ResourceOpener |
getLoadingThread()
Returns the most recently added ResourceOpener thread, null if there is no open Thread. |
Iterator |
getLocationBarHistory()
Returns an Iterator over the String contents of the LocationBar's history, null if empty. |
String |
getLocationValue()
Returns the text content of the LocationBar's URI field as a String. |
MessageView |
getMessageView()
Return the MessageView, the messaging area on the lower part of the main horizontal split pane. |
Rectangle |
getPopupBounds()
Returns the current recommended size for popup windows. |
ProgressBar |
getProgressBar()
Return the progress bar. |
int |
getProgressValue()
Return an int representing the current the progress bar value. |
FrequencyModel |
getRecentGraphList()
Returns the recent graph document list. |
Component |
getScriptConsole()
Return the registered Groovy console as an Object. |
Services |
getServices()
Returns the Services object used with this Desktop. |
SourceProcessor |
getSourceProcessor()
Returns the SourceProcessor used for document I/O. |
ViewManager |
getViewManager()
Returns the ViewManager used by this Desktop. |
boolean |
hasFindReplaceDialog()
Returns true if the FindReplaceDialog has been created. |
static boolean |
hasInstance()
Returns true if this class has been instantiated. |
void |
interpretScript(File file)
Starts the GroovyService (if not already running), and then opens and interprets a Groovy script file. |
protected boolean |
isLocationBarSearchVisible()
Returns the visibility of the location bar search field. |
protected boolean |
isLocationBarVisible()
Returns the visibility of the Location Bar. |
boolean |
isMessageVisible()
Returns true if the message panel is visible (in this case, more than 10% visible). |
boolean |
isOpeningResource(String systemId)
Returns true if a ResourceOpener is already attempting to open the provided SystemId. |
ColorLookupTable |
loadCLUT(String name)
Loads the ColorLookupTable whose name is name. |
Plugin |
loadPlugin(String path)
Returns a plugin whose identifier is the String path. |
Color |
lookup(String tableName,
String colorName,
Color failColor)
Returns the Color corresponding to the named color in the specified color table. |
void |
maximizeWorkArea()
Maximizes the work area by hiding various components. |
boolean |
openResource(ResourceOpener ro)
If no ResourceOpener thread is active, returns true regardless of the value of the ResourceOpener ro, allowing new openers to be started. |
boolean |
processURI(String uri)
Load content referenced by the URI. |
void |
progressFlashStart()
Starts flashing the progress bar as a progress indicator. |
void |
progressFlashStop()
Stops the flashing of the progress bar. |
void |
quit(boolean force)
Quit the application. |
void |
quit(boolean confirm,
boolean force)
Quit the application. |
boolean |
resourceOpened(ResourceOpener ro)
Removes the provided ResourceOpener from the Stack of opener Threads. |
protected void |
restoreSplitPaneLocation()
Restore the editor's split pane location from the preferences file, or set to 93% if unavailable. |
void |
runTests(boolean all)
Run the application-level test harness. |
void |
saveDefaultViewProperty()
Store the frontmost view type as the startup view to the preferences file. |
void |
saveDefaultViewProperty(int type)
Store the View type int type as the startup view to the preferences file. |
void |
saveHistory()
Store the current location, find and replace histories to a preferences file. |
protected void |
saveLocationBarVisibility()
Store the visibility of the location bar to the preferences file. |
protected void |
saveSettings()
Saves various session preferences to the preferences file. |
Iterator |
selectCollections(String title,
String message,
boolean multiple)
Shows a dialog allowing discontiguous selection among the list of Collections when multiple is true, a single selection when false, returning an Iterator over the chosen Collections. |
Font |
selectFont()
Shows a dialog allowing a selection among the list of available fonts, returning the selected Font, or null null if no selection was made. |
Iterator |
selectNodes(String cid,
String title,
String message,
boolean multiple)
Shows a dialog allowing discontiguous selection among the list of Nodes in the Collection cid when multiple is true, a single selection when false, returning an Iterator over the chosen Node IDs (not the nodes themselves). |
protected void |
setAlertIcon(int status,
String tooltip)
Sets the alert icon on the status bar to indicate the current notice, warning, or error status. |
void |
setF1Visible(boolean active)
Indicate the active state of the help dialog (use true when in tutorial). |
void |
setGraphPriority(boolean hasPriority)
Sets the thread priority of the graph display to a high value when the parameter is true, a low value when false. |
protected void |
setLocationBarSearchVisible(boolean visible)
Store the visibility of the location bar search to the boolean visible. |
protected void |
setLocationBarVisible(boolean visible)
Store the visibility of the Location Bar to the boolean visible. |
void |
setLocationValue(String uri,
boolean helpersActive)
Sets the text content of the LocationBar's URI field to the String uri. |
void |
setMessageDividerLocation(double loc)
Sets the position of the vertical divider location between the message area and the desktop. |
void |
setPopupBounds(Rectangle bounds)
Sets the current recommended size for popup windows to the provided Rectangle. |
void |
setProgressLimits(int min,
int max)
Set the progress bar minimum and maximum to the provided int values. |
void |
setProgressString(String s)
Set the progress bar text to the provided String. |
void |
setProgressValue(int value)
Set the progress bar value to the provided int. |
void |
setScriptConsole(Component console)
Register an Component as a Groovy console. |
void |
setScriptObject(Object o)
|
void |
setSourceProcessor(SourceProcessor sourceProcessor)
Sets the SourceProcessor used for document I/O to sourceproc. |
protected void |
setStatusIcon(int type,
boolean isDirty)
Sets the icon on the status bar to indicate the current ViewPanel. |
void |
setWebServerActive(boolean active)
Sets the visibility of the web server indicator. |
void |
showAbout()
Display the Ceryle About dialog. |
void |
showDesktop()
Show the Desktop with the initial view set to either the default, or that stored in session preferences. |
void |
showDesktop(int type)
Show the Desktop, with the initial view set to the enumerated int type. |
FindReplaceDialog |
showFindReplaceDialog(int mode)
Shows the FindReplaceDialog configured via int mode, whose values are the BitSet in FindReplaceDialog. |
void |
showHelp(boolean reset,
String id,
boolean modal)
Display the Ceryle application help. |
void |
showHelp(String id)
Display the Ceryle application help with the provided Topic shown. |
void |
showPreferences(String type)
Sets various user preferences. |
void |
showWaitCursor(boolean wait)
Sets the wait cursor when the parameter is true. |
boolean |
terminateOnError(int warnings,
int maxWarnings,
int errors,
int maxErrors)
This method is called by the MessageHandler if the number of warnings or errors exceeds the set maximum. |
void |
unimplemented()
A temporary method to handle unimplemented menu and button method calls. |
void |
webServerActivity()
When called, briefly indicates activity on the web server. |
void |
writeInfo(String message)
Sets the text content of the secondary status message area to the String message. |
String |
writeMessage(int status,
String message)
Write the contents of the String message to the MessageView area, prepending an indicator of the status. |
void |
writeMessage(String message)
Write the contents of the String message to the MessageView area. |
void |
writeStatus(String message)
Sets the text content of the primary status message area to the String message. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final String PROPERTY_splitPaneLoc
public static final String PROPERTY_frameBounds
public static final String PROPERTY_popupBounds
public static final String PROPERTY_menubarHeight
public static final String PROPERTY_locationBarVisible
public static final String PROPERTY_locationBarSearchVisible
public boolean autoSaveHistory
public boolean autoSaveSettings
public StackSet searchLocHistory
public StackSet findHistory
public StackSet replaceHistory
public ImageIcon colIcon
public ImageIcon colOpenIcon
public ImageIcon rootIcon
public ImageIcon dbrootIcon
public ImageIcon folderIcon
public ImageIcon folderOpenIcon
public ImageIcon docIcon
public ImageIcon docPlainIcon
public ImageIcon docWordIcon
public ImageIcon docPDFIcon
public ImageIcon noteIcon
public ImageIcon dirtyNoteIcon
public ImageIcon dirtyDocIcon
public ImageIcon projIcon
public ImageIcon dirtyProjIcon
public ImageIcon graphIcon
public ImageIcon dirtyGraphIcon
public ImageIcon browseIcon
public ImageIcon msgIcon
public ImageIcon addIcon
public ImageIcon removeIcon
public ImageIcon metaIcon
public ImageIcon metadataIcon
public ImageIcon metadataHideIcon
public ImageIcon databaseIcon
public ImageIcon bookmarkIcon
public ImageIcon historyIcon
public ImageIcon status_noticeIcon
public ImageIcon status_warnIcon
public ImageIcon status_errorIcon
public ImageIcon status_docIcon
public ImageIcon status_dirtyDocIcon
public ImageIcon status_graphIcon
public ImageIcon status_dirtyGraphIcon
public ImageIcon status_nullIcon
public DesktopMenus menus
public final Cursor waitCursor
public boolean m_confirmQuit
public boolean m_confirmQuitHTTP
protected static HelpDialog m_help_dlog
protected FrequencyModel m_recent_graph_list
protected HelpButton btn_help
protected JPanel m_statusArea
protected JLabel m_statusMsg1
protected JLabel m_statusMsg2
protected final ProgressBar m_progress
protected JSplitPane m_msgsplit
protected JScrollPane m_msgscroll
protected MessageView m_msgview
protected PreferencesDialog m_prefsDlog
protected final WebIndicator m_webIndicator
protected final JLabel editState
protected final JLabel editAlert
protected int minWFWidth
protected int maxWFWidth
protected int defWFHeight
protected int minWFHeight
protected int maxWFHeight
protected SourceProcessor sproc
protected JPopupMenu m_dtpopup
| Method Detail |
|---|
public static boolean hasInstance()
public boolean terminateOnError(int warnings,
int maxWarnings,
int errors,
int maxErrors)
Note that if the user chooses to exit, the ViewManager is sent
a ViewManager.closeAllFrames() message.
Implements the SafeQuit API.
terminateOnError in interface SafeQuitpublic static Desktop getInstance()
public Plugin loadPlugin(String path)
public ColorLookupTable getCLUT(String name)
public ColorLookupTable loadCLUT(String name)
getCLUT(String),
which caches existing ones.
public Color lookup(String tableName,
String colorName,
Color failColor)
Note that currently the table name is ignored - there's only one loaded CLUT at a time.
public void setWebServerActive(boolean active)
public void webServerActivity()
public void setF1Visible(boolean active)
public boolean hasFindReplaceDialog()
public FindReplaceDialog showFindReplaceDialog(int mode)
FindReplaceDialog.
If the value is -1, the keyword mode will be used.
public FindReplaceDialog getFindReplaceDialog()
getFindReplaceDialog(String,boolean,boolean) to create it.
public FindReplaceDialog getFindReplaceDialog(String defaultString,
boolean replace,
boolean show)
public GroovyService getGroovyService()
public void displayScriptConsole()
public void setScriptObject(Object o)
public void setScriptConsole(Component console)
This generally uses the groovy.swing.impl.ComponentFacade API to provide access to the Groovy implementation of the component used for the console window, providing a common reference point for Groovy scripts to obtain access to the console frame, no matter what Component subclass it might be.
Consoles implementing the ComponentFacade interface can set their
frames as the outer Component (generally for purposes of positioning
dialog boxes) using setScriptConsole(Component) and then
any Groovy scripts can obtain the console window via this method.
import org.ceryle.ui.Desktop import java.awt.Component ... Component console = Desktop.getInstance().getScriptConsole()
getScriptConsole()public Component getScriptConsole()
for notes.public void interpretScript(File file)
public BookmarksMenu getBookmarksMenu()
public void showDesktop()
public BackgroundClassifier getBackgroundClassifier()
public void enableBackgroundClassifier(boolean enable)
public void showDesktop(int type)
View.NOTE,
View.DOCUMENT,
View.GRAPHprotected final void fireEvent()
public Services getServices()
Ceryle,
Servicespublic ViewManager getViewManager()
ViewManager
public Iterator selectCollections(String title,
String message,
boolean multiple)
The title and message are optional; defaults will be used when null values are provided. Returns null if no selection was made, the database is not connected, or there are no collections in the database.
title - the optional dialog box titlemessage - the optional dialog box messagemultiple - when true, allows multiple selection
public Iterator selectNodes(String cid,
String title,
String message,
boolean multiple)
throws ProcessException
ProcessExceptionpublic Font selectFont()
public void writeMessage(String message)
MessageWriter API.
writeMessage in interface MessageWriter
public String writeMessage(int status,
String message)
MessageWriter API.
writeMessage in interface MessageWriterMessageHandlerpublic void writeStatus(String message)
G27y.getStyleString(int,String).
The primary status area resides at the leftmost part of the status bar.
This method implements the MessageWriter API.
writeStatus in interface MessageWriterpublic void writeInfo(String message)
public String getLocationValue()
public void setLocationValue(String uri,
boolean helpersActive)
public Iterator getLocationBarHistory()
protected void setLocationBarVisible(boolean visible)
protected boolean isLocationBarVisible()
protected void saveLocationBarVisibility()
protected void setLocationBarSearchVisible(boolean visible)
protected boolean isLocationBarSearchVisible()
public FrequencyModel getRecentGraphList()
public void addToRecentGraphList(String systemId)
public void runTests(boolean all)
protected void saveSettings()
saveHistory()).
public void showPreferences(String type)
public Rectangle getPopupBounds()
public void setPopupBounds(Rectangle bounds)
public void saveDefaultViewProperty()
public void saveDefaultViewProperty(int type)
public void saveHistory()
public boolean isMessageVisible()
protected void restoreSplitPaneLocation()
public void setProgressLimits(int min,
int max)
public void setProgressString(String s)
public void setProgressValue(int value)
public ProgressBar getProgressBar()
public int getProgressValue()
public void progressFlashStart()
public void progressFlashStop()
public void setGraphPriority(boolean hasPriority)
public ResourceOpener getLoadingThread()
public boolean resourceOpened(ResourceOpener ro)
public boolean isOpeningResource(String systemId)
public boolean openResource(ResourceOpener ro)
public boolean processURI(String uri)
public void showWaitCursor(boolean wait)
public MessageView getMessageView()
public void setMessageDividerLocation(double loc)
public void maximizeWorkArea()
public void errorDialog(String title,
String message)
protected void setStatusIcon(int type,
boolean isDirty)
protected void setAlertIcon(int status,
String tooltip)
MessageHandler:
MessageHandler.ERROR
indicates an error has occurred.MessageHandler.WARN
indicates a warning has occurred.MessageHandler.NOTICE
indicates a notice has occurred.MessageHandler.OK
causes the icon to be cleared/hidden.If the tooltip parameter is non-null it will be applied to the status alert icon regardless of state.
public void setSourceProcessor(SourceProcessor sourceProcessor)
public SourceProcessor getSourceProcessor()
public void quit(boolean force)
public void quit(boolean confirm,
boolean force)
Implements the SafeQuit API.
quit in interface SafeQuitpublic void showAbout()
public void showHelp(String id)
public void showHelp(boolean reset,
String id,
boolean modal)
public void unimplemented()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||