|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfig.objects.FigBaseobject
jfig.objects.FigRectangle
jfig.objects.FigImage
embedded (GIF/JPEG/XBM) image object.
This class represents embedded image objects, realized as a subclass of FigRectangle with a reference to a java.awt.Image object. As for all other objects, the reference point for a FigImage is the top left corner.
Due to the usage of java.awt.Image, not all image formats supported by xfig can be displayed in jfig. Currently, only XBM, GIF, and JPEG images are supported on all platforms, while TIFF, PNG, and EPS/Postscript are not.
FigImage objects will react to 'mirror x/y' command with corresponding coordinate changes. The image, however, will not be mirrored but only be moved.
Image
Field Summary | |
protected int |
aspectRatio
|
protected java.lang.String |
filetype
|
static int |
FIT_TO_HEIGHT
|
static int |
FIT_TO_WIDTH
|
(package private) boolean |
has_error
|
(package private) boolean |
imageUpdateDebug
|
static int |
KEEP_SELECTED_SIZE
|
protected java.lang.String |
name
|
protected java.lang.String |
pathname
|
(package private) int |
sx1
|
(package private) int |
sx2
|
(package private) int |
sy1
|
(package private) int |
sy2
|
protected FullRedraw |
theCanvas
|
protected java.awt.Image |
theImage
|
protected java.awt.image.ImageObserver |
theObserver
|
Fields inherited from class jfig.objects.FigRectangle |
pixel_width, radius, renderer, use_rounded_corners |
Fields inherited from class jfig.objects.FigBaseobject |
attribs, bbox, comment, debug, painter, printer, sc_bbox, sc_bbox_timestamp, selected, showPoints, syncRedrawFlag, timestamp, trafo, visible, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
FigImage()
construct a so-far empty image |
|
FigImage(int x1,
int y1,
int x2,
int y2,
FigAttribs attribs,
FigTrafo2D trafo,
java.lang.String imageName)
The FigImage constructor with full parameter set: (x1,y1) and (x2,y2) specify the image position (and size), attribs and trafo are the FigImage attributes and trafo is a reference to the current editor viewport transformation. |
Method Summary | |
FigObject |
copy()
make a copy of this object and return the reference to the copy. |
void |
createRenderer()
|
java.awt.Image |
getImage()
|
void |
getImageFromResource(java.lang.String name)
|
java.lang.String |
getImageName()
|
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int width,
int height)
|
void |
paint(java.awt.Graphics g)
the paint() method |
void |
paint(java.awt.Graphics g,
FigTrafo2D trafo)
paint this object using the specified transformation and Graphics g |
void |
rebuild()
as we store our coordinates directly as the bounding box coords, we have nothing to do here except to tell our renderer. |
void |
setFilenameAndType(java.lang.String pathname,
java.lang.String filetype)
|
void |
setImage(java.awt.Image image)
|
void |
setImage(java.lang.String name,
boolean preserve_aspect)
|
void |
setImageAndFilename(java.lang.String name,
java.lang.String pathname,
java.lang.String filetype,
boolean preserve_aspect)
|
void |
setImageName(java.lang.String name)
|
void |
setObjectPainter(ObjectPainter canvas)
set the ObjectPainter responsible for drawing this FigBaseobject |
void |
setRedraw(FullRedraw canvas)
|
java.lang.String |
toString()
toString() for debug purposes. |
void |
updateAspectRatio(int aspectRatio)
|
Methods inherited from class jfig.objects.FigRectangle |
appendPoint, canRotate, deletePoint, getMovePointNeighbors, getNearestPoint, getNeighborPoints, getPoints, insertPoint, isClosed, isRounded, minDistance, minDistanceEuclid, mirrorX, mirrorY, move, movePoint, paintSave, setAttributes, setFillColor, setFillStyle, setLayer, setLineColor, setLineStyle, setLineWidth, setPoints, supportsPointOps, update |
Methods inherited from class jfig.objects.FigBaseobject |
build_sc_bbox, clonePoints, deselect, get_sc_bbox, getAttributes, getBbox, getComment, getLayer, getPosition, getSyncRedrawFlag, getText, getTimestamp, getTrafo, initialize, isSelected, isShowPoints, isVisible, isVisible, keyPressed, manhattan, message, numPoints, reset_debug, rotate, scale, select, set_debug, setComment, setConsole, setSyncRedrawFlag, setText, setTrafo, setVisible, showPoints, updateAttributes, writeAsResource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected java.awt.Image theImage
protected int aspectRatio
protected FullRedraw theCanvas
protected java.awt.image.ImageObserver theObserver
int sx1
int sy1
int sx2
int sy2
boolean has_error
boolean imageUpdateDebug
protected java.lang.String pathname
protected java.lang.String filetype
public static final int FIT_TO_WIDTH
public static final int FIT_TO_HEIGHT
public static final int KEEP_SELECTED_SIZE
Constructor Detail |
public FigImage(int x1, int y1, int x2, int y2, FigAttribs attribs, FigTrafo2D trafo, java.lang.String imageName)
The paint() method for the FigImage relies on the Java AWT. Therefore, only GIF and JPEG images are supported by now. Other images won't be loaded and displayed, but still we create the object and display the bounding box.
Note that the java.AWT functions load Images asynchronously!
imageName
- The URL-name (or pathname) for the Image to load.public FigImage()
Method Detail |
public void rebuild()
FigRectangle
rebuild
in interface FigObject
rebuild
in class FigRectangle
public void createRenderer()
createRenderer
in class FigRectangle
public java.lang.String getImageName()
public void setFilenameAndType(java.lang.String pathname, java.lang.String filetype)
public void getImageFromResource(java.lang.String name)
public void setImage(java.lang.String name, boolean preserve_aspect)
public void setImageName(java.lang.String name)
public void setImageAndFilename(java.lang.String name, java.lang.String pathname, java.lang.String filetype, boolean preserve_aspect)
public void setImage(java.awt.Image image)
public java.awt.Image getImage()
public void setObjectPainter(ObjectPainter canvas)
FigBaseobject
setObjectPainter
in interface FigObject
setObjectPainter
in class FigBaseobject
public void updateAspectRatio(int aspectRatio)
public FigObject copy()
FigRectangle
copy
in interface FigObject
copy
in class FigRectangle
public void paint(java.awt.Graphics g)
paint
in interface FigObject
paint
in class FigRectangle
public void paint(java.awt.Graphics g, FigTrafo2D trafo)
FigDrawable
paint
in interface FigObject
paint
in class FigRectangle
public boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
public void setRedraw(FullRedraw canvas)
public java.lang.String toString()
toString
in interface FigObject
toString
in class FigRectangle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |