<Serializable()> Public Class Box
    Inherits GraphicBase


    Public Overrides Sub Draw(ByVal g As System.Drawing.Graphics, ByVal isPreview As Boolean)
        ' 描画する
        Dim rc As RectangleF = GetRectangleF()

        If isPreview Then
            ' プレビュー時
            g.DrawRectangle(PreviewPen, rc.X, rc.Y, rc.Width, rc.Height)
        Else
            ' 非プレビュー時
            If Not FillColor.IsEmpty() Then
                Dim b As New SolidBrush(FillColor)
                g.FillRectangle(b, rc)
                b.Dispose()
            End If
            If Not LineColor.IsEmpty() Then
                Dim p As New Pen(LineColor)
                g.DrawRectangle(p, rc.X, rc.Y, rc.Width, rc.Height)
                p.Dispose()
            End If
        End If
    End Sub
End Class
