Class SSspreadPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--SSspreadPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

class SSspreadPanel
extends java.awt.Panel
implements java.awt.event.MouseListener

See Also:
Serialized Form

Inner 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)  java.awt.Font cellDataFont
          ARG: cell data font
(package private)  int[] cellFormat
          ARG: cell type fields[0:cols-1] one of CELL_NOP,CELL_URL, CELL_EXPR_PROFILE in user data space...
(package private)  SStextArray cells
          the array of SStextCell cells
(package private)  java.awt.Font cellUrlFont
          ARG: cell URL font
(package private)  int currentValueH
           
(package private)  int currentValueV
           
(package private)  java.awt.Font dataFontSize
          Calculated default or overidden
(package private)  java.lang.String[][] dataURL
          opt.
(package private)  int fontSize
          ARG: only if no fonts specified
(package private)  int headerClickedCol
           
(package private)  java.awt.Font headerFontSize
          Calculated default or overidden
(package private)  int[] index
          for sorting
(package private)  java.awt.GridLayout lay
           
(package private)  int locCol
           
(package private)  int locRow
           
(package private)  MAExplorer mae
           
(package private)  int offSet
           
(package private)  int oldPosition
          keep track of col last clicked
private  int positionX
          ULHC base address starting at (1,1)
private  int positionY
          ULHC base address starting at (1,1)
(package private)  int prepCols
          ARG: user data size
(package private)  java.lang.String[][] prepDataEdit
          "virt.
(package private)  java.lang.String[][] prepDataOrig
          ARG orig.
(package private)  int prepRows
          ARG: user data size
(package private)  SSscrollHorizontal sh
           
(package private)  boolean sortAsendDesendFlag
          keep track of desend/ascending
(package private)  ShowSpreadsheetPopup ssp
          pass down globals
(package private)  SSstatusBar status
          [RC] & full cell contents displayed @top
(package private)  SSscrollVertical sv
          scroll bars
(package private)  boolean urlPopupFlag
          popup browser flag
(package private)  int virCols
          ARG: "virtual screen" size
(package private)  int virRows
          ARG: "virtual screen" size that is visible
 
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) SSspreadPanel(MAExplorer mae, int virRows, int virCols, java.lang.String[][] prepDataOrig, int prepRows, int prepCols, int fontSize, java.awt.Font cellDataFont, java.awt.Font buttonFont)
          SSspreadPanel() - constructor, inits the grid with values without the URL font and fields.
(package private) SSspreadPanel(java.lang.String[][] prepDataOrig, ShowSpreadsheetPopup ssp, MAExplorer mae, int virRows, int virCols, int prepRows, int prepCols, int fontSize, java.awt.Font cellUrlFont, java.awt.Font cellDataFont, java.awt.Font buttonFont, int[] cellFormat, java.lang.String[][] dataURL)
          SSspreadPanel() - constructor, panel holding (row,col) matrix of TextFields with the URL font and fields.
 
Method Summary
(package private)  void cellAdjust(java.awt.event.MouseEvent e)
          cellAdjust() - take action for mouse clicks on individual cells
(package private)  void deleteColumn(int k)
          deleteColumn() - delete the k-th col
private  void doSSspreadPanel()
          doSSspreadPanel() - actually build the spreadsheet panel
(package private)  java.lang.String getValue(int i, int j)
          getValue() - get a single value from prepDataEdit cell(i,j)
(package private)  java.lang.String[][] getValues()
          getValues() - get all values in a String[][] array
(package private)  void initValues()
          initValues() - show prepDataEdit inside the grid in U.L.H.C.
(package private)  void initValues(java.lang.String[][] data)
          initValues() - show prepDataEdit inside grid in U.L.H.C.
(package private)  void insertColumn(int k)
          insertColumn() - insert a row at k'th row
 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)
          mousePressed() - handle mouse Press events
 void mouseReleased(java.awt.event.MouseEvent e)
           
private  boolean moveColHeader(int diff)
          moveColHeader() - move the head of cols use negative ints for moving left.
(package private)  void moveDown(int diff)
          moveDown() - move diff cells down
(package private)  void moveLeft(int diff)
          moveLeft() - move diff cells to the left
(package private)  void moveRight(int diff)
          moveRight() - move diff cells to the right
private  boolean moveRowHeader(int diff)
          moveRowHeader() - move first cell of rows use negative ints for moving down.
(package private)  void moveUp(int diff)
          moveUp() - move diff cells up
private  void setCellFontAndColor(int r, int c)
          setCellFontAndColor() - use dataFont or cellUrlFont depending on cell(r,c)
(package private)  java.lang.String[][] sortSpreadsheet(int oldPosition, int colToSort, int prepCols, int prepRows, java.lang.String[][] unsortedData)
          sortSpreadsheet() - sort entire spread sheet based on column clicked.
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName, getAccessibleContext
 
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

mae

MAExplorer mae

cells

SStextArray cells
the array of SStextCell cells

currentValueV

int currentValueV

currentValueH

int currentValueH

positionX

private int positionX
ULHC base address starting at (1,1)

positionY

private int positionY
ULHC base address starting at (1,1)

sv

SSscrollVertical sv
scroll bars

sh

SSscrollHorizontal sh

status

SSstatusBar status
[RC] & full cell contents displayed @top

dataFontSize

java.awt.Font dataFontSize
Calculated default or overidden

headerFontSize

java.awt.Font headerFontSize
Calculated default or overidden

headerClickedCol

int headerClickedCol

index

int[] index
for sorting

virRows

int virRows
ARG: "virtual screen" size that is visible

virCols

int virCols
ARG: "virtual screen" size

prepRows

int prepRows
ARG: user data size

prepCols

int prepCols
ARG: user data size

fontSize

int fontSize
ARG: only if no fonts specified

dataURL

java.lang.String[][] dataURL
opt. data for URLs if not null [0:prepRows-1][0:prepCols-1]

prepDataEdit

java.lang.String[][] prepDataEdit
"virt. screen" [1:prepRows-1][1:prepCols-1]

prepDataOrig

java.lang.String[][] prepDataOrig
ARG orig. data[1:prepRows-1][1:prepCols-1]

cellUrlFont

java.awt.Font cellUrlFont
ARG: cell URL font

cellDataFont

java.awt.Font cellDataFont
ARG: cell data font

buttonFont

java.awt.Font buttonFont
ARG: cell label font

locRow

int locRow

locCol

int locCol

oldPosition

int oldPosition
keep track of col last clicked

offSet

int offSet

cellFormat

int[] cellFormat
ARG: cell type fields[0:cols-1] one of CELL_NOP,CELL_URL, CELL_EXPR_PROFILE in user data space...

ssp

ShowSpreadsheetPopup ssp
pass down globals

urlPopupFlag

boolean urlPopupFlag
popup browser flag

sortAsendDesendFlag

boolean sortAsendDesendFlag
keep track of desend/ascending

lay

java.awt.GridLayout lay
Constructor Detail

SSspreadPanel

SSspreadPanel(java.lang.String[][] prepDataOrig,
              ShowSpreadsheetPopup ssp,
              MAExplorer mae,
              int virRows,
              int virCols,
              int prepRows,
              int prepCols,
              int fontSize,
              java.awt.Font cellUrlFont,
              java.awt.Font cellDataFont,
              java.awt.Font buttonFont,
              int[] cellFormat,
              java.lang.String[][] dataURL)
SSspreadPanel() - constructor, panel holding (row,col) matrix of TextFields with the URL font and fields.
Parameters:
prepDataOrig - is user data[0:usrRawData][]
ssp - is instance of ShowSpreadsheetPopup
mae - is instance of MAExplorer
virRows - is # of virtual rows i.e. size of prepDataEdit[][]
virCols - is # of virtual columns i.e. size of prepDataEdit[][]
prepRows - is the size of prepDataOrig
prepCols - is the size of prepDataOrig
fontSize - is 8, 10, 12, 14
cellUrlFont - is the cell URL font
cellDataFont - is the cell data font
buttonFont - is the cell label font
cellFormat[] - is the cell type fields
dataURL[][] - is the data for URLs if not null
See Also:
doSSspreadPanel()

SSspreadPanel

SSspreadPanel(MAExplorer mae,
              int virRows,
              int virCols,
              java.lang.String[][] prepDataOrig,
              int prepRows,
              int prepCols,
              int fontSize,
              java.awt.Font cellDataFont,
              java.awt.Font buttonFont)
SSspreadPanel() - constructor, inits the grid with values without the URL font and fields.
Parameters:
mae - is instance of MAExplorer
virRows - 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 prepDataOrig
prepCols - is the size of prepDataOrig
fontSize - is 8, 10, 12, 14
cellDataFont - is the cell data font
buttonFont - is the cell label font
See Also:
doSSspreadPanel(), initValues()
Method Detail

doSSspreadPanel

private void doSSspreadPanel()
doSSspreadPanel() - actually build the spreadsheet panel
See Also:
SSscrollHorizontal, SSscrollVertical, SSstatusBar, SStextArray, SStextArray.getTextField(int, int)

setCellFontAndColor

private void setCellFontAndColor(int r,
                                 int c)
setCellFontAndColor() - use dataFont or cellUrlFont depending on cell(r,c)
Parameters:
r - is row of cell
c - is column of cell
See Also:
SStextArray.getTextField(int, int)

sortSpreadsheet

java.lang.String[][] sortSpreadsheet(int oldPosition,
                                     int colToSort,
                                     int prepCols,
                                     int prepRows,
                                     java.lang.String[][] unsortedData)
sortSpreadsheet() - sort entire spread sheet based on column clicked.
Parameters:
oldPosition -  
colToSort - column to sort
prepCols - is # actual data cols
prepRows - is # actual data cols
unsortedData - is unsorted data to be stroed
Returns:
sorted data
See Also:
SortMAE.bubbleSortIndex(java.lang.String[], int, boolean), Util.cvs2f(java.lang.String)

initValues

void initValues()
initValues() - show prepDataEdit inside the grid in U.L.H.C.
See Also:
SStextArray.getTextField(int, int)

initValues

void initValues(java.lang.String[][] data)
initValues() - show prepDataEdit inside grid in U.L.H.C. with new data
Parameters:
data - to use
See Also:
initValues()

getValue

java.lang.String getValue(int i,
                          int j)
getValue() - get a single value from prepDataEdit cell(i,j)
Parameters:
i - coordinate of cell
j - coordinate of cell
Returns:
cell(i,j) value

getValues

java.lang.String[][] getValues()
getValues() - get all values in a String[][] array
Returns:
all values of array

moveColHeader

private boolean moveColHeader(int diff)
moveColHeader() - move the head of cols use negative ints for moving left. Used with horzontal scrollbar.
Parameters:
diff - is amount to move the column header
Returns:
false if out of bounds.
See Also:
SStextArray.getTextField(int, int)

moveRowHeader

private boolean moveRowHeader(int diff)
moveRowHeader() - move first cell of rows use negative ints for moving down.
Parameters:
diff - is amount to move the row header
Returns:
false if out of bounds.

moveUp

void moveUp(int diff)
moveUp() - move diff cells up
Parameters:
diff - is amount to move the cells up
See Also:
SStextArray.getTextField(int, int), moveRowHeader(int)

moveDown

void moveDown(int diff)
moveDown() - move diff cells down
Parameters:
diff - is amount to move the cells down
See Also:
SStextArray.getTextField(int, int), moveRowHeader(int)

moveRight

void moveRight(int diff)
moveRight() - move diff cells to the right
Parameters:
diff - is amount to move the cells right
See Also:
SStextArray.getTextField(int, int), moveColHeader(int), setCellFontAndColor(int, int)

moveLeft

void moveLeft(int diff)
moveLeft() - move diff cells to the left
Parameters:
diff - is amount to move the cells left
See Also:
SStextArray.getTextField(int, int), moveColHeader(int), setCellFontAndColor(int, int)

deleteColumn

void deleteColumn(int k)
deleteColumn() - delete the k-th col
Parameters:
k - is column to delete
See Also:
initValues()

insertColumn

void insertColumn(int k)
insertColumn() - insert a row at k'th row
Parameters:
k - is column to insert
See Also:
initValues()

cellAdjust

void cellAdjust(java.awt.event.MouseEvent e)
cellAdjust() - take action for mouse clicks on individual cells
Parameters:
e - is MouseEvent
See Also:
FileIO.logMsgln(java.lang.String), SStextArray.getTextField(int, int), moveUp(int), Component.repaint(), sortSpreadsheet(int, int, int, int, java.lang.String[][])

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
mousePressed() - handle mouse Press events
Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
cellAdjust(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener