org.jhotdraw.draw
Interface ImageHolderFigure
-
- All Superinterfaces:
- java.lang.Cloneable, Figure, java.io.Serializable
- All Known Implementing Classes:
- ImageFigure, SVGImageFigure
public interface ImageHolderFigure extends Figure
The interface of aFigurewhich has some editable image contents.The
ImageToolcan be used to create figures which implement this interface.
Design PatternsPrototype
The image tool creates new figures by cloning a prototype figure object. That's the reason whyFigureextends theCloneableinterface.
Prototype:ImageHolderFigure; Client:ImageTool.Prototype
The image input format creates new image holder figures by cloning a prototype figure object and assigning an image to it, which was read from data input. That's the reason whyFigureextends theCloneableinterface.
Prototype:ImageHolderFigure; Client:ImageInputFormat.
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.awt.image.BufferedImagegetBufferedImage()Gets the buffered image from the figure.byte[]getImageData()Gets the image data.voidloadImage(java.io.File f)Loads an image from a File.voidloadImage(java.io.InputStream in)Loads an image from an Input Stream.voidsetBufferedImage(java.awt.image.BufferedImage image)Sets the buffered image for the figure.voidsetImage(byte[] imageData, java.awt.image.BufferedImage bufferedImage)Sets the image.-
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addNotify, addPropertyChangeListener, changed, clone, contains, createHandles, draw, findCompatibleConnector, findConnector, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, restoreTransformTo, set, setBounds, transform, willChange
-
-
-
-
Method Detail
-
loadImage
void loadImage(java.io.File f) throws java.io.IOExceptionLoads an image from a File. By convention this method is never invoked on the AWT Event Dispatcher Thread.- Throws:
java.io.IOException
-
loadImage
void loadImage(java.io.InputStream in) throws java.io.IOExceptionLoads an image from an Input Stream. By convention this method is never invoked on the AWT Event Dispatcher Thread.- Throws:
java.io.IOException
-
getBufferedImage
@Nullable java.awt.image.BufferedImage getBufferedImage()
Gets the buffered image from the figure.
-
setBufferedImage
void setBufferedImage(@Nullable java.awt.image.BufferedImage image)
Sets the buffered image for the figure.
-
setImage
void setImage(@Nullable byte[] imageData, @Nullable java.awt.image.BufferedImage bufferedImage) throws java.io.IOException
Sets the image.- Parameters:
imageData- The image data. If this is null, a buffered image must be provided.bufferedImage- An image constructed from the imageData. If this is null, imageData must be provided.- Throws:
java.io.IOException
-
getImageData
@Nullable byte[] getImageData()
Gets the image data.- Returns:
- imageData The image data, or null, if the ImageHolderFigure does not have an image.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG