Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/25/10 17:28:31 (14 years ago)
Author:
mkommend
Message:

finished mapping from OperatorGraph to GraphVisualizationInfo (ticket #867)

File:
1 edited

Legend:

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

    r2768 r2868  
    7979            if(e.Button == MouseButtons.Left && Enabled && !IsSuspended && !Blocked)
    8080            {
    81                 if(Selection.SelectedItems.Count > 0)
     81              if (this.Controller.Model.Selection.SelectedItems.Count > 0)
    8282                {
    8383                    initialPoint = e.Location;
     
    9494                    // does its thing when the mouse is moved.
    9595                    //return true;
    96                 }
    97                 else if(Selection.Connector != null && Selection.Connector.Parent is IConnection)
    98                 {
    99                     if(!typeof(IShape).IsInstanceOfType(Selection.Connector.Parent)) //note that there is a separate tool to move shape-connectors!
     96              } else if (this.Controller.Model.Selection.Connector != null && this.Controller.Model.Selection.Connector.Parent is IConnection)
     97                {
     98                if (!typeof(IShape).IsInstanceOfType(this.Controller.Model.Selection.Connector.Parent)) //note that there is a separate tool to move shape-connectors!
    10099                    {
    101100                        initialPoint = e.Location;
     
    123122            {
    124123                //can be a connector
    125                 if(Selection.Connector != null)
    126                 {
    127                     Selection.Connector.MoveBy(new Point(point.X - lastPoint.X, point.Y - lastPoint.Y));
     124              if (this.Controller.Model.Selection.Connector != null)
     125                {
     126                this.Controller.Model.Selection.Connector.MoveBy(new Point(point.X - lastPoint.X, point.Y - lastPoint.Y));
    128127                    #region Do we hit something meaningful?
    129128
    130129                    if (hoveredConnector != null)
    131                         hoveredConnector.Hovered = false;                       
    132                    
    133                     hoveredConnector = Selection.FindConnectorAt(e.Location);
     130                        hoveredConnector.Hovered = false;
     131
     132                    hoveredConnector = this.Controller.Model.Selection.FindConnectorAt(e.Location);
    134133                    if(hoveredConnector!=null)
    135134                        hoveredConnector.Hovered = true;
    136                     if(hoveredConnector != null && hoveredConnector!=Selection.Connector)
     135                    if (hoveredConnector != null && hoveredConnector != this.Controller.Model.Selection.Connector)
    137136                    {
    138137                        Controller.View.CurrentCursor = CursorPalette.Grip;
     
    145144                else //can be a selection
    146145                {
    147                     foreach(IDiagramEntity entity in Selection.SelectedItems)
     146                  foreach (IDiagramEntity entity in this.Controller.Model.Selection.SelectedItems)
    148147                    {
    149148                        if (entity.AllowMove)
     
    204203                    #region Is the connector attached?
    205204                    //detach only if there is a parent different than a connection; the join of a chained connection is allowed to move
    206                     if( Selection.Connector.AttachedTo != null && !typeof(IConnection).IsInstanceOfType(Selection.Connector.AttachedTo))
    207                     {
    208                         DetachConnectorCommand detach = new DetachConnectorCommand(this.Controller, Selection.Connector.AttachedTo, Selection.Connector);
     205                  if (this.Controller.Model.Selection.Connector.AttachedTo != null && !typeof(IConnection).IsInstanceOfType(this.Controller.Model.Selection.Connector.AttachedTo))
     206                    {
     207                    DetachConnectorCommand detach = new DetachConnectorCommand(this.Controller, this.Controller.Model.Selection.Connector.AttachedTo, this.Controller.Model.Selection.Connector);
    209208                        detach.Redo();
    210209                        package.Commands.Add(detach);
     
    216215                    //a bundle might look like overkill here but it makes the coding model uniform
    217216                    Bundle bundle = new Bundle(Controller.Model);
    218                     bundle.Entities.Add(Selection.Connector);
     217                    bundle.Entities.Add(this.Controller.Model.Selection.Connector);
    219218                    MoveCommand move = new MoveCommand(this.Controller, bundle, new Point(lastPoint.X - initialPoint.X, lastPoint.Y - initialPoint.Y));
    220219                    //no Redo() necessary here!
     
    231230                            //whatever, except itself and any children of the moved connector
    232231                            //since this would entail a child becoming a parent!
    233                             if(conn.Hit(e.Location) && conn != Selection.Connector && !Selection.Connector.AttachedConnectors.Contains(conn))
     232                          if (conn.Hit(e.Location) && conn != this.Controller.Model.Selection.Connector && !this.Controller.Model.Selection.Connector.AttachedConnectors.Contains(conn))
    234233                                return true;
    235234                            return false;
    236235                        };
    237236                    //find it!
    238                     IConnector parentConnector = Selection.FindConnector(predicate);
     237                    IConnector parentConnector = this.Controller.Model.Selection.FindConnector(predicate);
    239238
    240239                    if(parentConnector != null) //aha, there's an attachment
    241240                    {                       
    242                         BindConnectorsCommand binder = new BindConnectorsCommand(this.Controller, parentConnector, Selection.Connector);
     241                        BindConnectorsCommand binder = new BindConnectorsCommand(this.Controller, parentConnector, this.Controller.Model.Selection.Connector);
    243242                        package.Commands.Add(binder);
    244243                        binder.Redo(); //this one is necessary since the redo cannot be performed on the whole compound command
     
    253252                    #region We are moving entities other than a connector
    254253                    Bundle bundle = new Bundle(Controller.Model);
    255                     bundle.Entities.AddRange(Selection.SelectedItems);
     254                    bundle.Entities.AddRange(this.Controller.Model.Selection.SelectedItems);
    256255                    MoveCommand cmd = new MoveCommand(this.Controller, bundle, new Point(lastPoint.X - initialPoint.X, lastPoint.Y - initialPoint.Y));
    257256                    package.Commands.Add(cmd);
Note: See TracChangeset for help on using the changeset viewer.