public class PersonPanel
extends javax.swing.JPanel
A PersonPanel displays all the data about a Person and allows the User to edit any of it (except the serial number, of course).
DATA POSTING STRATEGY - As soon as any field in this panel loses focus, we post the latest data to the Individual/Person being displayed ("infoPerson"). When a new person is chosen for display, we validate all data and if any invalid fields are found, we do not allow the change in infoPerson until valid data is entered. Then the person's record is updated and we proceed to let user choose a new infoPerson to display/edit.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
ADD |
static int |
CANCEL |
static int |
DELETE |
static java.lang.String[] |
reservedWords |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PersonPanel()
Creates new form PersonPanel
|
Modifier and Type | Method and Description |
---|---|
void |
addToEgoChoices(Individual ind)
Add this person to the drop-down menu of possible Egos that appears in
the Detail Display.
|
static boolean |
allBlanksPrecededByCommas(java.lang.String s)
Assure all blanks are right after commas; embedded blanks are forbidden
in kin terms.
|
void |
applyAutoDef(Node nod,
java.util.ArrayList<Context.CB_Ptr> list,
DomainTheory dt,
Individual ego)
For every ClauseBody in the list, create a new Dyad; if it does not
duplicate an existing dyad, then fill in all fields and post it to
the Context's dyadsDefined.
|
void |
checkForAutoDefs(Node nod,
Individual ego)
If any kin term definitions have been selected by User for auto-fill-in,
check to see if the relationship between Ego & Alter fits one of them;
if so, apply it by calling applyAutoDef.
|
static void |
debugDyads() |
static java.lang.String |
deSlashify(java.lang.String s)
Reversing slashification is simple; replace all slashes with blanks.
|
void |
displayClues() |
void |
displayUDPVals(Individual ind)
For the particular UDP shown in the UDP Combo Box, pull the current
value(s) from the Individual's object, and display them in the UDP area.
|
void |
fillTextField(Node nod,
javax.swing.JTextField field,
boolean addr)
Get the appropriate text from the Node, reformat it, and fill in the
text field.
|
void |
fillTextField(Node nod,
java.lang.String fieldType,
boolean addr)
An alternative format for calling
fillTextField . |
void |
fireAlterFirstNamesFocusLost() |
static java.lang.String |
firstSymbolOf(java.lang.String pcString) |
static java.lang.String |
getSymbolNumber(int number,
java.lang.String pcString) |
void |
initUDPCombo()
If any UDPs are defined in this context, then build a ComboBox User so can
pick which UDP to display in the Detail Display for an Individual.
|
static Dyad |
makeDyad(Individual currEgo,
Individual infoPerson,
java.lang.String kinTerm,
Node alterNode) |
void |
prepComponents() |
void |
rebuildEgoBox()
Rebuild the ComboBox with the names & IDs of every (non-deleted) person
in this Context.
|
static java.lang.String |
restoreLineBreaks(java.lang.String in)
To avoid parsing problems, when text is saved to a SILK file all line
breaks (e.g.
|
static java.lang.String |
sanitizeKinTerms(java.awt.Component c,
java.lang.String k,
java.lang.String typ)
Change all forbidden characters into their legal replacements.
|
java.lang.String |
sanitizeName(java.lang.String nam) |
void |
setDistinctAdrTerms(boolean val)
Set all the flags that record whether there are separate Terms of Address.
|
void |
showInfo(Individual ind)
Set local flags, then load the data from ind's object into the
proper fields of the Detail Display.
|
static java.lang.String |
slashify(java.awt.Component c,
java.lang.String k)
Finds all characters normally prohibited in a symbol, and precedes them
with a backSlash.
|
static int |
symbolCount(java.lang.String pcString)
Count the number of capital letters and double-asterisks in the
PC String.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int ADD
public static final int DELETE
public static final int CANCEL
public static final java.lang.String[] reservedWords
public void prepComponents()
public void initUDPCombo()
public void fireAlterFirstNamesFocusLost()
public void displayClues()
public void showInfo(Individual ind)
ind
- the person whose info we want to showpublic void displayUDPVals(Individual ind)
ind
- the Person whose UDPs we want to displaypublic static java.lang.String restoreLineBreaks(java.lang.String in)
in
- the input string in which to restorepublic void checkForAutoDefs(Node nod, Individual ego)
nod
- the Node object for Alterego
- the Individual object for Egopublic void applyAutoDef(Node nod, java.util.ArrayList<Context.CB_Ptr> list, DomainTheory dt, Individual ego)
nod
- the Node object for Alterlist
- a list of the kin terms that apply to this Ego/Alter pair.dt
- the DomainTheory containing the definitionego
- the Individual object for Egopublic void fillTextField(Node nod, java.lang.String fieldType, boolean addr)
fillTextField
.nod
- a Node containing kin term datafieldType
- either 'primary' or 'reciprocal'addr
- true if this is a term of addresspublic void fillTextField(Node nod, javax.swing.JTextField field, boolean addr)
nod
- a Node containing kin term datafield
- the text field to be filledaddr
- true if this is a term of addresspublic java.lang.String sanitizeName(java.lang.String nam)
public static java.lang.String slashify(java.awt.Component c, java.lang.String k)
c
- window to which messages should be postedk
- the kinTerm to be slashifiedpublic static java.lang.String deSlashify(java.lang.String s)
s
- the string to be deSlashifiedpublic static java.lang.String sanitizeKinTerms(java.awt.Component c, java.lang.String k, java.lang.String typ) throws KSParsingErrorException
c
- the window to write tok
- the string to be sanitizedtyp
- the type of string we are sanitizingKSParsingErrorException
public static boolean allBlanksPrecededByCommas(java.lang.String s)
s
- the string to be checkedpublic static Dyad makeDyad(Individual currEgo, Individual infoPerson, java.lang.String kinTerm, Node alterNode)
public static int symbolCount(java.lang.String pcString)
pcString
- the kin type, like 'FaBroWiMo'public static java.lang.String getSymbolNumber(int number, java.lang.String pcString)
public static java.lang.String firstSymbolOf(java.lang.String pcString)
public static void debugDyads()
public void rebuildEgoBox()
public void addToEgoChoices(Individual ind)
ind
- the person to be addedpublic void setDistinctAdrTerms(boolean val)
val
- true = this Context has distinct terms of address