Exemple #1
0
        public override void Do()
        {
            SelectionModel sm = (Designer.CurrentSheet as Sheet <Gdk.Event, Cairo.Context, SolidV.MVC.Model>).Model.GetSubModel <SelectionModel>();

            for (int i = 0; i < sm.Selected.Count - 1; i++)
            {
                BinaryRelationShape binaryRelation = (BinaryRelationShape)NewShape.DeepCopy();
                binaryRelation.From = sm.Selected[i];
                binaryRelation.To   = sm.Selected[i + 1];
                Designer.AddShapes(binaryRelation);
            }
        }
Exemple #2
0
 public virtual void Do()
 {
     designer.AddShapes(NewShape.DeepCopy());
 }
 public NewToOldAdapter(NewShape shape)
 {
     _newShape = shape;
 }
        ///<summary>
        /// Default constructor for FerdaView class.
        ///</summary>
        ///<param name="locManager">
        /// Interface that takes care of the 
        ///localizacion in the application
        /// </param>
        ///<param name="svgMan">
        /// Interface for providing SVG graphics
        ///</param>
        ///<param name="menuDisp">Menu displayer</param>
        ///<param name="view">The view thath should be connected to this desktop</param>
        ///<param name="pm">The project manager of the application</param>
        ///<param name="arch">Control that displays the archive</param>
        ///<param name="provider">Provider of the icons</param>
        ///<param name="toolBar">Toolbar control</param>
        public FerdaDesktop(Menu.ILocalizationManager locManager,
            SVGManager svgMan, IMenuDisplayer menuDisp, ProjectManager.View view,
            ProjectManager.ProjectManager pm, Archive.IArchiveDisplayer arch,
            IIconProvider provider, IMenuDisplayer toolBar)
            : base()
        {
            //setting the icon
            this.provider = provider;

            //adding the localization
            localizationManager = locManager;
            ResManager = localizationManager.ResManager;

            //adding the svgManager
            svgManager = svgMan;

            //setting the menu displayer
            menuDisplayer = menuDisp;
            archiveDisplayer = arch;
            this.toolBar = toolBar;

            //Current view
            this.view = view;
            projectManager = pm;

            //name of the desktop
            Name = view.Name;

            //properties od the GraphControl to work propertly
            AllowMoveShape = true;
            AllowAddConnection = true;
            AllowAddShape = true;
            AllowDeleteShape = true;
            AllowDrop = true;
            AutoScroll = true;
            EnableContextMenu = true;
            EnableLayout = false;
            ShowGrid = false;
            Zoom = 1;
            RestrictToCanvas = false;
            this.ImeMode = System.Windows.Forms.ImeMode.On;

            //for now trial stuff
            BackgroundType = Netron.GraphLib.CanvasBackgroundTypes.Gradient;
            GradientTop = System.Drawing.Color.SkyBlue;

            //EventHandlers
            GotFocus += new EventHandler(FerdaDesktop_GotFocus);
            OnContextMenu += new MouseEventHandler(FerdaDesktop_ContextMenu);
            OnNewConnection += new NewConnection(FerdaDesktop_OnNewConnection);
            KeyPress += new KeyPressEventHandler(FerdaDesktop_KeyPress);
            OnFerdaMouseUp += new MouseEventHandler(FerdaDesktop_OnFerdaMouseUp);
            OnFerdaDeleteConnection += new FerdaConnection(FerdaDesktop_OnFerdaDeleteConnection);
            OnShapeRemoved += new NewShape(FerdaDesktop_OnShapeRemoved);

            //Setting the arrow for connections
            DefaultLineEnd = ConnectionEnds.RightFilledArrow;

            //Creation of the boxes and connections
            Adapt();
        }