fr.ifremer.isisfish.ui.sensitivity
Class EditorHelper

java.lang.Object
  extended by fr.ifremer.isisfish.ui.sensitivity.EditorHelper

public class EditorHelper
extends java.lang.Object

Helper for sensitivity Swing component manipulation.

Version:
$Revision: 2937 $ Last update: $Date: 2010-01-22 16:39:11 +0100 (ven., 22 janv. 2010) $ by : $Author: chatellier $
Author:
letellier

Constructor Summary
EditorHelper()
           
 
Method Summary
static boolean canBeContinue(javax.swing.JComponent component, java.lang.Object value)
          Return true if component or value can be defined in continuous factor.
static boolean canBeContinue(javax.swing.JComponent component, org.nuiton.topia.persistence.TopiaEntity entity)
          Return true if component or entity can be defined in continuous factor.
static ContinuousPanelContainerUI getContinuousPanel(javax.swing.JComponent component, org.nuiton.topia.persistence.TopiaEntity entity)
          Get copy of component with original entity value as default value.
static ContinuousPanelContainerUI getContinuousPanelWithValue(javax.swing.JComponent component, ContinuousDomain<?,?> domain, Factor<?,?> factor)
          Get continuous editor for component with given value.
static ContinuousPanelContainerUI getContinuousRangeOfValuePanel(javax.swing.JComponent cOrigine, org.nuiton.topia.persistence.TopiaEntity bean)
           
static java.util.List<java.lang.String> getDiscretRangeOfValueValues(javax.swing.JComponent cOrigine, org.nuiton.topia.persistence.TopiaEntity bean)
           
static javax.swing.JComponent getEditor(javax.swing.JComponent component, org.nuiton.topia.persistence.TopiaEntity entity)
          Get copy of component with original entity value as default value.
static javax.swing.JComponent getEditorForFactor(Factor<?,?> factor, org.nuiton.topia.TopiaContext context)
          Return the component to edit factor depending on factor path.
static javax.swing.JComponent getEditorForType(java.lang.Class<?> typeClazz)
          Get editor for type.
static javax.swing.JComponent getEditorForValue(java.lang.Object bean, java.lang.String beanProperty)
          Get editor for editing value.
static javax.swing.JComponent getEditorWithValue(javax.swing.JComponent component)
          Get new instance of component filled with original swing component value.
static javax.swing.JComponent getEditorWithValue(javax.swing.JComponent component, java.lang.Object value)
          Get new instance of component filled with specified value depending of component type.
static java.lang.String getMethod(javax.swing.JComponent component)
          Get "method" property value for wing component.
protected static java.lang.Object getMethodValue(java.lang.Object entity, java.lang.String fieldName)
          Get value for fieldName in entity.
protected static javax.swing.JTextField getNewBoundEditor(javax.swing.JComponent component, org.nuiton.topia.persistence.TopiaEntity entity)
          Get new text component with current entity default value.
static java.lang.Object getValue(javax.swing.JComponent component)
          Return value in swing component that could be next used into factor.
static boolean isContinue(javax.swing.JComponent component)
          Return if component is is continue factor enable.
static boolean isRangeOfValue(javax.swing.JComponent component)
          Return if component is instanceof RangeOfValuesUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorHelper

public EditorHelper()
Method Detail

getMethod

public static java.lang.String getMethod(javax.swing.JComponent component)
Get "method" property value for wing component.

Parameters:
component - component
Returns:
property value

getEditor

public static javax.swing.JComponent getEditor(javax.swing.JComponent component,
                                               org.nuiton.topia.persistence.TopiaEntity entity)
Get copy of component with original entity value as default value.

Parameters:
component - component
entity - entity
Returns:
component copy

getContinuousPanel

public static ContinuousPanelContainerUI getContinuousPanel(javax.swing.JComponent component,
                                                            org.nuiton.topia.persistence.TopiaEntity entity)
Get copy of component with original entity value as default value.

Parameters:
component - component
entity - entity
Returns:
component copy

getNewBoundEditor

protected static javax.swing.JTextField getNewBoundEditor(javax.swing.JComponent component,
                                                          org.nuiton.topia.persistence.TopiaEntity entity)
Get new text component with current entity default value.

Parameters:
component - component
entity - entity
Returns:
bound editor

getContinuousPanelWithValue

public static ContinuousPanelContainerUI getContinuousPanelWithValue(javax.swing.JComponent component,
                                                                     ContinuousDomain<?,?> domain,
                                                                     Factor<?,?> factor)
Get continuous editor for component with given value.

Parameters:
component - component
domain - domain
factor - factor
Returns:
component copy

getEditorWithValue

public static javax.swing.JComponent getEditorWithValue(javax.swing.JComponent component)
Get new instance of component filled with original swing component value.

Parameters:
component - component
Returns:
new component instance

getEditorWithValue

public static javax.swing.JComponent getEditorWithValue(javax.swing.JComponent component,
                                                        java.lang.Object value)
Get new instance of component filled with specified value depending of component type.

Parameters:
component - component
value - value
Returns:
new component instance

getValue

public static java.lang.Object getValue(javax.swing.JComponent component)
Return value in swing component that could be next used into factor.

Parameters:
component - component
Returns:
factor value

isRangeOfValue

public static boolean isRangeOfValue(javax.swing.JComponent component)
Return if component is instanceof RangeOfValuesUI.

Parameters:
component - component
Returns:
true if component is intance of RangeOfValuesUI

isContinue

public static boolean isContinue(javax.swing.JComponent component)
Return if component is is continue factor enable.

Parameters:
component - component
Returns:
true if component is is continue factor enable

canBeContinue

public static boolean canBeContinue(javax.swing.JComponent component,
                                    org.nuiton.topia.persistence.TopiaEntity entity)
Return true if component or entity can be defined in continuous factor.

Parameters:
component - component
entity - entity
Returns:
continuous enabled

canBeContinue

public static boolean canBeContinue(javax.swing.JComponent component,
                                    java.lang.Object value)
Return true if component or value can be defined in continuous factor.

Parameters:
component - component
value - value
Returns:
continuous enabled

getMethodValue

protected static java.lang.Object getMethodValue(java.lang.Object entity,
                                                 java.lang.String fieldName)
Get value for fieldName in entity.

Parameters:
entity -
fieldName -
Returns:
method return value

getContinuousRangeOfValuePanel

public static ContinuousPanelContainerUI getContinuousRangeOfValuePanel(javax.swing.JComponent cOrigine,
                                                                        org.nuiton.topia.persistence.TopiaEntity bean)

getDiscretRangeOfValueValues

public static java.util.List<java.lang.String> getDiscretRangeOfValueValues(javax.swing.JComponent cOrigine,
                                                                            org.nuiton.topia.persistence.TopiaEntity bean)

getEditorForFactor

public static javax.swing.JComponent getEditorForFactor(Factor<?,?> factor,
                                                        org.nuiton.topia.TopiaContext context)
Return the component to edit factor depending on factor path. (inspect the return type of entity denoted by path) Used to edit reloader factor from old simulation.

Parameters:
factor - factor
context - context
Returns:
component

getEditorForType

public static javax.swing.JComponent getEditorForType(java.lang.Class<?> typeClazz)
Get editor for type.

Parameters:
typeClazz - type to get editor
Returns:
component

getEditorForValue

public static javax.swing.JComponent getEditorForValue(java.lang.Object bean,
                                                       java.lang.String beanProperty)
Get editor for editing value.

Parameters:
bean - bean
beanProperty - bean property
Returns:
component


Copyright © 1999-2010 CodeLutin. All Rights Reserved.