Class MultiPositionData


  • public class MultiPositionData
    extends java.lang.Object
    The MultiPositionData class stores an array of numbers which is required in order to calculate display positions of ISO multi-part objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int Y_DIM
      Number of rows in the array.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getHeight​(int shapeID)
      Returns the total height for a multi-square image.
      int getWidth​(int shapeID)
      Returns the total width for a multi-square image.
      int getXOffset​(int shapeID, int positionID)
      Calculate the x-offset from the leftmost pixel of the big face image and the default x-position (The default position is where a single-square image would be put).
      int getYOffset​(int shapeID, int positionID)
      Calculate the y-offset from the topmost pixel of the big face image and the default y-position (The default position is where a single-square image would be put).
      void load​(@NotNull ErrorView errorView, @NotNull java.net.URL url)
      Load the array-data from file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiPositionData

        public MultiPositionData​(@NotNull
                                 @NotNull IsoMapSquareInfo isoMapSquareInfo)
        Creates a new instance.
        Parameters:
        isoMapSquareInfo - the iso square info to use
    • Method Detail

      • load

        public void load​(@NotNull
                         @NotNull ErrorView errorView,
                         @NotNull
                         @NotNull java.net.URL url)
        Load the array-data from file. An error is reported when the numbers in the file don't match expected array dimensions.
        Parameters:
        errorView - the error view for reporting errors
        url - the URL of the archdef file to read
      • getXOffset

        public int getXOffset​(int shapeID,
                              int positionID)
        Calculate the x-offset from the leftmost pixel of the big face image and the default x-position (The default position is where a single-square image would be put).
        Parameters:
        shapeID - ID number for the multi-square shape (-> rows in position data file)
        positionID - number of square in the big bunch
        Returns:
        x-offset
      • getYOffset

        public int getYOffset​(int shapeID,
                              int positionID)
        Calculate the y-offset from the topmost pixel of the big face image and the default y-position (The default position is where a single-square image would be put).
        Parameters:
        shapeID - ID number for the multi-square shape (-> rows in position data file)
        positionID - number of square in the big bunch
        Returns:
        y-offset
      • getWidth

        public int getWidth​(int shapeID)
        Returns the total width for a multi-square image.
        Parameters:
        shapeID - the shape ID
        Returns:
        the width in pixels
      • getHeight

        public int getHeight​(int shapeID)
        Returns the total height for a multi-square image.
        Parameters:
        shapeID - the shape ID
        Returns:
        the height in pixels