|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.uah.math.devices.Parameter
public class Parameter
This class consists of a slider and a label, and is intended for adjusting the value of a real parameter. The real parameter is characterized by a minimum value, a maximum value, a step size, a current value, a name, and a symbol. The name is intended to be descriptive and is used in the tool tip. The symbol is used in the label.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, 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 |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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()
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |