Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Core/Grid.cs

    r2768 r4068  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    42using System.Drawing;
    5 using System.Windows.Forms;
    63using System.Drawing.Drawing2D;
    74
    8 namespace Netron.Diagramming.Core
    9 {
    10     public class Grid
    11     {
    12         // ------------------------------------------------------------------
    13         /// <summary>
    14         /// Constructor.
    15         /// </summary>
    16         // ------------------------------------------------------------------
    17         public Grid()
    18         {
    19         }
     5namespace Netron.Diagramming.Core {
     6  public class Grid {
     7    // ------------------------------------------------------------------
     8    /// <summary>
     9    /// Constructor.
     10    /// </summary>
     11    // ------------------------------------------------------------------
     12    public Grid() {
     13    }
    2014
    21         public static void Paint(
    22             Graphics g,
    23             RectangleF area,
    24             float horizontalSpacing,
    25             float verticalSpacing,
    26             float penWidth)
    27         {
    28             //ControlPaint.DrawGrid(
    29             //    g,
    30             //    area,
    31             //    new Size(20, 20),
    32             //    Color.Wheat);
     15    public static void Paint(
     16        Graphics g,
     17        RectangleF area,
     18        float horizontalSpacing,
     19        float verticalSpacing,
     20        float penWidth) {
     21      //ControlPaint.DrawGrid(
     22      //    g,
     23      //    area,
     24      //    new Size(20, 20),
     25      //    Color.Wheat);
    3326
    34             //g.SmoothingMode = SmoothingMode.HighQuality;
    35             //g.CompositingQuality = CompositingQuality.HighQuality;
    36             //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
    37             g.SetClip(area);
    38             float sideLength = Math.Min(area.Width, area.Height);
    39             float horizSpacing = sideLength / horizontalSpacing;
    40             float vertSpacing = sideLength / verticalSpacing;
     27      //g.SmoothingMode = SmoothingMode.HighQuality;
     28      //g.CompositingQuality = CompositingQuality.HighQuality;
     29      //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
     30      g.SetClip(area);
     31      float sideLength = Math.Min(area.Width, area.Height);
     32      float horizSpacing = sideLength / horizontalSpacing;
     33      float vertSpacing = sideLength / verticalSpacing;
    4134
    42             Pen majorPen = new Pen(Color.DarkGray);
    43             majorPen.Width = penWidth;
    44             majorPen.DashStyle = DashStyle.Dot;
     35      Pen majorPen = new Pen(Color.DarkGray);
     36      majorPen.Width = penWidth;
     37      majorPen.DashStyle = DashStyle.Dot;
    4538
    46             float top = area.Top;  // The top y coord.
    47             float bottom = area.Bottom;  // The bottom y coord.
    48             float left = area.Left;  // The left y coord.
    49             float right = area.Right;  // The right y coord.
    50             PointF p1;  // The starting point for the grid line.
    51             PointF p2;  // The end point for the grid line.
     39      float top = area.Top;  // The top y coord.
     40      float bottom = area.Bottom;  // The bottom y coord.
     41      float left = area.Left;  // The left y coord.
     42      float right = area.Right;  // The right y coord.
     43      PointF p1;  // The starting point for the grid line.
     44      PointF p2;  // The end point for the grid line.
    5245
    53             // Draw the horizontal lines, starting at the top.
    54             for (float i = top; i <= bottom; i += horizontalSpacing)
    55             {
    56                 p1 = new PointF(left, i);
    57                 p2 = new PointF(right, i);
    58                 g.DrawLine(majorPen, p1, p2);
    59             }
     46      // Draw the horizontal lines, starting at the top.
     47      for (float i = top; i <= bottom; i += horizontalSpacing) {
     48        p1 = new PointF(left, i);
     49        p2 = new PointF(right, i);
     50        g.DrawLine(majorPen, p1, p2);
     51      }
    6052
    61             // Draw the major vertical lines, starting at the left edge.
    62             for (float i = left; i <= right; i += verticalSpacing)
    63             {
    64                 p1 = new PointF(i, top);
    65                 p2 = new PointF(i, bottom);
    66                 g.DrawLine(majorPen, p1, p2);
    67             }
    68             g.ResetClip();
    69         }
     53      // Draw the major vertical lines, starting at the left edge.
     54      for (float i = left; i <= right; i += verticalSpacing) {
     55        p1 = new PointF(i, top);
     56        p2 = new PointF(i, bottom);
     57        g.DrawLine(majorPen, p1, p2);
     58      }
     59      g.ResetClip();
    7060    }
     61  }
    7162}
Note: See TracChangeset for help on using the changeset viewer.