Class ArrayDesignBlock

All Implemented Interfaces:
AccessControlled, Identifiable

public class ArrayDesignBlock extends ChildItem
Version:
2.0
Author:
Enell
Last modified
$Date: 2015-04-17 14:02:22 +0200 (fr, 17 apr 2015) $
  • Field Details

  • Constructor Details

  • Method Details

    • getNew

      static ArrayDesignBlock getNew(DbControl dc, ArrayDesign arrayDesign, BlockInfo blockInfo) throws BaseException
      Throws:
      BaseException
    • getById

      Get a ArrayDesignBlock object when you know the ID.
      Parameters:
      dc - The DbControl 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 found
      PermissionDeniedException - If the logged in user doesn't have read permission to the items
      BaseException - If there is another error
    • getQuery

      public static ItemQuery<ArrayDesignBlock> getQuery(ArrayDesign arrayDesign)
      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

      Description copied from class: BasicItem
      Get the BasicData object that holds all data for this item.
      Specified by:
      getData in class BasicItem
    • getType

      public 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 the Item enumeration.
      Returns:
      A value indicating the type of item
    • isUsed

      public boolean isUsed() throws BaseException
      Array design blocks are always used by an array design.
      Overrides:
      isUsed in class BasicItem
      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

      public Set<ItemProxy> getUsingItems() throws BaseException
      Get the array design this block is a part of.
      Overrides:
      getUsingItems in class BasicItem
      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

      void initPermissions(int granted, int denied) throws BaseException
      WRITE and DELETE permissions are always denied.
      Overrides:
      initPermissions in class ChildItem
      Parameters:
      granted - Permissions that have been granted by the subclass
      denied - Permissions that have been denied by the subclass
      Throws:
      BaseException - If the permissions couldn't be initialised
    • getSharedParent

      SharedData getSharedParent()
      Description copied from class: ChildItem
      Get the shareable parent item of this child item. This is used by the ChildItem.initPermissions(int, int) method to calculate the logged in user's permissions for the child item.
      Specified by:
      getSharedParent in class ChildItem
      Returns:
      The parent item
    • getArrayDesign

      public ArrayDesign getArrayDesign() throws PermissionDeniedException, BaseException
      Get the ArrayDesign that is linked with this block.
      Returns:
      An ArrayDesign item
      Throws:
      PermissionDeniedException - If the logged in user doesn't have read permission to the item
      BaseException - This exception is thrown if there is another error
    • setArrayDesign

      private void setArrayDesign(ArrayDesign arrayDesign) throws InvalidDataException
      Set the ArrayDesign 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

      private void setMetaGrid(int metaGridX, int metaGridY) throws InvalidDataException
      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

      private void setBlockNumber(int blockNumber) throws InvalidDataException
      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

      public void setBlockSizeX(int blockSizeX) throws InvalidDataException
      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

      public void setBlockSizeY(int blockSizeY) throws InvalidDataException
      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

      public void setOriginX(int originX) throws InvalidDataException
      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

      public void setOriginY(int originY) throws InvalidDataException
      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

      public void setSpacingX(int spacingX) throws InvalidDataException
      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

      public void setSpacingY(int spacingY) throws InvalidDataException
      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

      public void setFeatureDiameter(int diameter) throws InvalidDataException
      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 this ArrayDesignBlock has any features.
      Returns:
      TRUE if the AraryDesignBlock has any fetures