All Packages Class Hierarchy This Package Previous Next Index
Class graphing.ZoomGraphWindow
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----graphing.GraphWindow
|
+----graphing.ZoomGraphWindow
- public class ZoomGraphWindow
- extends GraphWindow
A ZoomGraphWindow is a GraphWindow together with methods to change scale easily (zooming in and zooming out).
The mouse draws out a rubber band on the screen and doZoomToBox() snaps the viewing rectangle to
this box.
-
bandColor
- The color of the rubber band
-
ZoomGraphWindow()
-
-
ZoomGraphWindow(double, double, double, double)
- Constructs a ZoomGraphWindow with the specified ranges of x and y axes.
-
ZoomGraphWindow(double, double, double, double, double, double)
- Constructs a ZoomGraphWindow with the specified ranges of x and y axes.
-
bandIsVisible()
-
-
deleteBand()
-
-
doZoomIn()
- Zooms the viewing rectangle in on the center of the screen.
-
doZoomOut()
- Pulls the viewing rectangle back out of the center of the screen.
-
doZoomToBox()
- Snaps the viewing rectangle to the rubber band drawn out by the mouse.
-
drawGraph(double, double, double, double, double, double)
- Overrides the drawGraph() method of GraphWindow.
-
lostFocus(Event, Object)
- When we loose focus, the rubber band vanishes.
-
mouseDown(Event, int, int)
-
-
mouseDrag(Event, int, int)
-
-
mouseUp(Event, int, int)
-
-
paint(Graphics)
-
-
selects(int, int)
- Tells whether the point (x,y) is inside the region selected by the rubber band
-
update(Graphics)
-
This class overrides Component.update() to reduce flicker
bandColor
public Color bandColor
- The color of the rubber band
ZoomGraphWindow
public ZoomGraphWindow(double xMin,
double xMax,
double xScale,
double yMin,
double yMax,
double yScale)
- Constructs a ZoomGraphWindow with the specified ranges of x and y axes. The axes show tickmarks separated by xScale and yScale.
ZoomGraphWindow
public ZoomGraphWindow(double xMin,
double xMax,
double yMin,
double yMax)
- Constructs a ZoomGraphWindow with the specified ranges of x and y axes. The axes show no tickmarks.
ZoomGraphWindow
public ZoomGraphWindow()
update
public void update(Graphics g)
- This class overrides Component.update() to reduce flicker
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class GraphWindow
drawGraph
public void drawGraph(double xMin,
double xMax,
double xScale,
double yMin,
double yMax,
double yScale)
- Overrides the drawGraph() method of GraphWindow.
- Overrides:
- drawGraph in class GraphWindow
selects
public boolean selects(int x,
int y)
- Tells whether the point (x,y) is inside the region selected by the rubber band
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- Overrides:
- mouseDrag in class Component
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- Overrides:
- mouseUp in class Component
lostFocus
public boolean lostFocus(Event e,
Object w)
- When we loose focus, the rubber band vanishes. But the window will still be primed for doZoomToBox()
if zoomActive is set.
- Overrides:
- lostFocus in class Component
bandIsVisible
public boolean bandIsVisible()
deleteBand
public void deleteBand()
doZoomIn
public void doZoomIn()
- Zooms the viewing rectangle in on the center of the screen.
doZoomToBox
public void doZoomToBox()
- Snaps the viewing rectangle to the rubber band drawn out by the mouse.
doZoomOut
public void doZoomOut()
- Pulls the viewing rectangle back out of the center of the screen.
All Packages Class Hierarchy This Package Previous Next Index