issrg.policywizard
Class PWizard

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 issrg.policywizard.PWizard
All Implemented Interfaces:
XMLChangeListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class PWizard
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, XMLChangeListener, java.awt.event.WindowListener

The Main Class for the Policy Wizard.

Contains methods for changing from one slide to the next.

Author:
Christian Azzopardi
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 BottomButtonPanel bbp
           
static java.awt.Color bgcolor
           
static ConfigurationComponent configDocument
           
static WriteToPolicy finishWizard
           
 PWizardPanel1 pwslide1
           
 PWizardPanel2 pwslide2
           
 PWizardPanel3 pwslide3
           
 PWizardPanel3b pwslide3b
           
 PWizardPanel4 pwslide4
           
 PWizardPanel4b pwslide4b
           
 PWizardPanel5 pwslide5
           
 PWizardPanel5b pwslide5b
           
 PWizardPanel6 pwslide6
           
 PWizardPanel6b pwslide6b
           
 PWizardPanel7 pwslide7
           
 PWizardPanel7a pwslide7a
           
 PWizardPanel7b pwslide7b
           
 PWizardPanel7c pwslide7c
           
 PWizardPanel7d pwslide7d
           
 PWizardPanel8 pwslide8
           
 PWizardPanel9 pwslide9
           
static Version version
           
 
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
 
Constructor Summary
PWizard()
          Creates a new instance of the Policy Wizard
PWizard(PEApplication owner)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
protected  void centerApplication()
          Centers the Application position on the screen.
 void clearTargetVectors()
          Clears the ActionPolicy, TargetPolicy, and the TargetAccessPolicy
 void closeMethod(boolean showDialog)
          Closes the application.
 void finishMethod()
          Displays the last slide of the Wizard (the one displaying the readable policy/xml).
 ConfigurationComponent getConfiguration()
          Obtains the Policy Editor config file.
 java.lang.Object getCurrentPanel()
          Obtains the current slide displayed in the Wizard.
 boolean hasChildren(java.lang.String policyTag, java.lang.String childTag)
          Checks if the policyTag has child Elements of a particular childTag tag name.
 void initBottomPanel()
          Initialises the Back/Next/Close button panel.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Acts on ItemEvents.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
static void main(java.lang.String[] args)
          The Main Application that calls the Policy Wizard constructor.
 void nextSlide(java.lang.Object slideToRemove, java.lang.Object slideToAdd)
          Removes the previous panel, and displays the panel to display.
 void setCurrentPanel(java.lang.Object o)
          Sets the current panel to be equal to the object passed.
 void setFinishButton()
          Transforms the Next Button to act as a Finish Button.
 void setNextButton()
          Sets the Next Button to act as the 'Next' Button.
 void setupSlide7()
          Sets up slide7, including the Listeners
 void setupSlide7b()
          Sets up slide7b, including the Listeners
 void setupSlide7d()
          Sets up slide7d, including the Listeners
 void setupSlide9()
          Sets up slide9.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          When the X button is pressed to close the wizard application, the same code is executed as if the user presses the Close button.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 void XMLChanged(XMLChangeEvent ev)
          When XML has changed, this method will check which nodes/slides have produced this XMLChangeEvent and modify the GUI accordingly.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
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.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, 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, 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, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
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

bbp

public BottomButtonPanel bbp

pwslide1

public PWizardPanel1 pwslide1

pwslide2

public PWizardPanel2 pwslide2

pwslide3

public PWizardPanel3 pwslide3

pwslide3b

public PWizardPanel3b pwslide3b

pwslide4

public PWizardPanel4 pwslide4

pwslide4b

public PWizardPanel4b pwslide4b

pwslide5

public PWizardPanel5 pwslide5

pwslide5b

public PWizardPanel5b pwslide5b

pwslide6

public PWizardPanel6 pwslide6

pwslide6b

public PWizardPanel6b pwslide6b

pwslide7

public PWizardPanel7 pwslide7

pwslide7a

public PWizardPanel7a pwslide7a

pwslide7b

public PWizardPanel7b pwslide7b

pwslide7c

public PWizardPanel7c pwslide7c

pwslide7d

public PWizardPanel7d pwslide7d

pwslide8

public PWizardPanel8 pwslide8

pwslide9

public PWizardPanel9 pwslide9

finishWizard

public static WriteToPolicy finishWizard

configDocument

public static ConfigurationComponent configDocument

bgcolor

public static java.awt.Color bgcolor

version

public static final Version version
Constructor Detail

PWizard

public PWizard()
Creates a new instance of the Policy Wizard


PWizard

public PWizard(PEApplication owner)
Method Detail

initBottomPanel

public void initBottomPanel()
Initialises the Back/Next/Close button panel. Sets the text the buttons will show, and the ActionListeners.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

closeMethod

public void closeMethod(boolean showDialog)
Closes the application.

If the showDialog parameter is true, a dialog will appear that will require confirmation to close the application or not.

Parameters:
showDialog - a boolean value whether to display a confirmation dialog on closing or not.

setupSlide7

public void setupSlide7()
Sets up slide7, including the Listeners


setupSlide7b

public void setupSlide7b()
Sets up slide7b, including the Listeners


setupSlide7d

public void setupSlide7d()
Sets up slide7d, including the Listeners


setupSlide9

public void setupSlide9()
Sets up slide9. Refreshes the panels to display any user privileges that were set already.


clearTargetVectors

public void clearTargetVectors()
Clears the ActionPolicy, TargetPolicy, and the TargetAccessPolicy


setFinishButton

public void setFinishButton()
Transforms the Next Button to act as a Finish Button.


finishMethod

public void finishMethod()
Displays the last slide of the Wizard (the one displaying the readable policy/xml). Transforms the Next Button to act as a Save Button.

Fills parts of the policy that are not filled in when using the wizard.


setNextButton

public void setNextButton()
Sets the Next Button to act as the 'Next' Button.


nextSlide

public void nextSlide(java.lang.Object slideToRemove,
                      java.lang.Object slideToAdd)
Removes the previous panel, and displays the panel to display. Ensures that the panel to be displayed is displayed nicely by repainting it.

It sets the current panel to be the next slide.

Parameters:
slideToRemove - The slide to remove.
slideToAdd - The slide to display.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Acts on ItemEvents. Updates the GUI accordingly to changes in the GUI properties.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

XMLChanged

public void XMLChanged(XMLChangeEvent ev)
When XML has changed, this method will check which nodes/slides have produced this XMLChangeEvent and modify the GUI accordingly.

Specified by:
XMLChanged in interface XMLChangeListener

hasChildren

public boolean hasChildren(java.lang.String policyTag,
                           java.lang.String childTag)
Checks if the policyTag has child Elements of a particular childTag tag name.

Parameters:
policyTag - The name of the parent tag.
childTag - The name of the child tags to look for.
Returns:
true if the policyTag has child Elements with tag names childTag. Otherwise false.

getCurrentPanel

public java.lang.Object getCurrentPanel()
Obtains the current slide displayed in the Wizard.

Returns:
The Current Slide that is being displayed.

setCurrentPanel

public void setCurrentPanel(java.lang.Object o)
Sets the current panel to be equal to the object passed.

Parameters:
o - the slide to set as the current panel.

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
When the X button is pressed to close the wizard application, the same code is executed as if the user presses the Close button.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

getConfiguration

public ConfigurationComponent getConfiguration()
Obtains the Policy Editor config file.

Returns:
the ConfigurationComponent, that stores the configuration file of the Policy Editor.

centerApplication

protected void centerApplication()
Centers the Application position on the screen.


main

public static void main(java.lang.String[] args)
The Main Application that calls the Policy Wizard constructor.