ElegantJ Data Tables Java API Specification v1.1

com.elegantj.data.comp.computedfield
Class ComputedField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended bycom.elegantj.jfc.label.JFCLabel
                      extended bycom.elegantj.data.comp.label.DataLabel
                          extended bycom.elegantj.data.comp.computedfield.ComputedField
All Implemented Interfaces:
javax.accessibility.Accessible, Computable, com.elegantj.data.comp.DatabaseColumn, java.io.Externalizable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants

public class ComputedField
extends com.elegantj.data.comp.label.DataLabel
implements java.io.Externalizable, Computable

This bean component allows the user to get the look and feel of JFCLabel and functionality of DatabaseColumn.

This bean provides the expression executor to parse the expression (arithmetical/database related) and to execute it. It also provides the support to the MethodsClass to get the functionality of the database related activities.

This bean provides powerful designing aspects by providing following user friendly property
Expression the expression string to be executed

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 com.elegantj.editors.C1 c1
           
 
Fields inherited from class javax.swing.JLabel
labelFor
 
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
ComputedField()
          Creates a ComputedField
 
Method Summary
 java.lang.Object executeExp()
          Executes the expression
 java.util.Vector getColumnData(int colIndex)
          Returns the column values of the column at colIndex
 java.util.Vector getColumnData(java.lang.String colName)
          Returns the column values of the column colName
 int getColumnIndex(java.lang.String colName)
          Returns the index for the specified column
 java.util.Vector getColumnNames()
          Returns the column names
 int getCurrentIndex()
          Returns the current index
 int getCurrentPage()
          Returns the current vertical page index
 int getCurrentPageAcross()
          Returns the current horizontal page index
 java.util.Vector getCurrentRecord()
          Returns the current record
 java.util.Vector getData()
          Returns the data for computation
 java.lang.String getExpression()
          Gets the expression string to be executed
 java.lang.String getLicenseKey()
          Gets the license key
 java.lang.String[] getMethods()
          Returns the valid methods to use in the expression
 java.lang.String[] getOperators()
          Returns the valid operators to use in the expression
 int getPageAcrossCount()
          Returns the horizontal page count
 int getPageCount()
          Returns the vertical page count
 void readExternal(java.io.ObjectInput in)
          Externalizable interface implementation to save and retrieve the state of this bean
 void setColumnNames(java.util.Vector columnNames)
          Sets the column names
 void setCurrentIndex(int index)
          Sets the current index
 void setCurrentPage(int n)
          Sets the current vertical page index
 void setCurrentPageAcross(int n)
          Sets the current horizontal page index
 void setData(java.util.Vector data)
          Sets the data for computation
 void setExpression(java.lang.String exp)
          Sets the expression string to be executed
 void setLicenseKey(java.lang.String key)
          Sets the license key
 void setPageAcrossCount(int n)
          Sets the horizontal page count
 void setPageCount(int n)
          Sets the vertical page count
 boolean verifyExp()
          Checks the expression whether it is valid or not
 void writeExternal(java.io.ObjectOutput out)
          Externalizable interface implementation to save and retrieve the state of this bean
 
Methods inherited from class com.elegantj.data.comp.label.DataLabel
getBandName, getColumnName, getColumnNo, getDataDisplayValues, getDataValue, getDefaultValue, getDisplayValue, isColumnField, isLayered, setBandName, setColumnName, setColumnNo, setDataDisplayValues, setDataValue, setDefaultValue, setDisplayValue, setLayered
 
Methods inherited from class com.elegantj.jfc.label.JFCLabel
addPropertyChangeListener, getDisabledIconPath, getIconPath, getInsets, getLocale, getMnemonic, isLightweight, removePropertyChangeListener, setAutoscrolls, setBackground, setBorder, setBounds, setCursor, setDisabledIconPath, setDoubleBuffered, setEnabled, setFont, setForeground, setHorizontalAlignment, setHorizontalTextPosition, setIconPath, setIconTextGap, setInsets, setLabelFor, setLayout, setLightweight, setLocale, setMnemonic, setOpaque, setRequestFocusEnabled, setText, setToolTipText, setVerticalAlignment, setVerticalTextPosition, setVisible
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setIcon, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setDebugGraphicsOptions, setDefaultLocale, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, 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
 
Methods inherited from interface com.elegantj.data.comp.DatabaseColumn
isEnabled, setEnabled
 

Field Detail

c1

public transient com.elegantj.editors.C1 c1
Constructor Detail

ComputedField

public ComputedField()
Creates a ComputedField

Method Detail

setLicenseKey

public void setLicenseKey(java.lang.String key)
Sets the license key

Parameters:
key - the license key

getLicenseKey

public java.lang.String getLicenseKey()
Gets the license key

Returns:
the license key

setExpression

public void setExpression(java.lang.String exp)
Sets the expression string to be executed

Specified by:
setExpression in interface Computable
Parameters:
exp - the expression string

getExpression

public java.lang.String getExpression()
Gets the expression string to be executed

Specified by:
getExpression in interface Computable
Returns:
the expression string

verifyExp

public boolean verifyExp()
Checks the expression whether it is valid or not

Specified by:
verifyExp in interface Computable
Returns:
true, if an expression is valid, otherwise false

executeExp

public java.lang.Object executeExp()
Executes the expression

Specified by:
executeExp in interface Computable
Returns:
the result of the expression

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalizable interface implementation to save and retrieve the state of this bean

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Description copied from class: com.elegantj.data.comp.label.DataLabel
Externalizable interface implementation to save and retrieve the state of this bean

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

setData

public void setData(java.util.Vector data)
Sets the data for computation

Specified by:
setData in interface Computable
Parameters:
data - the vector contains the data

getData

public java.util.Vector getData()
Returns the data for computation

Specified by:
getData in interface Computable
Returns:
the vector contains the data

setColumnNames

public void setColumnNames(java.util.Vector columnNames)
Sets the column names

Specified by:
setColumnNames in interface Computable
Parameters:
columnNames - the vector contains the column names

getColumnNames

public java.util.Vector getColumnNames()
Returns the column names

Specified by:
getColumnNames in interface Computable
Returns:
the vector contains the column names

setCurrentIndex

public void setCurrentIndex(int index)
Sets the current index

Specified by:
setCurrentIndex in interface Computable
Parameters:
index - the index of the record ,being proccessed

getCurrentIndex

public int getCurrentIndex()
Returns the current index

Specified by:
getCurrentIndex in interface Computable
Returns:
the index of the record ,being proccessed

getCurrentRecord

public java.util.Vector getCurrentRecord()
Returns the current record

Specified by:
getCurrentRecord in interface Computable
Returns:
the vector containing the current record values

getColumnData

public java.util.Vector getColumnData(java.lang.String colName)
Returns the column values of the column colName

Specified by:
getColumnData in interface Computable
Parameters:
colName - the column name
Returns:
the vector of the column values

getColumnIndex

public int getColumnIndex(java.lang.String colName)
Returns the index for the specified column

Parameters:
colName - the name of the column
Returns:
the index for the specified column

getColumnData

public java.util.Vector getColumnData(int colIndex)
Returns the column values of the column at colIndex

Specified by:
getColumnData in interface Computable
Parameters:
colIndex - the column index
Returns:
the vector of the column values

setCurrentPage

public void setCurrentPage(int n)
Sets the current vertical page index

Specified by:
setCurrentPage in interface Computable
Parameters:
n - the current vertical page index

getCurrentPage

public int getCurrentPage()
Returns the current vertical page index

Specified by:
getCurrentPage in interface Computable
Returns:
the current vertical page index

setPageCount

public void setPageCount(int n)
Sets the vertical page count

Specified by:
setPageCount in interface Computable
Parameters:
n - the vertical page count

getPageCount

public int getPageCount()
Returns the vertical page count

Specified by:
getPageCount in interface Computable
Returns:
the vertical page count

setCurrentPageAcross

public void setCurrentPageAcross(int n)
Sets the current horizontal page index

Specified by:
setCurrentPageAcross in interface Computable
Parameters:
n - the current horizontal page index

getCurrentPageAcross

public int getCurrentPageAcross()
Returns the current horizontal page index

Specified by:
getCurrentPageAcross in interface Computable
Returns:
the current horizontal page index

setPageAcrossCount

public void setPageAcrossCount(int n)
Sets the horizontal page count

Specified by:
setPageAcrossCount in interface Computable
Parameters:
n - the horizontal page count

getPageAcrossCount

public int getPageAcrossCount()
Returns the horizontal page count

Specified by:
getPageAcrossCount in interface Computable
Returns:
the horizontal page count

getOperators

public java.lang.String[] getOperators()
Returns the valid operators to use in the expression

Specified by:
getOperators in interface Computable
Returns:
the array of the operators

getMethods

public java.lang.String[] getMethods()
Returns the valid methods to use in the expression

Specified by:
getMethods in interface Computable
Returns:
the array of the method names

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjbeans.com
All Rights Reserved.