Ejemplo n.º 1
0
 public void _rectDraw(Graphics nGraphics, Rect2I nRect)
 {
     ImagePos_ imagePos_ = mRectStream._getImagePos();
     Image image_ = mRectStream._getImage();
     int width_ = 12;
     int x_ = nRect._getX();
     int x1_ = x_ + width_ + 1;
     int y_ = nRect._getHeight() - width_;
     y_ /= 2;
     y_ = nRect._getY() + y_;
     int y1_ = nRect._getY();
     int w1_ = nRect._getWidth() - x1_;
     int h1_ = nRect._getHeight();
     if (imagePos_ == ImagePos_.mRectLeftTop_)
     {
         x1_ = nRect._getX();
         w1_ = nRect._getWidth();
         y_ = nRect._getY() - 11;
     }
     nGraphics.DrawImage(image_, x_ + 1, y_, width_, width_);
     string name_ = mRect._getName();
     FONT font_ = mRectStream._getFont();
     Rect2I rect_ = new Rect2I(x1_, y1_, w1_, h1_);
     Graphicsos._drawString(name_, rect_, nGraphics, font_);
 }
Ejemplo n.º 2
0
 public void _rectDrawCreate(Graphics nGraphics, Rect2I nRect)
 {
     RGB brushRGB_ = mRectStream._getCreateFill();
     Graphicsos._runFill(nRect, nGraphics, brushRGB_);
     RGB penRGB_ = mRectStream._getCreateDraw();
     Graphicsos._runDraw(nRect, nGraphics, penRGB_);
 }
Ejemplo n.º 3
0
 public void _rectDrawMove(Graphics nGraphics, Rect2I nRect)
 {
     RGB brushRGB_ = mRectStream._getMoveFill();
     Graphicsos._runFill(nRect, nGraphics, brushRGB_);
     RGB penRGB_ = mRectStream._getMoveDraw();
     Graphicsos._runDraw(nRect, nGraphics, penRGB_);
     this._rectDraw(nGraphics, nRect);
 }
Ejemplo n.º 4
0
 public bool _drawCreate(Point2I nPoint, string nId, Graphics nGraphics)
 {
     Rect2I labelRect2I_ = this._getRect2I();
     if (!labelRect2I_._contain(nPoint))
     {
         return false;
     }
     if (mRectShapes.Count <= 0)
     {
         if (this._rectIdSel(nId))
         {
             base._rectDrawCreate(nGraphics, labelRect2I_);
             return true;
         }
         return false;
     }
     Rect2I rect2i_ = new Rect2I(labelRect2I_);
     rect2i_._setHeight(mLabelHeight);
     if (rect2i_._contain(nPoint))
     {
         if (this._rectIdSel(nId))
         {
             base._rectDrawCreate(nGraphics, labelRect2I_);
             return true;
         }
         return false;
     }
     rect2i_._offset(0, mLabelHeight);
     rect2i_._setHeight(mRectHeight);
     foreach (RectShape i in mRectShapes)
     {
         if (rect2i_._contain(nPoint))
         {
             if (i._rectIdSel(nId))
             {
                 i._rectDrawCreate(nGraphics, rect2i_);
                 return true;
             }
             return false;
         }
         rect2i_._offset(0, mRectHeight);
     }
     return false;
 }
Ejemplo n.º 5
0
        public static void _drawBroken(Rect2I nRect, Graphics nGraphics, RGB nRGB, int nSize = 0)
        {
            Point2I lefttop_ = nRect._getPoint();
            lefttop_._offset(-nSize, -nSize);

            Point2I righttop_ = nRect._getRTPoint();
            righttop_._offset(nSize, -nSize);

            Point2I leftbottom_ = nRect._getLBPoint();
            leftbottom_._offset(-nSize, nSize);

            Point2I rightbottom_ = nRect._getRBPoint();
            rightbottom_._offset(nSize, nSize);

            Line2I top_ = new Line2I(lefttop_, righttop_);
            Graphicsos._drawBroken(top_, nGraphics, nRGB);
            Line2I bottom_ = new Line2I(rightbottom_, leftbottom_);
            Graphicsos._drawBroken(bottom_, nGraphics, nRGB);
            Line2I left_ = new Line2I(leftbottom_, lefttop_);
            Graphicsos._drawBroken(left_, nGraphics, nRGB);
            Line2I right_ = new Line2I(righttop_, rightbottom_);
            Graphicsos._drawBroken(right_, nGraphics, nRGB);
        }
Ejemplo n.º 6
0
 public bool _isSelect(Point2I nBeg, Point2I nEnd)
 {
     Rect2I rect2i0_ = this._getRect2I();
     Rect2I rect2i1_ = new Rect2I(nBeg, nEnd);
     return rect2i0_._intersectWith(rect2i1_);
 }
Ejemplo n.º 7
0
        public void _drawPull(Graphics nGraphics)
        {
            if (PullState_.mNone_ != mPullState)
            {
                return;
            }
            ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
            RGB selectrgb_ = shapeDescriptorSingleton_._selectRGB();
            Rect2I labelRect2I_ = this._getRect2I();

            Rect2I rect2i_ = new Rect2I(labelRect2I_);
            rect2i_._setHeight(mLabelHeight);
            this._rectDrawMove(nGraphics, rect2i_);
            rect2i_._offset(0, mLabelHeight);
            rect2i_._setHeight(mRectHeight);
            foreach (RectShape i in mRectShapes)
            {
                this._rectDrawMove(nGraphics, rect2i_);
                rect2i_._offset(0, mRectHeight);
            }

            Graphicsos._drawPull(labelRect2I_, nGraphics, selectrgb_, 4);
        }
Ejemplo n.º 8
0
        public void _drawSelect(Graphics nGraphics)
        {
            ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
            RGB selectrgb_ = shapeDescriptorSingleton_._selectRGB();
            Rect2I labelRect2I_ = this._getRect2I();

            Rect2I rect2i_ = new Rect2I(labelRect2I_);
            rect2i_._setHeight(mLabelHeight);
            this._rectDrawNormal(nGraphics, rect2i_);
            rect2i_._offset(0, mLabelHeight);
            rect2i_._setHeight(mRectHeight);
            foreach (RectShape i in mRectShapes)
            {
                this._rectDrawNormal(nGraphics, rect2i_);
                rect2i_._offset(0, mRectHeight);
            }

            Graphicsos._drawBroken(labelRect2I_, nGraphics, selectrgb_, 4);
        }
Ejemplo n.º 9
0
        public static void _drawPull(Rect2I nRect, Graphics nGraphics, RGB nRGB, int nSize = 4)
        {
            Point2I lefttop_ = nRect._getPoint();
            lefttop_._offset(-nSize, -nSize);

            Point2I righttop_ = nRect._getRTPoint();
            righttop_._offset(nSize, -nSize);

            Point2I leftbottom_ = nRect._getLBPoint();
            leftbottom_._offset(-nSize, nSize);

            Point2I rightbottom_ = nRect._getRBPoint();
            rightbottom_._offset(nSize, nSize);

            Point2I lt_ = new Point2I();
            lt_._setX(nRect._getX() - nSize);
            lt_._setY(nRect._centerY() - 3);
            Point2I lb_ = new Point2I();
            lb_._setX(nRect._getX() - nSize);
            lb_._setY(nRect._centerY() + 3);
            Point2I lp_ = new Point2I();
            lp_._setX(nRect._getX() - 4);
            lp_._setY(nRect._centerY());

            Point2I rt_ = new Point2I();
            rt_._setX(nRect._getRTX() + nSize);
            rt_._setY(nRect._centerY() - 3);
            Point2I rb_ = new Point2I();
            rb_._setX(nRect._getRTX() + nSize);
            rb_._setY(nRect._centerY() + 3);
            Point2I rp_ = new Point2I();
            rp_._setX(nRect._getRTX() + 4);
            rp_._setY(nRect._centerY());

            Line2I top_ = new Line2I(lefttop_, righttop_);
            _drawBroken(top_, nGraphics, nRGB);
            Line2I bottom_ = new Line2I(leftbottom_, rightbottom_);
            _drawBroken(bottom_, nGraphics, nRGB);
            Line2I left0_ = new Line2I(lefttop_, lt_);
            _drawBroken(left0_, nGraphics, nRGB);
            Line2I left1_ = new Line2I(leftbottom_, lb_);
            _drawBroken(left1_, nGraphics, nRGB);
            Line2I right0_ = new Line2I(righttop_, rt_);
            _drawBroken(right0_, nGraphics, nRGB);
            Line2I right1_ = new Line2I(rightbottom_, rb_);
            _drawBroken(right1_, nGraphics, nRGB);
            _drawEllipse(lp_, nGraphics, nRGB);
            _drawEllipse(rp_, nGraphics, nRGB);
        }
Ejemplo n.º 10
0
 public void _selectMid(Point2I nPoint, Graphics nGraphics)
 {
     Rect2I rect_ = new Rect2I(mMouseDown, nPoint);
     ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
     RGB rgb_ = shapeDescriptorSingleton_._selectRGB();
     Graphicsos._drawBroken(rect_, nGraphics, rgb_);
 }
Ejemplo n.º 11
0
 public static void _runDraw(Rect2I nRect, Graphics nGraphics, RGB nRGB)
 {
     Color color_ = nRGB._getColor();
     Pen pen_ = new Pen(color_);
     nGraphics.DrawRectangle(pen_, nRect._getX(), nRect._getY(), nRect._getWidth(), nRect._getHeight());
 }
Ejemplo n.º 12
0
 public static void _runFill(Rect2I nRect, Graphics nGraphics, RGB nRGB)
 {
     Color color_ = nRGB._getColor();
     Brush brush_ = new SolidBrush(color_);
     nGraphics.FillRectangle(brush_, nRect._getX(), nRect._getY(), nRect._getWidth(), nRect._getHeight());
 }
Ejemplo n.º 13
0
 protected override Rect2I _getRect2I()
 {
     int x_ = mLabel._getX();
     int y_ = mLabel._getY();
     int w_ = mLabel._getWidth();
     if (w_ < mRectWidth)
     {
         w_ = mRectWidth;
     }
     int h_ = mLabelHeight;
     if (null != mRectShapes)
     {
         h_ += mRectShapes.Count * mRectHeight;
     }
     Rect2I result_ = new Rect2I(x_, y_, w_, h_);
     return result_;
 }
Ejemplo n.º 14
0
 public bool _isSelect(int nX, int nY, int nDistance = 3)
 {
     Rect2I rect_ = new Rect2I(mBeg, mEnd);
     rect_._offset(-nDistance, -nDistance);
     rect_._sizeOffset(nDistance * 2, nDistance * 2);
     if (!rect_._contain(nX, nY))
     {
         return false;
     }
     double distance_ = this._distance(nX, nY);
     if (distance_ < nDistance)
     {
         return true;
     }
     return false;
 }
Ejemplo n.º 15
0
        public void _pullMid(Point2I nPoint, Graphics nGraphics)
        {
            if (default(int) == mPullPoint._getX() && default(int) == mPullPoint._getY())
            {
                return;
            }
            ShapeDescriptorSingleton shapeDescriptorSingleton_ = __singleton<ShapeDescriptorSingleton>._instance();
            RGB selectrgb_ = shapeDescriptorSingleton_._selectRGB();
            Rect2I labelRect2I_ = this._runPull(nPoint);

            Rect2I rect2i_ = new Rect2I(labelRect2I_);
            rect2i_._setHeight(mLabelHeight);
            this._rectDrawMove(nGraphics, rect2i_);
            rect2i_._offset(0, mLabelHeight);
            rect2i_._setHeight(mRectHeight);
            foreach (RectShape i in mRectShapes)
            {
                this._rectDrawMove(nGraphics, rect2i_);
                rect2i_._offset(0, mRectHeight);
            }

            Graphicsos._drawPull(labelRect2I_, nGraphics, selectrgb_, 4);
        }
Ejemplo n.º 16
0
 public void _setRect(Rect2I nRect)
 {
     mPoint._setPoint(nRect._getPoint());
     mSize._setSize(nRect._getSize());
 }
Ejemplo n.º 17
0
 public bool _intersectWith(Rect2I nRect)
 {
     Point2I lt0_ = this._getPoint();
     Point2I lb0_ = this._getLBPoint();
     Point2I rt0_ = this._getRTPoint();
     Point2I rb0_ = this._getRBPoint();
     if (nRect._contain(lt0_))
     {
         return true;
     }
     if (nRect._contain(lb0_))
     {
         return true;
     }
     if (nRect._contain(rt0_))
     {
         return true;
     }
     if (nRect._contain(rb0_))
     {
         return true;
     }
     Point2I lt1_ = nRect._getPoint();
     Point2I lb1_ = nRect._getLBPoint();
     Point2I rt1_ = nRect._getRTPoint();
     Point2I rb1_ = nRect._getRBPoint();
     if (this._contain(lt1_))
     {
         return true;
     }
     if (this._contain(lb1_))
     {
         return true;
     }
     if (this._contain(rt1_))
     {
         return true;
     }
     if (this._contain(rb1_))
     {
         return true;
     }
     int x00_ = this._getX();
     int y00_ = this._getY();
     int x01_ = this._getRTX();
     int y01_ = this._getLBY();
     int x10_ = nRect._getX();
     int y10_ = nRect._getY();
     int x11_ = nRect._getRTX();
     int y11_ = nRect._getLBY();
     if (x00_ < x10_ && x01_ > x11_ && y00_ > y10_ && y01_ < y11_)
     {
         return true;
     }
     if (x00_ > x10_ && x01_ < x11_ && y00_ < y10_ && y01_ > y11_)
     {
         return true;
     }
     return false;
 }
Ejemplo n.º 18
0
 public Rect2I _getRect()
 {
     Rect2I result_ = new Rect2I(this);
     return result_;
 }
Ejemplo n.º 19
0
 public Rect2I(Rect2I nRect)
 {
     mPoint = new Point2I(nRect._getPoint());
     mSize = new Size2I(nRect._getSize());
 }
Ejemplo n.º 20
0
 public Rect2I _rectGetRect2I(int nIndex)
 {
     int x_ = mLabel._getX();
     int y_ = mLabel._getY();
     y_ += mLabelHeight;
     y_ += nIndex * mRectHeight;
     int w_ = mLabel._getWidth();
     if (w_ < mRectWidth)
     {
         w_ = mRectWidth;
     }
     int h_ = mRectHeight;
     Rect2I result_ = new Rect2I(x_, y_, w_, h_);
     return result_;
 }
Ejemplo n.º 21
0
 public static void _drawString(string nName, Rect2I nRect, Graphics nGraphics, FONT nFont)
 {
     Font font_ = nFont._getFont();
     Color color_ = nFont._getColor();
     Brush brush_ = new SolidBrush(color_);
     string text_ = _widthString(nGraphics, font_, nName, nRect._getWidth() + 1);
     int x_ = _stringWidth(nGraphics, font_, text_);
     x_ = nRect._getWidth() - x_;
     x_ /= 2;
     x_ = nRect._getX() + x_;
     int y_ = nRect._getHeight() - font_.Height;
     y_ /= 2;
     y_ = nRect._getY() + y_ - 1;
     nGraphics.DrawString(text_, font_, brush_, x_, y_);
 }
Ejemplo n.º 22
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);
 }
Ejemplo n.º 23
0
 public bool _isSelect(Point2I nBeg, Point2I nEnd)
 {
     Rect2I rect_ = new Rect2I(nBeg, nEnd);
     return rect_._intersectWith(this);
 }