Package net.sf.basedb.core
Class ArrayDesignBlock
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.ChildItem
net.sf.basedb.core.ArrayDesignBlock
- All Implemented Interfaces:
AccessControlled
,Identifiable
- Version:
- 2.0
- Author:
- Enell
- Last modified
- $Date: 2015-04-17 14:02:22 +0200 (fr, 17 apr 2015) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet theArrayDesign
that is linked with this block.int
Get the block number of this block.int
Get the number of columns in this block.int
Get the number of rows in this block.static ArrayDesignBlock
Get aArrayDesignBlock
object when you know the ID.(package private) ArrayDesignBlockData
getData()
Get theBasicData
object that holds all data for this item.int
Get the expected diameter of spots on the slide.int
Get the column coordinate of this block.int
Get the row coordinate of this block.(package private) static ArrayDesignBlock
getNew
(DbControl dc, ArrayDesign arrayDesign, BlockInfo blockInfo) int
Get the distance from the left edge of the slide to the top left spot in the block.int
Get the distance from the top edge of the slide to the top left spot in the block.static ItemQuery<ArrayDesignBlock>
getQuery
(ArrayDesign arrayDesign) Get a query configured to retrieve array design blocks for the specified array design.(package private) SharedData
Get the shareable parent item of this child item.int
Get the x spacing between the spots in the slide.int
Get the y spacing between the spots in the slide.getType()
Get the type of item represented by the object.Get the array design this block is a part of.boolean
Checks if thisArrayDesignBlock
has any features.(package private) void
initPermissions
(int granted, int denied) WRITE and DELETE permissions are always denied.boolean
isUsed()
Array design blocks are always used by an array design.private void
setArrayDesign
(ArrayDesign arrayDesign) Set theArrayDesign
for this block.private void
setBlockNumber
(int blockNumber) Set the block number of this block.void
setBlockSizeX
(int blockSizeX) Set the number of columns in this block.void
setBlockSizeY
(int blockSizeY) Set the number of rows in this block.void
setFeatureDiameter
(int diameter) Set the expected diameter of spots on the slide.private void
setMetaGrid
(int metaGridX, int metaGridY) Set the metagrid coordinates.void
setOriginX
(int originX) Set the distance from the left edge of the slide to the top left spot in this block.void
setOriginY
(int originY) Set the distance from the top edge of the slide to the top left spot in this block.void
setSpacingX
(int spacingX) Set the x spacing between the spots in the slide.void
setSpacingY
(int spacingY) Set the y spacing between the spots in the slide.Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
-
Constructor Details
-
ArrayDesignBlock
ArrayDesignBlock(ArrayDesignBlockData data)
-
-
Method Details
-
getNew
static ArrayDesignBlock getNew(DbControl dc, ArrayDesign arrayDesign, BlockInfo blockInfo) throws BaseException - Throws:
BaseException
-
getById
public static ArrayDesignBlock getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aArrayDesignBlock
object when you know the ID.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The ID of the item to load- Returns:
- The
ArrayDesignBlock
item - Throws:
ItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have read permission to the itemsBaseException
- If there is another error
-
getQuery
Get a query configured to retrieve array design blocks for the specified array design.- Parameters:
arrayDesign
- The array design to retreive blocks for, null is not allowed- Returns:
- An
ItemQuery
object
-
getData
ArrayDesignBlockData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item. -
getType
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Returns:
- A value indicating the type of item
-
isUsed
Array design blocks are always used by an array design.- Overrides:
isUsed
in classBasicItem
- Returns:
- TRUE if this item is used, FALSE otherwise
- Throws:
BaseException
- If not able to tell if item is used or not.- See Also:
-
getUsingItems
Get the array design this block is a part of.- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- Throws:
BaseException
- If there is an error loading the items- Since:
- 2.2
- See Also:
-
initPermissions
WRITE and DELETE permissions are always denied.- Overrides:
initPermissions
in classChildItem
- Parameters:
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass- Throws:
BaseException
- If the permissions couldn't be initialised
-
getArrayDesign
Get theArrayDesign
that is linked with this block.- Returns:
- An
ArrayDesign
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- This exception is thrown if there is another error
-
setArrayDesign
Set theArrayDesign
for this block.- Throws:
InvalidDataException
-
getMetaGridX
public int getMetaGridX()Get the column coordinate of this block.- Returns:
- the column coordinate
-
getMetaGridY
public int getMetaGridY()Get the row coordinate of this block.- Returns:
- the row coordinate
-
setMetaGrid
Set the metagrid coordinates. If the coordinates are unknown the both should be set to 0 otherwise the coordinates must be greater then 0.- Parameters:
metaGridX
- the column coordinate- Throws:
InvalidDataException
-
getBlockNumber
public int getBlockNumber()Get the block number of this block.- Returns:
- The number of this block.
-
setBlockNumber
Set the block number of this block.- Parameters:
blockNumber
- the block number of this block- Throws:
InvalidDataException
- if the blocknumber is less then 1
-
getBlockSizeX
public int getBlockSizeX()Get the number of columns in this block.- Returns:
- the number of columns in this block.
-
setBlockSizeX
Set the number of columns in this block. Must be greater then 0.- Parameters:
blockSizeX
- the number of rows in this block.- Throws:
InvalidDataException
- if blockSizeX is less then 1
-
getBlockSizeY
public int getBlockSizeY()Get the number of rows in this block.- Returns:
- the number of rows in this block
-
setBlockSizeY
Set the number of rows in this block. Must be greater then 0.- Parameters:
blockSizeY
- the number of columns in this block.- Throws:
InvalidDataException
- if blockSizeY is less then 1
-
getOriginX
public int getOriginX()Get the distance from the left edge of the slide to the top left spot in the block.- Returns:
- the distance from the edge
-
setOriginX
Set the distance from the left edge of the slide to the top left spot in this block.- Parameters:
originX
- the distance from the edge- Throws:
InvalidDataException
- if originX is less then 0
-
getOriginY
public int getOriginY()Get the distance from the top edge of the slide to the top left spot in the block.- Returns:
- the distance from the edge
-
setOriginY
Set the distance from the top edge of the slide to the top left spot in this block.- Parameters:
originY
- the distance from the edge- Throws:
InvalidDataException
- if originY is less then 0
-
getSpacingX
public int getSpacingX()Get the x spacing between the spots in the slide.- Returns:
- the spacing between the spots
-
setSpacingX
Set the x spacing between the spots in the slide.- Parameters:
spacingX
- the spacing between the spots- Throws:
InvalidDataException
- if spacingX is less then 0
-
getSpacingY
public int getSpacingY()Get the y spacing between the spots in the slide.- Returns:
- the spacing between the spots
-
setSpacingY
Set the y spacing between the spots in the slide.- Parameters:
spacingY
- the spacing between the spots- Throws:
InvalidDataException
- if spacingY is less then 0
-
getFeatureDiameter
public int getFeatureDiameter()Get the expected diameter of spots on the slide.- Returns:
- The expected diameter.
- Since:
- 2.7
-
setFeatureDiameter
Set the expected diameter of spots on the slide.- Parameters:
diameter
- The expected diameter- Throws:
InvalidDataException
- If the diameter is less then 0
-
hasFeatures
public boolean hasFeatures()Checks if thisArrayDesignBlock
has any features.- Returns:
- TRUE if the AraryDesignBlock has any fetures
-