|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserInterface
Specifies the methods required of a (multi-tabbed) user interface for the Quick Sequence Diagram Editor.
| Method Summary | |
|---|---|
void |
addAction(String category,
Action action,
Activator activator)
Adds a choosable component to the user interface such that on choosing it the given action is performed. |
void |
addCategory(String category,
String icon)
|
void |
addConfigurationAction(String category,
ConfigurationAction<?> action,
Activator activator)
|
void |
addListener(UserInterfaceListener listener)
Adds a listener to this UserInterface. |
String |
addTab(String title,
Bean<Configuration> configuration)
Adds a new tab to the user interface which becomes the tab that is currently selected. |
void |
addToolbarSeparator()
|
void |
addToToolbar(Action action,
Activator activator)
Adds an action that can be quickly performed (by just a single click, for instance). |
void |
appendText(String tab,
String text)
Appends text in the text area of the tab identified by the first argument. |
void |
clearDisplay()
Clears the area where the diagram is displayed. |
void |
configure(boolean local)
Shows a window where the preferences can be set |
boolean |
confirm(String message)
Asks the user for confirmation. |
int |
confirmOrCancel(String message)
Asks the user to confirm something or to cancel the process that lead to the point where something must be confirmed. |
void |
enterFilterMode()
Enters the filter mode where the user can enter a command for filtering the contents of the text area. |
void |
errorMessage(String msg)
Displays an error message to the user. |
void |
exit()
This method is called when the application is exited. |
void |
fullScreen()
Shows the diagram most recently generated in a full screen view. |
String |
getCode()
Returns the code from which a diagram is to be generated or an empty string if there is no code. |
Bean<Configuration> |
getConfiguration()
Returns the configuration belonging to the active tab or null if the active tab does show a help page. |
File |
getCurrentFile()
Returns the file that is associated to the text in the current tab, may be null if no such file exists. |
Diagram |
getDiagram()
Returns the diagram rendered most recently inside the current tab, or null, if there is not a regular tab visible. |
DiagramError |
getDiagramError()
Returns the first error that has occurred during the most recent rendering of a diagram, if any. |
File[] |
getFiles(boolean open,
boolean multiple,
String message,
String file,
File directory,
String... filter)
Lets the user choose one or more files and returns them. |
int |
getNumberOfTabs()
Returns the number of tabs currently open. |
String |
getOption(String text,
String... options)
|
String |
getString(String question,
String initialValue)
Asks the user to type some string into an input dialog. |
void |
help(String title,
String path,
boolean navigation)
Displays a help page. |
void |
home()
Makes the left top corner of the diagram visible, which may imply that the part that is currently visible is scrolled out of view. |
boolean |
isClean()
A flag denoting if the user has not changed the text currently displayed since last time the current tab had been added or setClean() had been called. |
boolean |
isDiagramBlank()
Returns a flag denoting if there are currently any diagram elements displayed in the current tab |
boolean |
isDiagramTabSelected()
Returns a flag denoting if a tab with a diagram is currently selected. |
void |
layout(int layout)
|
void |
leaveFilterMode()
Leaves the filter mode, no command can be entered any more. |
void |
message(String msg)
Displays a message to the user. |
void |
moveCursorToPosition(int pos)
Moves the cursor to the given position in the text area. |
void |
nextTab()
|
void |
previousTab()
|
void |
redo()
Redoes the last change that had been made to the text area and that had been made undone. |
void |
redraw()
Shows the diagram generated from the code in the current tab. |
void |
removeAction(String category,
Action action)
|
boolean |
removeCurrentTab(boolean check)
Removes the current tab. |
Diagram |
renderDiagram()
If a regular tab is open, creates a diagram from the code currently being displayed and returns it. |
boolean |
selectTabWith(File file)
Selects the first tab that shows a diagram associated to the given file or does nothing, if no such tab exists. |
void |
setClean()
Specifies that the text currently displayed is "clean", this means there are no changes made by the user. |
void |
setCode(String text)
Sets a piece of code in the current tab to generate a diagram from. |
void |
setCurrentFile(File file)
Associates the given file to the text in the current tab. |
void |
setErrorStatus(boolean warning,
String errorStatus,
int begin,
int end)
Displays text that informs about what was entered wrongly. |
void |
setQuitAction(Action action)
Sets the action that is to be performed when the user quits. |
void |
setStatus(String status)
Sets a status line. |
void |
setTabTitle(String title)
Sets the title of the current tab. |
void |
setTitle(String title)
Sets the title of the user interface. |
void |
showAboutDialog(URL aboutURL)
Shows an about-dialog with a content found at the URL given. |
void |
showPrintDialog(String filetype)
|
void |
showUI()
Makes the user interface visible. |
void |
toggleFilterMode()
Enters the filter mode, if we are not already in it, otherwise leaves it. |
void |
undo()
Undoes the last change made to the text area. |
| Method Detail |
|---|
void addListener(UserInterfaceListener listener)
listener - a listener for the UserInterface
void addAction(String category,
Action action,
Activator activator)
category - a string denoting the category of the actionaction - a performable actionactivator - an Activator that decides whether the action
resp. its associated button is to be enabled
void addCategory(String category,
String icon)
void removeAction(String category,
Action action)
void nextTab()
void previousTab()
void addConfigurationAction(String category,
ConfigurationAction<?> action,
Activator activator)
Diagram renderDiagram()
Diagram getDiagram()
DiagramError getDiagramError()
void setQuitAction(Action action)
action - the action to be performed when the user quitsvoid setCode(String text)
text - a piece of code to generate a diagram from
void appendText(String tab,
String text)
tab - the name of the tab where the text is to be appendedtext - the text to be appendedString getCode()
void redraw()
void setStatus(String status)
status - a status lineint confirmOrCancel(String message)
message - a message describing what is to be confirmed
boolean confirm(String message)
message - a message describing what is to be confirmed
File[] getFiles(boolean open,
boolean multiple,
String message,
String file,
File directory,
String... filter)
open - true if the files are to be openedmultiple - true if multiple files can be selectedmessage - the message describing the purpose of the file to be chosendirectory - the directory where to start choosing, or nullfilter - can be empty, in which case no file filter is used, otherwise
the first string is a description of the filter and the
remaining strings are extensions of files to be shown
String getString(String question,
String initialValue)
question - the question to which the string to be typed is an answerinitialValue - the initial string that is suggested as an answer
void configure(boolean local)
local - flag denoting if diagram preferences are to be configuredvoid message(String msg)
msg - a messagevoid showUI()
void errorMessage(String msg)
msg - an error messagevoid setTitle(String title)
title - the title of the user interface.
void addToToolbar(Action action,
Activator activator)
quickAction - an action that can be quickly performedvoid addToolbarSeparator()
void moveCursorToPosition(int pos)
pos - the position to where the cursor is to be moved
void setErrorStatus(boolean warning,
String errorStatus,
int begin,
int end)
warning - flag indicating if the user should only be warnederrorStatus - text that informs about what was entered wronglybegin - the index where the string causing the error beginsend - the index where the string causing the error endsvoid home()
String addTab(String title,
Bean<Configuration> configuration)
title - the title of the tabconfiguration - the configuration to be used for the diagram that is displayed
by the tab (typically a default configuration for empty tabs
or a loaded configuration for tabs that show diagrams loaded
from files)
void setTabTitle(String title)
title - the title of the current tabboolean removeCurrentTab(boolean check)
check - flag denoting whether the existence of another tab is a
pre-condition for removing the current tab
File getCurrentFile()
void setCurrentFile(File file)
file - the file to be associated to the text in the current tabboolean isClean()
void setClean()
void help(String title,
String path,
boolean navigation)
title - the title of the tab where the help page is shownpath - the path to the help document (for example /foo/bar/help.html
is the path to help.html in the package foo.barnavigation - flag denoting if a navigation tree is to be built from the
anchor names inside the help pagevoid undo()
void redo()
void clearDisplay()
int getNumberOfTabs()
void showAboutDialog(URL aboutURL)
aboutURL - a URL with the content of the about dialogvoid fullScreen()
void enterFilterMode()
void leaveFilterMode()
void toggleFilterMode()
void showPrintDialog(String filetype)
boolean selectTabWith(File file)
file - a diagram file
void exit()
void layout(int layout)
boolean isDiagramBlank()
boolean isDiagramTabSelected()
Bean<Configuration> getConfiguration()
String getOption(String text,
String... options)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||