public class MMDoubleSliderPanel extends MMCompoundPanel implements javax.swing.event.ChangeListener, java.awt.event.ActionListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLAY
Unicode Constant for "play" sign.
|
static java.lang.String |
STOP
Unicode Constant for "stop" sign.
|
m_font, m_oldEditForeground, m_oldHighLightForeground, m_preferredHeight, m_preferredWidth, m_properties
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MMDoubleSliderPanel(MMObjectIF master,
double leftBound,
double rightBound,
DoubleSliderTransformer transformer) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Called by the animation timer.
|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Add an additional change listener to the slider component.
|
void |
displayOnlySlider()
Specifies whether the slider should be displayed without any other panels.
|
boolean |
getAllowOnlyIntegers()
Returns whether the slider should display only integer values.
|
java.text.DecimalFormat |
getDecimalFormat() |
double |
getLeftBound()
Returns the left boundary of the values between the user can slide.
|
double |
getRightBound()
Returns the right boundary of the values between the user can slide.
|
int |
getSliderValue()
Returns the slider value from 0 to 99.
|
boolean |
isAnimationButtonVisible()
Returns the visibility status of the play button.
|
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Remove an additional change listener to the slider component.
|
void |
render()
Updates this panel's visualisation.
|
void |
setAllowOnlyIntegers(boolean allowOnlyIntegers)
Specifies whether the slider should display only integer values.
|
void |
setAnimationButtonVisible(boolean b)
Sets the visibility status of the play button.
|
void |
setBarLength(int l)
Specifies the length of the slider bar Default is 100.
|
void |
setBounds(double leftBound,
double rightBound)
Sets the left and right boundaries of the values between the user can slide.
|
void |
setDecimalFormat(java.text.DecimalFormat format) |
void |
setEditable(boolean editable)
Sets whether the value and boundaries may be edited.
|
void |
setInverted(boolean inverted)
Specifies whether the slider should be inverted in direction.
|
void |
setLabel(java.lang.String label)
Sets the label for this MM-Panel.
|
void |
setLeftBound(double leftBound)
Sets the left boundary of the values between the user can slide.
|
void |
setLeftBoundEditable(boolean editable)
Sets whether the left boundary may be edited.
|
void |
setNumberEditable(boolean editable)
Sets whether the number field may be edited.
|
void |
setNumberPanelVisible(boolean b)
Sets the visibility status of the value.
|
void |
setRightBound(double rightBound)
Sets the right boundary of the values between the user can slide.
|
void |
setRightBoundEditable(boolean editable)
Sets whether the right boundary may be edited.
|
void |
setSliderBGColor(java.awt.Color color)
Sets the background of the slider to the given color.
|
void |
setUnitText(java.lang.String text)
Sets the unit as text behind the value field.
|
void |
setVerticalOrientation()
Specifies whether the slider should be in horizontal or vertical orientation.
|
void |
stateChanged(javax.swing.event.ChangeEvent e)
Updates the double value of the master according to the slider position.
|
addImpl, addMMPanel, getMMPanel, getMMPanelCount, isEditable, remove, removeAll, removeAllMMPanels, removeMMPanel, removeMMPanel, setForeground
addSelectionListener, getBorderColor, getBorderInsets, getDrawableProperties, getFont, getInsets, getMaster, getMaximumSize, getMinimumSize, getPanelRenderingHints, getPreferredPanelSize, getPreferredSize, getPreferredSize, getRootPanel, getSelectionListeners, getViewerComponent, isCompoundPanel, isEdited, isFixedHeight, isFixedWidth, isLabelVisible, isMouseOver, isOwnRootPanel, isSelectable, isSelected, isTextVisible, paintBorder, removeSelectionListener, repaintAll, requestFocusFor, setBackground, setBorderColor, setEdited, setEnabled, setFont, setHeight, setLabelVisible, setMouseOver, setPreferredSize, setRootPanel, setSelectable, setSelected, setTextVisible, setViewerComponent, setWidth
getBaseline, setHorizontalAlignment, setLayout, setVerticalAlignment
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, 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, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBaseline, getHeight
public static final java.lang.String PLAY
public static final java.lang.String STOP
public MMDoubleSliderPanel(MMObjectIF master, double leftBound, double rightBound, DoubleSliderTransformer transformer)
public void setLabel(java.lang.String label)
MMPanel
public void addChangeListener(javax.swing.event.ChangeListener l)
public void removeChangeListener(javax.swing.event.ChangeListener l)
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void setDecimalFormat(java.text.DecimalFormat format)
public java.text.DecimalFormat getDecimalFormat()
public void setEditable(boolean editable)
setEditable
in class MMCompoundPanel
public void setLeftBoundEditable(boolean editable)
public void setRightBoundEditable(boolean editable)
public void setNumberEditable(boolean editable)
public void setAllowOnlyIntegers(boolean allowOnlyIntegers)
public void setBarLength(int l)
public void setVerticalOrientation()
public void setInverted(boolean inverted)
public void displayOnlySlider()
public int getSliderValue()
public boolean getAllowOnlyIntegers()
public void render()
MMPanel
public void setBounds(double leftBound, double rightBound)
public double getLeftBound()
public double getRightBound()
public void setLeftBound(double leftBound)
public void setRightBound(double rightBound)
public void setAnimationButtonVisible(boolean b)
public void setNumberPanelVisible(boolean b)
public boolean isAnimationButtonVisible()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void setSliderBGColor(java.awt.Color color)
public void setUnitText(java.lang.String text)
null
will hide the unit.text
- a text or null
Further documentation and examples can be found under www.mathletfactory.de.