|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdox.edit.Element
cdox.edit.ImageElement
This class represents an element that is contained within a document. An ImageElement can contain an Image as data.
Field Summary |
Fields inherited from class cdox.edit.Element |
cachedImage, cover, dashed, diagonalResizeRect, elementSize, flipHorizontal, flipVertical, horizontalResizeRect, position, quality, ratioX, ratioY, rotateBy, verticalResizeRect |
Constructor Summary | |
ImageElement(java.awt.Point pos,
java.awt.Dimension size,
java.lang.String imageSource,
Cover c)
Constructs a new ImageElement with a scaledImage at position pos. |
Method Summary | |
protected java.awt.image.BufferedImage |
getBufferedImage()
This method returns a bufferedImage. |
java.awt.image.BufferedImage |
getCurrentImage()
Returns the Original image with applied filters etc. |
java.lang.String |
getKey()
Returns the current key used to load the image of disk. |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor f)
Returns the scaled instance of the original Image. |
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor f)
|
void |
resetImage()
This method can be called to set the original image to null, and than call the garbageCollector. |
void |
resetOldImage(java.lang.String key)
Resets the oldImage to the image represented by the given key. |
protected void |
saveMyself(org.w3c.dom.Element root,
java.util.zip.ZipOutputStream out)
This method saves its data in the given parameters. |
void |
setPaintImage(java.awt.image.BufferedImage bi)
This method sets the filteredImage to this ImageElement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ImageElement(java.awt.Point pos, java.awt.Dimension size, java.lang.String imageSource, Cover c) throws java.io.IOException
pos
- the position.size
- the size.imageSource
- the ID that can be used to get the image from the TempFiles
class.c
- the cover which contains this image (used for calculating acpect ratio)
java.io.IOException
- if an error occurs.Method Detail |
public void setPaintImage(java.awt.image.BufferedImage bi)
bi
- the filtered BufferedImage to be drawnImageDialog.run()
public java.lang.String getKey()
public void resetOldImage(java.lang.String key)
key
- the key of the oldFile.BackgroundEditAction.undo()
,
BackgroundEditAction.redo()
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor f)
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor f)
f
- the kind of data which represent an image
EditAction.actionPerformed(java.awt.event.ActionEvent)
public java.awt.image.BufferedImage getCurrentImage()
getBufferedImage()
,
ImageDialog
protected java.awt.image.BufferedImage getBufferedImage()
getBufferedImage
in class Element
public void resetImage()
protected void saveMyself(org.w3c.dom.Element root, java.util.zip.ZipOutputStream out) throws java.io.IOException
Element
saveMyself
in class Element
root
- the root element to append the child to.out
- the ZipOutputStream to write any files to.
java.io.IOException
- if writing into the ZipStream failed.Element.appendChild(org.w3c.dom.Element, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |