|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel net.sourceforge.webcompmath.awt.DataTableInput net.sourceforge.webcompmath.awt.beans.WCMDataTableInputBean
public class WCMDataTableInputBean
This class extends DataTableInput to make it easier to use in GUI builder environments. It also limits the flexibility somewhat, so that if you need the full capabilities of the superclass, then you will need to hand-code calls to its methods.
This bean provides two columns and an expanding number of rows. The columns are names "X" and "Y" by default, but you can change these names, or hide them. If you give the bean a name and add it to a parser, then you can access certain capabilities in expressions. For example, if you set the name to "data", then data.X(3) will refer to the value in the 3rd row in the X column. data.sum{X} will sum the values in column X, and data.sum(X^2) will sum the squares of the values in column X. data.count provides the number of rows. Note that these values, and any graph of the data table, are not updated while the user edits the table. You should include a WCMComputeButtonBean to cause the updates to occur.
If you need more columns, need to manually initialize the table, access row or column variables outside of a parsed expression, or read data from a file into the table, then you will need to hand-code method calls to the superclass DataTableInput.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
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 |
---|
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 | |
---|---|
WCMDataTableInputBean()
Default constructor |
Method Summary | |
---|---|
java.awt.Color |
getBlankBackground()
get blank background color. |
java.awt.Color |
getCellBackground()
Get cell background color. |
java.awt.Color |
getGridColor()
Get grid color. |
java.awt.Color |
getLabelBackground()
Get label background color. |
MathObject |
getMathObject()
Returns the object that can be added to a parser. |
java.lang.String |
getName()
Get the name of the bean. |
Parser |
getParser()
Get the parser. |
boolean |
getShowColumnTitles()
Get whether to show column titles. |
boolean |
getShowRowNumbers()
Get whether to show row numbers. |
java.lang.String |
getXColumnName()
Get the column name for the first column. |
java.lang.String |
getYColumnName()
Get the column name for the second column. |
void |
setBlankBackground(java.awt.Color color)
Set blank background color. |
void |
setCellBackground(java.awt.Color color)
Set cell background color. |
void |
setGridColor(java.awt.Color color)
Set grid color. |
void |
setLabelBackground(java.awt.Color color)
set label background color. |
void |
setName(java.lang.String name)
Set the name of the bean. |
void |
setParser(Parser newParser)
Set the parser to use. |
void |
setShowColumnTitles(boolean show)
Set whether to show column titles. |
void |
setShowRowNumbers(boolean show)
Set whether to show row numbers. |
void |
setXColumnName(java.lang.String name)
Set the column name for the first column. |
void |
setYColumnName(java.lang.String name)
Set the column name for the second column. |
Methods inherited from class net.sourceforge.webcompmath.awt.DataTableInput |
---|
addColumn, addColumn, addRows, addVariablesToParser, clear, deleteCurrentRow, doParse, getAutoAddRows, getCellContents, getColumnCount, getColumnName, getColumnVariable, getCurrentRowNumber, getEmptyCellValue, getNonEmptyRowCount, getRowNumberVariable, getSerialNumber, getThrowErrors, insertRow, readFromStream, setAutoAddRows, setCellContents, setColumnName, setCurrentRowNumber, setEmptyCellValue, setThrowErrors |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, 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, 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 |
---|
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, 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, 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, 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 |
Methods inherited from interface net.sourceforge.webcompmath.data.beans.ParserMathObject |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public WCMDataTableInputBean()
Method Detail |
---|
public java.lang.String getName()
getName
in interface MathObject
getName
in class DataTableInput
DataTableInput.getName()
public void setName(java.lang.String name)
setName
in interface MathObject
setName
in class DataTableInput
name
- name of the tableDataTableInput.setName(java.lang.String)
public MathObject getMathObject()
getMathObject
in interface ParserMathObject
ParserMathObject.getMathObject()
public java.lang.String getXColumnName()
public void setXColumnName(java.lang.String name)
name
- the new name.public java.lang.String getYColumnName()
public void setYColumnName(java.lang.String name)
name
- the new name.public boolean getShowColumnTitles()
getShowColumnTitles
in class DataTableInput
DataTableInput.getShowColumnTitles()
public void setShowColumnTitles(boolean show)
setShowColumnTitles
in class DataTableInput
show
- true or falseDataTableInput.setShowColumnTitles(boolean)
public boolean getShowRowNumbers()
getShowRowNumbers
in class DataTableInput
DataTableInput.getShowRowNumbers()
public void setShowRowNumbers(boolean show)
setShowRowNumbers
in class DataTableInput
show
- true or falseDataTableInput.setShowRowNumbers(boolean)
public java.awt.Color getLabelBackground()
getLabelBackground
in class DataTableInput
DataTableInput.getLabelBackground()
public void setLabelBackground(java.awt.Color color)
setLabelBackground
in class DataTableInput
color
- desired background colorDataTableInput.setLabelBackground(java.awt.Color)
public java.awt.Color getCellBackground()
getCellBackground
in class DataTableInput
DataTableInput.getCellBackground()
public void setCellBackground(java.awt.Color color)
setCellBackground
in class DataTableInput
color
- cell background colorDataTableInput.setCellBackground(java.awt.Color)
public java.awt.Color getBlankBackground()
getBlankBackground
in class DataTableInput
DataTableInput.getBlankBackground()
public void setBlankBackground(java.awt.Color color)
setBlankBackground
in class DataTableInput
color
- background colorDataTableInput.setBlankBackground(java.awt.Color)
public java.awt.Color getGridColor()
getGridColor
in class DataTableInput
DataTableInput.getGridColor()
public void setGridColor(java.awt.Color color)
setGridColor
in class DataTableInput
color
- line colorDataTableInput.setGridColor(java.awt.Color)
public Parser getParser()
public void setParser(Parser newParser)
newParser
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |