All Packages Class Hierarchy This Package Previous Next Index
Class picture.Picture
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----GWin
|
+----Project
|
+----picture.Picture
- public class Picture
- extends Project
Draw an image and allow user to zoom in on portions.
When the picture is
a gallery of many little pictures, it allows one to be zoomed in on
with a single mouse click. Thereafter, a click and drag or number key zooms.
Many of the numerical constants have a suffix f because the compiler,
in direct violation of the spec, assumes they are double by default.
This code is (c) 1996 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.0, 11/23/95
- Author:
- Leemon Baird
-
bar
-
-
bHeight
-
-
both
-
-
component
-
-
CR
-
-
currGallery
-
-
fadeIn
-
-
gHeight
-
-
gWidth
-
-
LF
-
-
maxX
-
-
maxY
-
-
mdownx
-
-
mdowny
-
-
mdragx
-
-
mdragy
-
-
minX
-
-
minY
-
-
pass1
-
-
pass2
-
-
Picture()
-
-
BNF(int)
-
-
handleEvent(Event)
- ensure that events are handled sequentially
-
keyDown(Event, int)
- If a key is pressed, respond appropriately.
-
mouseDown(Event, int, int)
- Remember where mouse clicks so highlighting will be right.
-
mouseDrag(Event, int, int)
- As mouse is dragged, highlight appropriate region.
-
mouseUp(Event, int, int)
- When mouse is released, zoom in on appropriate region.
-
paint(Graphics)
- paint the screen from the buffer without stopping the drawing thread.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
reshape(int, int, int, int)
- when the user resizes or moves the canvas, stop and restart the thread
-
run()
- Draw picture after done parsing.
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
fadeIn
protected FadeIn fadeIn
CR
protected static final char CR
LF
protected static final char LF
mdownx
protected int mdownx
mdowny
protected int mdowny
mdragx
protected int mdragx
mdragy
protected int mdragy
gWidth
protected int gWidth
gHeight
protected int gHeight
bHeight
protected IntExp bHeight
minX
protected double minX
maxX
protected double maxX
minY
protected double minY
maxY
protected double maxY
currGallery
protected Gallery currGallery
component
protected Component component
pass1
protected PicPipePipeline pass1
pass2
protected PicPipePipeline pass2
both
protected PicPipePipeline both
bar
protected boolean bar
Picture
public Picture()
BNF
public String BNF(int lang)
- Overrides:
- BNF in class Project
unparse
public void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
- Overrides:
- unparse in class Project
- See Also:
- Parsable
parse
public Object parse(Parser p,
int lang) throws ParserException
- Parse the input file to get the parameters for this object.
- Throws: ParserException
- parser didn't find the required token
- Overrides:
- parse in class Project
run
public void run()
- Draw picture after done parsing. This is in a separate thread.
- Overrides:
- run in class Project
handleEvent
public boolean handleEvent(Event e)
- ensure that events are handled sequentially
- Overrides:
- handleEvent in class Component
reshape
public void reshape(int x,
int y,
int w,
int h)
- when the user resizes or moves the canvas, stop and restart the thread
- Overrides:
- reshape in class Component
paint
public void paint(Graphics g)
- paint the screen from the buffer without stopping the drawing thread.
- Overrides:
- paint in class GWin
mouseDown
public boolean mouseDown(Event event,
int x,
int y)
- Remember where mouse clicks so highlighting will be right.
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event event,
int x,
int y)
- As mouse is dragged, highlight appropriate region.
- Overrides:
- mouseDrag in class Component
mouseUp
public boolean mouseUp(Event event,
int x,
int y)
- When mouse is released, zoom in on appropriate region.
- Overrides:
- mouseUp in class Component
keyDown
public boolean keyDown(Event event,
int key)
- If a key is pressed, respond appropriately.
- Overrides:
- keyDown in class Component
All Packages Class Hierarchy This Package Previous Next Index