|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.ChildItem<ImageData> net.sf.basedb.core.Image
public class Image
An image represents a single image produced by a Scan
.
The images are usually analysed by some software to produce
a RawBioAssay
.
Nested Class Summary | |
---|---|
static class |
Image.Format
This enumeration is used to indicate the type of image. |
Field Summary | |
---|---|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has generic read permission to scans. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
Image(ImageData data)
|
Method Summary | |
---|---|
static Image |
getById(DbControl dc,
int id)
Get an Image item when you know the id. |
String |
getDescription()
Get the description for the item. |
File |
getFile()
Get the file that is attached to the item. |
Image.Format |
getFormat()
Get the format of this image. |
String |
getName()
Get the name of the item. |
static Image |
getNew(DbControl dc,
Scan scan)
Create a new Image item. |
static ItemQuery<Image> |
getQuery(Scan scan)
Get a query configured to retrieve images for the specified scan. |
Scan |
getScan()
Get the scan this image belongs to. |
(package private) SharedData |
getSharedParent()
Get the shareable parent item of this child item. |
Item |
getType()
Get the type of item represented by the object. |
boolean |
isPreview()
A boolean value indicating if this image is a preview image or the full-sized image. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
void |
setDescription(String description)
Set the description for the item. |
void |
setFile(File file)
Attach a file to the item. |
void |
setFormat(Image.Format format)
Set the format of the image. |
void |
setName(String name)
Set the name of the item. |
void |
setPreview(boolean preview)
Set a flag indicating if this image is a preview image or the full-sized image. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
(package private) void |
setScan(Scan scan)
Set the scan this image belongs to. |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
public static final Item TYPE
Item.IMAGE
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
Constructor Detail |
---|
Image(ImageData data)
Method Detail |
---|
public static Image getNew(DbControl dc, Scan scan) throws BaseException
Image
item.
dc
- The DbControl
which will be used for
permission checking and database accessscan
- The Scan
which the image is related to
Image
item
BaseException
- If there is an errorScan.newImage()
public static Image getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Image
item when you know the id.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to load
Image
item
ItemNotFoundException
- If an item with the specified
id is not found
PermissionDeniedException
- If the logged in user doesn't
have read permission to the item
BaseException
- If there is another errorpublic static ItemQuery<Image> getQuery(Scan scan) throws BaseException
scan
- The scan to retreive images for, null is allowed if
the logged in user has generic READ permission for scans in which case
all images will be returned
ItemQuery
object
BaseException
- If getting the query fails.Scan.getImages()
public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.
setDescription
in interface Nameable
description
- The new description for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
isRemoved
in interface Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic File getFile() throws PermissionDeniedException, BaseException
FileAttachable
getFile
in interface FileAttachable
File
item, or null if no file is attached
PermissionDeniedException
- If the logged in user doesn't have
read permission for the file
BaseException
- If there is another errorpublic void setFile(File file) throws PermissionDeniedException
FileAttachable
setFile
in interface FileAttachable
file
- The file to attach to the item
PermissionDeniedException
- If the logged in user doesn't
have use permission for the file or write permission for the
itemSharedData getSharedParent()
ChildItem
ChildItem.initPermissions(int, int)
method to calculate
the logged in user's permissions for the child item.
getSharedParent
in class ChildItem<ImageData>
public Scan getScan() throws PermissionDeniedException, BaseException
Scan
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission
BaseException
- If there is another errorvoid setScan(Scan scan) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the scan is null
PermissionDeniedException
public boolean isPreview()
public void setPreview(boolean preview) throws PermissionDeniedException
preview
- TRUE if the image is a preview image, FALSE otherwise
PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic Image.Format getFormat()
Format
objectpublic void setFormat(Image.Format format) throws PermissionDeniedException
format
- The format
PermissionDeniedException
- If the logged in user doesn't have
write permission
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |