Class DistributionsEditor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class DistributionsEditor extends JMTDialog

Title: Distributions' Editor

Description: A modal dialog used to choose a specific distribution for a class or station service and to enter its parameters. Users will enter owner Frame or Dialog and initial Distribution (can be null) and will collect chosen distribution with getResult() method.

Author:
Bertoli Marco Date: 29-giu-2005 Time: 11.31.07
See Also:
  • Field Details

    • initial

      protected Distribution initial
    • current

      protected Distribution current
    • target

      protected Distribution target
    • recursive

      protected boolean recursive
    • discrete

      protected boolean discrete
    • distributions

      protected static Map<String, Class<? extends Distribution>> distributions
      This variable will be initialized only once. It will contains every distribution that can be inserted
    • nestedDistributions

      protected static Map<String, Class<? extends Distribution>> nestedDistributions
    • discreteDistributions

      protected static Map<String, Class<? extends Distribution>> discreteDistributions
    • BORDERSIZE

      protected static final int BORDERSIZE
      See Also:
    • chooser

      protected JComboBox chooser
    • iconpanel

      protected ImagePanel iconpanel
    • param_panel

      protected JPanel param_panel
    • mean_c_panel

      protected JPanel mean_c_panel
    • scrollPanel

      protected JPanel scrollPanel
    • PROBABILITY

      protected static final String PROBABILITY
      See Also:
    • PROBABILITY_INTERVAL_A

      protected static final String PROBABILITY_INTERVAL_A
      See Also:
    • PROBABILITY_INTERVAL_B

      protected static final String PROBABILITY_INTERVAL_B
      See Also:
    • VALUE_DISTRIBUTION

      protected static final String VALUE_DISTRIBUTION
      See Also:
    • INTERVAL_LENGTH_DISTRIBUTION

      protected static final String INTERVAL_LENGTH_DISTRIBUTION
      See Also:
    • INTERVAL_A_LABEL

      protected static final String INTERVAL_A_LABEL
      See Also:
    • INTERVAL_B_LABEL

      protected static final String INTERVAL_B_LABEL
      See Also:
    • ROUND_ROBIN

      protected static final String ROUND_ROBIN
      See Also:
    • TRACEFILE

      protected static final String TRACEFILE
      See Also:
    • BASE_DISTRIBUTION

      protected static final String BASE_DISTRIBUTION
      See Also:
    • BATCH_SIZE_DISTRIBUTION

      protected static final String BATCH_SIZE_DISTRIBUTION
      See Also:
    • intervalPanels

      protected JPanel[] intervalPanels
    • phaseNumSpinner

      protected JSpinner phaseNumSpinner
    • parameterTables

      protected common.editors.DistributionsEditor.ParameterTable[] parameterTables
    • distributionMapJMCH

      protected static Map<String, Class<? extends Distribution>> distributionMapJMCH
    • okayAction

      protected AbstractAction okayAction
    • cancelAction

      protected AbstractAction cancelAction
    • parameterListener

      protected KeyFocusAdapter parameterListener
      Listener used to set parameters (associated to param_panel's JTextFields). Parameters are set when JTextField loses focus or ENTER key is pressed.
    • cmListener

      protected KeyFocusAdapter cmListener
      Listener that listens on Mean and C variations and updates parameters
    • change_listener

      protected ItemListener change_listener
      Listener for chooser ComboBox to instantiate a new distributions data object when current distribution type is changed.
  • Constructor Details

    • DistributionsEditor

      public DistributionsEditor(Dialog owner, Distribution initial, boolean recursive)
      Builds a new Distribution Editor Dialog. This dialog is designed to be modal.
      Parameters:
      owner - owner Dialog for this dialog.
      initial - Reference to initial distribution to be shown
    • DistributionsEditor

      public DistributionsEditor(Dialog owner, Distribution initial, boolean recursive, boolean discrete)
    • DistributionsEditor

      public DistributionsEditor(Frame owner, Distribution initial, boolean recursive)
      Builds a new Distribution Editor Dialog. This dialog is designed to be modal.
      Parameters:
      owner - owner Frame for this dialog.
      initial - Reference to initial distribution to be shown
    • DistributionsEditor

      public DistributionsEditor(Frame owner, Distribution initial, boolean recursive, boolean discrete)
    • DistributionsEditor

      public DistributionsEditor(Frame owner, Distribution initial, boolean recursive, boolean discrete, boolean disableBatch)
    • DistributionsEditor

      public DistributionsEditor(Dialog owner, Distribution initial, boolean recursive, boolean discrete, boolean disableBatch)
  • Method Details

    • setJMCH

      public void setJMCH()
    • unsetJMCH

      public void unsetJMCH()
    • getInstance

      public static DistributionsEditor getInstance(Container parent, Distribution initial)
      Returns a new instance of DistributionsEditor, given parent container (used to find top level Dialog or Frame to create this dialog as modal). The container is instantiated as not recursive and not discrete
      Parameters:
      parent - any type of container contained in a Frame or Dialog
      initial - initial distribution to be set
      Returns:
      new instance of DistributionsEditor
    • getInstance

      public static DistributionsEditor getInstance(Container parent, Distribution initial, boolean recursive)
      Returns a new instance of DistributionsEditor, given parent container (used to find top level Dialog or Frame to create this dialog as modal) The container is instantiated as not discrete
      Parameters:
      parent - any type of container contained in a Frame or Dialog
      initial - initial distribution to be set
      recursive - indicated if the DistributionEditor is used to select a nested distribution
      Returns:
      new instance of DistributionsEditor
    • getInstance

      public static DistributionsEditor getInstance(Container parent, Distribution initial, boolean recursive, boolean discrete)
      Returns a new instance of DistributionsEditor, given parent container (used to find top level Dialog or Frame to create this dialog as modal)
      Parameters:
      parent - any type of container contained in a Frame or Dialog
      initial - initial distribution to be set
      recursive - indicated if the DistributionEditor is used to select a nested distribution
      discrete - indicated if the DistributionEditor is used to select a discrete distribution
      Returns:
      new instance of DistributionsEditor
    • findDistributions

      protected static Map<String, Class<? extends Distribution>> findDistributions()
      Uses reflection to return a Map of distributions. Search's key is distribution name and value is the Class of found distribution
      Returns:
      found distributions
    • findNestedDistributions

      protected static Map<String, Class<? extends Distribution>> findNestedDistributions()
      Uses reflection to return a Map of distributions which are allowed to be nested. Search's key is distribution name and value is the Class of found distribution
      Returns:
      found nested distributions
    • findDiscreteDistributions

      protected static Map<String, Class<? extends Distribution>> findDiscreteDistributions()
      Uses reflection to return a Map of discrete distributions. Search's key is distribution name and value is the Class of found distribution
      Returns:
      found discrete distributions
    • getResult

      public Distribution getResult()
      Returns Distribution selected in this dialog or initial one if cancel button was pressed
      Returns:
      Selected distribution if okay button was pressed, initial otherwise. If this dialog has not been shown yet, returns initial value too.
    • initData

      protected void initData(Distribution initial)
      Initialize this dialog data structures
      Parameters:
      initial - Reference to initial distribution to be shown
    • initComponents

      protected void initComponents()
      Initialize this dialod's components and default dialog property
    • refreshView

      protected void refreshView()
    • refreshValues

      protected void refreshValues()
    • getInstanceWithoutBatch

      public static DistributionsEditor getInstanceWithoutBatch(Container parent, Distribution initial)
      Disable 'Batch distribution'