示例#1
0
        public FlNwElementVisualization(FlowNwGraph _parent, double _width, double _height, double _offset_hrzt, double _offset_vert)
        {
            this.parent_canvas       = _parent;
            this.element_offset_hrzt = _offset_hrzt;
            this.element_offset_vert = _offset_vert;

            this.element_width  = _width;
            this.element_height = _height;
            this.Width          = _width;
            this.Height         = _height;

            this.element_fill_color_1      = FlNwElementVisualization.NODE_COLOR_FILL_ACTIVE_1;
            this.element_fill_color_2      = FlNwElementVisualization.NODE_COLOR_FILL_ACTIVE_2;
            this.element_contour           = FlNwElementVisualization.NODE_COLOR_STROKE_ACTIVE;
            this.element_contour_thickness = FlNwElementVisualization.NODE_STROKE_THICKNESS_ACTIVE;

            this.Position = new Point(this.element_offset_hrzt, this.element_offset_vert);
            TranslateTransform transf = new TranslateTransform(this.element_offset_hrzt, this.element_offset_vert);

            this.RenderTransform = transf;

            this.Loaded += element_Loaded;

            // Add to Parent!
            if (this.parent_canvas != null)
            {
                this.parent_canvas.AddChild(this, this.position, this.element_width, this.element_height);
            }
        }
 // assumes that _fn_node is not NULL
 public FlNwNodeVisualization(FlowNwGraph _parent, FlNetNode _fn_node, NodePosInFlow _pos_in_flow)
     : base(_parent, FlNwElementVisualization.NODE_WIDTH_DEFAULT, FlNwElementVisualization.NODE_HEIGHT_DEFAULT,
            _fn_node.Position.X, _fn_node.Position.Y)
 {
     this.fn_node = _fn_node;
     this.fn_node.PropertyChanged += node_PropertyChanged;
     this.PosInFlow = _pos_in_flow;
 }
        public FlNwEdgeVisualization(FlowNwGraph _parent, FlNetEdge _fn_edge, FlNwNodeVisualization _start_vis, FlNwNodeVisualization _end_vis)
            : base(_parent, FlNwElementVisualization.NODE_WIDTH_DEFAULT, FlNwElementVisualization.NODE_HEIGHT_DEFAULT,
                   _fn_edge.Start.Position.X + FlNwElementVisualization.NODE_WIDTH_DEFAULT * 0.5,
                   _fn_edge.Start.Position.Y + FlNwElementVisualization.NODE_HEIGHT_DEFAULT * 0.5)
        {
            this.fn_edge = _fn_edge;
            this.fn_edge.PropertyChanged += fn_edge_PropertyChanged;

            this.UpdateGeometry();

            this.StartVis = _start_vis;
            this.EndVis   = _end_vis;
        }
示例#4
0
 // assumes that _fn_nw is not NULL
 public FlNwNetworkVisualization(FlowNwGraph _parent, FlowNetwork _fn_nw, NodePosInFlow _pos_in_flow)
     : base(_parent, _fn_nw, _pos_in_flow)
 {
     this.fn_nw = _fn_nw;
 }