public class JCalculatedExpression extends JPanel
| Modifier and Type | Class and Description |
|---|---|
static class |
JCalculatedExpression.ColumnPosition |
protected static class |
JCalculatedExpression.CustomListModel |
static class |
JCalculatedExpression.Expression |
protected static class |
JCalculatedExpression.InsertSymbolListener |
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected JButton |
addButton
Add button.
|
protected JList |
availableFieldsList
JList component that contains a list with available fields to use into
the editor of expressions.
|
protected JPanel |
buttonPanel
Panel that contains all operation buttons.
|
protected JButton |
closeParenthesisButton
Close Parenthesis button.
|
protected List |
componentList
List of all components that conform the JCalculatedExpression
|
protected JButton |
divideButton
Divide button.
|
protected ComponentTextPane |
expressionPane
The reference to the editor of the mathematical expression.
|
protected JButton |
multiplyButton
Multiply button.
|
protected JButton |
openParenthesisButton
Open Parenthesis button.
|
protected JSplitPane |
splitPane
SplitPane that contains the mathematical editor and the list of available
fields.
|
protected JButton |
substractButton
Subtract button.
|
protected UndoManager |
undoManager
The reference to the
UndoManager. |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
JCalculatedExpression() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAvailableFields(Object field) |
protected void |
addColumnToExpression(int index)
This method adds selected available field from the list to the editor of
expressions.
|
protected void |
checkExpression(String expr)
This method checks if the mathematical expression of the editor is well
defined.
|
protected JButton |
createButton(String text,
String iconPath,
boolean addToGroup)
This method creates a new JButton
|
protected ComponentTextPane |
createExpressionEditor(boolean addToGroup)
This method creates and configures 'editor' component.
|
protected JList |
createList(List values,
boolean addToGroup)
This method creates the JList component where are stored available field
to use into the mathematical expression.
|
static MathExpressionParser |
createParser(String expr,
List columns)
This method creates the parser that is used to check the mathematical
expression of the editor.
|
List |
getAvailableFields()
Recovers the list of available fields to use into the mathematical
expression.
|
Object |
getAvailableFields(int index)
This method returns from stored available fields the one indicated by the
specified index.
|
Object |
getExpression()
This method returns the mathematical expression contained into the
editor.
|
protected int[] |
getExpressionIndexColName(String colName,
String expression) |
protected String |
getFieldTranslation(String field) |
protected void |
init()
Initializes all components and distribute into the component.
|
protected void |
installHighlight(JButton button) |
protected void |
registerUndoableListener(JTextComponent component) |
protected void |
registerUndoRedoActions(JTextComponent component) |
void |
removeAllAvailableFields() |
void |
removeAvailableFields(int index) |
void |
removeAvailableFields(Object element) |
void |
setAvailableFields(List values)
Sets the list of fields that are going to be allowed to introduce into
the mathematical expression of the editor.
|
void |
setBorder(Border border) |
void |
setEnabled(boolean enabled) |
void |
setExpression(Object value)
This method sets the mathematical expression into the editor.
|
protected void |
setExpressionText(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).
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, isPaintingOrigin, 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, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, getName, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected List componentList
protected UndoManager undoManager
UndoManager.protected ComponentTextPane expressionPane
protected JPanel buttonPanel
protected JButton addButton
protected JButton substractButton
protected JButton multiplyButton
protected JButton divideButton
protected JButton openParenthesisButton
protected JButton closeParenthesisButton
protected 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 JSplitPane splitPane
protected void init()
public void setBorder(Border border)
setBorder in class JComponentpublic void setEnabled(boolean enabled)
setEnabled in class JComponentpublic List getAvailableFields()
List of elements.public 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(Object element)
public void removeAllAvailableFields()
public void setAvailableFields(List values)
values - A list with the values.public void addAvailableFields(Object field)
public Object getExpression()
String with the mathematical expression.public void setExpression(Object value)
value - The mathematical expression.protected void setExpressionText(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(String colName, 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(String expr) throws Exception
expr - The mathematical expression.Exception - if the expression is not well defined.public static MathExpressionParser createParser(String expr, List columns)
expr - The mathematical expressioncolumns - List of available fields that can be used into the expression.protected void registerUndoableListener(JTextComponent component)
protected void registerUndoRedoActions(JTextComponent component)
protected JButton createButton(String text, 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(JButton button)
protected JList createList(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 - Copyright © 2016 Imatia Innovation S.L.. All rights reserved.