public override NodeControl RenderChildren(RenderingContextInfo info)
        {
            if (_nodeControl == null)
            {
                double centreX = GetSurfaceCentreX(info);
                double centreY = GetSurfaceCentreY(info);

                if (SkinName != "Focal")
                {
                    NodeLocationOrganiser locationOrganiser = new NodeLocationOrganiser();
                    locationOrganiser.CentreX = centreX;
                    locationOrganiser.CentreY = centreY;
                    locationOrganiser.NumberOfNodes = NodeCount;
                    locationOrganiser.Radius = GetRadius(info);

                    Location = locationOrganiser.GetLocation(this);
                }
                else
                {
                    double focalXLocation = centreX - (Skin.NodeSkinWidth / 2); // Centre the focal node image along the x-axis.
                    double focalYLocation = centreY - (Skin.NodeSkinHeight / 2); // Centre the focal node image along the y-axis.

                    Location = new Point(focalXLocation, focalYLocation);
                }

                _nodeControl = Skin.RenderSkinElements(Node, SkinName, SkinProperties);
            }

            return _nodeControl;
        }
        private double GetRadius(RenderingContextInfo info)
        {
            double radius = 0;

            if (info.SurfaceWidth <= info.SurfaceHeight)
            {
                radius = info.SurfaceWidth / 2;
            }
            else
            {
                radius = info.SurfaceHeight / 2;
            }

            if (Skin.NodeSkinWidth >= Skin.NodeSkinHeight)
            {
                radius = radius - (Skin.NodeSkinWidth / 2);
            }
            else
            {
                radius = radius - (Skin.NodeSkinHeight / 2);
            }

            return radius;
        }
        private void ViewManager_NodesUpdated(object sender, EventArgs e)
        {
            MapDepthViewManager viewManager = sender as MapDepthViewManager;

            if (viewManager == null)
            {
                return;
            }

            RenderingContextInfo contextInfo = new RenderingContextInfo();

            contextInfo.SurfaceHeight = this.Height;
            contextInfo.SurfaceWidth = this.Width;
            contextInfo.SurfaceTopLeftX = 0;
            contextInfo.SurfaceTopLeftY = 0;

            viewManager.UpdateSurface(this, contextInfo);
            
            Command getPlayingStateCommand = new Command();
            getPlayingStateCommand.Name = "GetPlayingState";
            getPlayingStateCommand.Params = new List<Param>();
            getPlayingStateCommand.Params.Add(new Param() { Name = "CallbackId", Value = Navigator.FocalNodeId.ToString() });
            //Utilities.SendMessage(MessageSender, getPlayingStateCommand);
        }
Exemple #4
0
 public abstract NodeControl RenderChildren(RenderingContextInfo context);
 private double GetSurfaceCentreY(RenderingContextInfo info)
 {
     return (info.SurfaceHeight / 2);
 }
 private double GetSurfaceCentreX(RenderingContextInfo info)
 {
     return (info.SurfaceWidth / 2);
 }