public TransitionContactPointCircleGlyph(Point centre, int radius, IGlyph parent, TransitionContactEnd whichEnd, TransitionContactPointCircleGlyph otherEnd) : base(centre, radius) { this.Parent = parent; this._WhichEnd = whichEnd; this._OtherEnd = otherEnd; }
public void MouseDown(object sender, MouseEventArgs e) { _CurrentGlyph = null; _Model.DeSelectAllGlyphs (); _Point = new Point (e.X, e.Y); IGlyph actualCurrentGlyph; _CurrentGlyph = _Model.FindContactPoint (_Point, out actualCurrentGlyph); _ActualCurrentGlyph = actualCurrentGlyph; if (_CurrentGlyph == null) { _CurrentGlyph = _Model.FindGlyph (_Point); _ActualCurrentGlyph = _CurrentGlyph; } if (_CurrentGlyph != null) { System.Diagnostics.Debug.Assert (_ActualCurrentGlyph != null); _Context.SelectGlyph (_ActualCurrentGlyph); _LastSelectedGlyph = _ActualCurrentGlyph; } else { _Context.ShowHeader (); } }
protected string GlyphNameFrom(IGlyph glyph) { Stack stack = new Stack(); while (glyph != null) { stack.Push(glyph); glyph = glyph.Parent; while (glyph != null && AcceptParentInFullyQualifiedName(glyph) == false) { glyph = glyph.Parent; } } System.Text.StringBuilder builder = new System.Text.StringBuilder(); bool first = true; while (stack.Count > 0) { if (first) { first = false; } else { builder.Append("."); } glyph = stack.Pop() as IGlyph; builder.Append(GlyphNameFromString(glyph.Name)); } return(builder.ToString()); }
public GlyphPlacement(IGlyph glyph, int x, int y, int index) { this.Glyph = glyph; this.X = x; this.Y = y; this.Index = index; }
private void horizontal_ContactPoint(IGlyph glyph, OffsetEventArgs offsetEventArgs) { int expectedYPos = _Bounds.Y + _Bounds.Height / 2; int currentYPos = glyph.Bounds.Y + glyph.Bounds.Height / 2; offsetEventArgs.Offset = new Point(offsetEventArgs.Offset.X, expectedYPos - currentYPos); }
public PortLinkContactPointGlyph(Point centre, int radius, IGlyph parent, TransitionContactEnd whichEnd, PortLinkContactPointGlyph otherEnd) : base(new Rectangle (centre.X - radius, centre.Y - radius, radius + radius, radius + radius)) { this.Parent = parent; this._WhichEnd = whichEnd; this._OtherEnd = otherEnd; }
public void MouseDown(object sender, MouseEventArgs e) { _CurrentGlyph = null; _Model.DeSelectAllGlyphs(); _Point = new Point(e.X, e.Y); IGlyph actualCurrentGlyph; _CurrentGlyph = _Model.FindContactPoint(_Point, out actualCurrentGlyph); _ActualCurrentGlyph = actualCurrentGlyph; if (_CurrentGlyph == null) { _CurrentGlyph = _Model.FindGlyph(_Point); _ActualCurrentGlyph = _CurrentGlyph; } if (_CurrentGlyph != null) { System.Diagnostics.Debug.Assert(_ActualCurrentGlyph != null); _Context.SelectGlyph(_ActualCurrentGlyph); _LastSelectedGlyph = _ActualCurrentGlyph; } else { _Context.ShowHeader(); } }
void BuildStateTransitionParentRelationships() { foreach (DictionaryEntry de in _EntityLinkRel) { IGlyph glyph = _GlyphLookup [de.Key] as IGlyph; StringPair pair = de.Value as StringPair; IGlyph parentOne = _GlyphLookup [pair.One] as IGlyph; IGlyph parentTwo = _GlyphLookup [pair.Two] as IGlyph; IGroupGlyph groupGlyph = glyph as IGroupGlyph; int index = 0; foreach (IGlyph contact in groupGlyph.ContactPoints) { switch (index) { case 0: { contact.Parent = parentOne; } break; case 1: { contact.Parent = parentTwo; } break; } index++; } } }
private void vertical_ContactPoint(IGlyph glyph, OffsetEventArgs offsetEventArgs) { int expectedXPos = _Bounds.X + _Bounds.Width / 2; int currentXPos = glyph.Bounds.X + glyph.Bounds.Width / 2; offsetEventArgs.Offset = new Point(expectedXPos - currentXPos, offsetEventArgs.Offset.Y); }
protected void RaiseGlyphChange(GlyphChangeHandler handler, object sender, IGlyph glyph) { if (handler != null) { handler(sender, glyph); } }
public void RemoveOwned(IGlyph owned) { if (_OwnedItems.Contains(owned)) { _OwnedItems.Remove(owned); } }
public PortLinkContactPointGlyph(Point centre, int radius, IGlyph parent, TransitionContactEnd whichEnd, PortLinkContactPointGlyph otherEnd) : base(new Rectangle(centre.X - radius, centre.Y - radius, radius + radius, radius + radius)) { this.Parent = parent; this._WhichEnd = whichEnd; this._OtherEnd = otherEnd; }
public void RemoveChild(IGlyph child) { if (_Children.Contains(child)) { _Children.Remove(child); } }
protected override bool AcceptParentInFullyQualifiedName(IGlyph glyph) { System.Diagnostics.Debug.Assert(glyph != null); IStateGlyph state = glyph as IStateGlyph; System.Diagnostics.Debug.Assert(state != null); return(!state.IsOverriding); }
void LoadGlyphCommon(TextReader sr, IGlyph glyph) { glyph.Note = LoadText(sr, "NOTE:", ""); string doNotInstrument = LoadText(sr, "DEBUG_DONOTINSTRUMENT", false.ToString()); glyph.DoNotInstrument = bool.Parse(doNotInstrument); }
/// <summary> /// 指定した文字が単語の途中にあるかどうかを返します。 /// </summary> /// <param name="g"></param> /// <returns></returns> public virtual bool IsInWord(IGlyph g) { var cat = Char.GetUnicodeCategory(((Glyph)g).Character); return(cat == UnicodeCategory.DecimalDigitNumber || cat == UnicodeCategory.LowercaseLetter || cat == UnicodeCategory.UppercaseLetter); }
Rectangle GetReparentBounds(IGlyph currentGlyph) { #warning Kludge that counteracts the inflating of bounds for easier selection purposes - which makes reparenting worse. Rectangle currentGlyphBounds = currentGlyph.Bounds; currentGlyphBounds = new Rectangle(currentGlyphBounds.Location, currentGlyphBounds.Size); currentGlyphBounds.Inflate(-5, -5); return(currentGlyphBounds); }
public override void ExecuteAndUpdateCurrentLine() { switch (CurrentLine) { case 0: CurrentLine = 3; return; case 3: CurrentLine = 6; return; case 6: IGlyph glyph1 = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.I - 1); status.CanEdit = true; status.E = ((Square)glyph1).Text; break; case 7: //判断for语句条件是否成立,如果成立,CurrentLine = 8;不成立,CurrentLine = 10; if (status.J > status.Length - 1) { CurrentLine = 10; return; } break; case 8: //移动一个图形元素. movedGlyphs.Add(((ArrayIterator)arrayIterator).GetGlyphByIndex(status.J)); IGlyph tempGlyph = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.J); IGlyph tempGlyph1 = new Square(tempGlyph.Bounds.X - tempGlyph.Bounds.Width - squareSpace, tempGlyph.Bounds.Y, squareSize, status.图形背景色, status.图形外观, ((Square)tempGlyph).Text); ((ArrayIterator)arrayIterator).MoveGlyphHorizon(status.J, tempGlyph1, 0); string c = status.L[status.J].ToString(); status.CanEdit = true; status.L = status.L.Remove(status.J - 1, 1); status.CanEdit = true; status.L = status.L.Insert(status.J - 1, c); status.CanEdit = true; status.J++; CurrentLine = 7; return; case 10: //线性表长度减1 status.CanEdit = true; status.Length--; status.CanEdit = true; status.L = status.L.Remove(status.Length, 1); //删除最后一个结点 ((ArrayIterator)arrayIterator).DeleteGlyph(status.Length); break; case 11: return; } CurrentLine++; }
void SaveBounds(TextWriter sw, string elementType, IGlyph glyph) { sw.WriteLine (elementType); sw.WriteLine (glyph.Id); sw.WriteLine (glyph.Bounds.X); sw.WriteLine (glyph.Bounds.Y); sw.WriteLine (glyph.Bounds.Width); sw.WriteLine (glyph.Bounds.Height); }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destType) { if (destType == typeof(string) && value is IGlyph) { IGlyph glyph = (IGlyph)value; return(glyph.Name); } return(base.ConvertTo(context, culture, value, destType)); }
protected void DoGlyphCreated(IGlyph createdGlyph) { GlyphCreatedHandler handler = GlyphCreated; if (handler != null) { handler(createdGlyph); } }
void SaveBounds(TextWriter sw, string elementType, IGlyph glyph) { sw.WriteLine(elementType); sw.WriteLine(glyph.Id); sw.WriteLine(glyph.Bounds.X); sw.WriteLine(glyph.Bounds.Y); sw.WriteLine(glyph.Bounds.Width); sw.WriteLine(glyph.Bounds.Height); }
public static string Process(string[] glyphs, Size size, char on, char off) { if (glyphs == null || glyphs[0] == null) { return("glyph error"); } IGlyph glyphConverter = Converters[size]; Dictionary <char, string[]> alphabet = glyphConverter.Alphabet; // make sure the correct characters are used if (on != IGlyph.On) { for (int i = 0; i < glyphs.Length; ++i) { glyphs[i] = glyphs[i].Replace(on, IGlyph.On); } } if (off != IGlyph.Off) { for (int i = 0; i < glyphs.Length; ++i) { glyphs[i] = glyphs[i].Replace(off, IGlyph.Off); } } // make sure the glyph adheres to the correct size int length = glyphs[0].Length % glyphConverter.Width; if (length != 0) { string empty = new string(IGlyph.Off, 5 - length); for (int i = 0; i < glyphs.Length; ++i) { glyphs[i] += empty; } } // convert glyph to letter StringBuilder sb = new StringBuilder(); for (int i = 0; i < glyphs[0].Length; i += glyphConverter.Width) { char letter = '?'; IEnumerable <string> glyph = glyphs.Select(s => s.Substring(i, glyphConverter.Width)); foreach (KeyValuePair <char, string[]> pair in alphabet) { if (pair.Value != null && pair.Value.SequenceEqual(glyph)) { letter = pair.Key; break; } } sb.Append(letter); } return(sb.ToString()); }
private void horizontal_ContactPoint (IGlyph glyph, OffsetEventArgs offsetEventArgs) { if (glyph is IOperationContactPointGlyph) { int expectedYPos = _Bounds.Y + _Bounds.Height / 2; int currentYPos = glyph.Bounds.Y + glyph.Bounds.Height / 2; offsetEventArgs.Offset = new Point (offsetEventArgs.Offset.X, expectedYPos - currentYPos); } }
private void vertical_ContactPoint (IGlyph glyph, OffsetEventArgs offsetEventArgs) { if (glyph is IOperationContactPointGlyph) { int expectedXPos = _Bounds.X + _Bounds.Width / 2; int currentXPos = glyph.Bounds.X + glyph.Bounds.Width / 2; offsetEventArgs.Offset = new Point (expectedXPos - currentXPos, offsetEventArgs.Offset.Y); } }
void BuildStateParentRelationships() { foreach (DictionaryEntry de in _ParentChildRel) { IGlyph glyph = _GlyphLookup [de.Key] as IGlyph; IGlyph parent = _GlyphLookup [de.Value] as IGlyph; glyph.Parent = parent; } }
protected override void contactPoint_OffsetChanged(IGlyph glyph, OffsetEventArgs offsetEventArgs) { Point offset = offsetEventArgs.Offset; int index = _ContactPoints.IndexOf(glyph); if (glyph is IOperationPortGlyph) { _Bounds.Offset(offset); foreach (IGlyph contactPoint in ContactPoints) { if (contactPoint is IOperationContactPointGlyph) { ReOffsetContactPoint(contactPoint, offset); } } } else { switch (index) { case 0: { _Bounds.X += offset.X; _Bounds.Width -= offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint(2, offset); ReOffsetContactPoint(3, offset); } break; case 1: { _Bounds.Width += offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint(2, offset); ReOffsetContactPoint(3, offset); } break; case 2: { _Bounds.Y += offset.Y; _Bounds.Height -= offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint(0, offset); ReOffsetContactPoint(1, offset); } break; case 3: { _Bounds.Height += offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint(0, offset); ReOffsetContactPoint(1, offset); } break; } } }
public IGlyph FindGlyph(System.Drawing.Point point) { IGlyph glyph = InnerFindGlyph(point); if (ContainsDeletedGlyph(glyph)) { System.Diagnostics.Debug.Assert(false, "Deleted glyph found in _Glyphs or glyph.Children - see InnerFindGlyph ()"); } return(glyph); }
public void AddOwned(IGlyph owned) { if (!_OwnedItems.Contains(owned)) { _OwnedItems.Add(owned); // must be after _OwnedItems.Add since owned.Owner = owner // calls back to owner.AddOwned (owned) owned.Owner = this; } }
public void AddChild(IGlyph child) { if (!_Children.Contains(child)) { _Children.Add(child); // must be after _Children.Add since child.Parent = parent // calls back to parent.AddChild (child) child.Parent = this; } }
public TextBlock GetGlyph(Type glyphType, double fontSize) { IGlyph glyph = GetGlyphInstance(glyphType); TextBlock tb = new TextBlock(); tb.FontFamily = GetFontFamily(glyphType); tb.Text = glyph.GlyphCode; tb.FontSize = fontSize; tb.BaselineOffset = fontSize * GetBaseLineOffsetFactor(glyphType); return(tb); }
public void ShouldReturnHuman() { //Arrange GlyphValidInputResponseAction subject = new GlyphValidInputResponseAction(); //Act IGlyph actual = subject.Response("AB"); //Assert actual.Value().Should().Be("A"); }
public int CountParentDepth() { int depth = 0; IGlyph p = _Parent; while (p != null) { depth++; p = p.Parent; } return(depth); }
public void MoveGlyphHorizon(int glyphIndex, IGlyph insertGlyph, int direction) { if (direction == 1) //说明向右移 { glyphArray.RemoveAt(glyphIndex + 1); glyphArray.Insert(glyphIndex + 1, insertGlyph); } else if (direction == 0) //说明向左移 { glyphArray.RemoveAt(glyphIndex - 1); glyphArray.Insert(glyphIndex - 1, insertGlyph); } }
IGlyph InnerFindGlyph(IGlyph glyph, System.Drawing.Point point) { foreach (IGlyph child in glyph.Children) { if (child.ContainsPoint(point)) { if (ContainsGlyph(child)) { return(InnerFindGlyph(child, point)); } } } return(glyph); }
IGlyph InnerFindGlyph (IGlyph glyph, System.Drawing.Point point) { foreach (IGlyph child in glyph.Children) { if (child.ContainsPoint (point)) { if (ContainsGlyph (child)) { return InnerFindGlyph (child, point); } } } return glyph; }
public void SetCurrentItemNewColor(IGlyph glyph,Color newColor,Color oldColor) { INode currentNode = headNode.Next; while(currentNode != null) { if(currentNode.ToString() == glyph.ToString()) { currentNode.BackColor = newColor; } else { currentNode.BackColor = oldColor; } currentNode = currentNode.Next; } }
protected void WriteGlyphXml(XmlTextWriter writer, IGlyph glyph) { writer.WriteStartElement (glyph.GetType ().Name); try { WriteGlyphProperties (writer, glyph); foreach (IGlyph child in glyph.Children) { // only internal glyphs are owned i.e. contact points, etc. - so skip them. if (child.Owner == null) { WriteGlyphXml (writer, child); } } } finally { writer.WriteEndElement (); } }
void ReOffsetChild (IGlyph child, Point point) { child.Offset (point); }
public NullIterator(IGlyph glyph) { this.glyph = glyph; }
IGlyph CreateVisitedGlyph(IGlyph glyph) { int count = ((ArrayIterator)visitedIterator).Count; int diameter = 35; int x = 1; int y = 1; IPadContent animationPad = WorkbenchSingleton.Workbench.GetPad(typeof(NetFocus.DataStructure.Gui.Pads.AnimationPad)); if(animationPad != null) { x = 10 + count * (diameter + 5); y = animationPad.Control.Height - diameter - 10; } string text = ((IBiTreeNode)glyph).Text; return new BiTreeNode(x,y,diameter,status.遍历过结点颜色,text); }
IGlyph CreateStackItem(IGlyph nodeGlyph) { int itemCount = ((StackIterator)stackIterator).ItemCount; int x = 2; int y = 10; int width = 1; int height = 28; IPadContent stackPad = WorkbenchSingleton.Workbench.GetPad(typeof(NetFocus.DataStructure.Gui.Pads.StackPad)); if(stackPad != null) { y = stackPad.Control.Height - (itemCount + 1) * (2 + 28) - 1; width = stackPad.Control.Width - 6; } string text = ((IBiTreeNode)nodeGlyph).Text; return new StackItem(x,y,width,height,SystemColors.Control,GlyphAppearance.Popup,text); }
protected abstract void contactPoint_OffsetChanged(IGlyph glyph, OffsetEventArgs offsetEventArgs);
public OperationPortGlyph(Rectangle bounds, IGlyph parent, string portName) : base(bounds) { this.Parent = parent; _PortName = portName; }
void linkGlyph_Clicked(IGlyph glyph, Figure figure, DPoint pt) { ExecLink(figure); }
void LoadGlyphCommon(TextReader sr, IGlyph glyph) { glyph.Note = LoadText (sr, "NOTE:", ""); string doNotInstrument = LoadText (sr, "DEBUG_DONOTINSTRUMENT", false.ToString ()); glyph.DoNotInstrument = bool.Parse (doNotInstrument); }
public override void ExecuteAndUpdateCurrentLine() { switch (CurrentLine) { case 0: CurrentLine = 2; return; case 2: //i = low; j = high; R[0] = R[i]; status.CanEdit = true; status.I = status.Low; status.CanEdit = true; status.J = status.High; AssignValue(0,status.I); ch = status.R[status.I - 1].ToString(); CurrentLine = 4; return; case 4: //while(R[j].key >= R[0].key && j > i){ glyphJ = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.J); if(glyphJ != null) { nullIteratorJ = new VerticalPointer(glyphJ.Bounds.X + 10,glyphJ.Bounds.Y + glyphJ.Bounds.Height + 2,Color.Red,"j",GlyphAppearance.Flat).CreateIterator(); } indexArray.Clear(); currentIndex = status.J; AddIndexToIndexArray(currentIndex); ((ArrayIterator)arrayIterator).SetElementsBackColor(indexArray,status.当前背景色,status.图形背景色); if(status.R[status.J - 1] < ch[0] || status.J <= status.I) { CurrentLine = 7; return; } break; case 5: //j--; status.CanEdit = true; status.J--; glyphJ = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.J); if(glyphJ != null) { nullIteratorJ = new VerticalPointer(glyphJ.Bounds.X + 10,glyphJ.Bounds.Y + glyphJ.Bounds.Height + 2,Color.Red,"j",GlyphAppearance.Flat).CreateIterator(); } CurrentLine = 4; return; case 7: //if(j > i){ if(status.J <= status.I) { CurrentLine = 10; return; } break; case 8: //R[i] = R[j]; i++; AssignValue(status.I,status.J); string c = status.R[status.J - 1].ToString(); status.CanEdit = true; status.R = status.R.Remove(status.I - 1,1); status.CanEdit = true; status.R = status.R.Insert(status.I - 1,c); status.CanEdit = true; status.I++; glyphI = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.I); if(glyphI != null) { nullIteratorI = new VerticalPointer(glyphI.Bounds.X - 10,glyphI.Bounds.Y + glyphI.Bounds.Height + 2,Color.Red,"i",GlyphAppearance.Flat).CreateIterator(); } CurrentLine = 10; return; case 10: //while(R[i].key <= R[0].key && j > i){ glyphI = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.I); if(glyphI != null) { nullIteratorI = new VerticalPointer(glyphI.Bounds.X - 10,glyphI.Bounds.Y + glyphI.Bounds.Height + 2,Color.Red,"i",GlyphAppearance.Flat).CreateIterator(); } indexArray.Clear(); currentIndex = status.I; AddIndexToIndexArray(currentIndex); ((ArrayIterator)arrayIterator).SetElementsBackColor(indexArray,status.当前背景色,status.图形背景色); if(status.R[status.I - 1] > ch[0] || status.J <= status.I) { CurrentLine = 13; return; } break; case 11: //i++; status.CanEdit = true; status.I++; glyphI = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.I); if(glyphI != null) { nullIteratorI = new VerticalPointer(glyphI.Bounds.X - 10,glyphI.Bounds.Y + glyphI.Bounds.Height + 2,Color.Red,"i",GlyphAppearance.Flat).CreateIterator(); } CurrentLine = 10; return; case 13: //if(j > i){ if(status.J <= status.I) { CurrentLine = 16; return; } break; case 14: //R[j] = R[i]; j--; AssignValue(status.J,status.I); string c1 = status.R[status.I - 1].ToString(); status.CanEdit = true; status.R = status.R.Remove(status.J - 1,1); status.R = status.R.Insert(status.J - 1,c1); status.CanEdit = true; status.J--; glyphJ = ((ArrayIterator)arrayIterator).GetGlyphByIndex(status.J); if(glyphJ != null) { nullIteratorJ = new VerticalPointer(glyphJ.Bounds.X + 10,glyphJ.Bounds.Y + glyphJ.Bounds.Height + 2,Color.Red,"j",GlyphAppearance.Flat).CreateIterator(); } CurrentLine = 16; return; case 16: //while(i == j); if(status.J != status.I) { CurrentLine = 4; return; } break; case 17: //R[i] = R[0]; AssignValue(status.I,0); status.CanEdit = true; status.R = status.R.Remove(status.I - 1,1); status.CanEdit = true; status.R = status.R.Insert(status.I - 1,ch); break; case 18: //return; return; } CurrentLine++; }
protected virtual void ReOffsetContactPoint(IGlyph contact, Point point) { contact.OffsetChanged -= new OffsetChangedHandler (contactPoint_OffsetChanged); contact.Offset (point); contact.OffsetChanged += new OffsetChangedHandler (contactPoint_OffsetChanged); }
protected override void contactPoint_OffsetChanged(IGlyph glyph, OffsetEventArgs offsetEventArgs) { Point offset = offsetEventArgs.Offset; int index = _ContactPoints.IndexOf (glyph); if (glyph is IOperationPortGlyph) { _Bounds.Offset (offset); foreach (IGlyph contactPoint in ContactPoints) { if (contactPoint is IOperationContactPointGlyph) { ReOffsetContactPoint (contactPoint, offset); } } } else { switch (index) { case 0: { _Bounds.X += offset.X; _Bounds.Width -= offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint (2, offset); ReOffsetContactPoint (3, offset); } break; case 1: { _Bounds.Width += offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint (2, offset); ReOffsetContactPoint (3, offset); } break; case 2: { _Bounds.Y += offset.Y; _Bounds.Height -= offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint (0, offset); ReOffsetContactPoint (1, offset); } break; case 3: { _Bounds.Height += offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint (0, offset); ReOffsetContactPoint (1, offset); } break; } } }
public bool ContainsGlyph(IGlyph glyph) { return false; }
protected override void contactPoint_OffsetChanged(IGlyph glyph, OffsetEventArgs offsetEventArgs) { int index = _ContactPoints.IndexOf (glyph); switch (index) { case 0: { _From.Offset (offsetEventArgs.Offset.X, offsetEventArgs.Offset.Y); } break; case 1: { _To.Offset (offsetEventArgs.Offset.X, offsetEventArgs.Offset.Y); } break; } }
Rectangle GetBoundsFrom(Point point, IGlyph glyph) { Rectangle bounds = glyph.Bounds; return new Rectangle (point, bounds.Size); }
protected virtual void AddContactPoint(IGlyph contactPoint) { contactPoint.Owner = this; _ContactPoints.Add (contactPoint); contactPoint.OffsetChanged += new OffsetChangedHandler(contactPoint_OffsetChanged); }
public OperationContactPointGlyph(Rectangle bounds, IGlyph parent, OffsetChangedHandler positionAlg) : base(bounds) { this.Parent = parent; _PositionAlg = positionAlg; }
public void SelectGlyph(IGlyph glyph) { glyph.Selected = true; DoGlyphChange (glyph); }
public void PushGlyph(IGlyph glyph) { arrayList.Add(glyph); }
protected void DoGlyphChange(IGlyph glyph) { _GlyphPropertyWindow.Glyph = glyph; }
protected override void contactPoint_OffsetChanged(IGlyph glyph, OffsetEventArgs offsetEventArgs) { Point offset = offsetEventArgs.Offset; int index = _ContactPoints.IndexOf (glyph); switch (index) { case 0: { _Bounds.X += offset.X; _Bounds.Width -= offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint (2, offset); ReOffsetContactPoint (3, offset); } break; case 1: { _Bounds.Width += offset.X; _Bounds.Height += offset.Y; ReOffsetContactPoint (2, offset); ReOffsetContactPoint (3, offset); } break; case 2: { _Bounds.Y += offset.Y; _Bounds.Height -= offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint (0, offset); ReOffsetContactPoint (1, offset); } break; case 3: { _Bounds.Height += offset.Y; _Bounds.Width += offset.X; ReOffsetContactPoint (0, offset); ReOffsetContactPoint (1, offset); } break; } }
private void creator_GlyphCreated(IGlyph glyph) { if (resetToHandCheckBox.Checked) { SelectMoveInteractor (); } }