Package com._1c.g5.v8.dt.moxel.ui.editor
Class DrawUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.moxel.ui.editor.DrawUtils
-
public class DrawUtils extends Object
Drawing utils class
-
-
Field Summary
Fields Modifier and Type Field Description static int
SELECTION_BORDER_WIDTH
Толщина рамки выделения.
-
Constructor Summary
Constructors Constructor Description DrawUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
drawBorder(org.eclipse.swt.graphics.GC gc, int x1, int y1, int x2, int y2, CellLine line, Color borderColor)
Вывести линию.static void
drawDropSelection(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle selectionRectanglePixel, boolean[] sides)
Paint selection with 'drag selection' style.static void
drawHorizontalCellBorder(org.eclipse.swt.graphics.ImageData imageData, int x1, int x2, int y, CellLine line, Color borderColor)
Draw horizontal cell borderstatic void
drawSelection(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle selectionRectanglePixel, boolean[] sides)
Отрисовать выделение.static void
drawString(org.eclipse.swt.graphics.GC gc, Font font, String text, int x, int y, int angle)
Вывести строку.static org.eclipse.swt.graphics.Rectangle
drawText(org.eclipse.swt.graphics.GC gc, MoxelOutputDeviceInfo outputDeviceInfo, Font font, String text, org.eclipse.swt.graphics.Rectangle startRect, HorizontalAlignment align, int iangle, boolean mesureOnly, boolean noWrap, int indent, boolean calcHeight, UnitsConverter unitsConverter)
Вывести текст.static void
drawVerticalCellBorder(org.eclipse.swt.graphics.ImageData imageData, int x, int y1, int y2, CellLine line, Color borderColor)
Draw vertical cell borderstatic Color
getActiveCellSelectionColor(Color activeColor)
Get active cell selection color.static org.eclipse.swt.graphics.Color
getActiveCellSelectionColor(org.eclipse.swt.graphics.Color activeColor)
Get active cell selection color.static int
getBottomVerticalMargin(org.eclipse.swt.graphics.FontMetrics tm)
Получить отступ снизу для метрик шрифта.static org.eclipse.swt.graphics.LineAttributes
getDrawingLineAttributes(DrawingLine line)
Create line atributes for drawing figuresstatic Color
getHeaderSelectionColor(Color headerColor)
Get header selection color.static org.eclipse.swt.graphics.Color
getHeaderSelectionColor(org.eclipse.swt.graphics.Color headerColor)
Get header selection color.static Color
getSelectionColor(Color cellColor)
Get cell selection color.static org.eclipse.swt.graphics.Color
getSelectionColor(org.eclipse.swt.graphics.Color color)
Get cell selection color.static org.eclipse.swt.graphics.Color
getSWTColor(org.eclipse.swt.graphics.Device display, Color ourColor)
Get swt colorstatic org.eclipse.swt.graphics.Color
getSWTColor(org.eclipse.swt.graphics.GC gc, Color ourColor)
Получить цвет.static String
prepareTextForDraw(String str)
Подготовить текст для отрисовки.
-
-
-
Field Detail
-
SELECTION_BORDER_WIDTH
public static final int SELECTION_BORDER_WIDTH
Толщина рамки выделения.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSWTColor
public static org.eclipse.swt.graphics.Color getSWTColor(org.eclipse.swt.graphics.GC gc, Color ourColor)
Получить цвет.
-
getSWTColor
public static org.eclipse.swt.graphics.Color getSWTColor(org.eclipse.swt.graphics.Device display, Color ourColor)
Get swt color- Parameters:
display
-Device
ourColor
-Color
- Returns:
- swt color
-
getSelectionColor
public static Color getSelectionColor(Color cellColor)
Get cell selection color.- Parameters:
cellColor
- cell background color- Returns:
- color of the selected cell
-
getHeaderSelectionColor
public static Color getHeaderSelectionColor(Color headerColor)
Get header selection color.- Parameters:
headerColor
- header background color- Returns:
- color of selected header
-
getActiveCellSelectionColor
public static Color getActiveCellSelectionColor(Color activeColor)
Get active cell selection color.- Parameters:
activeColor
- active cell background color, must not benull
- Returns:
- color of active cell selection, never
null
-
getSelectionColor
public static org.eclipse.swt.graphics.Color getSelectionColor(org.eclipse.swt.graphics.Color color)
Get cell selection color.- Parameters:
cellColor
- cell background color- Returns:
- color of the selected cell
-
getHeaderSelectionColor
public static org.eclipse.swt.graphics.Color getHeaderSelectionColor(org.eclipse.swt.graphics.Color headerColor)
Get header selection color.- Parameters:
headerColor
- header background color- Returns:
- color of selected header
-
getActiveCellSelectionColor
public static org.eclipse.swt.graphics.Color getActiveCellSelectionColor(org.eclipse.swt.graphics.Color activeColor)
Get active cell selection color.- Parameters:
activeColor
- active cell background color, must not benull
- Returns:
- color of selected active cell selection, never
null
-
prepareTextForDraw
public static String prepareTextForDraw(String str)
Подготовить текст для отрисовки.
-
drawText
public static org.eclipse.swt.graphics.Rectangle drawText(org.eclipse.swt.graphics.GC gc, MoxelOutputDeviceInfo outputDeviceInfo, Font font, String text, org.eclipse.swt.graphics.Rectangle startRect, HorizontalAlignment align, int iangle, boolean mesureOnly, boolean noWrap, int indent, boolean calcHeight, UnitsConverter unitsConverter)
Вывести текст.- Parameters:
gc
-text
-startRect
-font
-align
-angle
-mesureOnly
-noWrap
-clipRect
-indent
-calcHeight
-- Returns:
-
drawString
public static void drawString(org.eclipse.swt.graphics.GC gc, Font font, String text, int x, int y, int angle)
Вывести строку.
-
getBottomVerticalMargin
public static int getBottomVerticalMargin(org.eclipse.swt.graphics.FontMetrics tm)
Получить отступ снизу для метрик шрифта.
-
drawBorder
public static void drawBorder(org.eclipse.swt.graphics.GC gc, int x1, int y1, int x2, int y2, CellLine line, Color borderColor)
Вывести линию.
-
drawHorizontalCellBorder
public static void drawHorizontalCellBorder(org.eclipse.swt.graphics.ImageData imageData, int x1, int x2, int y, CellLine line, Color borderColor)
Draw horizontal cell border- Parameters:
imageData
- - image data to draw ontox1
- - beginning x-coordx2
- - ending x-coordy
- = y-coordline
- - cell lineborderColor
- - line color
-
drawVerticalCellBorder
public static void drawVerticalCellBorder(org.eclipse.swt.graphics.ImageData imageData, int x, int y1, int y2, CellLine line, Color borderColor)
Draw vertical cell border- Parameters:
imageData
- - image data to draw ontox
- - x-coordy1
- - beginning y-coordy2
- - ending y-coordline
- - cell lineborderColor
- - line color
-
drawSelection
public static void drawSelection(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle selectionRectanglePixel, boolean[] sides)
Отрисовать выделение.- Parameters:
sides
- - какие стороны нужно отрисовывать. Лево, верх, право, низ.
-
drawDropSelection
public static void drawDropSelection(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle selectionRectanglePixel, boolean[] sides)
Paint selection with 'drag selection' style.- Parameters:
gc
-GC
selectionRectanglePixel
- selection rectanglesides
- array of booleans, which sides are to be painted [left, top, right, bottom]
-
getDrawingLineAttributes
public static org.eclipse.swt.graphics.LineAttributes getDrawingLineAttributes(DrawingLine line)
Create line atributes for drawing figures- Parameters:
line
- - type of DrawingLine- Returns:
- LineAttributes containg necessary line properties
-
-