Ontimize 5.2072EN

com.ontimize.gui.table
Class CalculatedColumnDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended bycom.ontimize.gui.container.EJDialog
                          extended bycom.ontimize.gui.table.CalculatedColumnDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class CalculatedColumnDialog
extends EJDialog
implements Internationalization

See Also:
Serialized Form

Nested Class Summary
static class CalculatedColumnDialog.ColumnPosition
           
protected static class CalculatedColumnDialog.CustomListModel
           
static class CalculatedColumnDialog.Expression
           
protected static class CalculatedColumnDialog.InsertSymbolListener
           
protected  class CalculatedColumnDialog.TranslationListCellRenderer
           
 
Nested classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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  Button acceptButton
           
protected  Button addButton
           
protected static java.lang.String AVAILABLE_COLUMMNS_TIP
           
protected  Column availableColumnPanel
           
protected  javax.swing.JList availableColumnsList
           
static java.lang.String CalculatedColsDialogTitle
           
protected  javax.swing.JList calculatedColumnList
           
protected  Column calculatedColumnsPanel
           
protected  Button cancelButton
           
protected  Button closeParenthesisButton
           
protected  java.util.List componentsGroup
          List with all the components that must be enabled or disabled when a calculated columns is selected or not
protected  Button createNewCalculatedColumnButton
           
protected  Button deleteCalculatedColumnButton
           
protected  java.util.List deletedExpressions
           
protected  Button divideButton
           
protected  Column expressionEditorPanel
           
protected  ComponentTextPane expressionPane
           
static java.lang.String HTML_HELP_TEXT
           
protected  HtmlHelpField htmlHelpField
           
protected  java.util.List internationalizationComponentList
           
protected static java.lang.String[] invalidChars
           
static java.lang.String labelsBgImage
           
static javax.swing.border.Border listBorder
           
protected  Button multiplyButton
           
protected  java.util.List newExpressions
           
protected  Button openParenthesisButton
           
protected  Button substractButton
           
protected  Table table
           
protected  javax.swing.undo.UndoManager undoManager
           
protected  boolean updateSelectedCalculatedColumnExpression
           
 
Fields inherited from class com.ontimize.gui.container.EJDialog
actions, askQuestionEverOnClose, askQuestionOnEsc, autoPackOnOpen, closeQuestion, defaultValueAskQuestionOnClose, defaultValueAskQuestionOnEsc, focusSet, glassPanel, keys, keyStrokes, opaque, previousGlassPane, sizePositionPreference
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CalculatedColumnDialog(java.awt.Dialog d, Table table)
           
CalculatedColumnDialog(java.awt.Frame frame, Table table)
           
 
Method Summary
protected  void acceptDialog()
           
protected  void addColumnToExpression(int index)
           
protected  Row buildLabelTitle(java.lang.String labelText)
           
protected  void cancelDialog()
           
protected  void changeCalculatedColumnSelection()
          Method used to update the text in the JTextPane using the selected calculated column
protected  void checkExpression(java.lang.String col, java.lang.String expr)
           
protected  void checkLoops(java.util.List sourceExpressions)
           
protected  void configureAvailableColsListRenderer(javax.swing.JList list)
           
protected  void configureCalculatedColsListRenderer(javax.swing.JList list)
           
protected  Button createButton(java.lang.String key, java.lang.String text, java.lang.String iconPath, boolean addToGroup, java.lang.String align)
           
protected  Column createColumn(boolean expand, java.lang.String title, int preferredWidth, boolean titleAsLabel, java.lang.String margin, boolean expandlast, javax.swing.border.Border border)
           
protected  ComponentTextPane createExpressionEditor()
           
protected  FormComponent createHelpPanel()
          Creates a CollapsiblePanel and add the help field to it
protected  void createHtmlHelpField()
           
protected  javax.swing.JList createList(java.lang.String attr, java.lang.String tip)
           
protected  void createNewCalculatedColumn(java.lang.String defaultName)
           
static MathExpressionParser createParser(java.lang.String col, java.lang.String expr, java.util.List columns)
           
protected  Row createRow(boolean expand, java.lang.String title, int preferredHeight, java.lang.String margin)
           
protected  void deleteSeletedCalculatedColumn()
           
protected  void enableGroup(boolean enabled)
           
protected  java.util.List getCalculatedColumnsDependence(java.lang.String expression, java.lang.String columnName, java.util.List columns)
           
protected  java.util.Hashtable getContainerParameters(boolean expand, java.lang.String title, int preferredWidth, int preferredHeight, java.lang.String margin, boolean titleAsLabel)
           
protected  int[] getExpressionIndexColName(java.lang.String colName, java.lang.String expression)
           
protected  java.util.List getModifiedElements(boolean onlyNames, boolean translate)
          Get a list with the modified columns
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
protected  void init(Table table)
           
protected  void registerUndoableListener(javax.swing.text.JTextComponent component)
           
protected  void registerUndoRedoActions(javax.swing.text.JTextComponent component)
           
 void setComponentLocale(java.util.Locale l)
           
protected  void setExpressionText(java.lang.String expression)
           
 void setResourceBundle(java.util.ResourceBundle res)
          Sets the language resource bundle.
static void showCalculatorWindow(java.awt.Component c, Table t)
           
protected  void updateAvailableColsList()
           
protected  void updateCalculatedColsList()
           
protected  void updateSelectedCalculatedColumnExpression()
           
 
Methods inherited from class com.ontimize.gui.container.EJDialog
askCloseQuestion, dispose, getSizePositionPreference, initWindowListener, isAskOnClose, isAskOnEsc, pack, processKeyEvent, processWindowEvent, registerKeyBindings, setAction, setActionForKey, setAskOnClose, setAskOnEsc, setAutoPackOnOpen, setInitialFocus, setSizePositionPreference, setVisible, transparent
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HTML_HELP_TEXT

public static java.lang.String HTML_HELP_TEXT

AVAILABLE_COLUMMNS_TIP

protected static final java.lang.String AVAILABLE_COLUMMNS_TIP
See Also:
Constant Field Values

CalculatedColsDialogTitle

public static final java.lang.String CalculatedColsDialogTitle
See Also:
Constant Field Values

labelsBgImage

public static java.lang.String labelsBgImage

listBorder

public static javax.swing.border.Border listBorder

table

protected Table table

calculatedColumnsPanel

protected Column calculatedColumnsPanel

createNewCalculatedColumnButton

protected Button createNewCalculatedColumnButton

deleteCalculatedColumnButton

protected Button deleteCalculatedColumnButton

calculatedColumnList

protected javax.swing.JList calculatedColumnList

expressionEditorPanel

protected Column expressionEditorPanel

addButton

protected Button addButton

substractButton

protected Button substractButton

multiplyButton

protected Button multiplyButton

divideButton

protected Button divideButton

openParenthesisButton

protected Button openParenthesisButton

closeParenthesisButton

protected Button closeParenthesisButton

availableColumnPanel

protected Column availableColumnPanel

availableColumnsList

protected javax.swing.JList availableColumnsList

expressionPane

protected ComponentTextPane expressionPane

acceptButton

protected Button acceptButton

cancelButton

protected Button cancelButton

internationalizationComponentList

protected java.util.List internationalizationComponentList

deletedExpressions

protected java.util.List deletedExpressions

newExpressions

protected java.util.List newExpressions

updateSelectedCalculatedColumnExpression

protected boolean updateSelectedCalculatedColumnExpression

undoManager

protected javax.swing.undo.UndoManager undoManager

htmlHelpField

protected HtmlHelpField htmlHelpField

componentsGroup

protected java.util.List componentsGroup
List with all the components that must be enabled or disabled when a calculated columns is selected or not


invalidChars

protected static java.lang.String[] invalidChars
Constructor Detail

CalculatedColumnDialog

public CalculatedColumnDialog(java.awt.Frame frame,
                              Table table)

CalculatedColumnDialog

public CalculatedColumnDialog(java.awt.Dialog d,
                              Table table)
Method Detail

enableGroup

protected void enableGroup(boolean enabled)

init

protected void init(Table table)

cancelDialog

protected void cancelDialog()

getModifiedElements

protected java.util.List getModifiedElements(boolean onlyNames,
                                             boolean translate)
Get a list with the modified columns

Parameters:
onlyNames - If this is then the list contains only the names (String) of the modified columns. If it is false then the list contains the Expression object
translate - If this is true and onlyNames is true then the names are translated. If
Returns:

acceptDialog

protected void acceptDialog()

deleteSeletedCalculatedColumn

protected void deleteSeletedCalculatedColumn()

createExpressionEditor

protected ComponentTextPane createExpressionEditor()

createNewCalculatedColumn

protected void createNewCalculatedColumn(java.lang.String defaultName)

getExpressionIndexColName

protected int[] getExpressionIndexColName(java.lang.String colName,
                                          java.lang.String expression)

createList

protected javax.swing.JList createList(java.lang.String attr,
                                       java.lang.String tip)

addColumnToExpression

protected void addColumnToExpression(int index)

changeCalculatedColumnSelection

protected void changeCalculatedColumnSelection()
Method used to update the text in the JTextPane using the selected calculated column


setExpressionText

protected void setExpressionText(java.lang.String expression)

updateSelectedCalculatedColumnExpression

protected void updateSelectedCalculatedColumnExpression()

configureCalculatedColsListRenderer

protected void configureCalculatedColsListRenderer(javax.swing.JList list)

configureAvailableColsListRenderer

protected void configureAvailableColsListRenderer(javax.swing.JList list)

createColumn

protected Column createColumn(boolean expand,
                              java.lang.String title,
                              int preferredWidth,
                              boolean titleAsLabel,
                              java.lang.String margin,
                              boolean expandlast,
                              javax.swing.border.Border border)

buildLabelTitle

protected Row buildLabelTitle(java.lang.String labelText)

createRow

protected Row createRow(boolean expand,
                        java.lang.String title,
                        int preferredHeight,
                        java.lang.String margin)

getContainerParameters

protected java.util.Hashtable getContainerParameters(boolean expand,
                                                     java.lang.String title,
                                                     int preferredWidth,
                                                     int preferredHeight,
                                                     java.lang.String margin,
                                                     boolean titleAsLabel)

createButton

protected Button createButton(java.lang.String key,
                              java.lang.String text,
                              java.lang.String iconPath,
                              boolean addToGroup,
                              java.lang.String align)

createHtmlHelpField

protected void createHtmlHelpField()

createHelpPanel

protected FormComponent createHelpPanel()
Creates a CollapsiblePanel and add the help field to it


setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Parameters:
res - the new language bundle.

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Description copied from interface: Internationalization
Returns all the texts in the element suitable for being translated.

Specified by:
getTextsToTranslate in interface Internationalization
Returns:
all the texts in the element suitable for being translated.

updateCalculatedColsList

protected void updateCalculatedColsList()

updateAvailableColsList

protected void updateAvailableColsList()

showCalculatorWindow

public static void showCalculatorWindow(java.awt.Component c,
                                        Table t)

registerUndoableListener

protected void registerUndoableListener(javax.swing.text.JTextComponent component)

registerUndoRedoActions

protected void registerUndoRedoActions(javax.swing.text.JTextComponent component)

checkExpression

protected void checkExpression(java.lang.String col,
                               java.lang.String expr)
                        throws java.lang.Exception
Throws:
java.lang.Exception

checkLoops

protected void checkLoops(java.util.List sourceExpressions)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getCalculatedColumnsDependence

protected java.util.List getCalculatedColumnsDependence(java.lang.String expression,
                                                        java.lang.String columnName,
                                                        java.util.List columns)

createParser

public static MathExpressionParser createParser(java.lang.String col,
                                                java.lang.String expr,
                                                java.util.List columns)

Ontimize