no.uio.edd.model.geo
Class GeoModelRunner

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTabbedPane
                  extended by no.uio.edd.model.geo.GeoModelRunner
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants, TableCallbackInterface, MenuInterface

public class GeoModelRunner
extends javax.swing.JTabbedPane
implements MenuInterface, TableCallbackInterface

The main runner for the GeoModelText application.

Author:
oeide
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  javax.swing.JFrame mainFrame
           
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GeoModelRunner(javax.swing.JFrame inFrame)
          Start a runner for the GeoModelText application.
 
Method Summary
 void cellLeft(int column, int row)
           
 GeoModelLocation findGeoModelLocation(java.lang.String id)
          Fint the object with a specified ID value.
(package private)  int findNodeNumberFromNodeId(java.lang.String nodeId)
          Send in the node id, find a number in the node list for the paragraph.
 GeoModelLinkable findNodeWithId(java.lang.String id)
          Find a node with a specified xml:id value.
(package private)  java.lang.String findPageNumForNode(java.lang.String nodeId)
          Find the page on which the start tag of an element is located.
 GeoModelElement[] getElements()
           
(package private)  java.lang.String getIdFromThisNode()
          Get the xml:id of the active node.
 java.lang.String getIdOfSurroundingPara(java.lang.String nodeId)
          Search for paragraphs with the given numeric part of the xml:id.
(package private)  AddedNodeSet getMyAddedNodeSet()
           
 GeoModelCoref getMyGeoModelCoref()
           
 GeoModelCorefTableView getMyGeoModelCorefTableView()
           
 GeoModelLinkSet getMyGeoModelLinkSet()
           
 GeoModelPersonReg getMyGeoModelPersonReg()
           
(package private)  GeoModelPlaceReg getMyGeoModelPlaceReg()
           
(package private)  GeoModelProperties getMyGeoModelProperties()
           
(package private)  java.lang.String getNodeIdFromEntTable(int rowNum)
          Return the node ID value from a specific line in the entity table.
(package private)  NodeListView getNodeListView()
          Getter for the NodeListView object.
 org.w3c.dom.Document getTeiRootNode()
           
(package private)  java.lang.String getTextFromNextNode()
          Increase the active node number (that is, go to the next paragraph type node) and return a string containing the text of the active node.
(package private)  java.lang.String getTextFromNodeNumber(java.lang.String nodeId, boolean tagged)
          Return a string containing the text of the node with this number.
(package private)  java.lang.String getTextFromPrevNode()
          Decrease the active node number (that is, go to the previous paragraph type node) and return a string containing the text of the active node.
(package private)  java.lang.String getTextFromSelectedNode(int nodeNumber)
          Set the active node number (that is, go to the selected paragraph type node) and return a string containing the text of the active node.
(package private)  java.lang.String getTextFromSurroundingPara(java.lang.String nodeId, boolean tagged)
          Search for paragraphs with the given numeric part of the xml:id.
(package private)  java.lang.String getTextFromThisNode()
          Return a string containing the text of the active node.
(package private)  void leaveNodeTable()
          Finish working on entity and attribute tables for one paragraph type element.
 void menuChoice(java.lang.String choice)
           
(package private)  void populateNodeTable()
          Insert values from the various objects connected to one paragraph type element into the entity and property tables.
 void rowSelected(java.lang.String rowValue, java.lang.String tableType)
          A row is selected.
 void tableEscape()
           
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
Methods inherited from class java.awt.Container
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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mainFrame

javax.swing.JFrame mainFrame
Constructor Detail

GeoModelRunner

public GeoModelRunner(javax.swing.JFrame inFrame)
Start a runner for the GeoModelText application.

Parameters:
inFrame - The frame we put things into.
Method Detail

getTextFromNextNode

java.lang.String getTextFromNextNode()
Increase the active node number (that is, go to the next paragraph type node) and return a string containing the text of the active node. An XML fragment or clean text is returned depending on the status of the showTags flag.

Returns:
The paragraph text string.

getTextFromPrevNode

java.lang.String getTextFromPrevNode()
Decrease the active node number (that is, go to the previous paragraph type node) and return a string containing the text of the active node. An XML fragment or clean text is returned depending on the status of the showTags flag.

Returns:
The paragraph text string.

getTextFromSelectedNode

java.lang.String getTextFromSelectedNode(int nodeNumber)
Set the active node number (that is, go to the selected paragraph type node) and return a string containing the text of the active node. An XML fragment or clean text is returned depending on the status of the showTags flag.

Returns:
The paragraph text string.

getTextFromNodeNumber

java.lang.String getTextFromNodeNumber(java.lang.String nodeId,
                                       boolean tagged)
Return a string containing the text of the node with this number. An XML fragment or clean text is returned depending on the tagged parameter.

Parameters:
nodeNumber - The xml:id of the node.
tagged - True if tags to be included.
Returns:
The paragraph text string.

getTextFromThisNode

java.lang.String getTextFromThisNode()
Return a string containing the text of the active node. An XML fragment or clean text is returned depending on the status of the showTags flag.

Returns:
The paragraph text string.

getIdFromThisNode

java.lang.String getIdFromThisNode()
Get the xml:id of the active node.

Returns:
The xml:id of the active node.

findNodeWithId

public GeoModelLinkable findNodeWithId(java.lang.String id)
Find a node with a specified xml:id value. Uses the first 4 characters of the ID to dispatch on node type to look for.

Parameters:
id - The xmk:id value
Returns:
the node typed according to the linkable interface.

findGeoModelLocation

public GeoModelLocation findGeoModelLocation(java.lang.String id)
                                      throws GeoModelLocationException
Fint the object with a specified ID value.

Parameters:
id - The ID identifying the object.
Returns:
The object according to the interface.
Throws:
GeoModelLocationException

findNodeNumberFromNodeId

int findNodeNumberFromNodeId(java.lang.String nodeId)
Send in the node id, find a number in the node list for the paragraph.

Parameters:
nodeId - A node ID string.
Returns:
The paragraph number (that is, in the listOfNodes nodeList) found, or -1 if none found.

leaveNodeTable

void leaveNodeTable()
Finish working on entity and attribute tables for one paragraph type element. Inserts new data from the tables into the various objects, and clears the tables to make them ready for the next paragraph type element.


populateNodeTable

void populateNodeTable()
Insert values from the various objects connected to one paragraph type element into the entity and property tables.


menuChoice

public void menuChoice(java.lang.String choice)
Specified by:
menuChoice in interface MenuInterface

getNodeListView

NodeListView getNodeListView()
Getter for the NodeListView object.

Returns:
the object.

getNodeIdFromEntTable

java.lang.String getNodeIdFromEntTable(int rowNum)
Return the node ID value from a specific line in the entity table.

Parameters:
rowNum - The row number in the table.
Returns:
The ID value of the record in this row. If the low number is out of bonds, null is returned.

rowSelected

public void rowSelected(java.lang.String rowValue,
                        java.lang.String tableType)
Description copied from interface: TableCallbackInterface
A row is selected.

Specified by:
rowSelected in interface TableCallbackInterface
Parameters:
rowValue - identificator for the selected row.
tableType - to see the difference between more than one result table in a single object.

tableEscape

public void tableEscape()
Specified by:
tableEscape in interface TableCallbackInterface

cellLeft

public void cellLeft(int column,
                     int row)
Specified by:
cellLeft in interface TableCallbackInterface

getMyGeoModelLinkSet

public GeoModelLinkSet getMyGeoModelLinkSet()

getMyGeoModelCoref

public GeoModelCoref getMyGeoModelCoref()

getTeiRootNode

public org.w3c.dom.Document getTeiRootNode()

getMyGeoModelCorefTableView

public GeoModelCorefTableView getMyGeoModelCorefTableView()

getTextFromSurroundingPara

java.lang.String getTextFromSurroundingPara(java.lang.String nodeId,
                                            boolean tagged)
Search for paragraphs with the given numeric part of the xml:id. Will look for paragraphs with ID numbers previous to the requested, but gives up after having tried 1000.

Parameters:
nodeId - The node ID to start with.
tagged - True of XML tags to be included.
Returns:
The string with the paragraph text, or null if none found.

getIdOfSurroundingPara

public java.lang.String getIdOfSurroundingPara(java.lang.String nodeId)
Search for paragraphs with the given numeric part of the xml:id. Will look for paragraphs with ID numbers previous to the requested, but gives up after having tried 1000.

Parameters:
nodeId - The node ID to start with.
Returns:
The string with the ID of the paragraph type element, or null if none found.

findPageNumForNode

java.lang.String findPageNumForNode(java.lang.String nodeId)
Find the page on which the start tag of an element is located.

Parameters:
nodeId - The element whose page to find.
Returns:
The number of the page on which the node starts. Null on failure.

getMyGeoModelPlaceReg

GeoModelPlaceReg getMyGeoModelPlaceReg()

getMyGeoModelProperties

GeoModelProperties getMyGeoModelProperties()

getMyAddedNodeSet

AddedNodeSet getMyAddedNodeSet()

getMyGeoModelPersonReg

public GeoModelPersonReg getMyGeoModelPersonReg()

getElements

public GeoModelElement[] getElements()