public class PictureExplorer
extends java.lang.Object
implements java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.MouseListener
Constructor and Description |
---|
PictureExplorer(RasterImage picture)
Public constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
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.
|
public PictureExplorer(RasterImage picture)
picture
- the picture to explorepublic 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 labelspublic 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 ActionEvent