public class Parameter
extends javax.swing.JPanel
implements javax.swing.event.ChangeListener, java.io.Serializable
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Parameter()
This default constructor creates a new parameter object with min value 0,
max value 1, step size 1/10, value 1/2, name "Probability", and symbol "p".
|
Parameter(double a,
double b,
double h,
double v,
java.lang.String n,
java.lang.String s)
This special constructor creates a new parameter object for adjusting a parameter, with default
size 175.
|
Parameter(double a,
double b,
double h,
double v,
java.lang.String n,
java.lang.String s,
int w)
This general constructor creates a new parameter object for adjusting a parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
applyDecimalPattern(java.lang.String p)
This method applys the decimal format to be used in the label
|
javax.swing.JLabel |
getLabel()
This method returns the label.
|
double |
getMax()
This method gets the maximum value of the parameter.
|
java.awt.Dimension |
getMaximumSize()
The method specifies that the maximum size should be the same as the preferred size.
|
double |
getMin()
This method gets the minimum value of the parameter.
|
java.awt.Dimension |
getMinimumSize()
This method specifies that the minimum size should be the same as the preferred size.
|
java.lang.String |
getName()
This method returns the name
|
java.awt.Dimension |
getPreferredSize()
This method sets the width of the preferred size to the specified value.
|
javax.swing.JSlider |
getSlider()
This method returns the slider.
|
int |
getSteps()
This method gets the number of steps.
|
double |
getStepSize()
This method gets the step size of the parameter.
|
java.lang.String |
getSymbol()
This method returns the symbol
|
double |
getValue()
This method gets the value of the parameter.
|
void |
setMax(double b)
This method sets the maximum value of the parameter.
|
void |
setMin(double a)
This method sets the minimum value of the parameter.
|
void |
setName(java.lang.String n)
This method sets the name.
|
void |
setProperties(double a,
double b,
double w,
double v,
java.lang.String n,
java.lang.String s)
This method sets the range and strings.
|
void |
setRange(double a,
double b,
double w,
double v)
This method sets the range of the parameter
|
void |
setStepSize(double w)
This method sets the step size of the parameter.
|
void |
setStrings(java.lang.String n,
java.lang.String s)
This method sets the name and symbol.
|
void |
setSymbol(java.lang.String s)
This method sets the symbol
|
void |
setValue(double v)
This method sets the value of the parameter.
|
void |
setWidth(int w)
This method sets the width of the component in pixels
|
void |
stateChanged(javax.swing.event.ChangeEvent e)
This method handles the events associated with changing
the scrollbar.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public Parameter(double a, double b, double h, double v, java.lang.String n, java.lang.String s, int w)
a
- the minimum value of the parameterb
- the maximum value of the parameterh
- the step size of the parameterv
- the initial value of the parametern
- the name of the parameters
- the symbol used for the parameterw
- the width dimension of the panel containing the slider and labelpublic Parameter(double a, double b, double h, double v, java.lang.String n, java.lang.String s)
a
- the minimum value of the parameterb
- the maximum value of the parameterh
- the step size of the parameterv
- the initial value of the parametern
- the name of the parameters
- the symbol used for the parameterpublic Parameter()
public void setMin(double a)
a
- the minimum valuepublic void setMax(double b)
b
- the maximum valuepublic void setStepSize(double w)
w
- the step sizepublic void setValue(double v)
v
- the value of the parameterpublic void setRange(double a, double b, double w, double v)
a
- the minimum value of the parameterb
- the maximum value of the parameterw
- the step size of the parameterv
- the value of the parameterpublic void setProperties(double a, double b, double w, double v, java.lang.String n, java.lang.String s)
a
- the minimum value of the parameterb
- the maximum value of the parameterw
- the step size of the parameterv
- the value of the parametern
- the name of the parameters
- the symbol of the parameterpublic void setStrings(java.lang.String n, java.lang.String s)
n
- the name of the parameters
- the symbol of the parameterpublic void setName(java.lang.String n)
setName
in class java.awt.Component
n
- the name of the parameterpublic java.lang.String getName()
getName
in class java.awt.Component
public void setSymbol(java.lang.String s)
s
- the symbol of the parameterpublic java.lang.String getSymbol()
public void setWidth(int w)
w
- the widthpublic double getValue()
public double getMin()
public double getMax()
public double getStepSize()
public int getSteps()
public javax.swing.JSlider getSlider()
public javax.swing.JLabel getLabel()
public void applyDecimalPattern(java.lang.String p)
p
- the decimal pattern.public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
e
- the change eventpublic java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class javax.swing.JComponent