public class ChartPanel
extends javax.swing.JPanel
implements javax.swing.event.MouseInputListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
boolean |
dirty
The dirty bit is TRUE when changes have been made to the Chart
since the last file save.
|
static int |
FIRST |
static int |
GAP |
static int |
INITIALS |
static int |
KINTERMADR |
static int |
KINTERMREF |
static int |
LAST |
static int |
LETTERADR |
static int |
LETTERREF |
static int |
NOKINTERM |
static int |
NOLABEL |
static int |
WHOLE |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ChartPanel() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Individual ix,
Family fx)
Add a person to the children of this family.
|
void |
addChildLink(Link lk,
Family fx)
Add a link to this family's children.
|
void |
addOrDeleteSpouse(Individual ix,
Family fx)
If ix is not already a spouse (or child) in ix, and is not the same sex as an existing
spouse, and there is spouse slot empty, then add ix as a spouse to fx.
|
void |
addOrDeleteSpouseLink(Link lk,
Family fx)
If we can successfully add/delete ix as a spouse in fx, then we only need
to record/erase that lk is a Link to ix and restore ix's old location.
|
void |
cancelAdoption()
The User has canceled an effort to create a chartable Special
Relationship.
|
void |
captureAdoption()
Gather information about the persons clicked on as 'parent' or 'child' in
this special relationship, then call the appropriate method to take the
next step in creating the chartable UDP.
|
void |
changeFileName(java.lang.String newName) |
int[] |
chartSize(java.awt.Rectangle viewArea) |
void |
checkFamArea(java.util.ArrayList<Family> fams) |
void |
checkSizeOfChart(Context ctxt)
Survey the locations of all symbols on this chart.
|
void |
clearInfo() |
void |
createChartableUDP_1()
Make a new instance of a pre-defined
UserDefinedProperty and prepare for
adding it to the chart. |
void |
createChartableUDP_2()
Present a confirmation dialog to User showing the parent and child to be
connected by this chartable UDP.
|
void |
createChartableUDP_3()
Make a final error check, then create the chartable UDP and draw it on chart.
|
void |
delayedAreaCheck(java.util.ArrayList<Link> lynx)
Add every link on this list to the list of links to check later.
|
void |
delayedAreaCk(java.util.ArrayList<Individual> people)
Add everyone on this list to the list of people to check later.
|
void |
delayedAreaCk(Family fam)
Add this family to the list of families to check later.
|
void |
delayedAreaCk(Link link)
Add this link to the list of links to check later.
|
void |
deleteAll()
First check for unsaved changes to the current context.
|
java.lang.String |
editParameters(Context ctxt) |
void |
exportKAESFile() |
int |
findMarriage(int x,
int y) |
int |
getNameLabel()
returns the labeling mode as an int
|
void |
getProjectName()
Called when the 1st person/union is created in any context.
|
java.awt.Point |
gridSnap(java.awt.Point p) |
boolean |
handleEvent(java.awt.Event event) |
void |
init(SIL_Edit k) |
void |
KinshipEditor_MouseDown(java.awt.event.MouseEvent event)
This runs AFTER the personMenu_ListSelect method; if User has created
a chartable UDP it calls for follow-up processing.
|
void |
KinshipEditor_MouseDrag(java.awt.event.MouseEvent event)
Provide for 3 different kinds of Family drags, depending on the modifier
keys depressed, or a single type of drag for an individual.
|
void |
KinshipEditor_MouseUp(java.awt.event.MouseEvent event)
This is where we check to see if anything has been dragged, a new Ego
chosen, a symbol has been moved, or someone has been added to a Union.
|
void |
loadSILKFile()
Load the SILK file that has been stored in saveFile, verify that all
necessary data is present, and load everything into its proper internal
fields.
|
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics g)
Gather a few additional parameters, then call the main painting method.
|
void |
paint0(java.awt.Graphics g,
java.awt.Rectangle myRect,
java.lang.String chart)
Paint the visible portion of the current chart with all persons, links,
families, and special relationships.
|
void |
paint1(java.awt.Graphics g)
The paint method when we are just browsing the Library.
|
void |
personMenu_ListSelect(java.awt.Event event)
Called when User makes a selection from the menu of new symbols
that can be created on a chart:
Female
Male
Union (a marriage or coupling that produces children)
Link to an existing person
Draw special relationship (UDP)
Creates the symbol at the location clicked (or nearest grid point
if snapToGrid has been selected), and then creates the
corresponding object (male, link, etc.) in this context.
|
void |
pickSILKFile()
Using the shared FileChooser, ask User to identify the SILK file
to load.
|
void |
removeChild(Individual ix,
Family fx)
Remove this child from the family.
|
void |
removeChildLink(Link lk,
Family fx)
Remove this child link from the family.
|
void |
removePersonAndRecomputeNodes(Individual ix,
Family fam)
Remove this person from fam, then modify/remove all nodes
in the KinTermMatrix and all dyads in the DyadTMaps that were affected.
|
void |
resizeAndRepaint()
This does what it says.
|
void |
saveAsFile()
Prompt User for a new file name, validity check it, make this the new
'saveFile' pathname, and then call saveSILKFile.
|
void |
saveKAESFile() |
void |
saveSILKFile()
Write the current SILK file to disk.
|
void |
setAlter(int serial) |
void |
setKTmLabel(java.lang.String c)
sets up the kin term labeling mode
|
void |
setNameLabel(java.lang.String c)
Sets up the name labeling mode.
|
void |
setOrigin(int x,
int y) |
void |
setRefYear(int x)
sets the reference year in the Person and Marriage objects
|
void |
showInfo(Family f)
Make sure we ares not in loading mode, then pass the call on to SIL_Edit.
|
void |
showInfo(Individual p)
Make sure we ares not in loading mode, then pass the call on to SIL_Edit.
|
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, 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, 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 boolean dirty
public static final int NOLABEL
public static final int INITIALS
public static final int FIRST
public static final int LAST
public static final int WHOLE
public static final int NOKINTERM
public static final int KINTERMREF
public static final int KINTERMADR
public static final int LETTERREF
public static final int LETTERADR
public static final int GAP
public void init(SIL_Edit k)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public boolean handleEvent(java.awt.Event event)
handleEvent
in class java.awt.Component
public int getNameLabel()
public void setNameLabel(java.lang.String c)
c
- the label to interpretpublic void setKTmLabel(java.lang.String c)
c
- the label to interpretpublic void setRefYear(int x)
x
- the reference yearpublic void setOrigin(int x, int y)
public void KinshipEditor_MouseDown(java.awt.event.MouseEvent event)
event
- the mouse_down eventpublic void captureAdoption()
public void getProjectName()
public void personMenu_ListSelect(java.awt.Event event)
event
- the mouse event that triggered this methodpublic java.awt.Point gridSnap(java.awt.Point p)
public int findMarriage(int x, int y)
public int[] chartSize(java.awt.Rectangle viewArea)
public void delayedAreaCk(java.util.ArrayList<Individual> people)
people
- a list of people whose location has changedpublic void delayedAreaCk(Link link)
link
- the link to addpublic void delayedAreaCheck(java.util.ArrayList<Link> lynx)
lynx
- public void delayedAreaCk(Family fam)
fam
- the family to addpublic void checkFamArea(java.util.ArrayList<Family> fams)
public void createChartableUDP_1()
UserDefinedProperty
and prepare for
adding it to the chart.public void cancelAdoption()
public void createChartableUDP_2()
public void createChartableUDP_3()
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- the graphics object to draw onpublic void paint1(java.awt.Graphics g)
g
- the graphics object to draw onpublic void paint0(java.awt.Graphics g, java.awt.Rectangle myRect, java.lang.String chart)
g
- the graphics object to draw onmyRect
- the bounds within which we will paintchart
- the name of the only chart we are painting.public void setAlter(int serial)
public void showInfo(Individual p)
p
- the person whose info should be shownpublic void showInfo(Family f)
f
- the family whose info should be shownpublic void clearInfo()
public void KinshipEditor_MouseDrag(java.awt.event.MouseEvent event)
event
- the mouse-drag eventpublic void KinshipEditor_MouseUp(java.awt.event.MouseEvent event)
event
- the mouse eventpublic void addOrDeleteSpouse(Individual ix, Family fx)
ix
- the Individual to be added or deletedfx
- the Family to receive or lose ixpublic void addOrDeleteSpouseLink(Link lk, Family fx)
lk
- the link that was dropped on fxfx
- the Family on which ix was droppedpublic void removeChild(Individual ix, Family fx)
ix
- kid to be removedfx
- family to remove frompublic void removeChildLink(Link lk, Family fx)
lk
- kid link to be removedfx
- family to remove frompublic void addChild(Individual ix, Family fx)
ix
- person to be addedfx
- family to receive the new kidpublic void addChildLink(Link lk, Family fx)
lk
- a link to a person who should be added as a child to fxfx
- the family to which we want to add the linkpublic void removePersonAndRecomputeNodes(Individual ix, Family fam)
ix
- Individual to be removed.fam
- Family object from serialNum to remove ix.public void changeFileName(java.lang.String newName)
public void saveAsFile()
public void saveSILKFile()
public java.lang.String editParameters(Context ctxt)
public void saveKAESFile()
public void deleteAll()
public void exportKAESFile()
public void pickSILKFile()
public void loadSILKFile()
public void resizeAndRepaint()
public void checkSizeOfChart(Context ctxt)
ctxt
- the context holding all the symbols for this chart.