Ejemplo n.º 1
0
 //draw the graphic
 public void Draw(IGraphics graphics, bool isPressed)
 {
     graphics.ClearAll();
     foreach (Shape aShape in _shapes)
     {
         aShape.Draw(graphics);
     }
     if (_shape != null)
     {
         _shape.DrawSelected(graphics);
     }
     if (isPressed)
     {
         if (_mode == LINE)
         {
             _line.Draw(graphics);
         }
         if (_mode == RECTANGLE)
         {
             _rectangle.Draw(graphics);
         }
         if (_mode == ELLIPSE)
         {
             _ellipse.Draw(graphics);
         }
         if (_mode == ARROW)
         {
             _arrow.Draw(graphics);
         }
         if (_mode == SELECT && _shape != null)
         {
             _shape.DrawSelected(graphics);
         }
     }
 }
Ejemplo n.º 2
0
 //
 public void Save(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape eachShape in _shapeList)
     {
         eachShape.Fill(graphics);
     }
 }
Ejemplo n.º 3
0
 // 將所有 shape 重繪
 protected void RefreshShapes(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape shape in _shapes)
     {
         shape.Draw(graphics);
     }
 }
Ejemplo n.º 4
0
 /// <summary>   Draw list. </summary>
 public void DrawList()
 {
     _graphics.ClearAll();
     foreach (IShape shape in _shapes)
     {
         shape.Draw(_graphics);
     }
 }
 /// <summary>
 /// Redraw the canvas.
 /// </summary>
 public virtual void RefreshDrawCanvas(IGraphics graphics)
 {
     if (graphics == null)
     {
         throw new ArgumentNullException(Definitions.ERROR_GRAPHICS_IS_NULL);
     }
     graphics.ClearAll();
     Draw(graphics);
 }
Ejemplo n.º 6
0
 //
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape eachShape in _shapeList)
     {
         eachShape.Fill(graphics);
     }
     if (_isPressed)
     {
         _hint.Draw(graphics);
     }
 }
Ejemplo n.º 7
0
 //Print all shapes in the shape list and the hint shape
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape shape in _shapes)
     {
         shape.Draw(graphics);
     }
     if (_isPointerPressed)
     {
         _hintShape.Draw(graphics);
     }
 }
Ejemplo n.º 8
0
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Line line in _lines)
     {
         line.Draw(graphics);
     }
     if (_isPressed)
     {
         _hint.Draw(graphics);
     }
 }
Ejemplo n.º 9
0
 //draw all shapes
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape aShape in _shapes)
     {
         aShape.Draw(graphics);
     }
     if (_isPressed)
     {
         _hintShapes[_paintMode].Draw(graphics);
     }
 }
Ejemplo n.º 10
0
        /// <summary>   Draws the given graphics. </summary>
        ///
        /// <param name="graphics">     The graphics. </param>
        /// <param name="isRedLine">    (Optional) True if is red line, false if not. </param>

        public void Draw(IGraphics graphics, bool isRedLine = false)
        {
            graphics.ClearAll();
            foreach (var shape in _shapes)
            {
                shape.Draw(graphics, isRedLine);
            }
            if (_isPressed)
            {
                _shape.Draw(graphics, isRedLine);
            }
        }
Ejemplo n.º 11
0
 // Draw the shape
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape aShape in _shapes)
     {
         aShape.Draw(graphics);
     }
     if (_isPressed)
     {
         DrawTheShape(graphics);
     }
 }
Ejemplo n.º 12
0
 //Draw
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape aShape in _shapes)
     {
         aShape.Draw(graphics);
     }
     if (_hint != null)
     {
         _hint.Draw(graphics);
     }
     if (_selected != null)
     {
         _selected.DrawBorder(graphics);
     }
 }
Ejemplo n.º 13
0
 // draw circle by interface
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (Shape aLine in _mouseEventModel.ShapeList)
     {
         if (_mouseEventModel.IsSelected != null && _mouseEventModel.ShapeList.IndexOf(aLine) == _mouseEventModel.Selected)
         {
             _mouseEventModel.Hint.Draw(graphics);
             continue;
         }
         aLine.Draw(graphics);
     }
     if (_mouseEventModel.IsPressed)
     {
         _mouseEventModel.Hint.Draw(graphics);
     }
 }
Ejemplo n.º 14
0
 // 畫圖
 public void Draw(IGraphics graphics)
 {
     graphics.ClearAll();
     foreach (IShape aShape in _shapes)
     {
         aShape.Draw(graphics);
     }
     if (IsPressed && CurrentMode != -1) // default drawing
     {
         _shapeHint.Draw(graphics);
     }
     if (IsSelected && CurrentMode == -1) // resize & select shape
     {
         _shapeHint.Draw(graphics);
         SelectedShape.DrawFrame(graphics);
     }
 }