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; }
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; } } }
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; } } }
public Border(Component parent, int width, Color color) { this.parent = parent; this.width = width; this.color = color; }
/// <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; }
/// <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; }
/// <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."); }
/// <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."); }