Создание программы-редактора схем

Автор работы: Пользователь скрыл имя, 20 Декабря 2011 в 10:11, курсовая работа

Описание работы

Различные схемы являются неотъемлемой частью любой информационной системы или программного продукта. Существует множество схем создающийся по различным стандартам, в частности стандарт ГОСТ 19.701 различает следующие схемы:
1. Схема данных.
2. Схема программы.
3. Схема работы системы.
4. Схема взаимодействия программ.
5. Схема ресурсов системы.

Содержание работы

ВВЕДЕНИЕ 3
1. Аналитический обзор существующих программ-редакторов схем 4
1.1 Microsoft Offise Visio 2007 4
1.2 Редактор блок-схем 5
1.3 FCEditor 6
1.4 Вывод по аналитическому обзору 6
2. Выбор технических средств 8
3. Диграммы 9
3.1 Функциональная модель 9
3.2 Функционально-стоимостной анализ IDEF0-схемы 14
3.3 Диаграмма потоков данных 15
3.4 Диаграмма прецендентов 16
3.5 Диаграмма последовательностей 17
3.6 Диаграмма классов 18
4. Описание системы…………………......……………………………………………….....…23
ЗАКЛЮЧЕНИЕ 26
ПРИЛОЖЕНИЕ А(справочное)Исходный текст пограммы…..……………….…………….27
СПИСОК ЛИТЕРАТУРЫ

Файлы: 1 файл

МИМИУС fin.doc

— 1.35 Мб (Скачать файл)

            FontFamily ff = (FontFamily)toolStripComboBox1.SelectedItem; 

            if (ff.IsStyleAvailable(FontStyle.Regular))

                fnt = new Font(ff, fontSize, FontStyle.Regular); 

            else if (ff.IsStyleAvailable(FontStyle.Bold))

                fnt = new Font(ff, fontSize, FontStyle.Bold); 

            else if (ff.IsStyleAvailable(FontStyle.Italic))

                fnt = new Font(ff, fontSize, FontStyle.Italic); 

            else if (ff.IsStyleAvailable(FontStyle.Strikeout))

                fnt = new Font(ff, fontSize, FontStyle.Strikeout); 

            else if (ff.IsStyleAvailable(FontStyle.Underline))

                fnt = new Font(ff, fontSize, FontStyle.Underline); 

            workAreaForm.drawFont = fnt;

            workAreaForm.update();

        } 

        private void toolStripComboBox2_SelectedIndexChanged(object sender, EventArgs e)

        {

            if (this.workAreaForm == null)

                return; 

            this.fontSize = int.Parse(toolStripComboBox2.SelectedItem.ToString()); 

            Font fnt = ChangeFontSize(workAreaForm.drawFont, fontSize); 

            workAreaForm.drawFont = fnt;

            workAreaForm.update();

        } 

        #endregion 
 
 

        private void toolStripButton1_CheckStateChanged(object sender, EventArgs e)

        {

            if (toolStripButton1.Checked)

                workAreaForm.needGrid = true;

            else

                workAreaForm.needGrid = false; 

            workAreaForm.update();

        } 
 

        private void toolStripButton2_CheckStateChanged(object sender, EventArgs e)

        {

            if (toolStripButton2.Checked)

            {

                workAreaForm.needBlocksAlign = true;

                workAreaForm.alignBlocks();

                workAreaForm.update();

            }

            else

                workAreaForm.needBlocksAlign = false;

        } 
 

        private void toolStripButton3_Click(object sender, EventArgs e)

        {

            foreach (ArrowTemplate arrow in workAreaForm.arrows)

            {

                if (arrow.isMovable)

                {

                    bool state = arrow.needEndCap;

                    state = !state;

                    arrow.changeArrowEndCap(state, false);

                }

            }

            workAreaForm.update();

        } 
 

        private void toolStripTextBox1_LostFocus(object sender, EventArgs e)

        {

            int size; 

            try

            {

                size = int.Parse(toolStripTextBox1.Text);

            }

            catch (System.Exception ex)

            {

                MessageBox.Show("Ошибка в размере сетки\n" + ex.Message, "Ошибка");

                toolStripTextBox1.Text = Convert.ToString(workAreaForm.gridBlockSize);

                return;

            } 
 

            if (size > 200)

            {

                workAreaForm.gridBlockSize = 200;

                toolStripTextBox1.Text = Convert.ToString(200);

            }

            else if (size < 15)

            {

                workAreaForm.gridBlockSize = 15;

                toolStripTextBox1.Text = Convert.ToString(15);

            }

            else

            {

                workAreaForm.gridBlockSize = size;

            } 
 

            if (workAreaForm.needBlocksAlign)

                workAreaForm.alignBlocks(); 

            workAreaForm.update();

        } 
 
 

        private void lineThicknesstoolStripTextBox_LostFocus(object sender, EventArgs e)

        {

            int thickness; 

            try

            {

                thickness = int.Parse(lineThicknesstoolStripTextBox.Text);

                workAreaForm.thickness = thickness;

            }

            catch (System.Exception ex)

            {

                MessageBox.Show("Ошибка в толщине линий\n" + ex.Message, "Ошибка");

                toolStripTextBox1.Text = Convert.ToString(workAreaForm.gridBlockSize);

                return;

            } 

            if (thickness > 5)

            {

                thickness = 5;

                workAreaForm.thickness = 5;

                lineThicknesstoolStripTextBox.Text = Convert.ToString(1);

            }

            else if (thickness < 1)

            {

                thickness = 1;

                workAreaForm.thickness = 1;

                lineThicknesstoolStripTextBox.Text = Convert.ToString(1);

            } 

            for (int i = 0; i < workAreaForm.arrows.Count; i++)

            {

                workAreaForm.arrows[i].changeLineThickness(thickness);

            } 

            workAreaForm.update();

        } 

        #region saving and opening xml files 

        private void fileSaveToolStripMenuItem_Click(object sender, EventArgs e)

        {

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

            //сохранение параметров//

            config.gridBlockSize = workAreaForm.gridBlockSize;

            config.needBlocksAlign = workAreaForm.needBlocksAlign;

            config.needGrid = workAreaForm.needGrid;

            config.shapes = workAreaForm.blocks;

            config.arrows = workAreaForm.arrows;

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

            saveFileDialog1.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; 

            string fileName = string.Empty; 

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)

                fileName = saveFileDialog1.FileName; 

            if (fileName == String.Empty)

                return; 

            FileStream fStream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); 

            XmlSerializer xmlFormat = new XmlSerializer(

                typeof(Configuration),

                new Type[]

                {

                    typeof(Point[]),

                    typeof(ArrowNodePoint[]),

                   

                    typeof(ArrowTemplate[]), 

                    typeof(List<BlockTemplate>),

                    typeof(List<ProcessBlock>),

                    typeof(List<DataBlock>),

                    typeof(List<DecisionBlock>),

                    typeof(List<RAM_Block>),

                    typeof(List<SerialAcessMemoryBlock>),

                    typeof(List<ManualInputBlock>),

                    typeof(List<PredefinedProcessBlock>),

                    typeof(List<ManualOperationBlock>),

                    typeof(List<PreparationBlock>),

                    typeof(List<LoopStartBlock>),

                    typeof(List<LoopEndBlock>),

                    typeof(List<DocumentBlock>),

                   typeof(List<MemoryWithDirectAcessBlock>),

                    typeof(List<DataStorageBlock>),

                    typeof(List<ExternalDataBlock>),

                    typeof(List<TerminatorBlock>),

                    typeof(List<CommentLeftBlock>),

                    typeof(List<CommentRightBlock>), 

                    typeof(List<ArrowTemplate>),

                    typeof(List<ArrowCurveHorizontal>),

                    typeof(List<ArrowCurveVertical>),

                    typeof(List<ArrowHorizontal>),

                    typeof(List<ArrowVertical>)

                }

            ); 
 

            xmlFormat.Serialize(fStream, config);

            fStream.Close();

        } 
 

        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)

        {

            string fileName = String.Empty; 

            if (openFileDialog1.ShowDialog() == DialogResult.OK)

                fileName = openFileDialog1.FileName; 

            if (fileName == String.Empty)    //user didn't select a file

                return; 
 

            FileStream fStream = File.OpenRead(fileName); 

            XmlSerializer xmlFormat = new XmlSerializer(

                typeof(Configuration),

                new Type[]

                {

                    typeof(Point[]),

                    typeof(ArrowNodePoint[]),

                   

                    typeof(ArrowTemplate[]), 

                    typeof(List<BlockTemplate>),

                    typeof(List<ProcessBlock>),

                    typeof(List<DataBlock>),

                    typeof(List<DecisionBlock>),

                    typeof(List<RAM_Block>),

                    typeof(List<SerialAcessMemoryBlock>),

                    typeof(List<ManualInputBlock>),

                    typeof(List<PredefinedProcessBlock>),

                    typeof(List<ManualOperationBlock>),

                    typeof(List<PreparationBlock>),

                    typeof(List<LoopStartBlock>),

                    typeof(List<LoopEndBlock>),

                    typeof(List<DocumentBlock>),

                    typeof(List<MemoryWithDirectAcessBlock>),

                    typeof(List<DataStorageBlock>),

                    typeof(List<ExternalDataBlock>),

                    typeof(List<TerminatorBlock>),

                    typeof(List<CommentLeftBlock>),

                    typeof(List<CommentRightBlock>), 

                    typeof(List<ArrowTemplate>),

                    typeof(List<ArrowCurveHorizontal>),

                    typeof(List<ArrowCurveVertical>),

                    typeof(List<ArrowHorizontal>),

                    typeof(List<ArrowVertical>)

                }

Информация о работе Создание программы-редактора схем