Beispiel #1
0
        public Annotation(PedigreeAnnotation annotation)
        {
            InitializeComponent();
            label = annotation.annotation;
            Size labelSize = TextRenderer.MeasureText(label, textFont);

            this.Size = new Size(labelSize.Width, labelSize.Height);
            this.Name = label;

            hraAnnotation = annotation;
        }
Beispiel #2
0
        public void SetPedigreeAnnotation(PedigreeAnnotation pa)
        {
            Annotation a = null;

            foreach (AnnotationContainer ac in annotation_areas)
            {
                bool found = false;
                foreach (AnnotationContainerSlot acs in ac.slots)
                {
                    if (acs.resident != null)
                    {
                        if (acs.resident.label == pa.annotation)
                        {
                            if (acs.resident.hraAnnotation != pa)
                            {
                                acs.resident.hraAnnotation = pa;
                            }

                            a = acs.resident;
                            break;
                        }
                    }
                }
                if (found)
                {
                    break;
                }
            }
            if (a != null)
            {
                foreach (AnnotationContainer ac in annotation_areas)
                {
                    if (ac.area == pa.area)
                    {
                        if (a.StartingContainer != ac)
                        {
                            ac.AddAnnotation(a);
                            a.hraAnnotation.area = ac.area;
                        }
                    }
                    else
                    {
                        ac.RemoveAnnotation(a);
                    }
                }
            }
        }