issrg.editor2
Class PEApplication

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.editor2.PEApplication
All Implemented Interfaces:
java.awt.event.ComponentListener, 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 PEApplication
extends javax.swing.JFrame
implements java.awt.event.WindowListener, java.awt.event.ComponentListener

PEApplication Class. The main Class with all its Main Methods. The main window extends a JFrame, and the subpolicies are in turn implemented in JInternalFrames. This Main Class mainly acts as a loader that puts the menus in place, and loads all labels from the PEApplication resource bundle. The menu buttons are in turn added to their respective listeners to perform the methods when clicked.

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
static ConfigurationComponent configComponent
           
 javax.swing.JDesktopPane desktop
           
static ErrorLogger errorLogger
           
static OptionsDialog ldapConfigWin
          Creates a new instance of the OptionsDialog.
 int newPolicyWindow
           
static PEApplication pea
           
 javax.swing.JPanel statusBar
           
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
PEApplication()
          Constructor creating a new Application window workbench.
 
Method Summary
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void create_about()
           
 void create_exit()
          Method called to ensure successful exit of the application.
 void create_ldapDialog()
           
 void create_pemanual()
           
 void create_pemanualFont()
           
 void create_policy(boolean choosePolicy, java.lang.String types)
          Method to create or load a policy.
 void create_policyViewer()
          On obtaining the Active open and focused policy, this methd will call the method to create a policy viewer and display the xml file and the readable policy side by side.
 void create_printreadablepolicy()
          On obtaining the Active open and focussed policy, this will call the print Readable Policy method.
 void create_printxml()
          On obtaining the Active open and focussed policy, this will call the print XML method.
 void create_readablepolicy()
          On obtaining the Active open and focussed policy, this method will call the method to create a window and display the human readable policy inside it.
 void create_redo()
          On obtaining the Active open and focussed policy, this method will call the method to redo.
 void create_save_dialog(PECFrame pecf)
          Used to check whether the Policy Editor window is saved or not when it has been closed.
 boolean create_save(boolean show_dialog)
          Saves Current Policy Editor Component according to Flag.
 void create_signandpublish()
           
 void create_text()
           
 void create_undo()
          On obtaining the Active open and focussed policy, this method will call the method to undo.
 void create_validate()
           
 void create_wizzard()
           
 void create_xml()
          On obtaining the Active open and focussed policy, this method will call the method to create a window and display the XML inside the newly opened window.
 void createGUI()
          Creates the GUI for the main application.
 javax.swing.JInternalFrame createInternalFrame(javax.swing.JFrame f, java.lang.String s)
           
 PECFrame getActivePECF()
          This method returns the current active policy window, if any.
static ConfigurationComponent getConfiguration()
           
 void importPolicyFromXMLEditor(XMLEditor policyDocument)
           
static void main(java.lang.String[] args)
          The Main method sets the look and feel of the application.
 void openFromLDAP()
           
 void openFromWebDAV()
           
 void prepareStatusBar()
           
 void readLabels(java.lang.String filename)
          Label Loader Method.
 void updateGUI(XMLEditor xmlED)
          This method is called to update the GUI, when there has been any modifications to a policy.
 void updateXValue()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowGainedFocus(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowLostFocus(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 void windowStateChanged(java.awt.event.WindowEvent e)
           
 
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

pea

public static PEApplication pea

desktop

public javax.swing.JDesktopPane desktop

statusBar

public javax.swing.JPanel statusBar

newPolicyWindow

public int newPolicyWindow

version

public static final Version version

configComponent

public static ConfigurationComponent configComponent

errorLogger

public static ErrorLogger errorLogger

ldapConfigWin

public static OptionsDialog ldapConfigWin
Creates a new instance of the OptionsDialog. This is not set to visible until needed. The PEApplication is the owner of this Dialog.

Constructor Detail

PEApplication

public PEApplication()
Constructor creating a new Application window workbench.

All the labels required for the applications main window will be loaded using the readLabels. The File Path specified will be the one in which the .properties resource bundle file will be searched.

This the Creates the GUI as we need it to appear. A JDesktopPane with a menubar, containing all the application options.

Method Detail

prepareStatusBar

public void prepareStatusBar()

updateGUI

public void updateGUI(XMLEditor xmlED)
This method is called to update the GUI, when there has been any modifications to a policy. When a policy is edited, we want to set the undo and redo menu buttons acccordingly. Also, if the current policy is saved we will ghost the save button otherwise enable it.


getActivePECF

public PECFrame getActivePECF()
This method returns the current active policy window, if any. If none are open it will return null.

Returns:
The current focussed frame.

create_policy

public void create_policy(boolean choosePolicy,
                          java.lang.String types)
Method to create or load a policy. When False is passed - Method follows a new policy procedure True is passed - Method follows a procedure for opening and existing policy. The loading/creating procedure is described further in PECframe.java

This method will then do the modifications to the main Application window gui

Parameters:
choosePolicy - True to open an existing file || False to create.

importPolicyFromXMLEditor

public void importPolicyFromXMLEditor(XMLEditor policyDocument)

updateXValue

public void updateXValue()

openFromLDAP

public void openFromLDAP()

openFromWebDAV

public void openFromWebDAV()

create_save

public boolean create_save(boolean show_dialog)
Saves Current Policy Editor Component according to Flag. It can Save or SaveAs.

Parameters:
show_dialog - When true it will show the file dialog in order to be able to enter a new file name to Save As. When false it will execute the Save procedure.

create_save_dialog

public void create_save_dialog(PECFrame pecf)
Used to check whether the Policy Editor window is saved or not when it has been closed.

If the Policy was Saved before closing, the window will just close.

Otherwise, the Policy has not been Saved before closing, and the method then checks if the policy has a file name or not. If the Policy does not have a file name, the Save As procedure is launched, otherwise if the policy has a filename the application will prompt the user with a 3 answer dialog: Yes, No, Cancel. If the user hits 'Yes' the file will overwrite the previous file and the closingSuccessful flag is set to True. If the user hits 'No' the changes will be discarded and the closingSuccessful flag is set to True. Otherwise when the user hits cancel, the changes and policy window will remain open, and the closingSuccessful flag is set to False.

Parameters:
pecf - The policy window that has just been shut.

create_printxml

public void create_printxml()
On obtaining the Active open and focussed policy, this will call the print XML method.


create_printreadablepolicy

public void create_printreadablepolicy()
On obtaining the Active open and focussed policy, this will call the print Readable Policy method.


create_exit

public void create_exit()
Method called to ensure successful exit of the application. It will mainly go through a loop of the PECF vector elements (a list of currently open policies) and try to close them one by one. This will pass the open policies through a saving procedure to ensure that all policies have been confirmed by the user on exiting. If all the policies have been closed sucessfully then the application will close.


create_undo

public void create_undo()
On obtaining the Active open and focussed policy, this method will call the method to undo.


create_redo

public void create_redo()
On obtaining the Active open and focussed policy, this method will call the method to redo.


create_xml

public void create_xml()
On obtaining the Active open and focussed policy, this method will call the method to create a window and display the XML inside the newly opened window.


create_readablepolicy

public void create_readablepolicy()
On obtaining the Active open and focussed policy, this method will call the method to create a window and display the human readable policy inside it.


create_policyViewer

public void create_policyViewer()
On obtaining the Active open and focused policy, this methd will call the method to create a policy viewer and display the xml file and the readable policy side by side.


create_validate

public void create_validate()

create_signandpublish

public void create_signandpublish()

create_ldapDialog

public void create_ldapDialog()

create_pemanual

public void create_pemanual()

create_pemanualFont

public void create_pemanualFont()

create_about

public void create_about()

create_wizzard

public void create_wizzard()

create_text

public void create_text()

createInternalFrame

public javax.swing.JInternalFrame createInternalFrame(javax.swing.JFrame f,
                                                      java.lang.String s)

createGUI

public void createGUI()
Creates the GUI for the main application. Instantiates a new instance for all the components that are required for the main application. Sets their Label, any Mnemonics, and the Event Listener to be called when any of the items are clicked on.


readLabels

public void readLabels(java.lang.String filename)
Label Loader Method.

The Label Names are loaded from filename. The Required Strings are then filled in with their referenced name in the resource bundle.


windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
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

windowGainedFocus

public void windowGainedFocus(java.awt.event.WindowEvent e)

windowLostFocus

public void windowLostFocus(java.awt.event.WindowEvent e)

windowStateChanged

public void windowStateChanged(java.awt.event.WindowEvent e)

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

getConfiguration

public static ConfigurationComponent getConfiguration()

main

public static void main(java.lang.String[] args)
The Main method sets the look and feel of the application. This could be one of three types: JavaLookAndFeel - the java look and feel MotifLookAndFeel - the motif look and feel NativeLookAndFeel - To adapt to the native OS look and feel These are set by calling the WindowUtilities class and using its set methods.

The main method will then create an instance of the PEApplication.