Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="panel"> The panel that this Manager controls</param>
        /// <param name="ld"> The domain for labeling strokes</param>
        public DisplayManager(ref SketchPanelLib.SketchPanel panel, EndPointMovedHandler endPointChange,
                              GateRotatedHandler gateRotated, bool ColorStrokes = true)
        {
            this.panel = panel;

            // Add and configure feedback
            circuitColorFeedback    = new ColorFeedback(ref panel);
            circuitMeshFeedback     = new MeshHighlightingFeedback(ref panel);
            circuitEndpointFeedback = new EndPointHighlightFeedback(ref panel, endPointChange);
            ghostGateFeedback       = new GhostGateFeedback(ref panel, gateRotated);
            currentErrors           = new List <ErrorBoxHelp>();
            //circuitParseErrorFeedback = new ParseErrorFeedback(panel);
            displayLabelTool = new DisplayLabelTool(ref panel);
            displayHelpTool  = new DisplayHelpTool(ref panel);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor.  Makes gate drawer, initializes lists, subscribes to supplied panel
        /// </summary>
        /// <param name="parent"></param>
        public GhostGateFeedback(ref SketchPanel parent, GateRotatedHandler gateRotated)
            : base(ref parent)
        {
            // Set up gate drawer
            gateDrawer                  = new GateDrawing.GateDrawing();
            gateDrawer.RotateGates      = true;
            gateDrawer.SnapRotation     = false;
            gateDrawer.LockDrawingRatio = true;
            this.gateRotated            = gateRotated;


            // Initialize our list of ghosts
            this.currGhosts = new List <GhostGate>();

            ShapeToIO   = new Dictionary <Sketch.Shape, KeyValuePair <List <string>, List <string> > >();
            ShapeToGate = new Dictionary <Shape, GhostGate>();

            displayHelpTool = new DisplayHelpTool(ref sketchPanel);

            SubscribeToPanel();
        }