Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public PToolBoxCanvas()
 {
     PPathwayLayer layer = new PPathwayLayer();
     base.Root.AddChild(layer);
     base.Camera.AddLayer(layer);
     base.Camera.ScaleViewBy(0.7f);
     base.Camera.Pickable = false;
     base.RemoveInputEventListener(base.PanEventHandler);
     base.RemoveInputEventListener(base.ZoomEventHandler);
     base.BackColor = Color.Silver;
     base.AllowDrop = false;
     base.GridFitText = false;
     base.AnimatingRenderQuality = RenderQuality.HighQuality;
     base.DefaultRenderQuality = RenderQuality.HighQuality;
     base.InteractingRenderQuality = RenderQuality.HighQuality;
 }
Example #2
0
        /// <summary>
        /// add the selected layer.
        /// </summary>
        /// <param name="name">the name of layer.</param>
        /// <param name="visible">the visibility of layer.</param>
        public void AddLayer(string name, bool visible)
        {
            // Error check.
            if (string.IsNullOrEmpty(name))
                throw new PathwayException("Error null string.");
            if (m_layers.ContainsKey(name))
                throw new PathwayException(string.Format(MessageResources.ErrAlrExist, name));

            PPathwayLayer layer = new PPathwayLayer(name);
            layer.Visible = visible;
            AddLayer(layer);
            AddLayer(m_ctrlLayer);
            m_layers.Add(layer.Name, layer);
        }
Example #3
0
        /// <summary>
        /// the constructor with initial parameters.
        /// </summary>
        /// <param name="control">PathwayControl.</param>
        /// <param name="modelID">Model id.</param>
        public CanvasControl(PathwayControl control, string modelID)
        {
            m_con = control;
            m_modelId = modelID;

            // Preparing PathwayViewCanvas
            m_pCanvas = new PPathwayCanvas(this);
            // Preparing OverviewCanvas
            m_overviewCanvas = new POverviewCanvas(this);
            m_pCanvas.Camera.RemoveLayer(m_pCanvas.Layer);
            m_pCanvas.Camera.ViewTransformChanged += new PPropertyEventHandler(Camera_ViewChanged);
            m_pCanvas.Camera.BoundsChanged += new PPropertyEventHandler(Camera_ViewChanged);
            m_pCanvas.BackColor = BrushManager.ParseBrushToColor(m_bgBrush);

            // Preparing layer list
            m_layers = new Dictionary<string, PPathwayLayer>();

            // Preparing system layer
            m_defaultLayer = new PPathwayLayer(LayerView.DEFAULT_LAYER);
            AddLayer(m_defaultLayer);
            // Preparing control layer
            m_ctrlLayer = new PPathwayLayer("");
            AddLayer(m_ctrlLayer);
            //m_pCanvas.Root.AddChild(m_ctrlLayer);
            //m_pCanvas.Camera.AddLayer(m_ctrlLayer);

            // Preparing system ResizeHandlers
            m_lineHandler = new EdgeHandler(this);

            // Set ViewMode
            m_showingId = m_con.ShowingID;
            m_focusMode = m_con.FocusMode;
        }
Example #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="isAnchored"></param>
 internal void NotifyAddLayer(string name, bool isAnchored)
 {
     // Error check.
     if (string.IsNullOrEmpty(name))
         return;
     if (m_layers.ContainsKey(name))
     {
         Util.ShowNoticeDialog(name + MessageResources.ErrAlrExist);
         return;
     }
     PPathwayLayer layer = new PPathwayLayer(name);
     AddLayer(layer);
     AddLayer(m_ctrlLayer);
     m_layers.Add(layer.Name, layer);
     NotifyLayerChange(isAnchored);
 }
Example #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="layer"></param>
 public LayerGridRow(PPathwayLayer layer)
     : this()
 {
     m_layer = layer;
     checkBox.Value = layer.Visible;
     textBox.Value = layer.Name;
 }