コード例 #1
0
        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);
        }
コード例 #2
0
 private void SetLocatorModeUI(bool locatorMode)
 {
     if (VisualComponent != null)
     {
         VisualComponent.SetLocatorMode(locatorMode);
     }
 }
コード例 #3
0
 public Player()
 {
     PlayerIndex               = PlayerIndex.One;
     PhysicsComponent          = new PhysicsComponentVector();
     PhysicsComponent.Position = new Vector2(200, 500);
     VisualComponent           = new VisualComponent(this);
 }
コード例 #4
0
 public Player(PlayerIndex playerIndex)
 {
     PlayerIndex               = playerIndex;
     PhysicsComponent          = new PhysicsComponentVector();
     PhysicsComponent.Position = new Vector2(700, 100);
     VisualComponent           = new VisualComponent(this);
 }
コード例 #5
0
 public void Dispose()
 {
     _interactiveWorkflow.RSession.Connected    -= RSession_Connected;
     _interactiveWorkflow.RSession.Disconnected -= RSession_Disconnected;
     VisualComponent?.Dispose();
     _dispose();
 }
コード例 #6
0
ファイル: Visual.cs プロジェクト: chismar/MyNetworkEngine
 public VisualComponent GetOrCreate(object obj)
 {
     if (_vc == null)
     {
         _vc = Init(obj);
         _vc.Init(obj, FieldPath);
     }
     return(_vc);
 }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
        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;
                }
            }
        }
コード例 #9
0
 public void SetContents(VisualComponent content)
 {
     // Some Implementation
 }
コード例 #10
0
ファイル: Coocoo3DScene.cs プロジェクト: sselecirPyM/Coocoo3D
        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);
                }
            }
        }
コード例 #11
0
 public override Task InvokeAsync()
 {
     VisualComponent.DecreaseThumbnailSize();
     return(Task.CompletedTask);
 }
コード例 #12
0
 public ScrollDecorator(VisualComponent visualComponent)
     : base(visualComponent)
 {
 }
コード例 #13
0
 public Decorator(VisualComponent component)
 {
     this.component = component;
 }
コード例 #14
0
 /// <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);
 }
コード例 #15
0
 protected Decorator(VisualComponent visualComponent)
 {
     _visualComponent = visualComponent;
 }
コード例 #16
0
 public BorderDecorator(VisualComponent c, int width) : base(c) => borderWidth = width;
コード例 #17
0
 public BorderDecorator(VisualComponent component, int borderWidth)
     : base(component)
 {
     this.borderWidth = borderWidth;
 }
コード例 #18
0
 public void Render(RenderHelper render)
 {
     render.DrawBox(Box, Color.FromNonPremultiplied(128, 128, 128, 128));
     VisualComponent.Render(render);
 }
コード例 #19
0
ファイル: AlphaSlider.cs プロジェクト: thrmotta/Imagin.NET
 /// <summary>
 ///
 /// </summary>
 /// <param name="OldValue"></param>
 /// <param name="NewValue"></param>
 protected override void OnComponentChanged(VisualComponent OldValue, VisualComponent NewValue)
 {
 }
コード例 #20
0
 public Task <CommandResult> InvokeAsync()
 {
     VisualComponent.DecreaseThumbnailSize();
     return(Task.FromResult(CommandResult.Executed));
 }
コード例 #21
0
        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();
        }
コード例 #22
0
 public Task <CommandResult> InvokeAsync()
 {
     VisualComponent.EndLocatorMode();
     return(Task.FromResult(CommandResult.Executed));
 }
コード例 #23
0
 public Decorator(VisualComponent comp)
 {
     component = comp;
 }
コード例 #24
0
 public Decorator(VisualComponent visualComponent)
 {
     _visualComponent = visualComponent;
 }
コード例 #25
0
 public BorderDecorator(VisualComponent visualComponent)
     : base(visualComponent)
 {
 }
コード例 #26
0
 public Task InvokeAsync()
 {
     VisualComponent.IncreaseThumbnailSize();
     return(Task.CompletedTask);
 }