コード例 #1
0
 public void MouseMove(Point e)
 {
     if (IsTapped)
     {
         CoreUML.SwitchToDrawInTmp();
         _newArrow.HookEndPointToFigure(e);
         _newArrow.Draw(CoreUML.Graphics);
         if (!(_newArrow.DataCommon[0].LastBox is null))
         {
             AbstractBox box = (AbstractBox)_newArrow.DataCommon[0].LastBox;
             AbstractBox.DrawConnectionPoint(CoreUML.Graphics, box.GetCordinatsOfConnectionPoint(_newArrow.DataCommon[0].LastPoint));
         }
         CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
     }
     else if (_newArrow is null)
     {
         foreach (IFigure figure in CoreUML.Figures)
         {
             if (figure is AbstractBox box && figure.CheckSelection(e, e, 7))
             {
                 CoreUML.DrawSelectionOfFigures();
                 AbstractBox.DrawConnectionPoint(CoreUML.Graphics, box.GetCordinatsOfConnectionPoint(box.GetConnectionPoint(e, e)));
                 break;
             }
         }
         CoreUML.DrawSelectionOfFigures();
         CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
     }
 }
コード例 #2
0
 public Client(AbstractFactory factory)
 {
     pc        = factory.CreatePc();
     box       = factory.CreateBox();
     processor = factory.CreateProcessor();
     mainboard = factory.CreateMainBoard();
     hdd       = factory.CreateHdd();
     memory    = factory.CreateMemory();
 }
コード例 #3
0
 public override void Interact(
     AbstractBox box,
     AbstractProcessor processor,
     AbstractMainBoard mainBoard,
     AbstractHdd hdd,
     AbstractMemory memory)
 {
     Console.WriteLine(this +
                       " interacts with \n{0}, \n{1}, \n{2}, \n{3}, \nand {4}",
                       box, processor, mainBoard, hdd, memory);
 }
コード例 #4
0
 public void MouseDown(Point e)
 {
     _newBox = (AbstractBox)FigureFactory.GetFigure(CoreUML.DefaultColor, (int)CoreUML.DefaultWidth);
     _newBox.AddPoints(e);
     CoreUML.Figures.Add(_newBox);
     CoreUML.SwitchToDrawInTmp();
     _newBox.Draw(CoreUML.Graphics);
     CoreUML.BitmapMain = (Bitmap)CoreUML.BitmapTmp.Clone();
     CoreUML.SelectedFigures.Clear();
     CoreUML.SelectedFigures.Add(_newBox);
     CoreUML.DrawSelectionOfFigures();
     CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
 }
コード例 #5
0
 public void UpdArrow()
 {
     if (DataCommon.Count != 0)
     {
         Point startPoint = Points[0];
         Point endPoint   = Points[Points.Count - 1];
         if (!(DataCommon[0].LastBox is null))
         {
             AbstractBox box = (AbstractBox)DataCommon[0].LastBox;
             endPoint = box.GetCordinatsOfConnectionPoint(DataCommon[0].LastPoint);
         }
         if (!(DataCommon[0].FirstBox is null))
         {
             AbstractBox box = (AbstractBox)DataCommon[0].FirstBox;
             startPoint = box.GetCordinatsOfConnectionPoint(DataCommon[0].FirstPoint);
         }
         GetPoints(startPoint, endPoint);
     }
 }
コード例 #6
0
ファイル: FormDoArticle.cs プロジェクト: Lsjbot/Bookbase.NET
 public FormDoArticle(Librarydb dbpar, int idpar)
 {
     InitializeComponent();
     db  = dbpar;
     id  = idpar;
     art = (from c in db.Article where c.Id == id select c).FirstOrDefault();
     if (art == null)
     {
         TB_title.Text = "(invalid article)";
     }
     else
     {
         TB_title.Text  = art.Title;
         this.Text      = art.Title;
         Yearlabel.Text = art.Year.ToString();
         var qa = (from c in db.AuthorArticle where c.Article == id select c);
         foreach (AuthorArticle aa in qa)
         {
             string s = util.addid(aa.AuthorAuthor.Name, aa.Author, 100);
             CB_author.Items.Add(s);
         }
         if (art.Journal != null)
         {
             Journallabel.Text = art.JournalJournal.Name;
             Volumelabel.Text  = "Volume " + art.Volume.ToString();
             Pageslabel.Text   = "Pages " + art.Pages;
         }
         else
         {
             Journallabel.Text = art.Refstring;
             Volumelabel.Text  = "";
             Pageslabel.Text   = "";
         }
         if (art.Summary != null)
         {
             AbstractBox.AppendText(art.Summary);
         }
     }
 }
コード例 #7
0
ファイル: StructBox.cs プロジェクト: Zombach/Project-UML
        public StructBox(IFigure figure)
        {
            AbstractBox box = (AbstractBox)figure;

            Type     = box.GetType().FullName;
            DataText = box.DataText;
            Font     = box.GetFont();
            Color    = box.GetColor();
            Width    = box.GetWidth();
            Points   = new List <IPoint>();
            for (int i = 0; i < box.Points.Count; i++)
            {
                StructPoints structPoints = new StructPoints(box.Points[i]);
                Points.Add(structPoints);
            }
            Data = new List <IDataCommon>();
            for (int i = 0; i < box.DataCommon.Count; i++)
            {
                StructDataCommon structData = new StructDataCommon(box.DataCommon[i]);
                Data.Add(structData);
            }
        }
コード例 #8
0
 public void MouseMove(Point e)
 {
     if (IsTapped)
     {
         CoreUML.SwitchToDrawInTmp();
         foreach (IFigure figure in CoreUML.SelectedFigures)
         {
             figure.Transform(e);
             figure.Draw(CoreUML.Graphics);
             if (figure is AbstractArrow arrow)
             {
                 if (arrow.SelectedZone.ZoneType == ZoneType.FirstPoint && !(arrow.DataCommon[0].FirstBox is null))
                 {
                     AbstractBox.DrawConnectionPoint(CoreUML.Graphics, arrow.Points[0]);
                 }
                 else if (arrow.SelectedZone.ZoneType == ZoneType.LastPoint && !(arrow.DataCommon[0].LastBox is null))
                 {
                     AbstractBox.DrawConnectionPoint(CoreUML.Graphics, arrow.Points[arrow.Points.Count - 1]);
                 }
             }
             CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
         }
     }
 }
コード例 #9
0
 public abstract void Interact(
     AbstractBox box,
     AbstractProcessor processor,
     AbstractMainBoard mainBoard,
     AbstractHdd hdd,
     AbstractMemory memory);