|
|||||||
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
com.sygem.swing.jpopupslider.JPopupSlider
The main class of the JPopupSlider component.
Title: JPopupSlider
Description: Displays a slider bar in a popup window
Copyright: Copyright (c) 2004
Company: SyGem Software
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
static int |
DIRECTION_DOWN
Draws the direction arrow pointing downwards |
static int |
DIRECTION_LEFT
Draws the direction arrow pointing to the left |
static int |
DIRECTION_RIGHT
Draws the direction arrow pointing to the right |
static int |
DIRECTION_UP
Draws the direction arrow pointing upwards (default) |
static int |
FULL_UP
Popup window will always be placed at the same position |
static int |
PARTIAL_UP
Popup slider will be drawn level with the mouse pointer (default) |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, 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 | |
JPopupSlider()
Constructs a new JPopupSlider with default values. |
|
JPopupSlider(double value,
double minvalue,
double maxvalue,
double step)
Constructs a new JPopupSlider with initial (double) values. |
|
JPopupSlider(int value,
int minvalue,
int maxvalue,
int step)
Constructs a new JPopupSlider with initial (integer) values. |
|
JPopupSlider(PopupNumberModel model)
Constructs a new JPopupSlider based on the PopupNumberModel. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener - listens for when the button has been pressed. |
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener - listens for when the value changes. |
java.awt.event.ActionListener[] |
getActionListeners()
Returns an array containing the ActionListeners registered against this popup slider. |
java.awt.Color |
getBarColor()
Returns the Color used to draw the popup slider bar. |
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array containing the ChangeListeners registered against this popup slider. |
int |
getDirection()
Returns the direction that the popup slider will appear, relative to the button. |
javax.swing.border.Border |
getDisabledBorder()
Returns the border used when the button is disabled. |
javax.swing.border.Border |
getLoweredBorder()
Returns the border used when the button is active and has been clicked on. |
PopupNumberModel |
getModel()
Returns the model used for controlling the values of this popup sider. |
int |
getPopupHeight()
Returns the height of the popup slider window |
int |
getPopupMode()
Returns the popup mode of the slider. |
java.awt.Color |
getPopupOutlineColor()
Returns the Color used to outline the popup slider window. |
int |
getPopupWidth()
Returns the width of the popup slider window |
javax.swing.border.Border |
getRaisedBorder()
Returns the border used when the button is active, but has not been clicked on. |
java.lang.Object |
getValue()
Gets the current value of this slider. |
boolean |
getValueIsUpdating()
Returns true if the value of the slider is currently being changed. |
void |
paintComponent(java.awt.Graphics g)
Overriden to enable the drawing of the direction arrow. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener. |
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener. |
void |
setBarColor(java.awt.Color barColor)
Sets the color used to draw the bar indicating the slider value. |
void |
setDirection(int dir)
Sets the direction that the popup slider will appear, relative to the button. |
void |
setDisabledBorder(javax.swing.border.Border disabledBorder)
Sets the border to be shown when the button is disabled. |
void |
setEnabled(boolean enabled)
Sets whether or not this component is enabled. |
void |
setLoweredBorder(javax.swing.border.Border loweredBorder)
Sets the border to be shown when the button is active and has been clicked on. |
void |
setModel(PopupNumberModel newModel)
Sets the PopupNumberModel used to control this popup slider. |
void |
setPopupHeight(int h)
Sets the height of the popup slider window. |
void |
setPopupMode(int m)
Sets the popup mode of the slider. |
void |
setPopupOutlineColor(java.awt.Color outlineColor)
Sets the color used to outline the popup window. |
void |
setPopupWidth(int w)
Sets the width of the popup slider window. |
void |
setRaisedBorder(javax.swing.border.Border raisedBorder)
Sets the border to be shown when the button is active, but not clicked on. |
void |
setValue(java.lang.Object value)
Sets the value of this popup slider. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DIRECTION_DOWN
public static final int DIRECTION_LEFT
public static final int DIRECTION_RIGHT
public static final int DIRECTION_UP
public static final int FULL_UP
public static final int PARTIAL_UP
Constructor Detail |
public JPopupSlider()
public JPopupSlider(double value, double minvalue, double maxvalue, double step)
value
- Inital value for the sliderminvalue
- Minimum valuemaxvalue
- Maximum valuestep
- Distance at which to draw step marks on the popup windowpublic JPopupSlider(int value, int minvalue, int maxvalue, int step)
value
- Inital value for the sliderminvalue
- Minimum valuemaxvalue
- Maximum valuestep
- Distance at which to draw step marks on the popup windowpublic JPopupSlider(PopupNumberModel model)
model
- PopupNumberModelPopupNumberModel
Method Detail |
public void addActionListener(java.awt.event.ActionListener listener)
listener
- The ActionListener to addpublic void addChangeListener(javax.swing.event.ChangeListener listener)
listener
- The ChangeListener to addpublic java.awt.event.ActionListener[] getActionListeners()
public java.awt.Color getBarColor()
public javax.swing.event.ChangeListener[] getChangeListeners()
public int getDirection()
Returns the direction that the popup slider will appear, relative to the button.
setDirection(int)
public javax.swing.border.Border getDisabledBorder()
public javax.swing.border.Border getLoweredBorder()
public PopupNumberModel getModel()
public int getPopupHeight()
public int getPopupMode()
Returns the popup mode of the slider.
setPopupMode(int)
public java.awt.Color getPopupOutlineColor()
public int getPopupWidth()
public javax.swing.border.Border getRaisedBorder()
public java.lang.Object getValue()
public boolean getValueIsUpdating()
public void paintComponent(java.awt.Graphics g)
g
- The Graphics context to which we draw the arrowpublic void removeActionListener(java.awt.event.ActionListener listener)
listener
- The ActionListener to removepublic void removeChangeListener(javax.swing.event.ChangeListener listener)
listener
- The ChangeListener to removepublic void setBarColor(java.awt.Color barColor)
barColor
- The bar colorpublic void setDirection(int dir)
Sets the direction that the popup slider will appear, relative to the button.
Valid values are:
dir
- The direction for this popup sliderpublic void setDisabledBorder(javax.swing.border.Border disabledBorder)
disabledBorder
- The new Disabled Borderpublic void setEnabled(boolean enabled)
enabled
- true if this component should be enabled, false otherwisepublic void setLoweredBorder(javax.swing.border.Border loweredBorder)
loweredBorder
- The new Lowered Borderpublic void setModel(PopupNumberModel newModel)
newModel
- A PopupNumberModelpublic void setPopupHeight(int h)
Sets the height of the popup slider window.
NOTE: if direction is either DIRECTION_LEFT or DIRECTION_RIGHT, this actually sets the width of the popup window.
h
- The height of the popup windowpublic void setPopupMode(int m)
Sets the popup mode of the slider.
Valid values are:
m
- Popup modepublic void setPopupOutlineColor(java.awt.Color outlineColor)
outlineColor
- The outline color for the popup windowpublic void setPopupWidth(int w)
Sets the width of the popup slider window.
NOTE: if direction is either DIRECTION_LEFT or DIRECTION_RIGHT, this actually sets the height of the popup window.
w
- The width of the popup windowpublic void setRaisedBorder(javax.swing.border.Border raisedBorder)
raisedBorder
- The new Raised Borderpublic void setValue(java.lang.Object value)
value
- The new value for the slider
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |