Class BpFiguresUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.bp.scheme.ui.util.BpFiguresUtil
-
public final class BpFiguresUtil extends Object
Util methods for BP scheme figures.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.draw2d.geometry.Rectangle
calculateAnchorableBounds(org.eclipse.draw2d.IFigure figure)
Calculates given figure anchorable bounds.static org.eclipse.draw2d.IFigure
createDummyTargetFigure(org.eclipse.draw2d.Connection connection, int position)
Creates dummy target figure.static org.eclipse.draw2d.geometry.PointList
createShapePolygon(org.eclipse.draw2d.geometry.PointList template, int templateMaximum, org.eclipse.draw2d.geometry.Rectangle bounds, boolean forOutline)
Creates polygon from given template and bounds.static org.eclipse.draw2d.geometry.Rectangle
getAlignedBounds(org.eclipse.draw2d.geometry.Rectangle bounds, int minWidth, int minHeight)
Returned aligned to grid bounds.static org.eclipse.draw2d.geometry.Point
getAlignedLocation(org.eclipse.draw2d.geometry.Point location)
Returnes aligned to grid location.static List<org.eclipse.draw2d.geometry.PointList>
getConnectionsPaths(List<? extends org.eclipse.draw2d.Connection> connections)
Returns given connections paths.static org.eclipse.swt.graphics.Font
getFont(Font font)
ReturnsSWT font
of given mcore font.static int
getHorizontalGridStep()
Returns horizontal grid step.static org.eclipse.swt.graphics.Image
getImage(Picture picture)
ReturnsImage
of given picture.static org.eclipse.swt.graphics.RGB
getRGB(Color color)
ReturnsRGB
of given color.static int
getVerticalGridStep()
Returns vertical grid step.static boolean
isEqualPaths(org.eclipse.draw2d.geometry.PointList path, org.eclipse.draw2d.geometry.PointList otherPath)
Returnstrue
if given paths is equal.static int
ModelToSWTBorderStyle(GraphicalSchemeLineType lineType)
Returns SWT border style depending on given string.static void
setPictureManager(IPictureManager pictureManager)
Sets picture manager.
-
-
-
Method Detail
-
setPictureManager
public static void setPictureManager(IPictureManager pictureManager)
Sets picture manager.- Parameters:
pictureManager
- - picture manager. Can't benull
.
-
createShapePolygon
public static org.eclipse.draw2d.geometry.PointList createShapePolygon(org.eclipse.draw2d.geometry.PointList template, int templateMaximum, org.eclipse.draw2d.geometry.Rectangle bounds, boolean forOutline)
Creates polygon from given template and bounds.- Parameters:
template
- - polygon template. Can't benull
.templateMaximum
- - maximum integer in template. If given value is0
, it will be calculated.bounds
- - figure bounds. Can't benull
.forOutline
- -true
if polygon creating for outlining.- Returns:
- shape polygon. Can't be
null
.
-
getAlignedLocation
public static org.eclipse.draw2d.geometry.Point getAlignedLocation(org.eclipse.draw2d.geometry.Point location)
Returnes aligned to grid location. If grid is off, returns copy of given location.- Parameters:
location
- - location to align. Can't benull
.- Returns:
- aligned to grid location. Can't return
null
.
-
getAlignedBounds
public static org.eclipse.draw2d.geometry.Rectangle getAlignedBounds(org.eclipse.draw2d.geometry.Rectangle bounds, int minWidth, int minHeight)
Returned aligned to grid bounds. If grid is off returns copy of givenbounds
.- Parameters:
bounds
- - bounds to align. Can't benull
.minWidth
- - width of returned rectangle can't be less than given value.minHeight
- - height of returned rectangle can't be less than given value.- Returns:
- ligned to grid bounds. Can't return
null
.
-
getHorizontalGridStep
public static int getHorizontalGridStep()
Returns horizontal grid step.- Returns:
- horizontal grid step.
-
getVerticalGridStep
public static int getVerticalGridStep()
Returns vertical grid step.- Returns:
- vertical grid step.
-
calculateAnchorableBounds
public static org.eclipse.draw2d.geometry.Rectangle calculateAnchorableBounds(org.eclipse.draw2d.IFigure figure)
Calculates given figure anchorable bounds. (Anchor connects to side of returned bounds).- Parameters:
figure
- - figure to calculate bounds. Can't benull
.- Returns:
- given figure anchorable bounds. (Anchor connects to side of returned bounds). Can't return
null
.
-
ModelToSWTBorderStyle
public static int ModelToSWTBorderStyle(GraphicalSchemeLineType lineType)
Returns SWT border style depending on given string.- Parameters:
lineType
- - line type. Can't benull
.- Returns:
- SWT border style. Can't return
null
.
-
createDummyTargetFigure
public static org.eclipse.draw2d.IFigure createDummyTargetFigure(org.eclipse.draw2d.Connection connection, int position)
Creates dummy target figure.- Parameters:
connection
- - connection to make dummy target for. Can't benull
.position
- - dummy target position.- Returns:
- created dummy figure. Can't return
null
.
-
isEqualPaths
public static boolean isEqualPaths(org.eclipse.draw2d.geometry.PointList path, org.eclipse.draw2d.geometry.PointList otherPath)
Returnstrue
if given paths is equal.- Parameters:
path
- - path. Can't benull
.otherPath
- - other path. Can't benull
.- Returns:
true
if given paths is equal.
-
getConnectionsPaths
public static List<org.eclipse.draw2d.geometry.PointList> getConnectionsPaths(List<? extends org.eclipse.draw2d.Connection> connections)
Returns given connections paths. Paths in returned list has same order as connections in given list.- Parameters:
connections
- - connections to return paths. Can't benull
.- Returns:
- given connections paths. Can't return
null
.
-
getRGB
public static org.eclipse.swt.graphics.RGB getRGB(Color color)
ReturnsRGB
of given color.- Parameters:
color
- - color to get rgb. Can't benull
.- Returns:
RGB
of given color. Can't returnnull
.
-
getImage
public static org.eclipse.swt.graphics.Image getImage(Picture picture)
ReturnsImage
of given picture.- Parameters:
picture
- - picture to get image from. Can't benull
.- Returns:
Image
of given picture. Can't returnnull
.
-
getFont
public static org.eclipse.swt.graphics.Font getFont(Font font)
ReturnsSWT font
of given mcore font.- Parameters:
font
- - mcore font to get swt font. Can't benull
.- Returns:
SWT font
of given mcore font. Can returnnull
.
-
-