kaos.kpat.applet
Class KPATApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by kaos.kpat.applet.KPATApplet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, CheckPermissionPanel.PolicyViewer

public class KPATApplet
extends javax.swing.JApplet
implements CheckPermissionPanel.PolicyViewer

KAoS Policy Administration Tool

Provides a web browser-based user interface onto a KAoS Domain.

Can also be run as a stand-alone application.

Modifications by robert.e.cranfill@boeing.com

See "???" comments for problem areas, mystery code, etc

Functional Things To Do:

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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
protected static java.lang.String _configPath
           
protected static boolean _doCommitNoDialog
           
protected  boolean _isConflictingPolicy
           
protected  boolean _isDSActive
           
protected  boolean _isPolRedundant
           
protected  boolean _policyListSelected
           
protected static java.lang.String _policyPath
           
protected static java.lang.String _policySetPath
           
protected  java.util.List _redundantPolicies
           
protected  ModelPolicy _selectedPolicyFromList
           
static java.lang.String DOMAIN_DESC
           
static int LOG_LEVEL
           
static java.awt.Color ONTOLOGY_TABS_COLOR
           
static int POLICY_TABLE_COLUMN_ATTRIBS
           
static int POLICY_TABLE_COLUMN_HARMONIZED
           
static int POLICY_TABLE_COLUMN_INFORCE
           
static int POLICY_TABLE_COLUMN_LEVEL
           
static int POLICY_TABLE_COLUMN_POLICY
           
static java.awt.Color POLICY_TABS_COLOR
           
static java.lang.String SUBDOMAINS
           
static java.lang.String SYMBOL_POLICY_SOURCE
           
static java.lang.String SYMBOL_POLICY_SOURCE_KPAT
           
static java.awt.Color TREE_VIEW_TABS_COLOR
           
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
KPATApplet()
           
 
Method Summary
 void clearPolicyTarget()
           
static java.lang.String condPolVectToString(java.util.Vector v)
          ConditionalPolicy doesn't have a toString :/ so here's a util method to do so
static java.util.Vector convertModelPolicySetVector(java.util.Vector modelPolicySets)
          converts a vector of model policy sets to a vector of policy set msgs
 SortableTreeNode createTreeForDomain(ModelDomain modelDomain)
          Update the domain tree display.
 void doRefresh()
          Called by the RMI proxy, to cause GUI to refresh.
static void expandTreeNodes(javax.swing.JTree jt, javax.swing.tree.TreeNode startNode)
          Recursively expand the given node, and all its children.
static java.util.Hashtable getAgentPropsForDisplay(KAoSAgentDescription desc)
           
 ModelPolicy getCurrentNodeSelected()
          Returns the current selected node in the policy list.
 java.lang.String getCurrentServletURL()
          Returns the current URL used to connect to the servlet
 java.util.List getGuardList()
           
 boolean getIsDirty()
           
 ModelPolicyList getPolicyListModel()
           
 void handleBBNDialog(java.lang.String selection)
           
 void init()
          Initialize the Applet.
static java.lang.String listOfStringsToString(java.util.List list)
          Converts a list of strings to a string with the ids separated by commas
static java.util.Vector modelPolicyListToVectorOfMsgs(ModelPolicyList mpl)
          Converts a model policy list to a vector of PolicyMsgs
 void notifyUser(java.lang.String message)
          Used by KPATRMI to display a message.
protected  java.lang.String parseString(java.lang.String name)
          Parse the string to get the short name after the hash # symbol
 void policyTableUpdate()
          Update the JTable of polices for the currently selected node.
 void policyTableUpdate(SortableTreeNode node)
          Update the JTable of polices for the node.
 void setArgs(java.lang.String[] args)
           
 void setIsDirty(boolean isDirty)
          Public method to toggle our dirty/clean state; (which affects whether the "Commit" and "Discard" buttons should be enabled)
 void setIsDirty(boolean isDirty, int whatsDirty)
          Version of setIsDirty for conditional policies sulcate
 void showDeferredMessages()
           
 void showPolicy(java.lang.String policyId)
          implements CheckPermissionPanel.PolicyViewer
 void startConnectionToDS()
          Start a new connection to a servlet
 void treeViewHostCreate()
          Create the intitial Host-centric tree view.
 void treeViewHostUpdate(ModelHost host_rootNode)
          Update the Host tree.
static void treeViewSetStandardOptions(javax.swing.JTree jt)
          For stuff that's the same for the two tree views.
 void updateGeneralInfoFields(iModelObject o)
          Update the 'General Info' area (not the policy table) according to selected object.
protected  void updateGuardList()
           
 void updatePolicyPane(SortableTreeNode node)
          Update the policy pane with info for the specified object.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, 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, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TREE_VIEW_TABS_COLOR

public static final java.awt.Color TREE_VIEW_TABS_COLOR

POLICY_TABS_COLOR

public static final java.awt.Color POLICY_TABS_COLOR

ONTOLOGY_TABS_COLOR

public static final java.awt.Color ONTOLOGY_TABS_COLOR

LOG_LEVEL

public static final int LOG_LEVEL
See Also:
Constant Field Values

POLICY_TABLE_COLUMN_POLICY

public static final int POLICY_TABLE_COLUMN_POLICY
See Also:
Constant Field Values

POLICY_TABLE_COLUMN_LEVEL

public static final int POLICY_TABLE_COLUMN_LEVEL
See Also:
Constant Field Values

POLICY_TABLE_COLUMN_INFORCE

public static final int POLICY_TABLE_COLUMN_INFORCE
See Also:
Constant Field Values

POLICY_TABLE_COLUMN_ATTRIBS

public static final int POLICY_TABLE_COLUMN_ATTRIBS
See Also:
Constant Field Values

POLICY_TABLE_COLUMN_HARMONIZED

public static final int POLICY_TABLE_COLUMN_HARMONIZED
See Also:
Constant Field Values

SYMBOL_POLICY_SOURCE

public static final java.lang.String SYMBOL_POLICY_SOURCE
See Also:
Constant Field Values

SYMBOL_POLICY_SOURCE_KPAT

public static final java.lang.String SYMBOL_POLICY_SOURCE_KPAT
See Also:
Constant Field Values

SUBDOMAINS

public static final java.lang.String SUBDOMAINS
See Also:
Constant Field Values

DOMAIN_DESC

public static final java.lang.String DOMAIN_DESC
See Also:
Constant Field Values

_isConflictingPolicy

protected boolean _isConflictingPolicy

_redundantPolicies

protected java.util.List _redundantPolicies

_isPolRedundant

protected boolean _isPolRedundant

_selectedPolicyFromList

protected ModelPolicy _selectedPolicyFromList

_policyPath

protected static java.lang.String _policyPath

_policySetPath

protected static java.lang.String _policySetPath

_configPath

protected static java.lang.String _configPath

_doCommitNoDialog

protected static boolean _doCommitNoDialog

_policyListSelected

protected boolean _policyListSelected

_isDSActive

protected boolean _isDSActive
Constructor Detail

KPATApplet

public KPATApplet()
Method Detail

setArgs

public void setArgs(java.lang.String[] args)

showDeferredMessages

public void showDeferredMessages()

init

public void init()
Initialize the Applet.

Connect to the tunneling client, and build the GUI.

{sulcate} Command-line args are {"CoAX" | "UltraLog"} First arg must be one of these two literals; {servletURL} 2nd arg is URL of tunnel servlet (for CoAX) or PSP_PolicyAdministrator (for UltraLog); {DMRMIName} The RMI name the Domain Manager is bound to (we will send this to the servlet so it can talk to DM); [{KPATBindName}] Only used for CoAX, the name KPAT will bind its KPATRMI object to. Note that getting args from applet params is all hosed up, which is OK, cuz we can't run as an applet anyway, can we?

Overrides:
init in class java.applet.Applet

getCurrentServletURL

public java.lang.String getCurrentServletURL()
Returns the current URL used to connect to the servlet


createTreeForDomain

public SortableTreeNode createTreeForDomain(ModelDomain modelDomain)
Update the domain tree display.


startConnectionToDS

public void startConnectionToDS()
Start a new connection to a servlet


updateGuardList

protected void updateGuardList()

getGuardList

public java.util.List getGuardList()

modelPolicyListToVectorOfMsgs

public static java.util.Vector modelPolicyListToVectorOfMsgs(ModelPolicyList mpl)
Converts a model policy list to a vector of PolicyMsgs


convertModelPolicySetVector

public static java.util.Vector convertModelPolicySetVector(java.util.Vector modelPolicySets)
converts a vector of model policy sets to a vector of policy set msgs


condPolVectToString

public static java.lang.String condPolVectToString(java.util.Vector v)
ConditionalPolicy doesn't have a toString :/ so here's a util method to do so


doRefresh

public void doRefresh()
Called by the RMI proxy, to cause GUI to refresh.


getCurrentNodeSelected

public ModelPolicy getCurrentNodeSelected()
Returns the current selected node in the policy list.


getPolicyListModel

public ModelPolicyList getPolicyListModel()

treeViewHostCreate

public void treeViewHostCreate()
Create the intitial Host-centric tree view. There's no data behind this, that will happen if and when the hit the "Host" tab.


treeViewHostUpdate

public void treeViewHostUpdate(ModelHost host_rootNode)
Update the Host tree.

See comments for treeViewDomainUpdate.


treeViewSetStandardOptions

public static void treeViewSetStandardOptions(javax.swing.JTree jt)
For stuff that's the same for the two tree views.


expandTreeNodes

public static void expandTreeNodes(javax.swing.JTree jt,
                                   javax.swing.tree.TreeNode startNode)
Recursively expand the given node, and all its children.


updatePolicyPane

public void updatePolicyPane(SortableTreeNode node)
Update the policy pane with info for the specified object. This is called when the user selects an object in the tree view.

Parameters:
o - Specified object
node - The corresponding tree node of object o

updateGeneralInfoFields

public void updateGeneralInfoFields(iModelObject o)
Update the 'General Info' area (not the policy table) according to selected object.


getAgentPropsForDisplay

public static java.util.Hashtable getAgentPropsForDisplay(KAoSAgentDescription desc)

parseString

protected java.lang.String parseString(java.lang.String name)
Parse the string to get the short name after the hash # symbol


listOfStringsToString

public static java.lang.String listOfStringsToString(java.util.List list)
Converts a list of strings to a string with the ids separated by commas


policyTableUpdate

public void policyTableUpdate()
Update the JTable of polices for the currently selected node.


policyTableUpdate

public void policyTableUpdate(SortableTreeNode node)
Update the JTable of polices for the node. Actually, update the model 'behind' the table.


setIsDirty

public void setIsDirty(boolean isDirty)
Public method to toggle our dirty/clean state; (which affects whether the "Commit" and "Discard" buttons should be enabled)


getIsDirty

public boolean getIsDirty()

setIsDirty

public void setIsDirty(boolean isDirty,
                       int whatsDirty)
Version of setIsDirty for conditional policies sulcate


notifyUser

public void notifyUser(java.lang.String message)
                throws java.rmi.RemoteException
Used by KPATRMI to display a message.

Throws:
java.rmi.RemoteException

clearPolicyTarget

public void clearPolicyTarget()

handleBBNDialog

public void handleBBNDialog(java.lang.String selection)

showPolicy

public void showPolicy(java.lang.String policyId)
implements CheckPermissionPanel.PolicyViewer

Specified by:
showPolicy in interface CheckPermissionPanel.PolicyViewer