Title: CS187 - Project 3
Description: class representing a butonless mouse
CGWU CS187 Design of User Interface
| Field Detail |
Timer enterTimer
Timer exitTimer
Timer insideTimer
public static final int NO_DELAY
public static final int SHORT_DELAY
public static final int MID_DELAY
public static final int LONG_DELAY
private static boolean Flag_
private static boolean First_
private JComponent currentComponent_
private MouseEvent mouseEvent_
private boolean jump_
private boolean debug_
private int Ier_
| Constructor Detail |
public ButtonLess()
Construct a buttonless mouse by creating enterTimer, exitTimer, and insideTimer.
The enterTimer and exitTimer's delay is set as the default NO_DELAY. The insideTimer's delay is set as the default SHORT_DELAYpublic ButtonLess(int insideDelay)
Construct a buttonless mouse by creating enterTimer, exitTimer, and insideTimer
The enterTimer and exitTimer's delay is set as the default NO_DELAY. The insideTimer's delay is set by the given "insideDelay"insideDelay - int| Method Detail |
public int getDelay()
public int getInitialDelay()
public void setDelay(int delay)
delay - the number of milliseconds to delay before clicking the buttonpublic void setInitialDelay(int delay)
delay - the number of milliseconds to delay (after the cursor has paused) before displaying the tooltippublic void setJump(boolean jump)
jump - booleanpublic void registerComponent(JComponent component)
component - JComponentpublic void unregisterComponent(JComponent component)
component - JComponentpublic void mouseClicked(MouseEvent event)
Override MouseAdapter.mouseClicked - called when the mouse is clicked on this component.
Stop all Timers and set currentComponent_ = null. (so that no action would be taken by the buttonless mouse, until the mouse exit and reenters.)event - MouseEventpublic void mouseEntered(MouseEvent event)
Override MouseAdapter.mouseEntered - called when the mouse enters to this component.
Stop the exitTimer; Restart the enterTimer and InsideTimer.event - MouseEventpublic void mouseExited(MouseEvent event)
Override MouseAdapter.mouseExited - called when the mouse exits from this component.
Stop all Timers and set currentComponent_ = null.event - the event in questionpublic void mousePressed(MouseEvent event)
Override MouseAdapter.mousePressed - called when the mouse button is pressed on this component.
Stop all Timers and set currentComponent_ = null.event - the event in questionpublic void mouseReleased(MouseEvent event)
Override MouseAdapter.mouseReleased - called when the mouse button is released on this component.
Stop all Timers and set currentComponent_ = null.event - the event in questionpublic void mouseDragged(MouseEvent event)
Override MouseMotionListener.mouseDragged - called when the mouse is pressed and dragged.
Right now, does nothingevent - the event in questionpublic void mouseMoved(MouseEvent event)
Override MouseMotionListener.mouseMoved - called when the mouse is moved.
Right now, does nothingevent - the event in questionprivate void doSomething_(JComponent component)
component - JComponentprivate void backToDefault_(JComponent component)
component - JComponentprivate void click_(AbstractButton button)
button - AbstractButtonprivate void changeCaretPosition_(JTextComponent textComp)
textComp - JTextComponent
private void slide_(JSlider slider,
boolean jump)
slider - JSliderjump - boolean
private void scroll_(JScrollBar scrollBar,
boolean jump)
scrollBar - JScrollBarjump - booleanprivate void panelShow_(JPanel panel)
panel - JPanel
private int normalized_(double pos,
double width,
double length,
int range)
pos - doublewidth - intlength - intrange - int
private void print_(String eventDescription,
MouseEvent event)
eventDescription - Stringevent - MouseEventprivate void print_(ButtonLessTimerListener listener)
listener - ButtonLessTimerListenerprivate void print_(String st)
st - String