org.keridwen.modelling.group.editor.ui
Class CharacteristicEditorView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.keridwen.modelling.group.editor.ui.CharacteristicEditorView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CharacteristicEditorView
extends JPanel

GUI for the Characteristic Editor.

Author:
J.Forest, Artenum SARL.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String CANCEL_EDITION_ACTION
           
static String EDIT_SERIES_ACTION
           
static String EDIT_UNIT_ACTION
           
static String SHOW_PLOT_ACTION
           
static String VALID_EDITION_ACTION
           
 
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
CharacteristicEditorView(ActionListener listener)
          Default constructor.
 
Method Summary
 void addActionListener(ActionListener listener)
          Main action listener
 String getDescription()
          Get the value of the description field.
 int getId()
          Get the value of the Id field.
 JLabel getLabelType()
          Get the value of the type label.
 int getLocalisation()
          Return the localisation value as set by the combobox for the current characteristic, if set or -1 otherwise.
 JPanel getMainPanel()
          Return the main panel of the present editor view.
 String getPropertyName()
          Get the value of the name field.
 Object getValueField()
          Return the value in the field value, if relevant depending on the type of Characteristic.
 void initComponents()
          Initialise the whole editor panel.
 void initSerieValueLine()
          Initialize the sub-panel (i.e line) for the value in the case of a SeriesOfDoubleCharacteristic.
 void initSimpleValueLine()
          Initialize the sub-panel (i.e line) for the value in the case of a simple type Characteristics (e.g DoubleCharacteristic, Float, Integer, etc...).
 void initTupleValueLine()
          Initialize the sub-panel (i.e line) for the value in the case of a tuple type Characteristics (e.g Tuple).
static void main(String[] args)
          For test purpose only
 void setDescription(String description)
          Set the value of the description field.
 void setId(int id)
          Set the Id in the Id field.
 void setLabelType(JLabel labelType)
          Set the value of the Characteristic type label.
 void setLocalisation(int local)
          Set the value of the localisation combobox.
 void setLocalisationModel(DefaultComboBoxModel model)
          Set the localisation model.
 void setPropertyName(String name)
          Set the value of the name field.
 void setType(String type)
          Set the type string of the Characteristic.
 void setUnitModel(DefaultComboBoxModel model)
           
 void setValueField(Object value)
          Set the view.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALID_EDITION_ACTION

public static final String VALID_EDITION_ACTION
See Also:
Constant Field Values

CANCEL_EDITION_ACTION

public static final String CANCEL_EDITION_ACTION
See Also:
Constant Field Values

SHOW_PLOT_ACTION

public static final String SHOW_PLOT_ACTION
See Also:
Constant Field Values

EDIT_SERIES_ACTION

public static final String EDIT_SERIES_ACTION
See Also:
Constant Field Values

EDIT_UNIT_ACTION

public static final String EDIT_UNIT_ACTION
See Also:
Constant Field Values
Constructor Detail

CharacteristicEditorView

public CharacteristicEditorView(ActionListener listener)
Default constructor.

Parameters:
listener - - controller to be linked.
Method Detail

setId

public void setId(int id)
Set the Id in the Id field.

Parameters:
id - - Id to be set.

getId

public int getId()
Get the value of the Id field.

Returns:
value of the Id field.

setPropertyName

public void setPropertyName(String name)
Set the value of the name field.

Parameters:
name - to be set.

getPropertyName

public String getPropertyName()
Get the value of the name field.


setDescription

public void setDescription(String description)
Set the value of the description field.

Parameters:
description - - description of the characteristic.

getDescription

public String getDescription()
Get the value of the description field.

Returns:
description of the characteristic.

setValueField

public void setValueField(Object value)
Set the view. The corresponding Swing component will be automatically adapted according the type of Characteristic. If the Characteristic is a simple type one (e.g DoubleCharacteristic), a simple text field is provided. If the Characteristic is a complex one (e.g SeriesOfDouble), action buttons to allow access to advanced editors (table) and viewer (plot) are provided.
NB: The type field should be set before to call this method.

Parameters:
value - - value to be displayed.

getValueField

public Object getValueField()
Return the value in the field value, if relevant depending on the type of Characteristic.

Returns:

setLocalisationModel

public void setLocalisationModel(DefaultComboBoxModel model)
Set the localisation model.

Parameters:
model -

setType

public void setType(String type)
Set the type string of the Characteristic.

Parameters:
type - - type of the Characteristic.

setLocalisation

public void setLocalisation(int local)
Set the value of the localisation combobox.

Parameters:
local -

getLocalisation

public int getLocalisation()
Return the localisation value as set by the combobox for the current characteristic, if set or -1 otherwise.

Returns:
location as set by the combobox.

setUnitModel

public void setUnitModel(DefaultComboBoxModel model)

initComponents

public void initComponents()
Initialise the whole editor panel.


initSimpleValueLine

public void initSimpleValueLine()
Initialize the sub-panel (i.e line) for the value in the case of a simple type Characteristics (e.g DoubleCharacteristic, Float, Integer, etc...). This provides a text field for the value.


initTupleValueLine

public void initTupleValueLine()
Initialize the sub-panel (i.e line) for the value in the case of a tuple type Characteristics (e.g Tuple). This provides a table to set the values.


initSerieValueLine

public void initSerieValueLine()
Initialize the sub-panel (i.e line) for the value in the case of a SeriesOfDoubleCharacteristic. In place of a simple JTextField, this panel provides a button to access to a y=f(x) type like plot (see SerieGraphicViewer class) and a button to access to a JTable based editor.


getMainPanel

public JPanel getMainPanel()
Return the main panel of the present editor view.

Returns:
main panel.

getLabelType

public JLabel getLabelType()
Get the value of the type label.

Returns:

setLabelType

public void setLabelType(JLabel labelType)
Set the value of the Characteristic type label.

Parameters:
labelType - Characteristic type as string.

addActionListener

public void addActionListener(ActionListener listener)
Main action listener

Parameters:
listener -

main

public static void main(String[] args)
For test purpose only

Parameters:
args -


Copyright © 2012-2013 Artenum. All Rights Reserved.