Exemple #1
0
 public void _drawSelect(Graphics nGraphics)
 {
     Point2I beg_ = mLine._getBegPoint();
     Point2I end_ = mLine._getEndPoint();
     Line2I line_ = new Line2I(beg_, end_);
     Point2I beg0_ = line_._begPoint(3);
     Point2I beg1_ = line_._begPoint(6);
     Point2I end0_ = line_._endPoint(3);
     Point2I end1_ = line_._endPoint(6);
     ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
     Graphicsos._fillRectangle(beg0_, nGraphics, shapeDescriptorSingleton_._selectRGB());
     Graphicsos._fillRectangle(end0_, nGraphics, shapeDescriptorSingleton_._selectRGB());
     Line2I line0_ = new Line2I(beg1_, end1_);
     string name_ = mLine._getName();
     Graphicsos._runDraw(line0_, nGraphics, mLineStream._getDraw(), mLineStream._getStyleName(), 1, mLineStream._getImage(), name_, mLineStream._getFont());
 }
Exemple #2
0
 public void _drawPull(Graphics nGraphics)
 {
     if (default(int) != mPullPoint._getX() || default(int) != mPullPoint._getY())
     {
         return;
     }
     Point2I beg_ = mLine._getBegPoint();
     Point2I end_ = mLine._getEndPoint();
     Line2I line_ = new Line2I(beg_, end_);
     Point2I beg0_ = line_._begPoint(3);
     Point2I beg1_ = line_._begPoint(6);
     Point2I end0_ = line_._endPoint(3);
     Point2I end1_ = line_._endPoint(6);
     ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
     Graphicsos._drawEllipse(beg0_, nGraphics, shapeDescriptorSingleton_._selectRGB());
     Graphicsos._drawEllipse(end0_, nGraphics, shapeDescriptorSingleton_._selectRGB());
     Line2I line0_ = new Line2I(beg1_, end1_);
     string name_ = mLine._getName();
     Graphicsos._runDraw(line0_, nGraphics, mLineStream._getMoveDraw(), mLineStream._getStyleName(), 1, mLineStream._getImage(), name_, mLineStream._getFont());
 }
Exemple #3
0
 public static void _runDraw(Line2I nLine, Graphics nGraphics, RGB nRGB, string nStyle, int nWidth = 1, Image nImage = null, string nName = null, FONT nFont = null)
 {
     PenCapProvider penCapProvider_ = __singleton<PenCapProvider>._instance();
     Color color_ = nRGB._getColor();
     Pen pen_ = new Pen(color_, nWidth);
     if ("multiEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("multiBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
     }
     else if ("multiMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("multiAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("multiInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("multiSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("aggrEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("aggrAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("aggrSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("inhEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("inhBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
     }
     else if ("inhMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("inhAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("inhInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("inhSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("singleEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("singleBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
     }
     else if ("singleMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("singleAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("singleInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("singleSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else
     {
     }
     GraphicsState graphicsState_ = nGraphics.Save();
     nGraphics.SmoothingMode = SmoothingMode.HighQuality;
     nGraphics.DrawLine(pen_, nLine._begX(), nLine._begY(), nLine._endX(), nLine._endY());
     nGraphics.Restore(graphicsState_);
     Rect2I rect_ = new Rect2I(nLine._getBeg(), nLine._getEnd());
     Point2I imagePoint_ = nLine._begPoint();
     if (null == imagePoint_)
     {
         return;
     }
     if (nLine._begX() < nLine._endX())
     {
         imagePoint_._offset(3, 0);
     }
     else
     {
         imagePoint_._offset(-3, 0);
     }
     if (nLine._begY() < nLine._endY())
     {
         imagePoint_._offset(0, 3);
     }
     else
     {
         imagePoint_._offset(0, -3);
     }
     nGraphics.DrawImage(nImage, imagePoint_._getX(), imagePoint_._getY(), 12, 12);
     if (null == nName || "" == nName)
     {
         return;
     }
     int h_ = rect_._getHeight();
     if (h_ < 18)
     {
         return;
     }
     Point2I center_ = rect_._centerPoint();
     int x_ = center_._getX() - 50;
     int y_ = center_._getY() - 9;
     int w_ = 100;
     int hx_ = 18;
     Rect2I rect0_ = new Rect2I(x_, y_, w_, hx_);
     Graphicsos._drawString(nName, rect0_, nGraphics, nFont);
 }
Exemple #4
0
 public bool _isPull(Point2I nPoint)
 {
     Point2I beg_ = mLine._getBegPoint();
     Point2I end_ = mLine._getEndPoint();
     Line2I line_ = new Line2I(beg_, end_);
     Point2I beg0_ = line_._begPoint(3);
     if (beg0_._isSelect(nPoint))
     {
         return true;
     }
     Point2I end0_ = line_._endPoint(3);
     if (end0_._isSelect(nPoint))
     {
         return true;
     }
     return false;
 }