public class Photo extends Media implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
CLOCKWISE
|
static int |
COUNTER_CLOCKWISE
|
protected java.util.HashMap<java.lang.String,java.awt.Point[]>
|
persons
|
Constructor and Description |
---|
Photo(java.lang.String name,
java.lang.String path)
Construct a Photo with a name and a path to a file
|
Photo(java.lang.String name,
java.lang.String path,
boolean refresh)
Construct a Photo with a name, a path to a file, and a boolean saying
if
the photo has to be refreshed
|
Modifier and Type | Method and Description |
---|---|
void |
crop(java.awt.Point[] currentSel)
Crop the picture according to the given points
|
java.util.HashMap<java.lang.String,java.awt.Point[]>
|
getPersons()
Get the list of persons displayed on the photo
|
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Print the photo on the screen
|
void |
resize(int newWidth)
Resize the picture according to the given width
|
void |
rotate(int rotateDirection)
Rotate a picture and save it as the current media's image
|
void |
setPersons(java.util.HashMap<java.lang.String,java.awt.Point[]> persons)
Set the list of persons displayed on the photo
|
void |
tagPerson(java.lang.String name,
java.awt.Point[] currentSel) |
void |
toBlur()
Blur the image
|
void |
toBW()
Color the image to black and white
|
void |
toSepia()
Color the image to sepia
|
getEntry, getImage, isModified,
reloadImage,
saveBufImage,
setEntry,
setMediaSource,
setMediaSource,
tmpSaveImage
delete,
downloadTags,
getDescription,
getGeoLocation,
getId, getResourcePath,
getSerialEntry,
getStatus,
getTags, getThumbnailPath,
getTitle,
resetTags,
save, save,
setDescription,
setGeoLocation,
setId,
setResourcePath,
setSerialEntry,
setStatus,
setTags,
setThumbnailPath,
setTitle,
setTitle
public static final int CLOCKWISE
public static final int COUNTER_CLOCKWISE
protected java.util.HashMap<java.lang.String,java.awt.Point[]> persons
public Photo(java.lang.String name, java.lang.String path) throws java.net.URISyntaxException
name
- name of the photopath
- path to the photo filejava.net.URISyntaxException
public Photo(java.lang.String name, java.lang.String path, boolean refresh) throws java.net.URISyntaxException
name
- name of the photopath
- path to the filerefresh
- the photo has to be refreshedjava.net.URISyntaxException
public java.util.HashMap<java.lang.String,java.awt.Point[]> getPersons()
public void setPersons(java.util.HashMap<java.lang.String,java.awt.Point[]> persons)
persons
- list of personspublic void rotate(int rotateDirection)
rotateDirection
- direction to rotate the image, Photo.CLOCKWISE or
Photo.COUNTER_CLOCKWISE.
public void resize(int newWidth)
newWidth
- the desired width for the picturepublic void tagPerson(java.lang.String name, java.awt.Point[] currentSel)
public void crop(java.awt.Point[] currentSel)
Point
- points for the new imagepublic int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex) throws java.awt.print.PrinterException
graphics
- graphics where to drawpageFormat
- format of the pagepageIndex
- index in the pagejava.awt.print.PrinterException
public void toSepia()
public void toBW()
public void toBlur()