|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsm.SMShape
sm.SMImage
An image shape for use with an SMCanvas
.
The image is loaded from a file and can be in any format recognized by Java2D.
The fill paint is ignored.
If the shape is outlined, the border of the image is drawn according to the outline paint and stroke.
Field Summary |
Fields inherited from class sm.SMShape |
cptId |
Constructor Summary | |
SMImage(java.lang.String file,
java.awt.geom.Point2D loc)
Builds a SMImage. |
|
SMImage(java.lang.String file,
java.awt.geom.Point2D loc,
java.awt.Paint o)
Builds a SMImage. |
|
SMImage(java.lang.String file,
java.awt.geom.Point2D loc,
java.awt.Paint o,
java.awt.Stroke str)
Builds a SMImage. |
|
SMImage(java.lang.String file,
java.awt.geom.Point2D loc,
java.awt.Stroke str)
Builds a SMImage. |
Method Summary | |
SMShape |
copyTo(SMShape sms)
Copies this shape into a destination shape. |
SMShape |
duplicate()
Creates a new copy of this shape and returns it. |
java.lang.String |
getFileName()
Returns the name of the file containing the image displayed by this shape. |
double |
getX()
Returns the x coordinate of the image. |
double |
getY()
Returns the y coordinate of the image. |
void |
paint(java.awt.Graphics g)
Paints the shape. |
SMImage |
setFileName(java.lang.String name)
Sets the image of this SMImage. |
SMImage |
setLocation(java.awt.geom.Point2D loc)
Sets the coordinate of the image. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SMImage(java.lang.String file, java.awt.geom.Point2D loc, java.awt.Paint o, java.awt.Stroke str)
file
- The name of the file image (gif, jpeg or png)loc
- The location of the lower left corner of the imageo
- The paint style of the outline of the imagestr
- The stroke style of the outline of the imagepublic SMImage(java.lang.String file, java.awt.geom.Point2D loc, java.awt.Paint o)
file
- The name of the file image (gif, jpeg or png)loc
- The location of the lower left corner of the imageo
- The paint style of the outline of the imagepublic SMImage(java.lang.String file, java.awt.geom.Point2D loc, java.awt.Stroke str)
file
- The name of the file image (gif, jpeg or png)loc
- The location of the lower left corner of the imagestr
- The stroke style of the outline of the imagepublic SMImage(java.lang.String file, java.awt.geom.Point2D loc)
file
- The name of the file image (gif, jpeg or png)loc
- The location of the lower left corner of the imageMethod Detail |
public double getX()
public double getY()
public SMImage setLocation(java.awt.geom.Point2D loc)
loc
- The new coordinate to set.
public java.lang.String getFileName()
public SMImage setFileName(java.lang.String name)
name
- The file name of the new image.
public void paint(java.awt.Graphics g)
SMShape
paint
in class SMShape
g
- The graphics with which the shape must be painted.public SMShape copyTo(SMShape sms)
copyTo
in class SMShape
sms
- The destination shape
SMShape.copyTo(sm.SMShape)
public SMShape duplicate()
duplicate
in class SMShape
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |