|
All Methods zio package context |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object zio.ZObject zio.ZPicture
A program writeable image area. Images written after the window has been constructed will be cropped if they are larger than the existing area.
If a size()
suffix is used, that will be the size.
If a minSize()
suffix is used an initial image must
also be given and the size will be formed from the largest
dimensions available.
It is an error to provide no size guidance at setup time. An
initial image (obtained by using
There is a mechanism for responding to mouse clicks
and knowing where on the image the mouse click was
performed. See the showImage()
as if
it were a suffix) is sufficient.
action
method.
Sample use
ZPicture pic = new ZPicture().showImage(InOut.readImage("MyPicture.jpg") );
Constructor Summary | |
ZPicture()
Creates a ZPicture with no image.. |
Method Summary | |
protected void |
action(boolean isLeftButton,
java.awt.Point point)
For execution when user clicks the mouse over the picture. |
ZPicture |
debug(java.lang.String debugId)
Suffix that creates debug output. |
protected void |
enableMouseAction()
Method for causing the action() method to be
executed upon mouse clicks. |
ZPicture |
expandH()
Suffix that enables horizontal stretching. |
ZPicture |
expandV()
Suffix that enables vertical stretching. |
ZPicture |
minSize(java.awt.Dimension minSize)
Suffix that sets the minimum size. |
ZPicture |
showImage(java.awt.image.BufferedImage image)
Display a picture. |
ZPicture |
size(java.awt.Dimension desiredSize)
Suffix that sets the size. |
Methods inherited from class zio.ZObject |
getSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZPicture()
ZPicture
with no image..
Method Detail |
public ZPicture debug(java.lang.String debugId)
debugId
- a string to identify this component
in the debug outputpublic final ZPicture minSize(java.awt.Dimension minSize)
minSize
- the desired minimum sizepublic final ZPicture size(java.awt.Dimension desiredSize)
ZPicture
object will fill. This suffix overrides any other
size determiner.
desiredSize
- the desired minimum sizepublic final ZPicture expandH()
public final ZPicture expandV()
public final ZPicture showImage(java.awt.image.BufferedImage image)
image
- the image to be displayedprotected void enableMouseAction()
action()
method to be
executed upon mouse clicks.
Has no discernable effect unless the action()
method is overridden in a subclass.
protected void action(boolean isLeftButton, java.awt.Point point)
action()
method does nothing and is not invoked.
To cause this method to be invoked whenever the user clicks the mouse,
enableMouseAction()
ZObject
class, it is usually easier to use suffixes
this way.)
The point passed to action()
has the upper lefthand corner of the component as
its origin. The y coordinate is positive in a downward
direction.
isLeftButton
- true when the clicked button was the left
or "first" buttonpoint
- coordinates of the point where the
left mouse button was released
|
author context |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |