|
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.util.swing.JCalculatedExpression
| Nested Class Summary | |
static class |
JCalculatedExpression.ColumnPosition
|
protected static class |
JCalculatedExpression.CustomListModel
|
static class |
JCalculatedExpression.Expression
|
protected static class |
JCalculatedExpression.InsertSymbolListener
|
| 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 javax.swing.JButton |
addButton
Add button. |
protected javax.swing.JList |
availableFieldsList
JList component that contains a list with available fields to use into the editor of expressions. |
protected javax.swing.JPanel |
buttonPanel
Panel that contains all operation buttons. |
protected javax.swing.JButton |
closeParenthesisButton
Close Parenthesis button. |
protected java.util.List |
componentList
List of all components that conform the JCalculatedExpression |
protected javax.swing.JButton |
divideButton
Divide button. |
protected ComponentTextPane |
expressionPane
The reference to the editor of the mathematical expression. |
protected javax.swing.JButton |
multiplyButton
Multiply button. |
protected javax.swing.JButton |
openParenthesisButton
Open Parenthesis button. |
protected javax.swing.JSplitPane |
splitPane
SplitPane that contains the mathematical editor and the list of available fields. |
protected javax.swing.JButton |
substractButton
Subtract button. |
protected javax.swing.undo.UndoManager |
undoManager
The reference to the UndoManager. |
| 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 | |
JCalculatedExpression()
|
|
| Method Summary | |
void |
addAvailableFields(java.lang.Object field)
|
protected void |
addColumnToExpression(int index)
This method adds selected available field from the list to the editor of expressions. |
protected void |
checkExpression(java.lang.String expr)
This method checks if the mathematical expression of the editor is well defined. |
protected javax.swing.JButton |
createButton(java.lang.String text,
java.lang.String iconPath,
boolean addToGroup)
This method creates a new JButton |
protected ComponentTextPane |
createExpressionEditor(boolean addToGroup)
This method creates and configures 'editor' component. |
protected javax.swing.JList |
createList(java.util.List values,
boolean addToGroup)
This method creates the JList component where are stored available field to use into the mathematical expression. |
static MathExpressionParser |
createParser(java.lang.String expr,
java.util.List columns)
This method creates the parser that is used to check the mathematical expression of the editor. |
java.util.List |
getAvailableFields()
Recovers the list of available fields to use into the mathematical expression. |
java.lang.Object |
getAvailableFields(int index)
This method returns from stored available fields the one indicated by the specified index. |
java.lang.Object |
getExpression()
This method returns the mathematical expression contained into the editor. |
protected int[] |
getExpressionIndexColName(java.lang.String colName,
java.lang.String expression)
|
protected java.lang.String |
getFieldTranslation(java.lang.String field)
|
protected void |
init()
Initializes all components and distribute into the component. |
protected void |
installHighlight(javax.swing.JButton button)
|
protected void |
registerUndoableListener(javax.swing.text.JTextComponent component)
|
protected void |
registerUndoRedoActions(javax.swing.text.JTextComponent component)
|
void |
removeAllAvailableFields()
|
void |
removeAvailableFields(int index)
|
void |
removeAvailableFields(java.lang.Object element)
|
void |
setAvailableFields(java.util.List values)
Sets the list of fields that are going to be allowed to introduce into the mathematical expression of the editor. |
void |
setBorder(javax.swing.border.Border border)
|
void |
setEnabled(boolean enabled)
|
void |
setExpression(java.lang.Object value)
This method sets the mathematical expression into the editor. |
protected void |
setExpressionText(java.lang.String expression)
This method sets the expression into the editor replacing the name of the available fields by CustomLabel objects. |
protected void |
updateSelectedCalculatedColumnExpression()
This method updates the color of the text of the expression depending on if the expression is well defined (black foreground color) or not (red foreground color). |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, 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, 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, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, removeFocusListener, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.List componentList
protected javax.swing.undo.UndoManager undoManager
UndoManager.
protected ComponentTextPane expressionPane
protected javax.swing.JPanel buttonPanel
protected javax.swing.JButton addButton
protected javax.swing.JButton substractButton
protected javax.swing.JButton multiplyButton
protected javax.swing.JButton divideButton
protected javax.swing.JButton openParenthesisButton
protected javax.swing.JButton closeParenthesisButton
protected javax.swing.JList availableFieldsList
SelectableItem that allows to visualize the name of the available
field with a check to select if this field is required or not.
protected javax.swing.JSplitPane splitPane
| Constructor Detail |
public JCalculatedExpression()
| Method Detail |
protected void init()
public void setBorder(javax.swing.border.Border border)
public void setEnabled(boolean enabled)
public java.util.List getAvailableFields()
List of elements.public java.lang.Object getAvailableFields(int index)
index - The index of the element to recover.
Object with the name of the available field.public void removeAvailableFields(int index)
public void removeAvailableFields(java.lang.Object element)
public void removeAllAvailableFields()
public void setAvailableFields(java.util.List values)
values - A list with the values.public void addAvailableFields(java.lang.Object field)
public java.lang.Object getExpression()
String with the mathematical expression.public void setExpression(java.lang.Object value)
value - The mathematical expression.protected void setExpressionText(java.lang.String expression)
CustomLabel objects. It allows to manage the name of the fields as a unique entity instead
of a set of characters.
expression -
protected int[] getExpressionIndexColName(java.lang.String colName,
java.lang.String expression)
protected ComponentTextPane createExpressionEditor(boolean addToGroup)
addToGroup - Boolean that indicates if it is desired to add the current button to the list of all
components of the JCalculatedExpression.
ComponentTextPane component.protected void updateSelectedCalculatedColumnExpression()
protected void checkExpression(java.lang.String expr)
throws java.lang.Exception
expr - The mathematical expression.
java.lang.Exception - if the expression is not well defined.
public static MathExpressionParser createParser(java.lang.String expr,
java.util.List columns)
expr - The mathematical expressioncolumns - List of available fields that can be used into the expression.
protected void registerUndoableListener(javax.swing.text.JTextComponent component)
protected void registerUndoRedoActions(javax.swing.text.JTextComponent component)
protected javax.swing.JButton createButton(java.lang.String text,
java.lang.String iconPath,
boolean addToGroup)
text - Text of the button.iconPath - Path to the icon of the button.addToGroup - Boolean that indicates if it is desired to add the current button to the list of all
components of the JCalculatedExpression.
JButton component.protected void installHighlight(javax.swing.JButton button)
protected javax.swing.JList createList(java.util.List values,
boolean addToGroup)
values - The list of elements to insert into the JList.addToGroup - Boolean that indicates if it is desired to add the current button to the list of all
components of the JCalculatedExpression.
JList component.protected void addColumnToExpression(int index)
index - protected java.lang.String getFieldTranslation(java.lang.String field)
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||