Class DistributionsEditor
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
jmt.framework.gui.components.JMTDialog
common.editors.DistributionsEditor
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classClass encapsulation methods to render Batched parametersprotected classClass encapsulation methods to render Burst parametersprotected classThis class is currently only used for Burst distributions since the other distributions do not contain any nested distributions as parameters Action performed when user clicks on Edit-Button at a Distribution Parameter Opens a new Distribution Editor to change and edit distribution parametersprotected classListener used for Burst-Distribution only.protected classListener used for Burst-Distribution only.Nested classes/interfaces inherited from class JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final intprotected AbstractActionprotected ItemListenerListener for chooser ComboBox to instantiate a new distributions data object when current distribution type is changed.protected JComboBoxprotected KeyFocusAdapterListener that listens on Mean and C variations and updates parametersprotected Distributionprotected booleanprotected static Map<String, Class<? extends Distribution>> protected static Map<String, Class<? extends Distribution>> protected static Map<String, Class<? extends Distribution>> This variable will be initialized only once.protected ImagePanelprotected Distributionprotected static final Stringprotected static final Stringprotected static final Stringprotected JPanel[]protected JPanelprotected static Map<String, Class<? extends Distribution>> protected AbstractActionprotected JPanelprotected KeyFocusAdapterListener used to set parameters (associated to param_panel's JTextFields).protected common.editors.DistributionsEditor.ParameterTable[]protected JSpinnerprotected static final Stringprotected static final Stringprotected static final Stringprotected booleanprotected static final Stringprotected JPanelprotected Distributionprotected static final Stringprotected static final StringFields inherited from class JMTDialog
AUTO_MANAGE_ON_CLOSEFields inherited from class JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class Dialog
DEFAULT_MODALITY_TYPEFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionDistributionsEditor(Dialog owner, Distribution initial, boolean recursive) Builds a new Distribution Editor Dialog.DistributionsEditor(Dialog owner, Distribution initial, boolean recursive, boolean discrete) DistributionsEditor(Dialog owner, Distribution initial, boolean recursive, boolean discrete, boolean disableBatch) DistributionsEditor(Frame owner, Distribution initial, boolean recursive) Builds a new Distribution Editor Dialog.DistributionsEditor(Frame owner, Distribution initial, boolean recursive, boolean discrete) DistributionsEditor(Frame owner, Distribution initial, boolean recursive, boolean discrete, boolean disableBatch) -
Method Summary
Modifier and TypeMethodDescriptionprotected static Map<String, Class<? extends Distribution>> Uses reflection to return a Map of discrete distributions.protected static Map<String, Class<? extends Distribution>> Uses reflection to return a Map of distributions.protected static Map<String, Class<? extends Distribution>> Uses reflection to return a Map of distributions which are allowed to be nested.static DistributionsEditorgetInstance(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).static DistributionsEditorgetInstance(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 discretestatic DistributionsEditorgetInstance(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)static DistributionsEditorgetInstanceWithoutBatch(Container parent, Distribution initial) Disable 'Batch distribution'Returns Distribution selected in this dialog or initial one if cancel button was pressedprotected voidInitialize this dialod's components and default dialog propertyprotected voidinitData(Distribution initial) Initialize this dialog data structuresprotected voidprotected voidvoidsetJMCH()voidMethods inherited from class JMTDialog
canBeClosed, centerWindow, centerWindow, centerWindowWithOffset, close, doClose, moveToLowerRightCorner, setDefaultCloseOperationMethods inherited from class JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackMethods inherited from class Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
initial
-
current
-
target
-
recursive
protected boolean recursive -
discrete
protected boolean discrete -
distributions
This variable will be initialized only once. It will contains every distribution that can be inserted -
nestedDistributions
-
discreteDistributions
-
BORDERSIZE
protected static final int BORDERSIZE- See Also:
-
chooser
-
iconpanel
-
param_panel
-
mean_c_panel
-
scrollPanel
-
PROBABILITY
- See Also:
-
PROBABILITY_INTERVAL_A
- See Also:
-
PROBABILITY_INTERVAL_B
- See Also:
-
VALUE_DISTRIBUTION
- See Also:
-
INTERVAL_LENGTH_DISTRIBUTION
- See Also:
-
INTERVAL_A_LABEL
- See Also:
-
INTERVAL_B_LABEL
- See Also:
-
ROUND_ROBIN
- See Also:
-
TRACEFILE
- See Also:
-
BASE_DISTRIBUTION
- See Also:
-
BATCH_SIZE_DISTRIBUTION
- See Also:
-
intervalPanels
-
phaseNumSpinner
-
parameterTables
protected common.editors.DistributionsEditor.ParameterTable[] parameterTables -
distributionMapJMCH
-
okayAction
-
cancelAction
-
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
Listener that listens on Mean and C variations and updates parameters -
change_listener
Listener for chooser ComboBox to instantiate a new distributions data object when current distribution type is changed.
-
-
Constructor Details
-
DistributionsEditor
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
-
DistributionsEditor
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
-
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
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 Dialoginitial- 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 Dialoginitial- initial distribution to be setrecursive- 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 Dialoginitial- initial distribution to be setrecursive- indicated if the DistributionEditor is used to select a nested distributiondiscrete- indicated if the DistributionEditor is used to select a discrete distribution- Returns:
- new instance of DistributionsEditor
-
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
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
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
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
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
Disable 'Batch distribution'
-