Пример #1
0
        public ExpansionEditor(ExpansionKrystal krystal)
        {
            InitializeComponent();

            _newEditorState = _oldEditorState = EditorState.FixedOutput;
            _fixedInputPointsIndex = -1;
            _fixedOutputPointsIndex = -1;
            _inputPlanetIndex = -1;
            _outputPlanetIndex = -1;

            this.FieldPanel.MouseDown += new MouseEventHandler(FieldPanel_MouseDown);

            _outputKrystal = krystal;
            if(string.IsNullOrEmpty(_outputKrystal.Name))
                _outputKrystal.Name = K.UntitledKrystalName;
            _expander = _outputKrystal.Expander;

            _strandNodeList = krystal.StrandNodeList();
            _painter = new Painter(_strandNodeList);

            SetStatusText();
            SetTreeView();
            LoadGametesIntoEditor();
            DisableAllSaving();

            _fieldPanelGraphicsBuffer = _bufferedGraphicsContext.Allocate(FieldPanel.CreateGraphics(), FieldPanel.DisplayRectangle);
            _painter.DrawBackground(_fieldPanelGraphicsBuffer.Graphics);

            PointGroupParameters.InitSamplePanel(_painter._inputDotSize, _painter._outputDotSize, _painter._theLinePen, _painter._theOutputFillBrush);
            PointGroupParameters.UpdateFieldEditor += new PointGroupParameters.PointGroupParametersChangedHandler(PointGroupParametersChangedDelegate);

            ZoomComboBox.SelectedIndex = 4;
        }