com.kpro.ui
Class PrivacyAdvisorGUI

java.lang.Object
  extended by com.kpro.ui.UserIO
      extended by com.kpro.ui.PrivacyAdvisorGUI

public class PrivacyAdvisorGUI
extends UserIO

Privacy Advisor GUI to run on top of

Author:
ulfnore

Nested Class Summary
(package private)  class PrivacyAdvisorGUI.pAdvisorButtonListener
          Listens on GUI buttons.
private  class PrivacyAdvisorGUI.PrivacyAdvisorConfigEditor
           
private  class PrivacyAdvisorGUI.TListener
          Implements the TreeSelectionListener interface.
 
Field Summary
private  javax.swing.JTree dataBaseTree
           
private  javax.swing.tree.DefaultMutableTreeNode dataBaseTreeRoot
           
private  javax.swing.JScrollPane dataBaseTreeScrollPane
           
private  javax.swing.JMenuItem exitMenuItem
           
private  javax.swing.JFrame frame
           
private  Gio gio
           
private  javax.swing.JMenuItem loadConfigMenuItem
           
private  javax.swing.JMenuItem loadDBMenuItem
           
private  javax.swing.JMenu menu
           
private  javax.swing.JMenuBar menuBar
           
private  javax.swing.JTextArea outputArea
           
private  javax.swing.JScrollPane outputAreaScrollPane
           
private  javax.swing.JTree policyTree
           
private  javax.swing.tree.DefaultMutableTreeNode policyTreeRoot
           
private  javax.swing.JScrollPane policyTreeScrollPane
           
private  javax.swing.JMenuItem runMenuItem
           
 
Constructor Summary
PrivacyAdvisorGUI()
          Default no-arg constructor
 
Method Summary
private  void buildTree(javax.swing.tree.DefaultMutableTreeNode root, PolicyDatabase pdb)
          Builds the tree view of the knowledge base (ie.
private  void buildTree(javax.swing.tree.DefaultMutableTreeNode root, PolicyObject po)
          Builds the tree view of the policy to be classified.
 void closeResources()
          closes all resources used by UserIO - windows, files, streams, etc
private  void initialize()
          GUI initializer: Initialize the contents of the frame.
private  void loadConfig()
           
private  void loadDB()
           
 java.util.ArrayList<PolicyObject> loadHistory()
          gets any policies not already provided for the history
static void main(java.lang.String[] args)
          Launch the application.
private  void println(java.lang.String str)
          Write to PrivacyAdvisorGUI output textarea.
private  void run()
          Runs the CBR algorithm to classify the input P3P.
 void showDatabase(PolicyDatabase pdb)
          display the contents of the database
 void user_init(java.util.Properties genProps)
          Called from GIO.
 PolicyObject userResponse(PolicyObject n)
          Shows recommendation and prompts for user action Needs improvement to allow for giving reasons as for why recommendation is not accepted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

private javax.swing.JFrame frame

gio

private Gio gio

outputArea

private javax.swing.JTextArea outputArea

dataBaseTree

private javax.swing.JTree dataBaseTree

policyTree

private javax.swing.JTree policyTree

dataBaseTreeRoot

private javax.swing.tree.DefaultMutableTreeNode dataBaseTreeRoot

policyTreeRoot

private javax.swing.tree.DefaultMutableTreeNode policyTreeRoot

menuBar

private javax.swing.JMenuBar menuBar

menu

private javax.swing.JMenu menu

loadConfigMenuItem

private javax.swing.JMenuItem loadConfigMenuItem

loadDBMenuItem

private javax.swing.JMenuItem loadDBMenuItem

runMenuItem

private javax.swing.JMenuItem runMenuItem

exitMenuItem

private javax.swing.JMenuItem exitMenuItem

outputAreaScrollPane

private javax.swing.JScrollPane outputAreaScrollPane

dataBaseTreeScrollPane

private javax.swing.JScrollPane dataBaseTreeScrollPane

policyTreeScrollPane

private javax.swing.JScrollPane policyTreeScrollPane
Constructor Detail

PrivacyAdvisorGUI

public PrivacyAdvisorGUI()
Default no-arg constructor

Method Detail

main

public static void main(java.lang.String[] args)
Launch the application.


initialize

private void initialize()
GUI initializer: Initialize the contents of the frame.


user_init

public void user_init(java.util.Properties genProps)
Called from GIO. Takes default properties file as argument.

Specified by:
user_init in class UserIO
Parameters:
genProps - the default values for all commandline arguments

loadConfig

private void loadConfig()

loadHistory

public java.util.ArrayList<PolicyObject> loadHistory()
Description copied from class: UserIO
gets any policies not already provided for the history

Specified by:
loadHistory in class UserIO
Returns:
an arraylist of policy objects to be added to history prior to the CBR run.

userResponse

public PolicyObject userResponse(PolicyObject n)
Shows recommendation and prompts for user action Needs improvement to allow for giving reasons as for why recommendation is not accepted.

Specified by:
userResponse in class UserIO
Parameters:
n - the policy display
Returns:
the policy given

closeResources

public void closeResources()
Description copied from class: UserIO
closes all resources used by UserIO - windows, files, streams, etc

Specified by:
closeResources in class UserIO

loadDB

private void loadDB()

run

private void run()
Runs the CBR algorithm to classify the input P3P.


println

private void println(java.lang.String str)
Write to PrivacyAdvisorGUI output textarea.


showDatabase

public void showDatabase(PolicyDatabase pdb)
Description copied from class: UserIO
display the contents of the database

Specified by:
showDatabase in class UserIO
Parameters:
pdb - the database to display

buildTree

private void buildTree(javax.swing.tree.DefaultMutableTreeNode root,
                       PolicyDatabase pdb)
Builds the tree view of the knowledge base (ie. reference database).

Parameters:
root -
pdb -

buildTree

private void buildTree(javax.swing.tree.DefaultMutableTreeNode root,
                       PolicyObject po)
Builds the tree view of the policy to be classified.

Parameters:
root -
po -