|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--SpreadSheet
This SpreadSheet class implements a dynamic spread sheet data structures. This includs underlying URL mappings, column and row headings etc. It has been extensively edited by the MAExplorer group to integrate it better with MAExplorer.
This class creates a spread sheet with 2 fixed rows on top and on the Left. The user data is modified using ShowSpreadSheetPopup.cvtTableToprepDataOrig(). This new size is the size of prepDataOrig[0:rows][0:cols] w/ 2 extra col & 2 extra rows. The size is (tRows+2)*(tCols+2) but is addressed in [1:tRows+1][1:tCols+1]. So if the user prepDataOrig is prepDataOrig[0:uRows-1][uCols], then the virtual array is prepDataEdit[uRows+2][uCols+1] and rows 0 and column 0 are fixed. Col 0 vector and Row 0 vector are NULLs. Col 1 vector is a fixed list of quoted numbers "1", "2", "3" ... Row 1 vector is a fixed list of field names F1, F2, F3,... and rows 0 and column 0 are fixed. row\col 0 1 2 3 5 6 tCols+1 (index) 0 null null null null null null ... 1 null "" F1(A) F2(B) F3(C) F4(D) ... F[tCols-1] 2 null "1" * * * * . . 3 null "2" * * * * . . . ... 4 null "3" * * * * . . . . . . tRows+1 null "tRows" . . . (index) This means that when we scroll, the contents of these fixed cells are not changed. We only copy a subregion from prepDataOrig[2:prepRows-1][2:prepCols-1] (???CHECK???) CLASSES ======= #1 SpreadSheet - creates spreadsheet, title, and control buttons #2 SSspreadPanel - creates a panel of cells and scrollbars, create prepDataEdit[][]. #3 SSstatusBar - panel w/ textfield displaying current grid value. #4 SStextCell - binary tree cells of TextFields with a String value #5 SStextArray - array of SStextCell #6 SSscrollHorizontal - a horizontal scrollbar for the SpreadSheet #7 SSscrollVertical - a vertical scrollbar for the SpreadSheet
Heavily modified by the MAExplorer group.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
, P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
Report
,
ShowSpreadsheetPopup
, Serialized FormInner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) java.awt.Font |
buttonFont
ARG: cell label font |
(package private) static int |
CELL_EXPR_PROFILE
Spreadsheet Cell mode: Cell is an expression profile |
(package private) static int |
CELL_NOP
Spreadsheet Cell mode: Cell is just data |
(package private) static int |
CELL_URL
Spreadsheet Cell mode: Cell is a URL hypertext link |
(package private) java.awt.Font |
cellDataFont
ARG: cell data font |
(package private) int[] |
cellFormat
ARG: cell type [cols] fields is CELL_xxxx |
(package private) java.awt.Font |
cellUrlFont
ARG: cell URL font |
(package private) java.lang.String[][] |
dataURL
ARG: opt. |
private int |
fontSize
font size number for cell entries |
(package private) MAExplorer |
mae
link to global MAExplorer instance |
private int |
prepCols
original # prep columns for prepDataOrig[0:prepRows-1][0:prepCols-1] sizes w/ 2 extra col & 2 extra rows. |
(package private) java.lang.String[][] |
prepDataOrig
ARG:orig. |
private int |
prepRows
original # prep rows for prepDataOrig[0:prepRows-1][0:prepCols-1] sizes w/ 2 extra col & 2 extra rows. |
private SSscrollHorizontal |
sh
horizontal spreadsheet scroller instance |
private SSspreadPanel |
sp
link to local SSspreadPanel instance |
(package private) ShowSpreadsheetPopup |
ssp
link to global instance of SpreadsheetPopup |
private SSscrollVertical |
sv
vertical spreadsheet scroller instance |
(package private) java.lang.String |
title
ARG: user title |
(package private) java.awt.Panel |
titlePanel
title panel for of spreadsheet |
(package private) boolean |
urlPopupFlag
popup browser flag |
private int |
virCols
virtual column sizes of prepDataEdit[0:rows-1][0:cols-1] This also inclues the field names in the top row and the row # in the left column |
private int |
virRows
virtual row size of prepDataEdit[0:rows-1][0:cols-1] This also inclues the field names in the top row and the row # in the left column |
Fields inherited from class java.awt.Panel |
base, nameCounter, serialVersionUID |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
Fields inherited from class java.awt.Component |
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
(package private) |
SpreadSheet(ShowSpreadsheetPopup ssp,
MAExplorer mae,
int virRows,
int virCols,
java.lang.String[][] prepDataOrig,
int prepRows,
int prepCols,
int fontSize,
java.lang.String title,
java.awt.Font cellUrlFont,
java.awt.Font cellDataFont,
java.awt.Font buttonFont,
int[] cellFormat,
java.lang.String[][] dataURL)
Spreadsheet() - creates a new Panel with BoderLayout and adds a new SSspreadPanel (the grid itself) w/ horizontal and vertical scrollbars. |
Method Summary | |
(package private) void |
deleteColumn(int k)
deleteColumn() - delete row at column k |
private void |
doSpreadSheet()
doSpreadSheet() - create the spreadsheet panel, title, and control buttons |
(package private) java.lang.String |
getValue(int i,
int j)
getValue() - get the String from the cell at grid position (i,j) |
(package private) java.lang.String[][] |
getValues()
getValues() - gets the whole grid as String[][] incl. |
(package private) void |
initValues(java.lang.String[][] data)
initValues() - initialize data values for spreadsheet data structures |
(package private) void |
insertColumn(int k)
insertColumn() - insert a column at column k |
Methods inherited from class java.awt.Panel |
|
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
MAExplorer mae
static final int CELL_NOP
static final int CELL_URL
static final int CELL_EXPR_PROFILE
private SSspreadPanel sp
private SSscrollVertical sv
private SSscrollHorizontal sh
private int fontSize
private int prepRows
private int prepCols
private int virRows
private int virCols
java.lang.String[][] prepDataOrig
java.lang.String[][] dataURL
java.lang.String title
java.awt.Font cellUrlFont
java.awt.Font cellDataFont
java.awt.Font buttonFont
int[] cellFormat
boolean urlPopupFlag
ShowSpreadsheetPopup ssp
java.awt.Panel titlePanel
Constructor Detail |
SpreadSheet(ShowSpreadsheetPopup ssp, MAExplorer mae, int virRows, int virCols, java.lang.String[][] prepDataOrig, int prepRows, int prepCols, int fontSize, java.lang.String title, java.awt.Font cellUrlFont, java.awt.Font cellDataFont, java.awt.Font buttonFont, int[] cellFormat, java.lang.String[][] dataURL)
ssp
- is instance of ShowSpreadsheetPopupmae
- is instance of MAExplorervirRows
- is # of virtual rows i.e. size of prepDataEdit[][]virCols
- is # of virtual columns i.e. size of prepDataEdit[][]prepDataOrig
- is user data[0:usrRawData][]prepRows
- is the size of prepDataOrigprepCols
- is the size of prepDataOrigfontSize
- is 8, 10, 12, 14title
- cellUrlFont
- is the cell URL fontcellDataFont
- is the cell data fontbuttonFont
- is the cell label fontcellFormat[]
- is the cell type fieldsdataURL[][]
- is the data for URLs if not nullSSspreadPanel.initValues()
,
doSpreadSheet()
Method Detail |
private void doSpreadSheet()
SSspreadPanel
void initValues(java.lang.String[][] data)
data
- is the initial data valuesSSspreadPanel.initValues()
java.lang.String getValue(int i, int j)
i
- is grid position ij
- is grid position jSSspreadPanel.getValue(int, int)
java.lang.String[][] getValues()
SSspreadPanel.getValue(int, int)
void insertColumn(int k)
k
- number of new row to insertSSspreadPanel.insertColumn(int)
void deleteColumn(int k)
k
- number of new row to deleteSSspreadPanel.deleteColumn(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |