public class MainPane
extends javax.swing.JFrame
implements java.awt.event.ActionListener
activity
and openBrowsers
hold,
respectively, the system-wide Error Log and a list of all open LibBrowser
windows (for good housekeeping purposes).This class creates the MenuBar and is the ActionListener which implements menu choices. Menu choices which lead to exceptions trigger the instantiation of the Error Log and posting to it. The Error Log is intended to record all problems encountered and recommended solutions. Therefore, all methods that post to it must provide enough information about the problem for the User to know what specific action to take much later when the log is reviewed.
Modifier and Type | Class and Description |
---|---|
class |
MainPane.CleanUpThread
The inner class CleanUpThread is used to tidy up and save state before the Kinship System exits.
|
static class |
MainPane.ContextFilter
ContextFilter makes filters that only allow *.ctxt files and directories.
|
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
static KSJInternalFrame |
activity |
static int |
buildNmbr |
static ContextEditor |
curr_CUC_Editor |
static javax.swing.JDesktopPane |
desktop |
static boolean |
emergencyExit |
static boolean |
fill_In_Flag |
static int |
NUMBER_OF_EGOS |
static int |
testSerialNmbr |
static MainPane |
topPane |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
MainPane(java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
This is the Listener that handles all menu choices.
|
void |
addWindow(KSJInternalFrame wind)
Add a window to the desktop, and make it the current focus.
|
void |
browseCurrentContext() |
void |
browseLibrary()
Construct a new
LibBrowser , make it the 'currentFrame' and add
it to the 'View' menu. |
void |
changeActivity(int activityCode) |
static void |
createActivityLog(javax.swing.JDesktopPane desktop,
javax.swing.JMenu menuView) |
void |
createMenu() |
static void |
displayError(java.lang.String msg,
java.lang.String title,
int typ) |
void |
doLv1ActiveLearning(Learned_DT learner,
int maxNoise,
int ignorable,
int maxConf,
int minDyadsPerPCStr,
DomainTheory sourceDT) |
void |
editCUC() |
void |
enableAdvancedMenuItems(boolean bool) |
void |
eraseExpansions(DomainTheory dt)
Erase all expandedDefs in the specified domain theory.
|
void |
exportGEDCOM()
Ask User for the target file name and a few options for the type of export.
|
void |
generateSimulatedData(Context ctxt,
DomainTheory dt,
int distLimit,
java.util.ArrayList<java.lang.Object> originalEgoBag,
Learned_DT learner) |
java.util.ArrayList<java.lang.Object> |
getOppo(java.lang.String key,
java.util.ArrayList<java.lang.Object> pairs) |
void |
importGEDCOM()
Ask User for the GEDCOM file name, create a Tokenizer and a parser,
and execute the parse.
|
void |
labelMenuItems() |
void |
leaveOneOut(Learned_DT learner,
DomainTheory sourceDT,
java.io.PrintWriter logFile,
java.io.PrintWriter tabFile,
int nmbrOfRounds,
int[] distanceLimits,
int[] minHitPercents,
int maxNoise,
int ignorable,
int minDyadsPerPCStr,
boolean replay,
int roundNmbr) |
boolean |
neutersIn(ClauseBody cb,
ClauseBody.StringObj details) |
void |
postConstraints(java.util.ArrayList<java.lang.Object> body,
java.util.TreeMap genderConstraints,
java.util.TreeMap genderVars,
java.util.ArrayList<java.lang.Object> opposites) |
Individual |
randomEgo(Context ctxt,
java.util.ArrayList<java.lang.Object> priorEgos,
java.lang.String priorSex) |
static java.util.TreeMap |
treeMapDeepCopy(java.util.TreeMap model)
This utility method returns a "deep copy" with new elements replacing
any subordinate TreeMaps or ALists as VALUES in the model.
|
void |
updateViewMenu(java.lang.String oldTxt,
java.lang.String newTxt) |
void |
writeActivityLog() |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static KSJInternalFrame activity
public static ContextEditor curr_CUC_Editor
public static javax.swing.JDesktopPane desktop
public static MainPane topPane
public static int testSerialNmbr
public static int buildNmbr
public static int NUMBER_OF_EGOS
public static boolean fill_In_Flag
public static boolean emergencyExit
public static void displayError(java.lang.String msg, java.lang.String title, int typ)
public static java.util.TreeMap treeMapDeepCopy(java.util.TreeMap model)
model
- the TreeMap to be copiedpublic void addWindow(KSJInternalFrame wind)
wind
- A window to be added to the system's desktop & displayed.public void updateViewMenu(java.lang.String oldTxt, java.lang.String newTxt)
public void createMenu()
public void labelMenuItems()
public void enableAdvancedMenuItems(boolean bool)
public void actionPerformed(java.awt.event.ActionEvent e)
browseLibrary()
.
actionPerformed
in interface java.awt.event.ActionListener
e
- the GUI event that triggered this call.public void eraseExpansions(DomainTheory dt)
dt
- the target domain theorypublic void browseCurrentContext()
public void browseLibrary()
LibBrowser
, make it the 'currentFrame' and add
it to the 'View' menu.public void editCUC()
public void exportGEDCOM()
exportFGEDCOM
method.public void importGEDCOM()
public void changeActivity(int activityCode)
public void doLv1ActiveLearning(Learned_DT learner, int maxNoise, int ignorable, int maxConf, int minDyadsPerPCStr, DomainTheory sourceDT) throws KSInternalErrorException, KSParsingErrorException, KSBadHornClauseException, KSConstraintInconsistency, java.lang.ClassNotFoundException, JavaSystemException, java.io.FileNotFoundException, java.io.IOException
KSInternalErrorException
KSParsingErrorException
KSBadHornClauseException
KSConstraintInconsistency
java.lang.ClassNotFoundException
JavaSystemException
java.io.FileNotFoundException
java.io.IOException
public void leaveOneOut(Learned_DT learner, DomainTheory sourceDT, java.io.PrintWriter logFile, java.io.PrintWriter tabFile, int nmbrOfRounds, int[] distanceLimits, int[] minHitPercents, int maxNoise, int ignorable, int minDyadsPerPCStr, boolean replay, int roundNmbr) throws KSParsingErrorException, KSConstraintInconsistency, KSBadHornClauseException, java.io.FileNotFoundException, java.io.IOException, KSInternalErrorException, KinshipSystemException, java.lang.ClassNotFoundException, JavaSystemException
KSParsingErrorException
KSConstraintInconsistency
KSBadHornClauseException
java.io.FileNotFoundException
java.io.IOException
KSInternalErrorException
KinshipSystemException
java.lang.ClassNotFoundException
JavaSystemException
public void generateSimulatedData(Context ctxt, DomainTheory dt, int distLimit, java.util.ArrayList<java.lang.Object> originalEgoBag, Learned_DT learner) throws KSBadHornClauseException, KSInternalErrorException, KinshipSystemException, java.lang.ClassNotFoundException
KSBadHornClauseException
KSInternalErrorException
KinshipSystemException
java.lang.ClassNotFoundException
public Individual randomEgo(Context ctxt, java.util.ArrayList<java.lang.Object> priorEgos, java.lang.String priorSex) throws KinshipSystemException
KinshipSystemException
public boolean neutersIn(ClauseBody cb, ClauseBody.StringObj details)
public java.util.ArrayList<java.lang.Object> getOppo(java.lang.String key, java.util.ArrayList<java.lang.Object> pairs)
public void postConstraints(java.util.ArrayList<java.lang.Object> body, java.util.TreeMap genderConstraints, java.util.TreeMap genderVars, java.util.ArrayList<java.lang.Object> opposites)
public static void createActivityLog(javax.swing.JDesktopPane desktop, javax.swing.JMenu menuView)
public void writeActivityLog()