|
||||||||||
| 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
net.sf.sdedit.ui.impl.UserInterfaceImpl
public final class UserInterfaceImpl
| Nested Class Summary |
|---|
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 net.sf.sdedit.Constants |
|---|
ACTIVE_LIFELINE_COLOR, ANTI_ALIAS, dashed, DEFAULT_CODE_FONT, DEFAULT_CURSOR, DEFAULT_ENCODING_SCHEME, dotted, emptyStroke, GLOBAL_CONF_FILE, HAND_CURSOR, MOVE_CURSOR, SAVE_AS_FILE_PROPERTY, SAVE_AS_TYPE_PROPERTY, solid, TEST_FREEHEP_CLASSNAME, thick, thick_dashed, THREAD_COLORS |
| 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 |
| Constructor Summary | |
|---|---|
UserInterfaceImpl()
|
|
| 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. |
void |
addPredicateAction(String category,
String name,
String description,
String tooltip,
Icon icon,
Predicate predicate,
boolean initialValue)
|
String |
addTab(String tabTitle,
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 tabTitle,
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. |
Tab |
currentTab()
|
void |
currentTabClosing()
The user requests the currently selected tab to be closed |
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. |
protected void |
fireCodeChanged(boolean checkSyntaxOnly)
|
protected void |
fireCurrentTabClosing()
|
void |
fireHyperlinkClicked(String hyperlink)
|
void |
fullScreen()
Shows the diagram most recently generated in a full screen view. |
void |
fullScreenModeLeft()
|
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)
|
ScalePanel |
getScalePanel()
|
String |
getString(String question,
String initialValue)
Asks the user to type some string into an input dialog. |
List<Tab> |
getTabs()
|
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. |
void |
hyperlinkUpdate(HyperlinkEvent event)
|
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 UserInterface.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. |
static Action |
makeToolbarAction(Action action)
|
void |
message(String msg)
Displays a message to the user. |
void |
moveCursorToPosition(int position)
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 stat,
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 |
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 |
stateChanged(ChangeEvent e)
This method is called when the state of the ATabbedPane changes, i. e. |
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. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.sdedit.ui.UserInterface |
|---|
setTitle |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Constructor Detail |
|---|
public UserInterfaceImpl()
| Method Detail |
|---|
public void showAboutDialog(URL aboutURL)
UserInterface
showAboutDialog in interface UserInterfaceaboutURL - a URL with the content of the about dialogpublic void addListener(UserInterfaceListener listener)
UserInterface
addListener in interface UserInterfacelistener - a listener for the UserInterface
public void addCategory(String category,
String icon)
addCategory in interface UserInterface
public void addAction(String category,
Action action,
Activator activator)
UserInterface
addAction in interface UserInterfacecategory - 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
public void addConfigurationAction(String category,
ConfigurationAction<?> action,
Activator activator)
addConfigurationAction in interface UserInterface
public void help(String title,
String path,
boolean navigation)
UserInterface
help in interface UserInterfacetitle - 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 pageprotected void fireCodeChanged(boolean checkSyntaxOnly)
protected void fireCurrentTabClosing()
public void fireHyperlinkClicked(String hyperlink)
public void currentTabClosing()
ATabbedPaneListener
currentTabClosing in interface ATabbedPaneListenerpublic void showUI()
UserInterface
showUI in interface UserInterfacepublic void stateChanged(ChangeEvent e)
stateChanged in interface ChangeListenere - public void setTabTitle(String title)
UserInterface
setTabTitle in interface UserInterfacetitle - the title of the current tab
public String addTab(String tabTitle,
Bean<Configuration> configuration)
UserInterface
addTab in interface UserInterfacetabTitle - 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)
public Tab currentTab()
public File getCurrentFile()
UserInterface
getCurrentFile in interface UserInterfacepublic void setCurrentFile(File file)
UserInterface
setCurrentFile in interface UserInterfacefile - the file to be associated to the text in the current tabpublic boolean removeCurrentTab(boolean check)
UserInterface
removeCurrentTab in interface UserInterfacecheck - flag denoting whether the existence of another tab is a
pre-condition for removing the current tab
public void addToToolbar(Action action,
Activator activator)
UserInterface
addToToolbar in interface UserInterfacepublic void addToolbarSeparator()
addToolbarSeparator in interface UserInterfacepublic static Action makeToolbarAction(Action action)
public void configure(boolean local)
UserInterface
configure in interface UserInterfacelocal - flag denoting if diagram preferences are to be configuredpublic void redraw()
UserInterface
redraw in interface UserInterfacepublic void fullScreen()
UserInterface
fullScreen in interface UserInterfacepublic void fullScreenModeLeft()
fullScreenModeLeft in interface FullScreenListenerpublic void clearDisplay()
UserInterface
clearDisplay in interface UserInterfacepublic void home()
UserInterface
home in interface UserInterfacepublic String getCode()
UserInterface
getCode in interface UserInterfacepublic void setCode(String text)
UserInterface
setCode in interface UserInterfacetext - a piece of code to generate a diagram frompublic void setStatus(String status)
UserInterface
setStatus in interface UserInterfacestatus - a status linepublic void setQuitAction(Action action)
UserInterface
setQuitAction in interface UserInterfaceaction - the action to be performed when the user quitspublic int confirmOrCancel(String message)
UserInterface
confirmOrCancel in interface UserInterfacemessage - a message describing what is to be confirmed
public boolean confirm(String message)
UserInterface
confirm in interface UserInterfacemessage - a message describing what is to be confirmed
public File[] getFiles(boolean open,
boolean multiple,
String message,
String file,
File directory,
String... filter)
UserInterface
getFiles in interface UserInterfaceopen - 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
public void message(String msg)
UserInterface
message in interface UserInterfacemsg - a messagepublic void errorMessage(String msg)
UserInterface
errorMessage in interface UserInterfacemsg - an error messagepublic void moveCursorToPosition(int position)
UserInterface
moveCursorToPosition in interface UserInterfaceposition - the position to where the cursor is to be moved
public void setErrorStatus(boolean warning,
String stat,
int begin,
int end)
UserInterface
setErrorStatus in interface UserInterfacewarning - flag indicating if the user should only be warnedstat - 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 endspublic boolean isClean()
UserInterface
isClean in interface UserInterfacepublic void setClean()
UserInterface
setClean in interface UserInterfacepublic void undo()
UserInterface
undo in interface UserInterfacepublic void redo()
UserInterface
redo in interface UserInterfacepublic int getNumberOfTabs()
UserInterface
getNumberOfTabs in interface UserInterface
public void appendText(String tabTitle,
String text)
UserInterface
appendText in interface UserInterfacetabTitle - the name of the tab where the text is to be appendedtext - the text to be appended
public String getString(String question,
String initialValue)
UserInterface
getString in interface UserInterfacequestion - the question to which the string to be typed is an answerinitialValue - the initial string that is suggested as an answer
public void addPredicateAction(String category,
String name,
String description,
String tooltip,
Icon icon,
Predicate predicate,
boolean initialValue)
public void hyperlinkUpdate(HyperlinkEvent event)
hyperlinkUpdate in interface HyperlinkListenerHyperlinkListener.hyperlinkUpdate(javax.swing.event.HyperlinkEvent)
public void removeAction(String category,
Action action)
removeAction in interface UserInterfacepublic boolean selectTabWith(File file)
UserInterface
selectTabWith in interface UserInterfacefile - a diagram file
public void nextTab()
nextTab in interface UserInterfacepublic void previousTab()
previousTab in interface UserInterfacepublic void showPrintDialog(String filetype)
showPrintDialog in interface UserInterfacepublic void exit()
UserInterface
exit in interface UserInterfacepublic ScalePanel getScalePanel()
public void layout(int layout)
layout in interface UserInterfacepublic void enterFilterMode()
UserInterface
enterFilterMode in interface UserInterfacepublic void leaveFilterMode()
UserInterface
leaveFilterMode in interface UserInterfacepublic void toggleFilterMode()
UserInterface
toggleFilterMode in interface UserInterfacepublic Bean<Configuration> getConfiguration()
UserInterface
getConfiguration in interface UserInterfacepublic boolean isDiagramBlank()
UserInterface
isDiagramBlank in interface UserInterfacepublic boolean isDiagramTabSelected()
UserInterface
isDiagramTabSelected in interface UserInterfacepublic Diagram renderDiagram()
UserInterface
renderDiagram in interface UserInterfacepublic Diagram getDiagram()
UserInterface
getDiagram in interface UserInterfacepublic DiagramError getDiagramError()
UserInterface
getDiagramError in interface UserInterfacepublic List<Tab> getTabs()
public String getOption(String text,
String... options)
getOption in interface UserInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||