示例#1
0
        public pics(MindMapTMR CurrentTMR, MindMapTMR OriginalTMR, MultilevelGenerator.MultiLevel ML, int level, List <pics> PicForms, GoogleImageSearchSettings settings, DrawingSizeMode drawSizeMode)
        {
            _level        = level;
            _settings     = settings;
            _DrawSizeMode = drawSizeMode;
            PicForms.Add(this);
            picForms = PicForms;
            InitializeComponent();
            this.CurrentTMR  = CurrentTMR;
            this.OriginalTMR = OriginalTMR;
            this.ML          = ML;
            this.Height      = 700;
            this.Width       = 1000;
            this.Text        = "Mind Map";

            viewer         = new MMViewManeger(this.panel1, this.CurrentTMR, false, settings, _DrawSizeMode);
            viewer.Control = this.panel1;
            int MaximumY = viewer.getMaximumY();
            int MaximumX = viewer.getMaximumX();

            this.panel1.Height = MaximumY + 40;
            this.panel1.Width  = MaximumX + 40;

            this.AutoScroll = true;
        }
示例#2
0
 public MultiLevelMMapForm(Form5 parentForm, MindMapTMR TopTMR, MindMapTMR OriginalTMR, MultilevelGenerator.MultiLevel ML, GoogleImageSearchSettings settings, DrawingSizeMode drawSizeMode)
 {
     InitializeComponent();
     _parentForm   = parentForm;
     _settings     = settings;
     _DrawSizeMode = drawSizeMode;
     _TopTMR       = TopTMR;
     _OriginalTMR  = OriginalTMR;
     _ML           = ML;
 }
示例#3
0
        public MMViewManeger(Control cntrl, MindMapTMR TMR, bool showedgeText, GoogleImageSearchSettings gImSearchSettings, DrawingSizeMode sizeMode)
            : base(cntrl)
        {
            _conceptCombination = ConceptCmbination.None;
            SizeMode            = sizeMode;
            GImSearch           = new NewGoogleSearch(gImSearchSettings);
            _TMR         = TMR;
            ShowEdgeText = showedgeText;
            FilterMeaningRepresentationForDrawing();
            BuildAutomaticLayoutedGraph(true);

            //4each 3al noun frames w n create entities w n defha w 2a3redha
            //verb frames
        }
示例#4
0
        public VerbFrameEntity(int x, int y, VerbFrame verbFrame, MindMapTMR tmr, NewGoogleSearch googleImSearch, DrawingSizeMode SizeMode)
            : base(0, 0, 70, 40, verbFrame.VerbName, "")
        {
            _tmr           = tmr;
            _SizeMode      = SizeMode;
            GoogleImSearch = googleImSearch;
            string Text = "";

            _verbFrame = verbFrame;
            if (_verbFrame.AdverbsInfo != null)
            {
                foreach (MyWordInfo mwi in _verbFrame.AdverbsInfo)
                {
                    Text += mwi.Word;
                }
            }
            Text += (_verbFrame.VerbName);

            _text = Text;
            if (IsGoogleImage())
            {
                //_bitmap = GoogleSearch.GetImage(verbFrame.VerbName);
                //_rectangle = new Rectangle(x, y, _bitmap.Width, _bitmap.Height);
                //_position = new PointF(x + _bitmap.Width / 2, y + _bitmap.Height / 2);



                IList <IImageResult> Results;
                if (_SizeMode == DrawingSizeMode.Normal)
                {
                    Results = GoogleImSearch.Search2(_text);
                }
                else
                {
                    ImageSize imsize = GetAutoSize();
                    Results = GoogleImSearch.Search2(_text, imsize);
                }
                if (Results.Count >= 1)
                {
                    googleImSearch.LoadImageFromUrl(Results[0].TbImage.Url, picbox);
                    _bitmap    = new Bitmap(picbox.Image);
                    _rectangle = new Rectangle(x, y, _bitmap.Width, _bitmap.Height);
                    _position  = new PointF(x + _bitmap.Width / 2, y + _bitmap.Height / 2);
                }
            }
        }
示例#5
0
        public NounFrameEntity(int x, int y, NounFrame nounFrame, MindMapTMR tmr, NewGoogleSearch googleImSearch, DrawingSizeMode sizeMode, ConceptCmbination conceptCombination)
            : base(0, 0, 70, 40, "", "")
        {
            _tmr           = tmr;
            _SizeMode      = sizeMode;
            GoogleImSearch = googleImSearch;
            _conceptComb   = conceptCombination;
            _nounFrame     = nounFrame;
            string Text = "";

            //if (_nounFrame.Adjective != null)
            //{
            //    foreach (ParseNode adj in _nounFrame.Adjective)
            //        Text += (adj.Text + " ");

            //}

            if (_nounFrame.AdjectivesInfo != null)
            {
                foreach (MyWordInfo mwi in _nounFrame.AdjectivesInfo)
                {
                    Text += (mwi.Word + " ");
                }
            }

            Text += (_nounFrame.Text);

            _conceptCombText       = GetConceptCombinationText();
            _nounFrame.SearchText1 = Text;


            //string _wordologyDirectoryPath = Application.ExecutablePath;
            //int index = _wordologyDirectoryPath.LastIndexOf("\\");
            //_wordologyDirectoryPath = _wordologyDirectoryPath.Substring(0, index);

            if (IsGoogleImage())
            {
                ///////////////// habal
                string strpath = "";
                //if (_nounFrame.Text == "agricultural".ToUpper())
                //    strpath = _wordologyDirectoryPath+@"\pics\agricultural.jpg";
                //else if (_nounFrame.Text == "queen".ToUpper())
                //    strpath = _wordologyDirectoryPath+@"\pics\queen.jpg";
                //else if (_nounFrame.Text == "shakespeare".ToUpper())
                //    strpath =_wordologyDirectoryPath+@"\pics\shakespeare.jpg";
                //else if (_nounFrame.Text == "living".ToUpper())
                //    strpath = _wordologyDirectoryPath+@"\pics\coins.jpg";
                //else if (_nounFrame.Text == "writer".ToUpper())
                //    strpath = _wordologyDirectoryPath+@"\pics\writer.jpg";

                ////////////////////////////

                if (strpath != "")
                {
                    _bitmap = new Bitmap(strpath);
                }
                else
                {
                    //_bitmap = GoogleSearch.GetImage(_nounFrame.SearchText1);


                    IList <IImageResult> Results;
                    if (sizeMode == DrawingSizeMode.Normal)
                    {
                        Results = GoogleImSearch.Search2(_nounFrame.SearchText1 + " " + _conceptCombText);
                    }
                    else
                    {
                        ImageSize imsize = GetAutoSize();
                        Results = GoogleImSearch.Search2(_nounFrame.SearchText1 + " " + _conceptCombText, imsize);
                    }
                    // if (Results.Count > 500000 && Results.Count < 15000000)
                    double R;
                    double.TryParse(_nounFrame.SearchText1, out R);

                    if (Results.Count >= 1 && R == 0)
                    {
                        GoogleImSearch.LoadImageFromUrl(Results[0].TbImage.Url, picbox);
                        _bitmap    = new Bitmap(picbox.Image);
                        _rectangle = new Rectangle(x, y, _bitmap.Width, _bitmap.Height);
                        _position  = new PointF(x + _bitmap.Width / 2, y + _bitmap.Height / 2);
                    }
                }
                /////////////////////////
                //_rectangle = new Rectangle(x, y, _bitmap.Width, _bitmap.Height);
                //_position = new PointF(x + _bitmap.Width / 2, y + _bitmap.Height / 2);
            }
        }