|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas com.softsynth.jmsl.view.JMSLScrollbar
public class JMSLScrollbar
Our own horizontal scrollbar, subclass of canvas, which uses
JMSLScrollbarProcessor interface to communicate with parent.
Example:
// A new scrollbar with parent, with default value 50, min value 0, max value 100 // Assumes "this" is a class that implements JMSLScrollbarProcessor myScrollbar = new JMSLScrollbar(this, 50, 0, 100); // set the graphic size of the scrollbar myScrollbar.setSize(320, 25); // set the increment that the value will jump when user clicks inside scrollbar myScrollbar.setPageIncrement(10); // set the increment that the value will jump when user clicks on arrows of scrollbar myScrollbar.setLineIncrement(1); // add it to layout add(myScrollbar); ...
public void JMSLScrollbarValueChanged(JMSLScrollbar jsb) { if (jsb == myScrollbar) { System.out.println("Value = " + myScrollbar.getValue()); } }
Field Summary | |
---|---|
static int |
HORIZONTAL
unused - presently always horizontal |
static int |
VERTICAL
unused - presently always horizontal |
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 | |
---|---|
JMSLScrollbar()
|
|
JMSLScrollbar(JMSLScrollbarProcessor par,
int v,
int min,
int max)
Constructor with parent who will receive notification of value change, initial value, min value, max value. |
Method Summary | |
---|---|
int |
getLineIncrement()
|
int |
getMax()
|
int |
getMin()
|
int |
getPageIncrement()
|
int |
getValue()
|
static void |
main(java.lang.String[] args)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
|
void |
setArrowColor(java.awt.Color c)
|
void |
setBevelColor1(java.awt.Color c)
|
void |
setBevelColor2(java.awt.Color c)
|
void |
setLineIncrement(int v)
Set how much the value jumps when click on leftmost or rightmost arrow. |
void |
setMax(int max)
set the max value for this scrollbar |
void |
setMin(int min)
set the min value for this scrollbar |
void |
setPageIncrement(int v)
Set how much the value jumps when click to left or right of slider. |
void |
setScrollbarBackgroundColor(java.awt.Color c)
|
void |
setSize(int w,
int h)
reshape size of scrollbar |
void |
setValue(int v)
|
void |
setValues(int v,
int min,
int max)
Set current value, minimum value, maximum value of scrollbar |
void |
update(java.awt.Graphics g)
|
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HORIZONTAL
public static final int VERTICAL
Constructor Detail |
---|
public JMSLScrollbar()
public JMSLScrollbar(JMSLScrollbarProcessor par, int v, int min, int max)
Method Detail |
---|
public void setArrowColor(java.awt.Color c)
public void setBevelColor1(java.awt.Color c)
public void setBevelColor2(java.awt.Color c)
public void setScrollbarBackgroundColor(java.awt.Color c)
public void setValues(int v, int min, int max)
public void setMin(int min)
public void setMax(int max)
public int getMin()
public int getMax()
public void setSize(int w, int h)
setSize
in class java.awt.Component
public void setPageIncrement(int v)
public int getPageIncrement()
public void setLineIncrement(int v)
public int getLineIncrement()
public int getValue()
public void setValue(int v)
public void update(java.awt.Graphics g)
update
in class java.awt.Canvas
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |