|
|||||||||
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 | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.concord.pedagogica.ui.TableInputView
Class that generates an n x n table for use as a Punnett Square.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TableInputView()
Constructor with no arguments. |
|
TableInputView(int size)
Constructor that allows user to provide an argument to set the size of the Punnett Square table. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
|
void |
addActionListener(java.awt.event.ActionListener listener)
|
void |
caretUpdate(javax.swing.event.CaretEvent event)
|
void |
clearAllText()
A method which can be applied to every cell in a Punnett Square or TableInputView object. |
java.awt.Point |
findCellLocation(java.lang.Object cell)
Method that determines the upper lefthand point location of an individual cell in the table that has experienced a mouse press. |
TableInputModel |
getTableInputModel()
Method which returns the associated TableInputModel that e.g. |
int |
getTableSize()
|
void |
initialize()
Method that: provides the table with resizing capability and listens for a mouse press for table cell selection. |
boolean |
isCellEditable(int row,
int col)
|
boolean |
isCellSelectable(int row,
int col)
|
boolean |
isCellSelected(int row,
int col)
|
static void |
main(java.lang.String[] args)
|
void |
mousePressed(java.awt.event.MouseEvent evt)
Event handler that |
protected void |
notifyActionListeners()
|
void |
paintComponent(java.awt.Graphics g)
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
void |
removeActionListener(java.awt.event.ActionListener listener)
|
void |
setAllEditable(boolean editable)
A boolean method which can be applied to every cell in a Punnett Square or TableInputView object. |
void |
setAllSelectable(boolean selectable)
|
void |
setAllSelected(boolean selected)
|
void |
setBackground(java.awt.Color color)
To set the background color of the Punnett Square. |
void |
setCellEditable(boolean editable,
int row,
int col)
A boolean method which can be applied to individual cells in a Punnett Square or TableInputView object. |
void |
setCellSelectable(boolean selectable,
int row,
int col)
|
void |
setCellSelected(boolean selected,
int row,
int col)
A boolean method which can be applied to individual cells in a Punnett Square or TableInputView object. |
void |
setCellText(java.lang.String text,
int row,
int col)
A method which can be applied to individual cells in a Punnett Square or TableInputView object. |
void |
setTableInputModel(TableInputModel model)
Method which associates a particular TableInputModel with a TableInputView object. |
void |
setTableSize(int size)
|
void |
setTableSize(int size,
java.lang.String breakChars)
Method to set the Punnett Square table size. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TableInputView()
public TableInputView(int size)
size
- int size size of n x n tableMethod Detail |
public void initialize()
public void setBackground(java.awt.Color color)
setBackground
in class javax.swing.JComponent
public void setTableSize(int size)
public void setTableSize(int size, java.lang.String breakChars)
size
- int size Example: table.setTableSize(3); will give the
Punnett Square or TableInputView object table a size of 3 cells per row and 3 cells per column.public int getTableSize()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public java.awt.Point findCellLocation(java.lang.Object cell)
cell
- Object cell cell is assigned an array locationpublic void mousePressed(java.awt.event.MouseEvent evt)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void caretUpdate(javax.swing.event.CaretEvent event)
caretUpdate
in interface javax.swing.event.CaretListener
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
public TableInputModel getTableInputModel()
public void setTableInputModel(TableInputModel model)
public void setAllEditable(boolean editable)
editable
- boolean - editable setting the JTextField to be editable either true or falsepublic void setCellEditable(boolean editable, int row, int col)
editable
- boolean editable setting the JTextField to be editable either true or falsecol
- int col number of the column in the table starting at the far left with column 0 (zero)public boolean isCellEditable(int row, int col)
public void setCellSelected(boolean selected, int row, int col)
editable
- boolean editable setting the Cell to be selected either true or falsecol
- int col number of the column in the table starting at the far left with column 0 (zero)public boolean isCellSelected(int row, int col)
public boolean isCellSelectable(int row, int col)
public void setCellSelectable(boolean selectable, int row, int col)
public void setAllSelected(boolean selected)
public void setAllSelectable(boolean selectable)
public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
protected void notifyActionListeners()
public void setCellText(java.lang.String text, int row, int col)
editable
- boolean editable setting the Cell to be selected either true or falsecol
- int col number of the column in the table starting at the far left with column 0 (zero)public void clearAllText()
editable
- boolean - editable setting the JTextField to be editable either true or falsepublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |