Пример #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public SketchJournalMainForm()
        {
            InitializeComponent();

            // Initialize and add InkPicture to form
            toolStripContainer1.ContentPanel.SuspendLayout();
            sketchPanel      = new SketchPanel();
            sketchPanel.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(sketchPanel);
            toolStripContainer1.ContentPanel.ResumeLayout();

            // Attach a (demo) recognizer
            //recognizer = new TimeoutRecognizer();
            recognizer = new GateRecognizer();
            //recognizer = new PartialGateRecognizer();
            recognizer.SubscribeToPanel(sketchPanel);
            sketchPanel.ResultReceived += new RecognitionResultReceivedHandler(sketchPanel_ResultReceived);

            // Add and configure feedback
            circuitColorFeedback = new ColorFeedback(sketchPanel, FilenameConstants.DefaultCircuitDomainFilePath);

            // Set up selection clearing callback for toolbar
            // FOR ALL NEW TOOLS, should add
            lassoMenuButton.CheckedChanged       += new EventHandler(lassoMenuButton_CheckedChanged);
            lassoSortedMenuButton.CheckedChanged += new EventHandler(lassoSortedMenuButton_CheckedChanged);
            lassoRegroupButton.CheckedChanged    += new EventHandler(lassoRegroupButton_CheckedChanged);
            retraceButton.CheckedChanged         += new EventHandler(retraceButton_CheckedChanged);


            // Set up correction tool
            commandManager      = new CommandManagement.CommandManager();
            lassoMenuStaticTool = new LassoMenuStaticTool(commandManager);
            lassoSortedMenuTool = new LassoMenuStaticTool(commandManager); // Same type as static for now
            lassoRegroupTool    = new LassoRegroupTool(commandManager);
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public SketchJournalMainForm()
        {
            InitializeComponent();
            doneButton.Text = "Begin";
            gates[0]        = AND;
            gates[1]        = OR;
            gates[2]        = XOR;
            gates[3]        = NAND;
            gates[4]        = NOR;
            gates[5]        = NOT;
            copies[0]       = COPY1;
            copies[1]       = COPY2;
            eqs[0]          = EQ1;
            eqs[1]          = EQ2;
            gates           = shuffle(gates);
            copies          = shuffle(copies);
            eqs             = shuffle(eqs);

            // Initialize and add InkPicture to form
            toolStripContainer1.ContentPanel.SuspendLayout();
            sketchPanel      = new SketchPanel();
            sketchPanel.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(sketchPanel);
            toolStripContainer1.ContentPanel.ResumeLayout();

            // Attach a (demo) recognizer
            recognizer = new TimeoutRecognizer();
            recognizer.SubscribeToPanel(sketchPanel);
        }
Пример #3
0
        private void partialGateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            recognizer.UnsubscribeFromPanel();

            recognizer = new PartialGateRecognizer();
            gateToolStripMenuItem.Checked        = false;
            partialGateToolStripMenuItem.Checked = true;

            recognizer.SubscribeToPanel(sketchPanel);
            sketchPanel.ResultReceived += new RecognitionResultReceivedHandler(sketchPanel_ResultReceived);
        }
Пример #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public SketchJournalMainForm()
        {
            InitializeComponent();

            // Initialize and add InkPicture to form
            toolStripContainer1.ContentPanel.SuspendLayout();
            sketchPanel      = new SketchPanel();
            sketchPanel.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(sketchPanel);
            toolStripContainer1.ContentPanel.ResumeLayout();

            // Attach a (demo) recognizer
            //recognizer = new TimeoutSketchRecognizer();
            recognizer = new GateSketchRecognizer();
            //recognizer = new PartialGateSketchRecognizer();
            recognizer.SubscribeToPanel(sketchPanel);
            sketchPanel.ResultReceived += new RecognitionResultReceivedHandler(sketchPanel_ResultReceived);
        }