Class PositionHolder


  • public class PositionHolder
    extends Object
    Контейнер позиций ячеек табличного документа.
    • Method Detail

      • getActualPictureSize

        public static PictureSize getActualPictureSize​(ReadOnlyFormat fmt,
                                                       boolean withoutScale)
        Get in-cell picture vertical alignment from instance of ReadOnlyFormat
        Parameters:
        fmt - - ReadOnlyFormat
        withoutScale - flag for ignore scale in picture size settings
        Returns:
        actual PictureSize
      • getOutputDeviceInfo

        public MoxelOutputDeviceInfo getOutputDeviceInfo()
        Get output device info
        Returns:
        output device info
      • getUnitsConverter

        public UnitsConverter getUnitsConverter()
        Get units converter
        Returns:
        units converter
      • getRowHeightPixel

        public int getRowHeightPixel​(int row)
        Get row height (in pixels)
        Parameters:
        row - - row index
        Returns:
        row height in pixels
      • getRowHeightUnit

        public int getRowHeightUnit​(int row)
        Получить высоту строки в юнитах
      • getRowPositionsUnit

        public void getRowPositionsUnit​(int startRow,
                                        int endRow,
                                        int[] positionsUnit)
        Получить позицию строк в юнитах.
        Parameters:
        startRow - - начальная строка.
        endRow - - конечная строка.
        positionsUnit - - массив позиций. В первый элемент будет помещена позиция начала начальной строки, во второй - позиция конца конечной строки.
      • getColPositionsUnit

        public void getColPositionsUnit​(Columns columns,
                                        int startCol,
                                        int endCol,
                                        int[] positionsUnit)
        Получить позиции колонок в юнитах.
        Parameters:
        columns - - колонки, для которых нужно получать.
        startCol - - начальная колонка.
        endCol - - конечная колонка.
        positionsUnit - - массив позиций. В первый элемент будет помещена позиция начала начальной колонки, во второй - позиция конца конечной колонки.
      • getColPositionsPixel

        public void getColPositionsPixel​(Columns columns,
                                         int startCol,
                                         int endCol,
                                         int[] positionsPixel)
        Получить позиции колонок в пикселях.
      • getEndPosition

        public SpreadsheetPoint getEndPosition​(SpreadsheetPoint startPoint,
                                               org.eclipse.swt.graphics.Point areaSizePixel)
        Получить позицию правого нижнего угла, если указанная точка выводится в верхнем левом углу.
        Parameters:
        startPoint - - точка, выводимая в верхнем левом углу.
        areaSizePixel - - размер области, для которой нужно рассчитать.
        Returns:
        координату, которая будет выводится в правом нижнем углу.
      • getRowAtPositionUnit

        public int getRowAtPositionUnit​(int offsetUnit,
                                        int[] restUnit)
        Get row at specified position
        Parameters:
        offsetUnit - - position (in units)
        restUnit - - rest units
        Returns:
        row index
      • getColumnAtPositionUnit

        public int getColumnAtPositionUnit​(Columns columns,
                                           int offsetUnit,
                                           int[] restUnit)
        Get column at specified position
        Parameters:
        columns - - column type
        offsetUnit - - position (in units)
        restUnit - - resdt units
        Returns:
        column index
      • getColumnAtPositionUnit

        public int getColumnAtPositionUnit​(Columns columns,
                                           int offsetUnit)
        Получить номер колонки в указанной позиции в юнитах.
      • getColumnAtPositionPixel

        public int getColumnAtPositionPixel​(Columns columns,
                                            int offsetPixel)
        Получить номер колонки в указанной позиции в пикселях.
      • getColumnWidthUnit

        public int getColumnWidthUnit​(Columns columns,
                                      int columnIndex)
        Получить ширину колонки.
      • getColumnWidthPixel

        public int getColumnWidthPixel​(Columns columns,
                                       int columnIndex)
        Получить ширину колонки в пикселях.
      • getSpreadsheetPointAtPosition

        public SpreadsheetPoint getSpreadsheetPointAtPosition​(int rowIndex,
                                                              int xUnit)
        Получить точку табличного документа для указаной строки и указанного смещения в юнитах.
      • skipRows

        public int skipRows​(int rowIndex,
                            int heightUnit,
                            boolean up)
        Пропусть столько строк, чтобы вместилось указанное количество унитов.
      • skipColumns

        public int skipColumns​(Columns columns,
                               int columnIndex,
                               int widthUnit,
                               boolean left)
        Пропусть столько колонок, чтобы вместилось указанное количество унитов.
      • clearRowHeightCache

        public void clearRowHeightCache()
        Clear cache
      • clearRowHeightCacheFormRow

        public void clearRowHeightCacheFormRow​(int row)
        Clear row height cache from specified row
        Parameters:
        row - - row index
      • clearCachedRowHeight

        public void clearCachedRowHeight​(int row)
        Clear height of specified row
        Parameters:
        row - - row index
      • moveCachedRowHeight

        public void moveCachedRowHeight​(int srcPos,
                                        int dstPos)
        Move cached row height
        Parameters:
        srcPos - - initial row index
        dstPos - - destination row index
      • getSheetPointPositionUnit

        public org.eclipse.swt.graphics.Point getSheetPointPositionUnit​(SpreadsheetPoint sheetPoint)
        Получить позицию точки табличного документа в unit.
      • getPositionForRectUnit

        public org.eclipse.swt.graphics.Rectangle getPositionForRectUnit​(SpreadsheetRect sheetRect)
        Получить поизцию в юнитах для прямоугольника табличного документа.
      • getSpreadsheetPointForPointInUnit

        public SpreadsheetPoint getSpreadsheetPointForPointInUnit​(int x,
                                                                  int y)
        Получить точку в координатах табличного документа по координатам в юнитах.
      • getSpreadsheetRectForRectInUnit

        public SpreadsheetRect getSpreadsheetRectForRectInUnit​(org.eclipse.swt.graphics.Rectangle rectUnit)
        Получить прямоугольник в координатах табличного документа по координатам в юнитах.
      • getRowTopPositionUnit

        public int getRowTopPositionUnit​(int row)
        Get position of specified row
        Parameters:
        row - - row index
        Returns:
        row top position (in units)
      • getColLeftPositionUnit

        public int getColLeftPositionUnit​(Columns columns,
                                          int column)
        Get position of specified column
        Parameters:
        columns - - column type
        column - - column index
        Returns:
        column left position (in units)
      • clearRowPositionCacheFromRow

        public void clearRowPositionCacheFromRow​(int row)
        Clear row positions cache, starting at specified row
        Parameters:
        row - - row index
      • clearRowPositionCache

        public void clearRowPositionCache()
        Clear row positions cache
      • clearColumnPositionCacheFromColumn

        public void clearColumnPositionCacheFromColumn​(Columns columns,
                                                       int column)
        Clear columns positions cahce for specified columns
        Parameters:
        columns - - columns type
        column - - column index
      • clearColumnPositionCache

        public void clearColumnPositionCache​(Columns columns)
        Clear columns positions cahce for specified columns
        Parameters:
        columns - - column type
      • clearColumnPositionCache

        public void clearColumnPositionCache()
        Clear columns positions cahce
      • getPictureRect

        public org.eclipse.swt.graphics.Rectangle getPictureRect​(org.eclipse.swt.graphics.Rectangle mergePixelRect,
                                                                 org.eclipse.swt.graphics.Rectangle cellRect,
                                                                 int[] crossAdditions)
        Get reactangle area of cell for paintng picture in it
        Parameters:
        mergePixelRect - - Rectangle, representing original cell's area, must not be null
        cellRect - - Rectangle, representing area taken by related Cell, must not be null
        crossAdditions - - optional buffer for placing used values of cross pixels to, may be null
        Returns:
        Rectangle, representing area for painting picture in, or null if cell is not contining picture or contains invalid picture
      • getTextRect

        public org.eclipse.swt.graphics.Rectangle getTextRect​(org.eclipse.swt.graphics.Rectangle mergePixelRect,
                                                              org.eclipse.swt.graphics.Rectangle cellRect,
                                                              org.eclipse.swt.graphics.Rectangle clipPixelRect)
        Get reactangle area of cell for paintng text in it and make corrections for cell's text clipping area
        Parameters:
        mergePixelRect - - Rectangle, representing original cell's area, must not be null
        cellRect - - Rectangle, representing area taken by related Cell, must not be null
        clipPixelRect - - Rectangle, representing cell's text clipping area, must not be null
        Returns:
        Rectangle, representing area for painting text in it, must not return null
      • getCellPictureSizePixels

        public org.eclipse.swt.graphics.Point getCellPictureSizePixels​(org.eclipse.swt.graphics.Rectangle mergePixelRect,
                                                                       org.eclipse.swt.graphics.Rectangle cellRect)
        Get size of in-cell picture size in pixels
        Parameters:
        mergePixelRect - - Rectangle, representing original cell's area, must not be null
        cellRect - - Rectangle, representing area taken by related Cell, must not be null
        Returns:
        Point, containing picture's horizontal and vertical size in pixels, must not return null
      • setDrawableAreaWidthPixel

        public void setDrawableAreaWidthPixel​(int width)
        Set drawable area width
        Parameters:
        width - width in pixels