|
Ontimize 5.2072EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.ontimize.gui.field.DataField
com.ontimize.gui.field.TextFieldDataField
com.ontimize.gui.field.RealDataField
com.ontimize.gui.field.CalculatedDataField
This class implements a field whose value is defined from a mathematical operation between other associated field values.
Important NOTE:
Three math parsers are allowed according to three different math libraries: JEP, JEP3x, MESP.
By default, JEP are used. To change this performance, user must set the property:
For example, to set "mesp" library as parser: System.setProperty("com.ontimize.util.math.MathExpressionParser", "mesp"); Possible values are:
| Nested Class Summary |
| Nested classes inherited from class com.ontimize.gui.field.TextFieldDataField |
TextFieldDataField.EJTextField, TextFieldDataField.InnerDocumentListener |
| Nested classes inherited from class com.ontimize.gui.field.DataField |
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButton |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| 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 | |
protected java.util.Vector |
attributeFields
An instance of attribute fields. |
protected java.lang.String |
expresion
A reference for the mathematical expression. |
protected MathExpressionParser |
parser
An instance of parser for mathematical operation. |
protected java.util.Vector |
requiredFields
A 2x2 Vector for required fields. |
protected java.lang.String |
source
A reference for associated fields. |
| Fields inherited from class com.ontimize.gui.field.RealDataField |
advancedHelpBMenu, calc, calcButton, frame |
| Fields inherited from class com.ontimize.gui.field.TextFieldDataField |
disabledTextColor, innerListener |
| 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 com.ontimize.gui.field.AdvancedDataComponent |
ADVANCED_QUERY |
| Fields inherited from interface com.ontimize.gui.field.DataComponent |
COMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2 |
| Fields inherited from interface com.ontimize.gui.field.FormComponent |
DEBUG |
| Fields inherited from interface com.ontimize.gui.i18n.Internationalization |
DEBUG_LANGUAGE |
| Fields inherited from interface com.ontimize.gui.SecureElement |
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS |
| Constructor Summary | |
CalculatedDataField(java.util.Hashtable parameters)
The class constructor. |
|
| Method Summary | |
java.lang.String |
getExpression()
Gets the expression parameter. |
java.lang.String |
getSource()
Gets the source parameter. |
boolean |
isModifiable()
Checks the modifiable condition for a component. |
boolean |
isModified()
Checks whether field is modified. |
protected void |
recalculate(java.util.Hashtable values)
Recalculates the value rebuilding the expression to parse it. |
void |
setEnabled(boolean enabled)
Checks permissions and enables the calc button according to param. |
void |
setParentForm(Form f)
Method declaration to set the form that contains the component. |
void |
setSourceExpression(java.lang.String source,
java.lang.String expression)
Prepares the mathematical expression to parse. |
void |
setValue(java.lang.Object value)
Sets the field value. |
void |
valueChanged(ValueEvent e)
Method called when the value change |
| Methods inherited from class com.ontimize.gui.field.RealDataField |
colorSelection, createPopupMenu, format, free, getDoubleValue, getNumericalValue, getSQLDataType, getValue, init, installInnerListener, installValidationDocumentListener, isEmpty, setAdvancedQueryMode, setComponentLocale, setParentFrame, setResourceBundle, showPopupMenu |
| Methods inherited from class com.ontimize.gui.field.TextFieldDataField |
createDataField, deleteData, getAttribute, getInnerListenerEnabled, getInnerValue, getLabelComponentText, getText, isInnerValueEqual, isRequired, setInnerListenerEnabled, setInnerValue |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
| 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, 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, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, 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, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, 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, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ontimize.gui.field.DataComponent |
deleteData, getLabelComponentText, isHidden, isRequired, setModifiable, setRequired |
| Methods inherited from interface com.ontimize.gui.field.FormComponent |
getConstraints, isEnabled, setVisible |
| Methods inherited from interface com.ontimize.gui.i18n.Internationalization |
getTextsToTranslate |
| Methods inherited from interface com.ontimize.gui.field.IdentifiedElement |
getAttribute |
| Methods inherited from interface com.ontimize.gui.SecureElement |
initPermissions, isRestricted |
| Field Detail |
protected java.lang.String expresion
protected java.util.Vector attributeFields
protected MathExpressionParser parser
protected java.util.Vector requiredFields
protected java.lang.String source
| Constructor Detail |
public CalculatedDataField(java.util.Hashtable parameters)
super() with Hashtable parameters and parses operation.
parameters - the Hashtable with parameters. New parameters are added:
| attribute | values | default | required | meaning |
| source | field1;field2;...;fieldn | yes | The fields to calculate the field value | |
| expression | yes | The mathematical expression to define the field value | ||
| requiredfields | required1;required2;...;requiredn | no | The required fields. When a required field is not present, the final value for calculated data field is not showed. |
| Method Detail |
public boolean isModifiable()
DataComponent
isModifiable in interface DataComponentisModifiable in class TextFieldDataFieldpublic java.lang.String getSource()
public java.lang.String getExpression()
public void setSourceExpression(java.lang.String source,
java.lang.String expression)
source - the fields of expressionexpression - the mathematical expressionpublic void setEnabled(boolean enabled)
RealDataField
setEnabled in interface FormComponentsetEnabled in class RealDataFieldenabled - the condition to enable componentpublic void setParentForm(Form f)
AccessForm
setParentForm in interface AccessFormsetParentForm in class DataFieldpublic void valueChanged(ValueEvent e)
ValueChangeListener
valueChanged in interface ValueChangeListenere - Event with the previous value and the new onepublic void setValue(java.lang.Object value)
RealDataField
setValue in interface DataComponentsetValue in class RealDataFieldvalue - the object with valuepublic boolean isModified()
RealDataField
isModified in interface DataComponentisModified in class RealDataFieldprotected void recalculate(java.util.Hashtable values)
values - the Hashtable with values to recalculate
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||