Inheritance: Drawable, MouseOverable
Esempio n. 1
0
        public Circle(Component compontent, int radius, int circleWidth, Point center, Color color)
        {
            this.component = compontent;
            this.radius = radius;
            this.circleWidth = circleWidth;

            this.center = center;
            this.outerRadius = radius * 2 + 2;
            this.color = color;
        }
Esempio n. 2
0
        public void OnMouseMotion(MouseEvent e)
        {
            foreach (ParentComponent pc in this.componentList)
            {
                Component mouseOver = pc.GetComponentAt(e.location);

                if( previousMouseOver != null && previousMouseOver != mouseOver ) FireMouseExitEvents(e);
                if (mouseOver != null)
                {
                    if (!mouseOver.isMouseOver)
                    {
                        ((MouseOverable)mouseOver).OnMouseEnter(e);
                    }
                    previousMouseOver = mouseOver;
                }

            }
        }
Esempio n. 3
0
        public void OnMouseMotion(MouseEvent e)
        {
            LinkedList<ParentComponent> sortedList = this.SortComponentsByZ(this.componentList, false);

            foreach (ParentComponent pc in sortedList)
            {
                Component mouseOver = pc.GetComponentAt(e.location);

                if (previousMouseOver != null && previousMouseOver != mouseOver) previousMouseOver.OnMouseExit(e);

                //FireMouseExitEvents(e);
                if (mouseOver != null)
                {
                    if (!mouseOver.isMouseOver)
                    {
                        ((MouseOverable)mouseOver).OnMouseEnter(e);
                    }
                    previousMouseOver = mouseOver;
                    break;
                }
            }
        }
Esempio n. 4
0
 public Border(Component parent, int width, Color color)
 {
     this.parent = parent;
     this.width = width;
     this.color = color;
 }
Esempio n. 5
0
 /// <summary>
 /// Removes a child from this component.
 /// </summary>
 /// <param name="component">The component to remove.</param>
 /// <returns>Whether the child was removed or not.</returns>
 public Boolean RemoveChild(Component component)
 {
     if (this.children.Contains(component))
     {
         component.parent = null;
         this.children.Remove(component);
         return true;
     }
     else return false;
 }
Esempio n. 6
0
 /// <summary>
 /// Adds a child to this component.
 /// </summary>
 /// <param name="component">The component to add to this parent component</param>
 public void AddChild(Component component)
 {
     this.children.AddLast(component);
     component.parent = this;
 }
Esempio n. 7
0
 /// <summary>
 /// DO NOT USE THIS FUNCTION UNLESS YOU WANT TO HAVE A NICE FAT EXCEPTION.
 /// </summary>
 /// <param name="c">F**k you</param>
 public new Boolean RemoveChild(Component c)
 {
     throw new NotSupportedException("Use RemoveChild(String optionName) instead.");
 }
Esempio n. 8
0
 /// <summary>
 /// DO NOT USE THIS FUNCTION UNLESS YOU WANT TO HAVE A NICE FAT EXCEPTION.
 /// </summary>
 /// <param name="c">F**k you</param>
 public new void AddChild(Component c)
 {
     throw new NotSupportedException("Use AddChild(String optionName) instead.");
 }