|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PictureExplorer
Displays a picture and lets you explore the picture by displaying the x, y, red, green, and blue values of the pixel at the cursor when you click a mouse button or press and hold a mouse button while moving the cursor. It also lets you zoom in or out. You can also type in a x and y value to see the color at that location. Originally created for the Jython Environment for Students (JES). Modified to work with DrJava by Barbara Ericson Copyright Georgia Institute of Technology 2004
Constructor Summary | |
PictureExplorer(DigitalPicture picture)
Public constructor |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent a)
Controls the zoom menu bar |
void |
changeToBaseOne()
Changes the number system to start at one |
void |
checkScroll()
Method to check that the current position is in the viewing area and if not scroll to center the current position if possible |
javax.swing.JPanel |
createLocationPanel(java.awt.Font labelFont)
Create the pixel location panel |
void |
displayPixelInformation(java.lang.String xString,
java.lang.String yString)
Method to display the pixel information from the passed x and y but also converts x and y from strings |
static void |
main(java.lang.String[] args)
Test Main. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Method called when the mouse is clicked |
void |
mouseDragged(java.awt.event.MouseEvent e)
Called when the mouse is dragged (button held down and moved) |
void |
mouseEntered(java.awt.event.MouseEvent e)
Method called when the component is entered (mouse moves over it) |
void |
mouseExited(java.awt.event.MouseEvent e)
Method called when the mouse moves over the component |
void |
mouseMoved(java.awt.event.MouseEvent e)
Method called when the mouse is moved with no buttons down |
void |
mousePressed(java.awt.event.MouseEvent e)
Method called when the mouse button is pushed down |
void |
mouseReleased(java.awt.event.MouseEvent e)
Method called when the mouse button is released |
void |
repaint()
Repaints the image on the scrollpane. |
void |
setTitle(java.lang.String title)
Set the title of the frame |
void |
zoom(double factor)
Zooms in the on picture by scaling the image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PictureExplorer(DigitalPicture picture)
picture
- the picture to exploreMethod Detail |
public void changeToBaseOne()
public void setTitle(java.lang.String title)
title
- the title to use in the JFramepublic javax.swing.JPanel createLocationPanel(java.awt.Font labelFont)
labelFont
- the font for the labels
public void checkScroll()
public void zoom(double factor)
factor
- the amount to zoom bypublic void repaint()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- the mouse eventpublic void displayPixelInformation(java.lang.String xString, java.lang.String yString)
xString
- the x value as a string from the useryString
- the y value as a string from the userpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- the mouse eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void actionPerformed(java.awt.event.ActionEvent a)
actionPerformed
in interface java.awt.event.ActionListener
a
- the ActionEventpublic static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |