public LokiFlowPort(Orientation portOrientation, Direction portDirection, Capacity capacity, string name = "Unnamed Port") : base(portOrientation, portDirection, capacity, name) { var ss = LokiResources.Get <StyleSheet>("StyleSheets/LokiFlowPort.uss"); styleSheets.Add(ss); defaultColor = new Color(0f, 0.62f, 0.79f, 0.82f); color = defaultColor; generateVisualContent += OnGenerateVisualContent; }
public LokiEdge() { styleSheets.Add(LokiResources.Get <StyleSheet>("StyleSheets/LokiEdge.uss")); capabilities |= Capabilities.Selectable | Capabilities.Deletable; usageHints = UsageHints.DynamicTransform; generateVisualContent += OnGenerateVisualContent; RegisterCallback <MouseEnterEvent>(OnMouseEnter); RegisterCallback <MouseLeaveEvent>(OnMouseLeave); RegisterCallback <AttachToPanelEvent>(OnAttachToPanel); RegisterCallback <DetachFromPanelEvent>(OnDetachFromPanel); this.AddManipulator(new ContextualMenuManipulator(OnContextMenuPopulate)); }
public LokiNodeView(LokiNodeAdapter adapter) { this.adapter = adapter; var visualTree = LokiResources.Get <VisualTreeAsset>("UXML/LokiNodeView.uxml"); visualTree.CloneTree(this); var styleSheet = LokiResources.Get <StyleSheet>("StyleSheets/LokiNodeView.uss"); styleSheets.Add(styleSheet); this.AddToClassList("node"); capabilities |= Capabilities.Selectable | Capabilities.Movable | Capabilities.Deletable | Capabilities.Ascendable | Capabilities.Copiable; usageHints = UsageHints.DynamicTransform; style.position = Position.Absolute; selectionBorder = this.Q <VisualElement>("selection-border"); container = this.Q <VisualElement>("node-root"); headerContainer = this.Q <VisualElement>("header-container"); midContainer = this.Q <VisualElement>("mid-container"); titleLabel = headerContainer.Q <Label>("title"); container.RegisterCallback <GeometryChangedEvent>(OnRootGeometryChanged); this.RegisterCallback <MouseEnterEvent>(OnMouseEnter); this.RegisterCallback <MouseLeaveEvent>(OnMouseLeave); adapter.BuildNodeView(this); }