fr.ifremer.isisfish.ui.sensitivity
Class SensitivityInputHandler

java.lang.Object
  extended by fr.ifremer.isisfish.ui.CommonHandler
      extended by fr.ifremer.isisfish.ui.input.InputHandler
          extended by fr.ifremer.isisfish.ui.sensitivity.SensitivityInputHandler

public class SensitivityInputHandler
extends InputHandler

Handler for sensitivity tab ui (fishery region factors).

Version:
$Revision: 3595 $ Last update : $Date: 2012-01-19 11:24:08 +0100 (Thu, 19 Jan 2012) $ By : $Author: echatellier $
Author:
chatellier

Field Summary
 
Fields inherited from class fr.ifremer.isisfish.ui.input.InputHandler
uiInstanceCache
 
Constructor Summary
SensitivityInputHandler()
           
 
Method Summary
 void addNewFactorGroup(SensitivityTabUI sensitivityTabUI, boolean continuous)
          Add new continuous factor group in factor tree.
 void addTabs(FactorWizardUI factorWizardUI)
          Refresh tab for discrete factor numbers.
 boolean canBeContinue(Object value)
          Return true if value can be defined in continuous factor.
 boolean canBeFactor(Class type)
          Return if type can be defined as a factor.
protected  void deleteSelectedFactors(SensitivityTabUI sensitivityTabUI)
          Delete selection factors.
protected  void factorSelected(SensitivityTabUI sensitivityTabUI)
          Factor selection, display modification wizard.
 void factorsTreeMouseClicked(SensitivityTabUI sensitivityTabUI, MouseEvent e)
          Mouse click on factors tree.
protected  Object getComponentValue(JComponent component)
          Return value in swing component that could be next used into factor for discrete factor values.
 ContinuousPanelContainerUI getContinuousPanel(Object value, org.nuiton.topia.persistence.TopiaEntityContextable bean, String property)
          Get copy of component with original entity value as default value.
 ContinuousPanelContainerUI getContinuousPanelWithValue(Factor factor, ContinuousDomain domain, org.nuiton.topia.TopiaContext topiaContext)
          Get continuous editor for component with given value.
protected  JComponent getEditorWithValue(FactorWizardUI factorWizardUI, Factor factor, Domain domain, Object value)
          Get editor for value (discrete).
 JComponent getNewDiscreteComponent(FactorWizardUI factorWizardUI)
          Get copy of component with original entity value as default value.
protected  Class<?> getPropertyClass(String factorPath, org.nuiton.topia.TopiaContext context)
          Retourne le type de valeur pointé par le path du facteur.
protected  Object getPropertyValue(Object entity, String fieldName)
          Get value for fieldName in entity.
protected  JComponent getRuleDiscreteComponent(FactorWizardUI factorWizardUI, Class type)
          Get new special
 void initExistingFactor(FactorWizardUI factorWizardUI, Factor factor)
          Reaffiche un facteur existant.
 void initNewFactor(FactorWizardUI factorWizardUI, org.nuiton.topia.persistence.TopiaEntityContextable bean, String property)
          Un init new se fait toujours sur une entité.
 void initNewFactorWithValue(FactorWizardUI factorWizardUI, Object value)
          Permet d'intialiser le wizard avec une valeur independante de la provenance (utile pour les facteurs sur les parametres de regles).
 boolean isContinue(Object value)
          Return if value is is continue factor enable.
 void loadFisheryRegionTree(SensitivityTabUI sensitivityTabUI)
           
 void moveFactor(SensitivityTabUI sensitivityTabUI, FactorGroup selectedFactorGroup, List<Factor> movedFactors)
          Move factors to another factorgroup.
 void nodeSelectionChanged(SensitivityTabUI sensitivityTabUI, TreeSelectionEvent event)
          Changement de selection dans l'arbre de la pecherie.
 void remove(FactorWizardUI factorWizardUI)
          Remove current factor.
 void save(FactorWizardUI factorWizardUI)
          Save current factor.
protected  void saveContinue(String name, String comment, String path, ContinuousPanelContainerUI panel, SimulAction action, boolean exist)
          Save a continous factor.
protected  void saveDiscret(String name, String comment, String path, List<JComponent> components, SimulAction action, boolean exist)
          Save a discret factor.
 
Methods inherited from class fr.ifremer.isisfish.ui.input.InputHandler
accept, commitRegionInCVS, copyRegion, createNewRegion, deleteTreeNode, displayFactorWizard, exportRegion, exportRegionSensitivityFactors, findSpecies, getUIInstanceForBeanClass, importRegion, importRegionAndRename, importRegionFromSimulation, importV2Region, insertTreeNode, loadRegion, nodeSelectionChanged, refreshRegionList, regionChange, reloadFisheryTree, removeRegion, setTreeSelection, setTreeSelection, updateTreeNode
 
Methods inherited from class fr.ifremer.isisfish.ui.CommonHandler
setStatusMessage, setStatusMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SensitivityInputHandler

public SensitivityInputHandler()
Method Detail

loadFisheryRegionTree

public void loadFisheryRegionTree(SensitivityTabUI sensitivityTabUI)
Parameters:
sensitivityTabUI -

nodeSelectionChanged

public void nodeSelectionChanged(SensitivityTabUI sensitivityTabUI,
                                 TreeSelectionEvent event)
Changement de selection dans l'arbre de la pecherie.

Parameters:
sensitivityTabUI -
event -

addNewFactorGroup

public void addNewFactorGroup(SensitivityTabUI sensitivityTabUI,
                              boolean continuous)
Add new continuous factor group in factor tree.

Parameters:
sensitivityTabUI -
continuous - continuous

moveFactor

public void moveFactor(SensitivityTabUI sensitivityTabUI,
                       FactorGroup selectedFactorGroup,
                       List<Factor> movedFactors)
Move factors to another factorgroup.

Parameters:
sensitivityTabUI -
selectedFactorGroup -
movedFactors -

factorsTreeMouseClicked

public void factorsTreeMouseClicked(SensitivityTabUI sensitivityTabUI,
                                    MouseEvent e)
Mouse click on factors tree.

Parameters:
sensitivityTabUI - ui
e - mouse event

factorSelected

protected void factorSelected(SensitivityTabUI sensitivityTabUI)
Factor selection, display modification wizard.

Parameters:
sensitivityTabUI -

deleteSelectedFactors

protected void deleteSelectedFactors(SensitivityTabUI sensitivityTabUI)
Delete selection factors.


initNewFactor

public void initNewFactor(FactorWizardUI factorWizardUI,
                          org.nuiton.topia.persistence.TopiaEntityContextable bean,
                          String property)
Un init new se fait toujours sur une entité. On recupere des info sur le type correspondant à la proprieté a mettre en facteur pour savoir le composant d'edition et s'il peut etre continue ou pas.

Parameters:
factorWizardUI - factorWizardUI
bean - bean in current ui
property - bean property to edit

initNewFactorWithValue

public void initNewFactorWithValue(FactorWizardUI factorWizardUI,
                                   Object value)
Permet d'intialiser le wizard avec une valeur independante de la provenance (utile pour les facteurs sur les parametres de regles). TODO chatellier : ne doit pas fonctionner pour des equations.

Parameters:
factorWizardUI - factorWizardUI
value - value

initExistingFactor

public void initExistingFactor(FactorWizardUI factorWizardUI,
                               Factor factor)
Reaffiche un facteur existant.

Parameters:
factorWizardUI -
factor - factor

addTabs

public void addTabs(FactorWizardUI factorWizardUI)
Refresh tab for discrete factor numbers.

Parameters:
factorWizardUI - factorWizardUI

getPropertyClass

protected Class<?> getPropertyClass(String factorPath,
                                    org.nuiton.topia.TopiaContext context)
Retourne le type de valeur pointé par le path du facteur. Il vaut mieux recuperer le type de la propriété a mettre en facteur que la valeur elle meme; elle peut être null et on ne peut pas en deduire sont type.

Parameters:
factorPath - factor path
context - context
Returns:
class

getPropertyValue

protected Object getPropertyValue(Object entity,
                                  String fieldName)
Get value for fieldName in entity.

Parameters:
entity -
fieldName -
Returns:
method return value

canBeFactor

public boolean canBeFactor(Class type)
Return if type can be defined as a factor.

Parameters:
type - type
Returns:
true if type can be defined as a factor

canBeContinue

public boolean canBeContinue(Object value)
Return true if value can be defined in continuous factor. Il serait plus interessant de le faire sur les types et non sur les valeur mais pour RangeOfValues par exemple, seule la valeur a un type Float... donc pas evident.

Parameters:
value - value
Returns:
continuous enabled

isContinue

public boolean isContinue(Object value)
Return if value is is continue factor enable.

Parameters:
value - value to test
Returns:
true if value is is continue factor enable

getContinuousPanel

public ContinuousPanelContainerUI getContinuousPanel(Object value,
                                                     org.nuiton.topia.persistence.TopiaEntityContextable bean,
                                                     String property)
Get copy of component with original entity value as default value.

Parameters:
value - value
bean - bean
property - property
Returns:
component copy

getContinuousPanelWithValue

public ContinuousPanelContainerUI getContinuousPanelWithValue(Factor factor,
                                                              ContinuousDomain domain,
                                                              org.nuiton.topia.TopiaContext topiaContext)
Get continuous editor for component with given value.

Parameters:
domain - domain
factor - factor
topiaContext - context used to get database value in case of equation factors
Returns:
component copy

getEditorWithValue

protected JComponent getEditorWithValue(FactorWizardUI factorWizardUI,
                                        Factor factor,
                                        Domain domain,
                                        Object value)
Get editor for value (discrete).

Parameters:
factorWizardUI - context for context value (RegionStorage)
value - type to get editor
factor -
domain -
Returns:
component

getNewDiscreteComponent

public JComponent getNewDiscreteComponent(FactorWizardUI factorWizardUI)
Get copy of component with original entity value as default value. Used to add new tab to a new or existing factor. Le composant retourné est inclut dans un jscrollpane (sauf pour les matrices qui contient deja un jscrollpane)

Parameters:
factorWizardUI - factorWizardUI
Returns:
component copy

getRuleDiscreteComponent

protected JComponent getRuleDiscreteComponent(FactorWizardUI factorWizardUI,
                                              Class type)
Get new special

Parameters:
clazz -
Returns:

save

public void save(FactorWizardUI factorWizardUI)
Save current factor.

Parameters:
factorWizardUI - factorWizardUI

saveContinue

protected void saveContinue(String name,
                            String comment,
                            String path,
                            ContinuousPanelContainerUI panel,
                            SimulAction action,
                            boolean exist)
Save a continous factor.

Parameters:
name - factor name
comment - comment
path - factor path
panel - panel
action - action
exist - exist

saveDiscret

protected void saveDiscret(String name,
                           String comment,
                           String path,
                           List<JComponent> components,
                           SimulAction action,
                           boolean exist)
Save a discret factor.

Parameters:
name -
comment -
path -
components -
action -
exist -

getComponentValue

protected Object getComponentValue(JComponent component)
Return value in swing component that could be next used into factor for discrete factor values.

Parameters:
component - component
Returns:
factor value

remove

public void remove(FactorWizardUI factorWizardUI)
Remove current factor.

Parameters:
factorWizardUI - factorWizardUI


Copyright © 1999-2012 CodeLutin. All Rights Reserved.