private void OnGetCurrentNodesCompleted(object sender, RendererNodesEventArgs e)
        {
            // TODO: When TODO item ID:1001 is being done a replacement for the following needs to be considered too.
            this.uxMapSurface.Children.Clear();

            RenderingContextInfo contextInfo = new RenderingContextInfo();

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

            foreach (KeyValuePair <Guid, INodeRenderer> nodeRenderer in e.View.NodeRenderers)
            {
                nodeRenderer.Value.Context = contextInfo;
                UIElement nodeRendererControl = nodeRenderer.Value as UIElement;

                if (nodeRendererControl != null)
                {
                    this.uxMapSurface.Children.Add(nodeRendererControl);
                }
            }

            foreach (KeyValuePair <Guid, IRelationshipRenderer> relationshipRenderer in e.View.RelationshipRenderers)
            {
                UIElement relationshipRendererControl = relationshipRenderer.Value as UIElement;

                if (relationshipRendererControl != null)
                {
                    this.uxMapSurface.Children.Add(relationshipRendererControl);
                }
            }
        }
Exemplo n.º 2
0
        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 Dictionary <string, string>();
            getPlayingStateCommand.Params.Add("CallbackId", Navigator.FocalNodeId.ToString());
            Utilities.SendMessage(MessageSender, getPlayingStateCommand);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public override NodeControl RenderChildren(RenderingContextInfo info)
        {
            if (_nodeControl == null)
            {
                double x = 0.0;
                double y = 0.0;

                MetadataContext xPosKey = new MetadataContext()
                {
                    MetadataName = "XPosition",
                    NodeUid = Node.Id
                };
                MetadataContext yPosKey = new MetadataContext()
                {
                    MetadataName = "YPosition",
                    NodeUid = Node.Id
                };

                IDescriptorTypeProxy descriptorType;

                //The is being drawn as a transclusion representation (i.e. not in it's original parent map)
                if (Node.ParentMapNodeUid != Guid.Empty && Node.ParentMapNodeUid != ParentNavigatorView.ContextNode.Id)
                {
                    RenderNodeAsTransclusion(xPosKey, yPosKey, out descriptorType, out x, out y);
                }

                //The node is being drawn in it's parent map (i.e. not a transclusion representation)
                else
                {
                    RenderNodeAsChild(xPosKey, yPosKey, out descriptorType, out x, out y);
                }

                Location = new Point(x, y);

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

            return _nodeControl;
        }
Exemplo n.º 5
0
        public override NodeControl RenderChildren(RenderingContextInfo info)
        {
            if (_nodeControl == null)
            {
                double x = 0.0;
                double y = 0.0;

                MetadataContext xPosKey = new MetadataContext()
                {
                    MetadataName = "XPosition",
                    NodeUid      = Node.Id
                };
                MetadataContext yPosKey = new MetadataContext()
                {
                    MetadataName = "YPosition",
                    NodeUid      = Node.Id
                };

                IDescriptorTypeProxy descriptorType;

                //The is being drawn as a transclusion representation (i.e. not in it's original parent map)
                if (Node.ParentMapNodeUid != Guid.Empty && Node.ParentMapNodeUid != ParentNavigatorView.ContextNode.Id)
                {
                    RenderNodeAsTransclusion(xPosKey, yPosKey, out descriptorType, out x, out y);
                }

                //The node is being drawn in it's parent map (i.e. not a transclusion representation)
                else
                {
                    RenderNodeAsChild(xPosKey, yPosKey, out descriptorType, out x, out y);
                }

                Location = new Point(x, y);

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

            return(_nodeControl);
        }
Exemplo n.º 6
0
        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 OnGetCurrentNodesCompleted(object sender, RendererNodesEventArgs e)
        {
            // TODO: When TODO item ID:1001 is being done a replacement for the following needs to be considered too.
            this.uxMapSurface.Children.Clear();

            RenderingContextInfo contextInfo = new RenderingContextInfo();

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

            foreach (KeyValuePair<Guid, INodeRenderer> nodeRenderer in e.View.NodeRenderers)
            {
                nodeRenderer.Value.Context = contextInfo;
                UIElement nodeRendererControl = nodeRenderer.Value as UIElement;

                if (nodeRendererControl != null)
                {
                    this.uxMapSurface.Children.Add(nodeRendererControl);
                }
            }

            foreach (KeyValuePair<Guid, IRelationshipRenderer> relationshipRenderer in e.View.RelationshipRenderers)
            {
                UIElement relationshipRendererControl = relationshipRenderer.Value as UIElement;

                if (relationshipRendererControl != null)
                {
                    this.uxMapSurface.Children.Add(relationshipRendererControl);
                }
            }
        }
Exemplo n.º 8
0
 private double GetSurfaceCentreY(RenderingContextInfo info)
 {
     return(info.SurfaceHeight / 2);
 }
Exemplo n.º 9
0
 private double GetSurfaceCentreX(RenderingContextInfo info)
 {
     return(info.SurfaceWidth / 2);
 }