public Task LoadPlotAsync(PlotMessage plot) { if (VisualComponent != null) { if (plot.IsClearAll) { VisualComponent.Clear(); } else if (plot.IsPlot) { try { VisualComponent.LoadPlot(plot.ToBitmapImage()); } catch (Exception e) when(!e.IsCriticalException()) { VisualComponent.Error(); } } else if (plot.IsError) { VisualComponent.Error(); } } ActivePlotIndex = plot.ActivePlotIndex; PlotCount = plot.PlotCount; _interactiveWorkflow.ActiveWindow?.Container.UpdateCommandStatus(false); PlotChanged?.Invoke(this, null); return(Task.CompletedTask); }
private void SetLocatorModeUI(bool locatorMode) { if (VisualComponent != null) { VisualComponent.SetLocatorMode(locatorMode); } }
public Player() { PlayerIndex = PlayerIndex.One; PhysicsComponent = new PhysicsComponentVector(); PhysicsComponent.Position = new Vector2(200, 500); VisualComponent = new VisualComponent(this); }
public Player(PlayerIndex playerIndex) { PlayerIndex = playerIndex; PhysicsComponent = new PhysicsComponentVector(); PhysicsComponent.Position = new Vector2(700, 100); VisualComponent = new VisualComponent(this); }
public void Dispose() { _interactiveWorkflow.RSession.Connected -= RSession_Connected; _interactiveWorkflow.RSession.Disconnected -= RSession_Disconnected; VisualComponent?.Dispose(); _dispose(); }
public VisualComponent GetOrCreate(object obj) { if (_vc == null) { _vc = Init(obj); _vc.Init(obj, FieldPath); } return(_vc); }
protected virtual void BuildContents(PDFContextBase context) { if (this.LayoutType != FieldLayoutType.ValueOnly) { Label label = new Label(); label.Text = this.FieldLabel; if (!string.IsNullOrEmpty(this.LabelPostFix) && !string.IsNullOrEmpty(this.FieldLabel)) { label.Text += this.LabelPostFix; } label.StyleClass = this.LabelClass; this.Contents.Add(label); this._labelItem = label; if (this.LayoutType == FieldLayoutType.Above) { label.PositionMode = Drawing.PositionMode.Block; } else if (this.LayoutType == FieldLayoutType.NextTo) { this.PositionMode = Drawing.PositionMode.Block; label.PositionMode = Drawing.PositionMode.Block; this.ColumnCount = 2; this.Contents.Add(new ColumnBreak()); } else { label.PositionMode = Drawing.PositionMode.Inline; } } VisualComponent field = this.DoBuildItemField(context); field.StyleClass = this.ValueClass; this.Contents.Add(field); if (this.LayoutType == FieldLayoutType.Inline) { field.PositionMode = Drawing.PositionMode.Inline; } else { field.PositionMode = Drawing.PositionMode.Block; } }
public void Update(GameTime time, List <Box> boxes) { PhysicsComponent.Update(time); VisualComponent.Update(time); // World physics. This should probably be moved foreach (Box box in boxes) { var info = CollisionHelper.CollisionInfo(Box, box); if (info.IsColliding) { PhysicsComponent.Position -= info.Normal * info.Overlap; PhysicsComponent.Velocity = Vector2.Reflect(PhysicsComponent.Velocity, info.Normal) * new Vector2(1f, 0.5f); // debounce the player somewhat //player.Acceleration -= info.Normal * info.Overlap; } } }
public void SetContents(VisualComponent content) { // Some Implementation }
public void ToScene(Scene currentScene, MainCaches caches) { foreach (var obj in objects) { GameObject gameObject = GetGameObject(obj); if (obj.type == "mmdModel") { string pmxPath = obj.path; ModelPack modelPack = caches.GetModel(pmxPath); gameObject.LoadPmx(modelPack); var renderer = gameObject.GetComponent <MMDRendererComponent>(); var animationState = gameObject.GetComponent <AnimationStateComponent>(); if (obj.skinning != null) { renderer.skinning = (bool)obj.skinning; } if (obj.enableIK != null) { renderer.enableIK = (bool)obj.enableIK; } if (obj.properties != null) { if (obj.properties.TryGetValue("motion", out string motion)) { animationState.motionPath = motion; } } if (obj.materials != null) { Mat2Mat(obj.materials, renderer.Materials); } currentScene.AddGameObject(gameObject); } else if (obj.type == "model") { string path = obj.path; ModelPack modelPack = caches.GetModel(path); modelPack.LoadMeshComponent(gameObject); var renderer = gameObject.GetComponent <MeshRendererComponent>(); if (obj.materials != null) { Mat2Mat(obj.materials, renderer.Materials); } currentScene.AddGameObject(gameObject); } else { Caprice.Display.UIShowType uiShowType = default; switch (obj.type) { case "lighting": uiShowType = Caprice.Display.UIShowType.Light; break; case "decal": uiShowType = Caprice.Display.UIShowType.Decal; break; case "particle": uiShowType = Caprice.Display.UIShowType.Particle; break; default: continue; } VisualComponent component = new VisualComponent(); component.UIShowType = uiShowType; gameObject.AddComponent(component); if (obj.visual != null) { component.material = Mat2Mat(obj.visual.material); } currentScene.AddGameObject(gameObject); } } }
public override Task InvokeAsync() { VisualComponent.DecreaseThumbnailSize(); return(Task.CompletedTask); }
public ScrollDecorator(VisualComponent visualComponent) : base(visualComponent) { }
public Decorator(VisualComponent component) { this.component = component; }
/// <summary> /// Gets the zero based index of the page in the document where this Component appears /// </summary> /// <param name="ele"></param> /// <returns></returns> public virtual int GetPageIndex(VisualComponent ele) { return(this.PageIndex); }
protected Decorator(VisualComponent visualComponent) { _visualComponent = visualComponent; }
public BorderDecorator(VisualComponent c, int width) : base(c) => borderWidth = width;
public BorderDecorator(VisualComponent component, int borderWidth) : base(component) { this.borderWidth = borderWidth; }
public void Render(RenderHelper render) { render.DrawBox(Box, Color.FromNonPremultiplied(128, 128, 128, 128)); VisualComponent.Render(render); }
/// <summary> /// /// </summary> /// <param name="OldValue"></param> /// <param name="NewValue"></param> protected override void OnComponentChanged(VisualComponent OldValue, VisualComponent NewValue) { }
public Task <CommandResult> InvokeAsync() { VisualComponent.DecreaseThumbnailSize(); return(Task.FromResult(CommandResult.Executed)); }
public BasicTestData(IElementTree componentTree) { var componentTemplateCollection = new ComponentTemplateProvider(); var componentFactory = new ComponentFactory(componentTemplateCollection); ComponentRoot = componentFactory.CreateComponent <VisualComponent>(); ComponentRoot.Name = "Root"; ComponentRoot.Width = RelativeLength.Infinity; ComponentRoot.Height = RelativeLength.Infinity; ComponentRoot.LayoutDirection = LayoutDirection.Vertical; //componentTree.RootComponent = ComponentRoot; ComponentTop = componentFactory.CreateComponent <VisualComponent>(); ComponentTop.Name = "Top"; ComponentTop.Width = RelativeLength.Infinity; ComponentTop.Height = new RelativeLength(50, UnitType.Pixel); ComponentRoot.LayoutDirection = LayoutDirection.Vertical; ComponentRoot.Children.Add(ComponentTop); ComponentBottom = componentFactory.CreateComponent <VisualComponent>(); ComponentBottom.Name = "Bottom"; ComponentBottom.Width = RelativeLength.Infinity; ComponentBottom.Height = RelativeLength.Infinity; ComponentBottom.LayoutDirection = LayoutDirection.Horizontal; ComponentRoot.Children.Add(ComponentBottom); // LEFT ComponentLeft = componentFactory.CreateComponent <VisualComponent>(); ComponentLeft.Name = "Left"; ComponentLeft.Width = new RelativeLength(1, UnitType.Ratio); ComponentLeft.Height = RelativeLength.NaN; ComponentLeft.LayoutDirection = LayoutDirection.Vertical; ComponentBottom.Children.Add(ComponentLeft); ComponentLeft1 = componentFactory.CreateComponent <VisualComponent>(); ComponentLeft1.Name = "Left1"; ComponentLeft1.Width = RelativeLength.Infinity; ComponentLeft1.Height = new RelativeLength(40, UnitType.Pixel); ComponentRoot.LayoutDirection = LayoutDirection.Vertical; ComponentLeft.Children.Add(ComponentLeft1); ComponentLeft2 = componentFactory.CreateComponent <VisualComponent>(); ComponentLeft2.Name = "Left2"; ComponentLeft2.Width = RelativeLength.Infinity; ComponentLeft2.Height = new RelativeLength(40, UnitType.Pixel); ComponentRoot.LayoutDirection = LayoutDirection.Vertical; ComponentLeft.Children.Add(ComponentLeft2); // RIGHT ComponentRight = componentFactory.CreateComponent <VisualComponent>(); ComponentRight.Name = "Right"; ComponentRight.Width = new RelativeLength(3, UnitType.Ratio); ComponentRight.Height = RelativeLength.Infinity; ComponentRight.LayoutDirection = LayoutDirection.Vertical; ComponentBottom.Children.Add(ComponentRight); ComponentRight1 = componentFactory.CreateComponent <VisualComponent>(); ComponentRight1.Name = "Right1"; ComponentRight1.Width = RelativeLength.Infinity; ComponentRight1.Height = new RelativeLength(40, UnitType.Pixel); ComponentRoot.LayoutDirection = LayoutDirection.Vertical; ComponentRight.Children.Add(ComponentRight1); ComponentRight2 = componentFactory.CreateComponent <VisualComponent>(); ComponentRight2.Name = "Right2"; ComponentRight2.Width = RelativeLength.Infinity; ComponentRight2.Height = new RelativeLength(80, UnitType.Pixel); ComponentRoot.LayoutDirection = LayoutDirection.Vertical; ComponentRight.Children.Add(ComponentRight2); //componentTree.Restructure(); }
public Task <CommandResult> InvokeAsync() { VisualComponent.EndLocatorMode(); return(Task.FromResult(CommandResult.Executed)); }
public Decorator(VisualComponent comp) { component = comp; }
public Decorator(VisualComponent visualComponent) { _visualComponent = visualComponent; }
public BorderDecorator(VisualComponent visualComponent) : base(visualComponent) { }
public Task InvokeAsync() { VisualComponent.IncreaseThumbnailSize(); return(Task.CompletedTask); }