net.sf.sdedit.ui.impl
Class UserInterfaceImpl

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by net.sf.sdedit.ui.impl.UserInterfaceImpl
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, HyperlinkListener, RootPaneContainer, WindowConstants, Constants, ATabbedPaneListener, FullScreenListener, UserInterface

public final class UserInterfaceImpl
extends JFrame
implements Constants, UserInterface, ChangeListener, FullScreenListener, HyperlinkListener, ATabbedPaneListener

See Also:
Serialized Form

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 javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
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.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
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

UserInterfaceImpl

public UserInterfaceImpl()
Method Detail

showAboutDialog

public void showAboutDialog(URL aboutURL)
Description copied from interface: UserInterface
Shows an about-dialog with a content found at the URL given.

Specified by:
showAboutDialog in interface UserInterface
Parameters:
aboutURL - a URL with the content of the about dialog

addListener

public void addListener(UserInterfaceListener listener)
Description copied from interface: UserInterface
Adds a listener to this UserInterface.

Specified by:
addListener in interface UserInterface
Parameters:
listener - a listener for the UserInterface

addCategory

public void addCategory(String category,
                        String icon)
Specified by:
addCategory in interface UserInterface

addAction

public void addAction(String category,
                      Action action,
                      Activator activator)
Description copied from interface: UserInterface
Adds a choosable component to the user interface such that on choosing it the given action is performed.

Specified by:
addAction in interface UserInterface
Parameters:
category - a string denoting the category of the action
action - a performable action
activator - an Activator that decides whether the action resp. its associated button is to be enabled

addConfigurationAction

public void addConfigurationAction(String category,
                                   ConfigurationAction<?> action,
                                   Activator activator)
Specified by:
addConfigurationAction in interface UserInterface

help

public void help(String title,
                 String path,
                 boolean navigation)
Description copied from interface: UserInterface
Displays a help page.

Specified by:
help in interface UserInterface
Parameters:
title - the title of the tab where the help page is shown
path - the path to the help document (for example /foo/bar/help.html is the path to help.html in the package foo.bar
navigation - flag denoting if a navigation tree is to be built from the anchor names inside the help page

fireCodeChanged

protected void fireCodeChanged(boolean checkSyntaxOnly)

fireCurrentTabClosing

protected void fireCurrentTabClosing()

fireHyperlinkClicked

public void fireHyperlinkClicked(String hyperlink)

currentTabClosing

public void currentTabClosing()
Description copied from interface: ATabbedPaneListener
The user requests the currently selected tab to be closed

Specified by:
currentTabClosing in interface ATabbedPaneListener

showUI

public void showUI()
Description copied from interface: UserInterface
Makes the user interface visible.

Specified by:
showUI in interface UserInterface

stateChanged

public void stateChanged(ChangeEvent e)
This method is called when the state of the ATabbedPane changes, i. e. when the tab to be displayed changes.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e -

setTabTitle

public void setTabTitle(String title)
Description copied from interface: UserInterface
Sets the title of the current tab.

Specified by:
setTabTitle in interface UserInterface
Parameters:
title - the title of the current tab

addTab

public String addTab(String tabTitle,
                     Bean<Configuration> configuration)
Description copied from interface: UserInterface
Adds a new tab to the user interface which becomes the tab that is currently selected.

Specified by:
addTab in interface UserInterface
Parameters:
tabTitle - the title of the tab
configuration - 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)
Returns:
the actual unique title of the newly added tab (may differ from the original title)

currentTab

public Tab currentTab()

getCurrentFile

public File getCurrentFile()
Description copied from interface: UserInterface
Returns the file that is associated to the text in the current tab, may be null if no such file exists.

Specified by:
getCurrentFile in interface UserInterface
Returns:
the file that is associated to the text in the current tab

setCurrentFile

public void setCurrentFile(File file)
Description copied from interface: UserInterface
Associates the given file to the text in the current tab.

Specified by:
setCurrentFile in interface UserInterface
Parameters:
file - the file to be associated to the text in the current tab

removeCurrentTab

public boolean removeCurrentTab(boolean check)
Description copied from interface: UserInterface
Removes the current tab. If the parameter check is true and there is no other tab open, the tab cannot be removed.

Specified by:
removeCurrentTab in interface UserInterface
Parameters:
check - flag denoting whether the existence of another tab is a pre-condition for removing the current tab
Returns:
a flag denoting if the current tab has in fact been removed

addToToolbar

public void addToToolbar(Action action,
                         Activator activator)
Description copied from interface: UserInterface
Adds an action that can be quickly performed (by just a single click, for instance).

Specified by:
addToToolbar in interface UserInterface

addToolbarSeparator

public void addToolbarSeparator()
Specified by:
addToolbarSeparator in interface UserInterface

makeToolbarAction

public static Action makeToolbarAction(Action action)

configure

public void configure(boolean local)
Description copied from interface: UserInterface
Shows a window where the preferences can be set

Specified by:
configure in interface UserInterface
Parameters:
local - flag denoting if diagram preferences are to be configured

redraw

public void redraw()
Description copied from interface: UserInterface
Shows the diagram generated from the code in the current tab.

Specified by:
redraw in interface UserInterface

fullScreen

public void fullScreen()
Description copied from interface: UserInterface
Shows the diagram most recently generated in a full screen view.

Specified by:
fullScreen in interface UserInterface

fullScreenModeLeft

public void fullScreenModeLeft()
Specified by:
fullScreenModeLeft in interface FullScreenListener

clearDisplay

public void clearDisplay()
Description copied from interface: UserInterface
Clears the area where the diagram is displayed.

Specified by:
clearDisplay in interface UserInterface

home

public void home()
Description copied from interface: UserInterface
Makes the left top corner of the diagram visible, which may imply that the part that is currently visible is scrolled out of view.

Specified by:
home in interface UserInterface

getCode

public String getCode()
Description copied from interface: UserInterface
Returns the code from which a diagram is to be generated or an empty string if there is no code.

Specified by:
getCode in interface UserInterface
Returns:
the code from which a diagram is to be generated or an empty string if there is no code

setCode

public void setCode(String text)
Description copied from interface: UserInterface
Sets a piece of code in the current tab to generate a diagram from.

Specified by:
setCode in interface UserInterface
Parameters:
text - a piece of code to generate a diagram from

setStatus

public void setStatus(String status)
Description copied from interface: UserInterface
Sets a status line.

Specified by:
setStatus in interface UserInterface
Parameters:
status - a status line

setQuitAction

public void setQuitAction(Action action)
Description copied from interface: UserInterface
Sets the action that is to be performed when the user quits.

Specified by:
setQuitAction in interface UserInterface
Parameters:
action - the action to be performed when the user quits

confirmOrCancel

public int confirmOrCancel(String message)
Description copied from interface: UserInterface
Asks the user to confirm something or to cancel the process that lead to the point where something must be confirmed.

Specified by:
confirmOrCancel in interface UserInterface
Parameters:
message - a message describing what is to be confirmed
Returns:
1 if the user confirms, 0 if the user disagrees, -1 for cancel

confirm

public boolean confirm(String message)
Description copied from interface: UserInterface
Asks the user for confirmation.

Specified by:
confirm in interface UserInterface
Parameters:
message - a message describing what is to be confirmed
Returns:
true iff the user confirms

getFiles

public File[] getFiles(boolean open,
                       boolean multiple,
                       String message,
                       String file,
                       File directory,
                       String... filter)
Description copied from interface: UserInterface
Lets the user choose one or more files and returns them.

Specified by:
getFiles in interface UserInterface
Parameters:
open - true if the files are to be opened
multiple - true if multiple files can be selected
message - the message describing the purpose of the file to be chosen
directory - the directory where to start choosing, or null
filter - 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
Returns:
an array of chosen files or null if no file has been chosen

message

public void message(String msg)
Description copied from interface: UserInterface
Displays a message to the user.

Specified by:
message in interface UserInterface
Parameters:
msg - a message

errorMessage

public void errorMessage(String msg)
Description copied from interface: UserInterface
Displays an error message to the user.

Specified by:
errorMessage in interface UserInterface
Parameters:
msg - an error message

moveCursorToPosition

public void moveCursorToPosition(int position)
Description copied from interface: UserInterface
Moves the cursor to the given position in the text area.

Specified by:
moveCursorToPosition in interface UserInterface
Parameters:
position - the position to where the cursor is to be moved

setErrorStatus

public void setErrorStatus(boolean warning,
                           String stat,
                           int begin,
                           int end)
Description copied from interface: UserInterface
Displays text that informs about what was entered wrongly.

Specified by:
setErrorStatus in interface UserInterface
Parameters:
warning - flag indicating if the user should only be warned
stat - text that informs about what was entered wrongly
begin - the index where the string causing the error begins
end - the index where the string causing the error ends

isClean

public boolean isClean()
Description copied from interface: UserInterface
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.

Specified by:
isClean in interface UserInterface
Returns:
flag denoting if the user has changed the text currently displayed

setClean

public void setClean()
Description copied from interface: UserInterface
Specifies that the text currently displayed is "clean", this means there are no changes made by the user.

Specified by:
setClean in interface UserInterface

undo

public void undo()
Description copied from interface: UserInterface
Undoes the last change made to the text area.

Specified by:
undo in interface UserInterface

redo

public void redo()
Description copied from interface: UserInterface
Redoes the last change that had been made to the text area and that had been made undone.

Specified by:
redo in interface UserInterface

getNumberOfTabs

public int getNumberOfTabs()
Description copied from interface: UserInterface
Returns the number of tabs currently open.

Specified by:
getNumberOfTabs in interface UserInterface
Returns:
the number of tabs that are currently open

appendText

public void appendText(String tabTitle,
                       String text)
Description copied from interface: UserInterface
Appends text in the text area of the tab identified by the first argument.

Specified by:
appendText in interface UserInterface
Parameters:
tabTitle - the name of the tab where the text is to be appended
text - the text to be appended

getString

public String getString(String question,
                        String initialValue)
Description copied from interface: UserInterface
Asks the user to type some string into an input dialog.

Specified by:
getString in interface UserInterface
Parameters:
question - the question to which the string to be typed is an answer
initialValue - the initial string that is suggested as an answer
Returns:
the string typed in by the user

addPredicateAction

public void addPredicateAction(String category,
                               String name,
                               String description,
                               String tooltip,
                               Icon icon,
                               Predicate predicate,
                               boolean initialValue)

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent event)
Specified by:
hyperlinkUpdate in interface HyperlinkListener
See Also:
HyperlinkListener.hyperlinkUpdate(javax.swing.event.HyperlinkEvent)

removeAction

public void removeAction(String category,
                         Action action)
Specified by:
removeAction in interface UserInterface

selectTabWith

public boolean selectTabWith(File file)
Description copied from interface: UserInterface
Selects the first tab that shows a diagram associated to the given file or does nothing, if no such tab exists.

Specified by:
selectTabWith in interface UserInterface
Parameters:
file - a diagram file
Returns:
flag denoting if an appropriate tab has been found

nextTab

public void nextTab()
Specified by:
nextTab in interface UserInterface

previousTab

public void previousTab()
Specified by:
previousTab in interface UserInterface

showPrintDialog

public void showPrintDialog(String filetype)
Specified by:
showPrintDialog in interface UserInterface

exit

public void exit()
Description copied from interface: UserInterface
This method is called when the application is exited. It is not supposed to call System.exit().

Specified by:
exit in interface UserInterface

getScalePanel

public ScalePanel getScalePanel()

layout

public void layout(int layout)
Specified by:
layout in interface UserInterface

enterFilterMode

public void enterFilterMode()
Description copied from interface: UserInterface
Enters the filter mode where the user can enter a command for filtering the contents of the text area.

Specified by:
enterFilterMode in interface UserInterface

leaveFilterMode

public void leaveFilterMode()
Description copied from interface: UserInterface
Leaves the filter mode, no command can be entered any more.

Specified by:
leaveFilterMode in interface UserInterface

toggleFilterMode

public void toggleFilterMode()
Description copied from interface: UserInterface
Enters the filter mode, if we are not already in it, otherwise leaves it.

Specified by:
toggleFilterMode in interface UserInterface

getConfiguration

public Bean<Configuration> getConfiguration()
Description copied from interface: UserInterface
Returns the configuration belonging to the active tab or null if the active tab does show a help page.

Specified by:
getConfiguration in interface UserInterface
Returns:
the configuration belonging to the active tab

isDiagramBlank

public boolean isDiagramBlank()
Description copied from interface: UserInterface
Returns a flag denoting if there are currently any diagram elements displayed in the current tab

Specified by:
isDiagramBlank in interface UserInterface
Returns:
a flag denoting if there are currently any diagram elements displayed in the current tab

isDiagramTabSelected

public boolean isDiagramTabSelected()
Description copied from interface: UserInterface
Returns a flag denoting if a tab with a diagram is currently selected.

Specified by:
isDiagramTabSelected in interface UserInterface
Returns:
a flag denoting if a tab with a diagram is currently selected

renderDiagram

public Diagram renderDiagram()
Description copied from interface: UserInterface
If a regular tab is open, creates a diagram from the code currently being displayed and returns it. Otherwise returns null.

Specified by:
renderDiagram in interface UserInterface
Returns:
the newly created diagram

getDiagram

public Diagram getDiagram()
Description copied from interface: UserInterface
Returns the diagram rendered most recently inside the current tab, or null, if there is not a regular tab visible.

Specified by:
getDiagram in interface UserInterface
Returns:
the diagram rendered most recently

getDiagramError

public DiagramError getDiagramError()
Description copied from interface: UserInterface
Returns the first error that has occurred during the most recent rendering of a diagram, if any.

Specified by:
getDiagramError in interface UserInterface
Returns:
the first error that has occurred during the most recent rendering of a diagram, if any

getTabs

public List<Tab> getTabs()

getOption

public String getOption(String text,
                        String... options)
Specified by:
getOption in interface UserInterface


Copyright © 2011. All Rights Reserved.