org.argouml.ui.explorer
Class PerspectiveConfigurator

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended byorg.tigris.swidgets.Dialog
                          extended byorg.argouml.ui.ArgoDialog
                              extended byorg.argouml.ui.explorer.PerspectiveConfigurator
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants

public class PerspectiveConfigurator
extends ArgoDialog

The "Configure Perspectives" dialog.

This class implements the following features:

This dialog behaves almost exactly as described in http://java.sun.com/products/jlf/at/book/Idioms6.html#57371

Since:
21 December 2003.
See Also:
Serialized Form

Nested Class Summary
(package private)  class PerspectiveConfigurator.DuplicatePerspectiveListener
          Handles pressing the Duplicate button.
(package private)  class PerspectiveConfigurator.LibraryListSelectionListener
          Handles selection changes in the library list.
(package private)  class PerspectiveConfigurator.MoveDownListener
          Handles pressing the move down button.
(package private)  class PerspectiveConfigurator.MoveUpListener
          Handles pressing the move up button.
(package private)  class PerspectiveConfigurator.NewPerspectiveListener
          Handles pressing the "New" button.
(package private)  class PerspectiveConfigurator.OkListener
          Handles pressing the OK button.
(package private)  class PerspectiveConfigurator.PerspectiveListSelectionListener
          Handles selection changes in the perspective list.
(package private)  class PerspectiveConfigurator.RemovePerspectiveListener
          Handles pressing the "Remove" button.
(package private)  class PerspectiveConfigurator.RenameDocumentListener
          Handles changes in the text in the text-entry field for the perspective name.
(package private)  class PerspectiveConfigurator.RenameListener
          Handles confirming a changed text in the text-entry field (e.g.
(package private)  class PerspectiveConfigurator.ResetListener
          Handles pressing the Reset-To-Default button.
(package private)  class PerspectiveConfigurator.RuleListener
          Handles pressing the ">>" or "<<" buttons.
(package private)  class PerspectiveConfigurator.RuleListMouseListener
          Handles double-clicking on the library list or on the ruleslist.
(package private)  class PerspectiveConfigurator.RulesListSelectionListener
          Handles selection changes in the rules list.
 
Nested classes inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  JButton addRuleButton
           
private  JPanel configPanelNorth
           
private  JPanel configPanelSouth
           
private  JButton duplicatePerspectiveButton
           
private static int INSET_PX
          Insets in pixels
private static Logger LOG
           
private  JButton moveDownButton
           
private  JButton moveUpButton
           
private  JButton newPerspectiveButton
           
private  JLabel persLabel
           
private  JList perspectiveList
           
private  DefaultListModel perspectiveListModel
           
private  JList perspectiveRulesList
           
private  DefaultListModel perspectiveRulesListModel
           
private  JButton removePerspectiveButton
           
private  JButton removeRuleButton
           
private  JTextField renameTextField
           
private  JButton resetToDefaultButton
           
private  JLabel ruleLibLabel
           
private  JList ruleLibraryList
           
private  DefaultListModel ruleLibraryListModel
           
private  JLabel rulesLabel
           
private  JSplitPane splitPane
           
 
Fields inherited from class org.argouml.ui.ArgoDialog
 
Fields inherited from class org.tigris.swidgets.Dialog
CLOSE_OPTION, DEFAULT_OPTION, OK_CANCEL_HELP_OPTION, OK_CANCEL_OPTION, YES_NO_CANCEL_HELP_OPTION, YES_NO_CANCEL_OPTION, YES_NO_HELP_OPTION, YES_NO_OPTION
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PerspectiveConfigurator(Frame parent)
          Creates a new instance of PerspectiveDesignerDialog.
 
Method Summary
private  void doAddRule()
          Add the currently selected rule from the library to the rules list for the current perspective.
private  void doRemoveRule()
          Remove the currently selected rule from the rules list for the current perspective.
private  void loadLibrary()
          Load all the existing rules from the perspective manager for presentation.
private  void loadPerspectives()
          Load the perspectives from the perspective manager for presentation.
private  void makeButtons()
          Make the buttons on the dialog box with localized strings and mnemonics.
private  void makeLayout()
          Make the layout for the dialog box.
private  void makeListeners()
          Add action listeners to the buttons and lists.
private  void makeLists()
          Make the lists on the dialog box and fill them.
private  void sortJListModel(JList list)
           
private  void updateLibLabel()
          Update the label above the library of rules list with count.
private  void updatePersLabel()
          Update the label above the list of perspectives with count.
private  void updateRuleLabel()
          Update the label above the library of rules list with count.
 
Methods inherited from class org.argouml.ui.ArgoDialog
nameButton, nameButtons
 
Methods inherited from class org.tigris.swidgets.Dialog
actionPerformed, addButton, addButton, getCancelButton, getCloseButton, getComponentGap, getContent, getHelpButton, getLabelGap, getNoButton, getOkButton, getYesButton, setContent
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

INSET_PX

private static final int INSET_PX
Insets in pixels

See Also:
Constant Field Values

configPanelNorth

private JPanel configPanelNorth

configPanelSouth

private JPanel configPanelSouth

splitPane

private JSplitPane splitPane

renameTextField

private JTextField renameTextField

newPerspectiveButton

private JButton newPerspectiveButton

removePerspectiveButton

private JButton removePerspectiveButton

duplicatePerspectiveButton

private JButton duplicatePerspectiveButton

moveUpButton

private JButton moveUpButton

moveDownButton

private JButton moveDownButton

addRuleButton

private JButton addRuleButton

removeRuleButton

private JButton removeRuleButton

resetToDefaultButton

private JButton resetToDefaultButton

perspectiveList

private JList perspectiveList

perspectiveRulesList

private JList perspectiveRulesList

ruleLibraryList

private JList ruleLibraryList

perspectiveListModel

private DefaultListModel perspectiveListModel

perspectiveRulesListModel

private DefaultListModel perspectiveRulesListModel

ruleLibraryListModel

private DefaultListModel ruleLibraryListModel

persLabel

private JLabel persLabel

ruleLibLabel

private JLabel ruleLibLabel

rulesLabel

private JLabel rulesLabel
Constructor Detail

PerspectiveConfigurator

public PerspectiveConfigurator(Frame parent)
Creates a new instance of PerspectiveDesignerDialog.

Parameters:
parent - the parent frame
Method Detail

makeLists

private void makeLists()
Make the lists on the dialog box and fill them.


makeButtons

private void makeButtons()
Make the buttons on the dialog box with localized strings and mnemonics.


makeLayout

private void makeLayout()
Make the layout for the dialog box.


makeListeners

private void makeListeners()
Add action listeners to the buttons and lists.


loadLibrary

private void loadLibrary()
Load all the existing rules from the perspective manager for presentation. These will be presented as the library of rules the user may pick from.


loadPerspectives

private void loadPerspectives()
Load the perspectives from the perspective manager for presentation.


updatePersLabel

private void updatePersLabel()
Update the label above the list of perspectives with count.


updateLibLabel

private void updateLibLabel()
Update the label above the library of rules list with count.


updateRuleLabel

private void updateRuleLabel()
Update the label above the library of rules list with count.


sortJListModel

private void sortJListModel(JList list)
Parameters:
list - the JList to be sorted

doAddRule

private void doAddRule()
Add the currently selected rule from the library to the rules list for the current perspective.


doRemoveRule

private void doRemoveRule()
Remove the currently selected rule from the rules list for the current perspective.



ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook