Package com._1c.g5.v8.dt.moxel.util
Class MoxelUtil
- java.lang.Object
- 
- com._1c.g5.v8.dt.moxel.util.MoxelUtil
 
- 
 public final class MoxelUtil extends Object Утилиты табличного документа.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringDEFAULT_LANGUAGE
 - 
Constructor SummaryConstructors Constructor Description MoxelUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyCellProperties(Cell srcCell, int cellProperties, Cell dstCell)Применить свойства ячейки к ячейке.static FontapplyFontProperties(Font font, Font fontToApply, int fontMask)Применить свойства к ширфту.static voidapplyFormat(ReadOnlyFormat src, Format dst)Применить формат формату.static voidapplyFormatByMask(ReadOnlyFormat src, long propertiesMask, Format dst)Apply format properties by properties maskstatic voidapplyFormatProperties(ReadOnlyFormat src, long propertiesMask, Format dst)Применить свойства, указанные в маске.static intcompareCells(Cell cell1, Cell cell2, int propertiesToCompare)Compare cellsstatic intcompareFonts(Font font1, Font font2, int fontMask)Сравнить шрифты.static longcompareFormats(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask)Сравнить форматы.static booleancompareLocalStrings(LocalString string1, LocalString string2)Compare two instances ofLocalString.static ColumnscreateColumns()Создать колонки.static ColumnscreateColumnsCopy(Columns columns)Создать копию колонок.static SpreadsheetDocumentcreateEmbeddedSpreadsheetDocument()Создать встраиваемый табличный документ.static LanguageSettingscreateLanguageSettings(IV8Project project)Creates language settings for respective project.static RectcreateRect(int left, int top, int width, int height)Создать прямоугольник.static SpreadsheetDocumentcreateSpreadsheetDocument()Создать табличный документ.static SpreadsheetPointcreateSpreadsheetPoint()Создать точку.static SpreadsheetRectcreateSpreadsheetRect()Создать прямоугольник.static intfillGroups(SpreadsheetDocument sheet, List<com._1c.g5.v8.dt.moxel.util.GroupInfo> allGroups, boolean rowGroups)Fill spreadsheet document's groups structure.static CellgetCell(SpreadsheetDocument document, int rowIndex, int columnIndex)Get document cell.static intgetCellLineIndex(SpreadsheetDocument document, CellLine line)Get index of CellLinestatic intgetColorIndex(SpreadsheetDocument sheet, Color color)static intgetDrawingLineIndex(SpreadsheetDocument document, DrawingLine line)Get index of DrawingLinestatic ReadOnlyFormatgetFormatByKey(SpreadsheetDocument document, int formatIndex)Get format by key.static intgetHorizontalSize(SpreadsheetDocument document, int rowIndex)Get document horizontal size for specified row.static intgetPictureIndex(SpreadsheetDocument sheet, Picture picture)Get picture indexstatic ColumnsgetRowColumns(SpreadsheetDocument document, int rowIndex)Get row columns.static RowgetRowContent(SpreadsheetDocument document, int rowIndex)Get row content.static longgetSettedProperties(ReadOnlyFormat format)Получить маску установленных в формате свойств.static SpreadsheetRectgetShiftedCommentDrawingPosition(CommentDrawing commentDrawing)Получить позицию рисунка примечания.static booleanisCellWithoutProperties(Cell cell)static booleanisEmbedded(SpreadsheetDocument document)Проверить, является ли документ встроенным.static booleanisEmptyFormat(Format format)Проверить, пустой ли формат.static booleanisEmptyFormat(ReadOnlyFormat format)Проверить, пустой ли формат.static booleanisEmptyString(LocalString string)Check ifLocalStringis empty.static booleanisEmptyViewSettings(ViewSettings viewSettings)Check if view settings are emptystatic booleanisFontBooleanPropertySet(Font font, int fontMask, int fontProperty)Проверить, установлено ли свойство шрифта.static CelllookupCell(SpreadsheetDocument document, int rowIndex, int columnIndex)Lookup for cell in spreadsheet document.static CellsheetCellApply(Cell srcCell, Cell dstCell, int cellPropertiesMask, boolean onlyUnassigned)Apply cell properties
 
- 
- 
- 
Field Detail- 
DEFAULT_LANGUAGEpublic static final String DEFAULT_LANGUAGE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createLanguageSettingspublic static LanguageSettings createLanguageSettings(IV8Project project) Creates language settings for respective project.- Parameters:
- project-- IV8Project, must not be- null
- Returns:
- created LanguageSettings, nevernull
 
 - 
createSpreadsheetPointpublic static SpreadsheetPoint createSpreadsheetPoint() Создать точку.
 - 
createSpreadsheetRectpublic static SpreadsheetRect createSpreadsheetRect() Создать прямоугольник.
 - 
createRectpublic static Rect createRect(int left, int top, int width, int height) Создать прямоугольник.
 - 
createSpreadsheetDocumentpublic static SpreadsheetDocument createSpreadsheetDocument() Создать табличный документ.
 - 
createEmbeddedSpreadsheetDocumentpublic static SpreadsheetDocument createEmbeddedSpreadsheetDocument() Создать встраиваемый табличный документ.
 - 
createColumnspublic static Columns createColumns() Создать колонки.
 - 
getColorIndexpublic static int getColorIndex(SpreadsheetDocument sheet, Color color) 
 - 
getPictureIndexpublic static int getPictureIndex(SpreadsheetDocument sheet, Picture picture) Get picture index- Parameters:
- sheet- -- SpreadsheetDocument
- picture- -- Picture
 
 - 
applyFormatpublic static void applyFormat(ReadOnlyFormat src, Format dst) Применить формат формату. При этом из источника в приемник копируются только те свойства, которые установлены в источнике.- Parameters:
- src- - формат - источник.
- dst- - формат - приемник.
 
 - 
applyFormatPropertiespublic static void applyFormatProperties(ReadOnlyFormat src, long propertiesMask, Format dst) Применить свойства, указанные в маске. Если свойство в маске указано, но свойство в исходном формате не установлено, то в результирующем формате свойство удаляется.- Parameters:
- propertiesMask- - составляется из FormatProperties.
 
 - 
applyFormatByMaskpublic static void applyFormatByMask(ReadOnlyFormat src, long propertiesMask, Format dst) Apply format properties by properties mask- Parameters:
- src- -- ReadOnlyFormat- source format
- propertiesMask- - properties mask
- dst- -- Format- destination format
 
 - 
compareFormatspublic static long compareFormats(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask) Сравнить форматы.- Parameters:
- propertiesMask- - свойства, которые нужно сравнивать.
- Returns:
- маска, каждый бит в которой указывает одинаковые значения. Единица в бите означает, что свойства одинаковые.
 
 - 
getSettedPropertiespublic static long getSettedProperties(ReadOnlyFormat format) Получить маску установленных в формате свойств.- Returns:
- маска установленных свойств. 1 соответствует установленному свойству, 0 - не установленному.
 
 - 
isEmptyFormatpublic static boolean isEmptyFormat(Format format) Проверить, пустой ли формат.
 - 
isEmbeddedpublic static boolean isEmbedded(SpreadsheetDocument document) Проверить, является ли документ встроенным.
 - 
isEmptyFormatpublic static boolean isEmptyFormat(ReadOnlyFormat format) Проверить, пустой ли формат.
 - 
isCellWithoutPropertiespublic static boolean isCellWithoutProperties(Cell cell) 
 - 
applyCellPropertiespublic static void applyCellProperties(Cell srcCell, int cellProperties, Cell dstCell) Применить свойства ячейки к ячейке.- Parameters:
- srcCell- - ячейка, формат которой нужно применить.
- cellProperties- - маска свойств.
- dstCell- - ячейка, к которой нужно применить свойства.
 
 - 
isEmptyViewSettingspublic static boolean isEmptyViewSettings(ViewSettings viewSettings) Check if view settings are empty- Parameters:
- viewSettings- -- ViewSettings
- Returns:
- check result
 
 - 
compareCellspublic static int compareCells(Cell cell1, Cell cell2, int propertiesToCompare) Compare cells- Parameters:
- cell1- - first cell to compare
- cell2- - second cell to compare
- propertiesToCompare- - properties to compare(mask)
- Returns:
- result of compare(mask)
 
 - 
getShiftedCommentDrawingPositionpublic static SpreadsheetRect getShiftedCommentDrawingPosition(CommentDrawing commentDrawing) Получить позицию рисунка примечания.
 - 
compareFontspublic static int compareFonts(Font font1, Font font2, int fontMask) Сравнить шрифты.- Parameters:
- fontMask- - исходная маска составляется из перечисления FontProperties.
- Returns:
- маска, каждый бит в которой указывает одинаковые значения. Единица в бите означает, что свойства одинаковые.
 
 - 
applyFontPropertiespublic static Font applyFontProperties(Font font, Font fontToApply, int fontMask) Применить свойства к ширфту.- Parameters:
- font- - исходный шрифт, к которому выполняется применение.
- fontToApply- - шрифт, который применяется.
- fontMask- - применяемые свойства. Составляется из FontProperties.
- Returns:
- - новый шрифт.
 
 - 
isFontBooleanPropertySetpublic static boolean isFontBooleanPropertySet(Font font, int fontMask, int fontProperty) Проверить, установлено ли свойство шрифта. Например, устанолена ли жирность.
 - 
getCellLineIndexpublic static int getCellLineIndex(SpreadsheetDocument document, CellLine line) Get index of CellLine- Parameters:
- document- -- SpreadsheetDocument
- line- -- CellLine
- Returns:
- line index
 
 - 
getDrawingLineIndexpublic static int getDrawingLineIndex(SpreadsheetDocument document, DrawingLine line) Get index of DrawingLine- Parameters:
- document- -- SpreadsheetDocument
- line- -- DrawingLine
- Returns:
- line index
 
 - 
sheetCellApplypublic static Cell sheetCellApply(Cell srcCell, Cell dstCell, int cellPropertiesMask, boolean onlyUnassigned) Apply cell properties- Parameters:
- srcCell- source cell
- dstCell- destination cell
- cellPropertiesMask- properties mask
- onlyUnassigned- set only unassigned properties
- Returns:
- result cell
 
 - 
compareLocalStringspublic static boolean compareLocalStrings(LocalString string1, LocalString string2) Compare two instances ofLocalString.- Parameters:
- string1- first string to compare. Must not be- null.
- string2- second string to compare. Must not be- null.
- Returns:
- trueif strings are equal,- falseotherwise.
 
 - 
isEmptyStringpublic static boolean isEmptyString(LocalString string) Check ifLocalStringis empty.- Parameters:
- string-- LocalString, may be- null
- Returns:
- trueif local string is empty,- falseotherwise
 
 - 
lookupCellpublic static Cell lookupCell(SpreadsheetDocument document, int rowIndex, int columnIndex) Lookup for cell in spreadsheet document.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- rowIndex- row index
- columnIndex- column index
- Returns:
- Cellif cell exists,- nullotherwise
 
 - 
getHorizontalSizepublic static int getHorizontalSize(SpreadsheetDocument document, int rowIndex) Get document horizontal size for specified row.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- rowIndex- row index
- Returns:
- document horizontal size for specified row
 
 - 
getRowColumnspublic static Columns getRowColumns(SpreadsheetDocument document, int rowIndex) Get row columns.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- rowIndex- row index
- Returns:
- Columns, never- null
 
 - 
getCellpublic static Cell getCell(SpreadsheetDocument document, int rowIndex, int columnIndex) Get document cell. If cell does not exist, create it.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- rowIndex- row index
- columnIndex- column index
- Returns:
- Cell, never- null
 
 - 
getRowContentpublic static Row getRowContent(SpreadsheetDocument document, int rowIndex) Get row content. If row does not exist, create it.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- rowIndex- row index
- Returns:
- Row, never- null
 
 - 
getFormatByKeypublic static ReadOnlyFormat getFormatByKey(SpreadsheetDocument document, int formatIndex) Get format by key.- Parameters:
- document-- SpreadsheetDocument, must not be- null
- formatIndex- format key
- Returns:
- ReadOnlyFormat, neer- null
 
 - 
fillGroupspublic static int fillGroups(SpreadsheetDocument sheet, List<com._1c.g5.v8.dt.moxel.util.GroupInfo> allGroups, boolean rowGroups) Fill spreadsheet document's groups structure.- Parameters:
- sheet-- SpreadsheetDocument, must- NotActiveExceptionbe- null
- allGroups- array of- GroupInfoto fill, must not be- null
- rowGroups- determines whether rows or columns groups structure is filled.
- Returns:
- max group depth
 
 
- 
 
-