SlideShare uma empresa Scribd logo
1 de 12
Лабораторная работа №1
по дисциплине
«Моделирование и анализ программного обеспечения»
«Фабрика Blockly»
ВЫПОЛНИЛ
СТУДЕНТ ГРУППЫ ПОС-12А
ПОТОПАХИН АЛЕКСЕЙ
Изображение SVG
Изображение SVG
Исходный текст SVG файла
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>Layer 1</title>
<circle id="svg_1" r="223.789032" cy="237.567027" cx="313.884056" stroke-width="4" stroke="#000000" fill="#ffffff"/>
<text font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="76" id="svg_3" y="362.950012" x="313.183334" stroke-linecap="null" stroke-linejoin="null"
stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">CIRCLE</text>
<circle id="svg_4" r="2.632813" cy="240.999995" cx="311.516872" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="#000000"/>
<line id="svg_6" y2="946.383362" x2="1327.450012" y1="1034.383362" x1="1424.450012" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000"
fill="none"/>
<line id="svg_7" y2="1961.449951" x2="2614.733276" y1="2021.449951" x1="2724.733276" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000"
fill="none"/>
<line id="svg_8" y2="93.280672" x2="142.531049" y1="239.280672" x1="309.531053" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/>
<line id="svg_9" y2="987.583313" x2="1163.866669" y1="1051.583313" x1="1269.866669" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000"
fill="none"/>
<line id="svg_10" y2="226.600958" x2="329.000015" y1="240.600958" x1="311.000015" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<line id="svg_11" y2="1895.5" x2="2418.283325" y1="1953.5" x1="2526.283325" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/>
<line id="svg_13" y2="1016.599976" x2="1632.366638" y1="1016.599976" x1="1580.366638" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<line id="svg_14" y2="1060.549988" x2="1286.883362" y1="1043.549988" x1="1122.883362" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<line id="svg_15" y2="226.8" x2="343.801158" y1="226.8" x1="328.801158" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<line id="svg_16" y2="172.376061" x2="268.776682" y1="186.376062" x1="250.776682" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<line id="svg_17" y2="172.375885" x2="283.477043" y1="172.375885" x1="268.477043" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/>
<text id="svg_19" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="22" y="234.580564" x="390.294425" stroke-linecap="null" stroke-linejoin="null"
stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">CENTER</text>
<text id="svg_20" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="22" y="180.233332" x="327.627764" stroke-linecap="null" stroke-linejoin="null"
stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">RADIUS</text>
</g>
</svg>
Blockly
Блоки Сгенерированный HTML код
<html>
<head>
<title> Circle Default Title</title>
</head>
<body>
<canvas id='canv' width="1000"
height="600" ></canvas>
<script>
if(window.WebGLRenderingContext)
{
var c =
document.getElementById('canv');
var gl = c.getContext('2d');
gl.beginPath();
gl.arc(200, 200, 100, 0, 2 * Math.PI, false);
gl.lineWidth = 1;
gl.strokeStyle = '#000000';
gl.stroke();
}
</script>
</body>
</html>
Результат
Blockly
Масштабирование
100% 120% 300%
Blockly Header
Blockly.Language.webgl_header =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function()
{
this.setColour(70);
this.appendStatementInput("NAME")
.appendTitle(new Blockly.FieldImage("../../media/circle.svg", 64, 48))
.appendTitle("Header");
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_header = function()
{
var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME');
var code = '&lt;html&gt;n&lt;head&gt;n&lt;title&gt;' + statements_name.toString() +
'&lt;/title&gt;n&lt;/head&gt;'
return code;
};
Blockly Title
Blockly.Language.webgl_title =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function()
{
this.setColour(140);
this.appendDummyInput()
.appendTitle("Title")
.appendTitle(new Blockly.FieldTextInput("Circle Default Title"), "NAME");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_title = function()
{
var text_name = this.getTitleValue('NAME');
var code = text_name.toString();
return code;
};
Blockly Body
Blockly.Language.webgl_body =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function ()
{
this.setColour(210);
this.appendStatementInput("NAME")
.appendTitle("Body");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_body = function ()
{
var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME');
var code = "n&lt;body&gt;n" + statements_name.toString() + "n&lt;/body&gt;"
return code;
};
Blockly Canvas
Blockly.Language.webgl_canvas =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function()
{
this.setColour(280);
this.appendDummyInput()
.appendTitle("canvas id")
.appendTitle(new Blockly.FieldTextInput("canvas"), "NAME");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_canvas = function()
{
var text_name_canvas = this.getTitleValue('NAME');
var code = "&lt;canvas id='" + text_name_canvas.toString() +"' width="1000" height="600"
&gt;&lt;/canvas&gt;"
canvas_name = text_name_canvas;
return code;
};
Blockly Draw circle
Blockly.Language.webgl_drawcircle =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function()
{
this.setColour(360);
this.appendDummyInput()
.appendTitle("Layout x =")
.appendTitle(new Blockly.FieldTextInput("200"), "x")
.appendTitle("Layout y =")
.appendTitle(new Blockly.FieldTextInput("200"), "y")
.appendTitle("radius =")
.appendTitle(new Blockly.FieldTextInput("100"), "r");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_drawcircle = function()
{
var text_x = this.getTitleValue('x');
var text_y = this.getTitleValue('y');
var text_r = this.getTitleValue('r');
var code = "n&lt;script&gt;"
code += "nif(window.WebGLRenderingContext)"
code += "n{"
code += "n var c = var c =
document.getElementById('" + canvas_name + "');""
code += "n var gl = c.getContext('2d');"
code += "n gl.beginPath();"
code += "n gl.arc(" + parseInt(text_x) + ",
"+parseInt(text_y)+", "+parseInt(text_r)+", 0, 2 * Math.PI,
false);"
code += "n gl.lineWidth = 1;"
code += "n gl.strokeStyle = '#000000';"
code += "n gl.stroke();"
code += "n}"
code = code + "n&lt;/script&gt;";
return code;
};
Blockly Footer
Blockly.Language.webgl_a09_footerhtml5 =
{
category: 'WebGL',
helpUrl: 'webgl_a09_headerhtml5.help.html',
init: function ()
{
this.appendDummyInput()
.appendTitle("Footer");
this.setPreviousStatement(true);
this.setTooltip('')
}
};
Blockly.JavaScript.webgl_a09_footerhtml5 = function ()
{
var code = "n&lt;/html&gt;"
return code;
};
Спасибо за внимание!

Mais conteúdo relacionado

Mais procurados

Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and RenderingStoyan Stefanov
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)Oswald Campesato
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQLHung-yu Lin
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Jeado Ko
 
Google
GoogleGoogle
Googlesoon
 
Vidéo approche en immobilier
Vidéo approche en immobilierVidéo approche en immobilier
Vidéo approche en immobilierhervepouliot
 
Slides pour blog
Slides pour blogSlides pour blog
Slides pour bloglyago
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningschicagonewsonlineradio
 
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridasFrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridasLoiane Groner
 

Mais procurados (20)

Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimization
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
WebXR if X = how?
WebXR if X = how?WebXR if X = how?
WebXR if X = how?
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Teste2
Teste2Teste2
Teste2
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Google
GoogleGoogle
Google
 
1cst
1cst1cst
1cst
 
Vidéo approche en immobilier
Vidéo approche en immobilierVidéo approche en immobilier
Vidéo approche en immobilier
 
Slides pour blog
Slides pour blogSlides pour blog
Slides pour blog
 
Test upload
Test uploadTest upload
Test upload
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screenings
 
RCEC Email 8.14.03
RCEC Email 8.14.03RCEC Email 8.14.03
RCEC Email 8.14.03
 
Security in Node.JS and Express:
Security in Node.JS and Express:Security in Node.JS and Express:
Security in Node.JS and Express:
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridasFrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
 
Moddefaults
ModdefaultsModdefaults
Moddefaults
 
CAR Email 06.05.02 (a)
CAR Email 06.05.02 (a)CAR Email 06.05.02 (a)
CAR Email 06.05.02 (a)
 

Semelhante a Лабораторная работа №1

лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10аl10bov
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the WorldJonathan Snook
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibilityEb Styles
 
Creating dynamic SVG elements in JavaScript
Creating dynamic SVG elements in JavaScriptCreating dynamic SVG elements in JavaScript
Creating dynamic SVG elements in JavaScriptJoseph Khan
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734pantangmrny
 
HTML5: A primer on the web's present and future
HTML5: A primer on the web's present and futureHTML5: A primer on the web's present and future
HTML5: A primer on the web's present and futureDaniel Stout
 
A HTML5 platform demókon keresztül
A HTML5 platform demókon keresztülA HTML5 platform demókon keresztül
A HTML5 platform demókon keresztülZoltán Dávid
 
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejElinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejPertti Paavola
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Los Estados De La Materia
Los Estados De La MateriaLos Estados De La Materia
Los Estados De La MateriaMayritalinda
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopShoshi Roberts
 
MOConf'13: WebNotBombs: Optimize this
MOConf'13: WebNotBombs: Optimize thisMOConf'13: WebNotBombs: Optimize this
MOConf'13: WebNotBombs: Optimize thisBoris Zapolsky
 
Library Program Technology in Ukraine & Romania
Library Program Technology in Ukraine & RomaniaLibrary Program Technology in Ukraine & Romania
Library Program Technology in Ukraine & RomaniaMark Belinsky
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationMevin Mohan
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 

Semelhante a Лабораторная работа №1 (20)

лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
smoke1272528461
smoke1272528461smoke1272528461
smoke1272528461
 
Creating dynamic SVG elements in JavaScript
Creating dynamic SVG elements in JavaScriptCreating dynamic SVG elements in JavaScript
Creating dynamic SVG elements in JavaScript
 
Upload[1]
Upload[1]Upload[1]
Upload[1]
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734
 
HTML5: A primer on the web's present and future
HTML5: A primer on the web's present and futureHTML5: A primer on the web's present and future
HTML5: A primer on the web's present and future
 
A HTML5 platform demókon keresztül
A HTML5 platform demókon keresztülA HTML5 platform demókon keresztül
A HTML5 platform demókon keresztül
 
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejElinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Los Estados De La Materia
Los Estados De La MateriaLos Estados De La Materia
Los Estados De La Materia
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
MOConf'13: WebNotBombs: Optimize this
MOConf'13: WebNotBombs: Optimize thisMOConf'13: WebNotBombs: Optimize this
MOConf'13: WebNotBombs: Optimize this
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
Library Program Technology in Ukraine & Romania
Library Program Technology in Ukraine & RomaniaLibrary Program Technology in Ukraine & Romania
Library Program Technology in Ukraine & Romania
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
HTML5
HTML5HTML5
HTML5
 

Último

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 

Último (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

Лабораторная работа №1

  • 1. Лабораторная работа №1 по дисциплине «Моделирование и анализ программного обеспечения» «Фабрика Blockly» ВЫПОЛНИЛ СТУДЕНТ ГРУППЫ ПОС-12А ПОТОПАХИН АЛЕКСЕЙ
  • 3. Изображение SVG Исходный текст SVG файла <svg width="640" height="480" xmlns="http://www.w3.org/2000/svg"> <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ --> <g> <title>Layer 1</title> <circle id="svg_1" r="223.789032" cy="237.567027" cx="313.884056" stroke-width="4" stroke="#000000" fill="#ffffff"/> <text font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="76" id="svg_3" y="362.950012" x="313.183334" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">CIRCLE</text> <circle id="svg_4" r="2.632813" cy="240.999995" cx="311.516872" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="#000000"/> <line id="svg_6" y2="946.383362" x2="1327.450012" y1="1034.383362" x1="1424.450012" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/> <line id="svg_7" y2="1961.449951" x2="2614.733276" y1="2021.449951" x1="2724.733276" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/> <line id="svg_8" y2="93.280672" x2="142.531049" y1="239.280672" x1="309.531053" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/> <line id="svg_9" y2="987.583313" x2="1163.866669" y1="1051.583313" x1="1269.866669" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/> <line id="svg_10" y2="226.600958" x2="329.000015" y1="240.600958" x1="311.000015" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <line id="svg_11" y2="1895.5" x2="2418.283325" y1="1953.5" x1="2526.283325" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="4" stroke="#000000" fill="none"/> <line id="svg_13" y2="1016.599976" x2="1632.366638" y1="1016.599976" x1="1580.366638" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <line id="svg_14" y2="1060.549988" x2="1286.883362" y1="1043.549988" x1="1122.883362" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <line id="svg_15" y2="226.8" x2="343.801158" y1="226.8" x1="328.801158" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <line id="svg_16" y2="172.376061" x2="268.776682" y1="186.376062" x1="250.776682" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <line id="svg_17" y2="172.375885" x2="283.477043" y1="172.375885" x1="268.477043" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke="#000000" fill="none"/> <text id="svg_19" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="22" y="234.580564" x="390.294425" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">CENTER</text> <text id="svg_20" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="Fantasy" font-size="22" y="180.233332" x="327.627764" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="#000000">RADIUS</text> </g> </svg>
  • 4. Blockly Блоки Сгенерированный HTML код <html> <head> <title> Circle Default Title</title> </head> <body> <canvas id='canv' width="1000" height="600" ></canvas> <script> if(window.WebGLRenderingContext) { var c = document.getElementById('canv'); var gl = c.getContext('2d'); gl.beginPath(); gl.arc(200, 200, 100, 0, 2 * Math.PI, false); gl.lineWidth = 1; gl.strokeStyle = '#000000'; gl.stroke(); } </script> </body> </html> Результат
  • 6. Blockly Header Blockly.Language.webgl_header = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function() { this.setColour(70); this.appendStatementInput("NAME") .appendTitle(new Blockly.FieldImage("../../media/circle.svg", 64, 48)) .appendTitle("Header"); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_header = function() { var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME'); var code = '&lt;html&gt;n&lt;head&gt;n&lt;title&gt;' + statements_name.toString() + '&lt;/title&gt;n&lt;/head&gt;' return code; };
  • 7. Blockly Title Blockly.Language.webgl_title = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function() { this.setColour(140); this.appendDummyInput() .appendTitle("Title") .appendTitle(new Blockly.FieldTextInput("Circle Default Title"), "NAME"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_title = function() { var text_name = this.getTitleValue('NAME'); var code = text_name.toString(); return code; };
  • 8. Blockly Body Blockly.Language.webgl_body = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function () { this.setColour(210); this.appendStatementInput("NAME") .appendTitle("Body"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_body = function () { var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME'); var code = "n&lt;body&gt;n" + statements_name.toString() + "n&lt;/body&gt;" return code; };
  • 9. Blockly Canvas Blockly.Language.webgl_canvas = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function() { this.setColour(280); this.appendDummyInput() .appendTitle("canvas id") .appendTitle(new Blockly.FieldTextInput("canvas"), "NAME"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_canvas = function() { var text_name_canvas = this.getTitleValue('NAME'); var code = "&lt;canvas id='" + text_name_canvas.toString() +"' width="1000" height="600" &gt;&lt;/canvas&gt;" canvas_name = text_name_canvas; return code; };
  • 10. Blockly Draw circle Blockly.Language.webgl_drawcircle = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function() { this.setColour(360); this.appendDummyInput() .appendTitle("Layout x =") .appendTitle(new Blockly.FieldTextInput("200"), "x") .appendTitle("Layout y =") .appendTitle(new Blockly.FieldTextInput("200"), "y") .appendTitle("radius =") .appendTitle(new Blockly.FieldTextInput("100"), "r"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_drawcircle = function() { var text_x = this.getTitleValue('x'); var text_y = this.getTitleValue('y'); var text_r = this.getTitleValue('r'); var code = "n&lt;script&gt;" code += "nif(window.WebGLRenderingContext)" code += "n{" code += "n var c = var c = document.getElementById('" + canvas_name + "');"" code += "n var gl = c.getContext('2d');" code += "n gl.beginPath();" code += "n gl.arc(" + parseInt(text_x) + ", "+parseInt(text_y)+", "+parseInt(text_r)+", 0, 2 * Math.PI, false);" code += "n gl.lineWidth = 1;" code += "n gl.strokeStyle = '#000000';" code += "n gl.stroke();" code += "n}" code = code + "n&lt;/script&gt;"; return code; };
  • 11. Blockly Footer Blockly.Language.webgl_a09_footerhtml5 = { category: 'WebGL', helpUrl: 'webgl_a09_headerhtml5.help.html', init: function () { this.appendDummyInput() .appendTitle("Footer"); this.setPreviousStatement(true); this.setTooltip('') } }; Blockly.JavaScript.webgl_a09_footerhtml5 = function () { var code = "n&lt;/html&gt;" return code; };