Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9181


Ignore:
Timestamp:
01/22/13 22:57:09 (12 years ago)
Author:
mkommend
Message:

#2006: Changed GhostFactory to not hold a reference to the View object and completely removed the TextEditor tool as it was not in use.

Location:
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Controller.cs

    r8000 r9181  
    4545
    4646    public override bool ActivateTextEditor(ITextProvider textProvider) {
    47       TextEditor.GetEditor(textProvider);
    48       TextEditor.Show();
    49       return true;
     47      return false;
    5048    }
    5149
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Ghosts.cs

    r4068 r9181  
    3535namespace HeuristicLab.Netron {
    3636  internal static class GhostsFactory {
    37     private static RectGhost mRectangular;
    38     private static LineGhost mLine;
    39     private static EllipticGhost mEllipse;
    40     private static MultiLineGhost mMultiLine;
    41     private static CurvedLineGhost mCurvedLine;
    42     private static PolygonGhost mPolygon;
    43 
    44     private static IView mView;
    45     public static IView View {
    46       get { return mView; }
    47       set { mView = value; }
    48     }
    49 
    5037    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
    51     public static IGhost GetGhost(object pars, GhostTypes type) {
     38    public static IGhost GetGhost(object pars, GhostTypes type, IView View) {
    5239      Point[] points;
    5340      switch (type) {
    5441        case GhostTypes.Rectangle:
    55           if (mRectangular == null)
    56             mRectangular = new RectGhost(View);
     42          var mRectangular = new RectGhost(View);
    5743          points = (Point[])pars;
    5844          mRectangular.Start = points[0];
     
    6046          return mRectangular;
    6147        case GhostTypes.Ellipse:
    62           if (mEllipse == null)
    63             mEllipse = new EllipticGhost(View);
     48          var mEllipse = new EllipticGhost(View);
    6449          points = (Point[])pars;
    6550          mEllipse.Start = points[0];
     
    6752          return mEllipse;
    6853        case GhostTypes.Line:
    69           if (mLine == null)
    70             mLine = new LineGhost(View);
     54          var mLine = new LineGhost(View);
    7155          points = (Point[])pars;
    7256          mLine.Start = points[0];
     
    7458          return mLine;
    7559        case GhostTypes.MultiLine:
    76           if (mMultiLine == null)
    77             mMultiLine = new MultiLineGhost(View);
     60          var mMultiLine = new MultiLineGhost(View);
    7861          points = (Point[])pars;
    7962          mMultiLine.Points = points;
    8063          return mMultiLine;
    8164        case GhostTypes.CurvedLine:
    82           if (mCurvedLine == null)
    83             mCurvedLine = new CurvedLineGhost(View);
     65          var mCurvedLine = new CurvedLineGhost(View);
    8466          points = (Point[])pars;
    8567          mCurvedLine.Points = points;
    8668          return mCurvedLine;
    8769        case GhostTypes.Polygon:
    88           if (mPolygon == null)
    89             mPolygon = new PolygonGhost(View);
     70          var mPolygon = new PolygonGhost(View);
    9071          points = (Point[])pars;
    9172          mPolygon.Points = points;
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446.csproj

    r8600 r9181  
    122122    <Compile Include="Plugin.cs" />
    123123    <Compile Include="Properties\AssemblyInfo.cs" />
    124     <Compile Include="TextEditor.cs" />
    125124    <Compile Include="View.cs" />
    126125  </ItemGroup>
     
    171170  -->
    172171  <PropertyGroup>
    173    <PreBuildEvent>
     172    <PreBuildEvent>
    174173    </PreBuildEvent>
    175174  </PropertyGroup>
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/NetronVisualization.cs

    r7259 r9181  
    4949        this.AttachToDocument(Document);
    5050        this.Controller.View = View;
    51         TextEditor.Init(this);
    5251
    5352        View.OnCursorChange += new EventHandler<CursorEventArgs>(mView_OnCursorChange);
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/View.cs

    r4068 r9181  
    4242      this.HorizontalRuler.Visible = true;
    4343      this.VerticalRuler.Visible = true;
    44       GhostsFactory.View = this;
    4544    }
    4645
     
    102101      Ghost = GhostsFactory.GetGhost(
    103102          new Point[] { ltPoint, rbPoint },
    104               GhostTypes.Ellipse);
     103              GhostTypes.Ellipse, this);
    105104    }
    106105    public override void PaintGhostRectangle(
     
    112111      Ghost = GhostsFactory.GetGhost(
    113112          new Point[] { ltPoint, rbPoint },
    114           GhostTypes.Rectangle);
     113          GhostTypes.Rectangle, this);
    115114    }
    116115    public override void PaintAntsRectangle(
     
    129128      Ghost = GhostsFactory.GetGhost(
    130129          new Point[] { ltPoint, rbPoint },
    131           GhostTypes.Line);
     130          GhostTypes.Line, this);
    132131    }
    133132    public override void PaintGhostLine(
     
    139138      switch (curveType) {
    140139        case MultiPointType.Straight:
    141           Ghost = GhostsFactory.GetGhost(points, GhostTypes.MultiLine);
     140          Ghost = GhostsFactory.GetGhost(points, GhostTypes.MultiLine, this);
    142141          break;
    143142        case MultiPointType.Polygon:
    144           Ghost = GhostsFactory.GetGhost(points, GhostTypes.Polygon);
     143          Ghost = GhostsFactory.GetGhost(points, GhostTypes.Polygon, this);
    145144          break;
    146145        case MultiPointType.Curve:
    147           Ghost = GhostsFactory.GetGhost(points, GhostTypes.CurvedLine);
     146          Ghost = GhostsFactory.GetGhost(points, GhostTypes.CurvedLine, this);
    148147          break;
    149148
Note: See TracChangeset for help on using the changeset viewer.