public BasicNode(BasicNodeStructure structure, RectangleRenderElementStyle border_style) { Structure = structure; BorderStyle = border_style; BorderElement = new RectangleRenderElement(Position, Width, Height, border_style.FillColor, border_style.BorderColor, border_style.BorderWidth); TriggerAreas.Add(new RectangleHitbox(Position, Width, Height)); }
public ClassDiagramNode(ClassStructure codestructure, BasicNodeStructure structure, RectangleRenderElementStyle border_style) : base(structure, border_style) { CodeStructure = codestructure; NameTextBox = new TextBoxNode(new BasicTextNodeStructure(Position, Renderer.GetTextWidth(Name.Length), Renderer.SingleTextHeight, Name), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); NameLine = new LineRenderElement(new Vector(Position.X, Position.Y + Renderer.SingleTextHeight), new Vector(Position.X + Width, Position.Y + Renderer.SingleTextHeight), 1, Color.Black); SeparatorLine = new LineRenderElement(new Vector(Position.X, Position.Y + Renderer.SingleTextHeight), new Vector(Position.X + Width, Position.Y + Renderer.SingleTextHeight), 1, Color.Black); Children.Add(NameTextBox); GeneratePrefab(); RepositionChildren(); SetEvents(); }
public PropertyNode(PropertyStructure codeStructure, BasicNodeStructure structure, RectangleRenderElementStyle border_style) : base(structure, border_style) { CodeStructure = codeStructure; AccessModifierButton = new ButtonNode(new ButtonStructure(Position, "+", Renderer.SingleTextWidth, Height, () => OnMenuShow?.Invoke(this, EventArgs.Empty)), RectangleRenderElementStyle.Textbox, TextRenderElementStyle.Default); NameTextBox = new TextBoxNode(new BasicTextNodeStructure(Position, Renderer.GetTextWidth(Name.Length), Height, Name), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); Separator = new LabelNode(new BasicTextNodeStructure(Position, Renderer.SingleTextWidth, Height, ":"), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); TypeTextBox = new TextBoxNode(new BasicTextNodeStructure(Position, Renderer.GetTextWidth(Type.Length), Height, Type), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); Children.Add(AccessModifierButton); Children.Add(NameTextBox); Children.Add(Separator); Children.Add(TypeTextBox); OnUnfocused += OnUnFocus; GenerateMenu(); GenerateOptions(); }
public MethodNode(MethodStructure codeStructure, BasicNodeStructure structure, RectangleRenderElementStyle border_style) : base(new PropertyStructure(codeStructure.Position, codeStructure.Name, codeStructure.Type, codeStructure.AccessModifier, codeStructure.Modifier), structure, border_style) { CodeStructure = codeStructure; LeftBracket = new LabelNode(new BasicTextNodeStructure(Position + new Vector(AccessModifierButton.Width + NameTextBox.Width, 0), Renderer.SingleTextWidth, Height, "("), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); string argum = codeStructure.Arguments; ArgumentsTextBox = new TextBoxNode(new BasicTextNodeStructure(Position + new Vector(AccessModifierButton.Width + NameTextBox.Width + LeftBracket.Width, 0), Renderer.GetTextWidth(argum.Length), Height, argum), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); RightBracket = new LabelNode(new BasicTextNodeStructure(Position + new Vector(NameTextBox.Width + AccessModifierButton.Width + ArgumentsTextBox.Width + LeftBracket.Width, 0), Renderer.SingleTextWidth, Height, ")"), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox); Children.Add(LeftBracket); Children.Add(RightBracket); Children.Add(ArgumentsTextBox); GenerateMenu(); GenerateOptions(); }