CH.ifa.draw.figures
Class ImageFigure
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractFigure
-
- CH.ifa.draw.figures.AttributeFigure
-
- CH.ifa.draw.figures.ImageFigure
-
- All Implemented Interfaces:
- Figure, Storable, java.awt.image.ImageObserver, java.io.Serializable, java.lang.Cloneable
public class ImageFigure extends AttributeFigure implements java.awt.image.ImageObserver
A Figure that shows an Image. Images shown by an image figure are shared by using the Iconkit.- See Also:
Iconkit, Serialized Form
-
-
Field Summary
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
-
-
Constructor Summary
Constructors Constructor and Description ImageFigure()ImageFigure(java.awt.Image image, java.lang.String fileName, java.awt.Point origin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidbasicDisplayBox(java.awt.Point origin, java.awt.Point corner)Sets the display box of a figure.java.awt.RectangledisplayBox()Gets the display box of a figure.voiddraw(java.awt.Graphics g)Draws the figure in the given graphics.java.util.Vectorhandles()Returns the handles of a Figure that can be used to manipulate some of its attributes.booleanimageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)Handles asynchroneous image updates.voidread(StorableInput dr)Reads the ImageFigure from a StorableInput.voidwrite(StorableOutput dw)Writes the ImageFigure to a StorableOutput.-
Methods inherited from class CH.ifa.draw.figures.AttributeFigure
getAttribute, getDefaultAttribute, getFillColor, getFrameColor, setAttribute
-
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, size, willChange
-
-
-
-
Constructor Detail
-
ImageFigure
public ImageFigure()
-
ImageFigure
public ImageFigure(java.awt.Image image, java.lang.String fileName, java.awt.Point origin)
-
-
Method Detail
-
basicDisplayBox
public void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)Description copied from class:AbstractFigureSets the display box of a figure. This is the method that subclassers override. Clients usually call displayBox.- Specified by:
basicDisplayBoxin interfaceFigure- Specified by:
basicDisplayBoxin classAbstractFigure- Parameters:
origin- the new origincorner- the new corner- See Also:
AbstractFigure.displayBox(java.awt.Point, java.awt.Point)
-
handles
public java.util.Vector handles()
Description copied from class:AbstractFigureReturns the handles of a Figure that can be used to manipulate some of its attributes.- Specified by:
handlesin interfaceFigure- Specified by:
handlesin classAbstractFigure- Returns:
- a Vector of handles
- See Also:
Handle
-
displayBox
public java.awt.Rectangle displayBox()
Description copied from class:AbstractFigureGets the display box of a figure.- Specified by:
displayBoxin interfaceFigure- Specified by:
displayBoxin classAbstractFigure- See Also:
Figure.basicDisplayBox(java.awt.Point, java.awt.Point)
-
draw
public void draw(java.awt.Graphics g)
Description copied from class:AttributeFigureDraws the figure in the given graphics. Draw is a template method calling drawBackground followed by drawFrame.- Specified by:
drawin interfaceFigure- Overrides:
drawin classAttributeFigure- Parameters:
g- the Graphics to draw into
-
imageUpdate
public boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)Handles asynchroneous image updates.- Specified by:
imageUpdatein interfacejava.awt.image.ImageObserver
-
write
public void write(StorableOutput dw)
Writes the ImageFigure to a StorableOutput. Only a reference to the image, that is its pathname is saved.- Specified by:
writein interfaceStorable- Overrides:
writein classAttributeFigure
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads the ImageFigure from a StorableInput. It registers the referenced figure to be loaded from the Iconkit.- Specified by:
readin interfaceStorable- Overrides:
readin classAttributeFigure- Throws:
java.io.IOException- See Also:
Iconkit.registerImage(java.lang.String)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG