|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--TrackCanvas
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
TrackCanvas(java.awt.Frame parent,
Track t,
java.util.Observer observer)
Initialize a new track canvas. |
Method Summary | |
java.awt.Point |
getMouseCoordinates()
Returns the current mouse coordinates. |
static int |
mapFieldCoords(float fx,
float rangef,
int rangex,
float minf)
Convert field coordinates to mouse coordinates. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Empty mouse clicked handler |
void |
mouseDragged(java.awt.event.MouseEvent e)
Empty mouse dragged handler |
void |
mouseEntered(java.awt.event.MouseEvent e)
Changes the cursor to a crosshair when the mouse enters the canvas. |
void |
mouseExited(java.awt.event.MouseEvent e)
Changes the cursor back to the default cursor when the mouse exits the canvas. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Updates the current mouse position and the canvas's observer. |
void |
mousePressed(java.awt.event.MouseEvent e)
Empty mouse pressed handler |
void |
mouseReleased(java.awt.event.MouseEvent e)
Empty mouse released handler |
void |
paint(java.awt.Graphics g)
Paint the image to the canvas |
void |
setTrack(Track t)
Set the current track. |
static float |
unmapMouseCoords(int mx,
int rangex,
float rangef,
float minf)
Convert mouse coordinates to field coordinates. |
void |
update(java.awt.Graphics g)
Update the underlying image object |
Methods inherited from class java.awt.Canvas |
addNotify |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
deliverEvent,
disable,
disableEvents,
dispatchEvent,
doLayout,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getAlignmentX,
getAlignmentY,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentAt,
getComponentAt,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getMaximumSize,
getMinimumSize,
getName,
getParent,
getPeer,
getPreferredSize,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
invalidate,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
layout,
list,
list,
list,
list,
list,
locate,
location,
lostFocus,
minimumSize,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
paramString,
postEvent,
preferredSize,
prepareImage,
prepareImage,
print,
printAll,
processComponentEvent,
processEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setEnabled,
setFont,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus,
validate |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public TrackCanvas(java.awt.Frame parent, Track t, java.util.Observer observer)
frame
- the canvas's parentt
- the track object to renderobserver
- the object to notify for position updatesMethod Detail |
public void setTrack(Track t)
t
- the track object to renderpublic void update(java.awt.Graphics g)
g
- the graphics object to updatepublic void paint(java.awt.Graphics g)
public static float unmapMouseCoords(int mx, int rangex, float rangef, float minf)
mx
- the mouse's x coordinaterangex
- the range of the mouse coordinatesrangef
- the range of the field coordinatesminf
- the minimum x field coordinatespublic static int mapFieldCoords(float fx, float rangef, int rangex, float minf)
fx
- the field's x coordinaterangef
- the range of the field coordinatesrangex
- the range of the mouse coordinatesminf
- the minimum x field coordinatespublic java.awt.Point getMouseCoordinates()
public void mouseMoved(java.awt.event.MouseEvent e)
e
- the event to processpublic void mouseEntered(java.awt.event.MouseEvent e)
e
- the mouse entered eventpublic void mouseExited(java.awt.event.MouseEvent e)
e
- the mouse exited eventpublic void mouseClicked(java.awt.event.MouseEvent e)
e
- the mouse clicked eventpublic void mouseDragged(java.awt.event.MouseEvent e)
e
- the mouse dragged eventpublic void mouseReleased(java.awt.event.MouseEvent e)
e
- the mouse released eventpublic void mousePressed(java.awt.event.MouseEvent e)
e
- the mouse pressed event
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |