ex09 task 4

LorenzB
Windoof-User
Windoof-User
Beiträge: 28
Registriert: 1. Sep 2015 12:27

ex09 task 4

Beitrag von LorenzB » 19. Jan 2018 12:52

Hello,

I have multiple questions?
  1. What's the difference between drawNode and drawText? Since they both take a text-argument
  2. When is svg-ellipse used ans when the text-"Node at x,y"? Is an Node represented by an circle/"node" an the text?
  3. Do we have to print the result of draw in the console?
  4. Has the containerElement a own position or is the location calculated based on the contained elements? Is it visualisated?
  5. I expect that the border of an element (task 2) is rectangular: Is it represented by 4 svg-lines?
  6. I expect that a Edge and the connected elements have to be added to the graph. Is the location of edge the location of the first connected element or the centre between them?
Thank you for the answers

LorenzB
Windoof-User
Windoof-User
Beiträge: 28
Registriert: 1. Sep 2015 12:27

Re: ex09 task 4

Beitrag von LorenzB » 19. Jan 2018 15:43

And do we have to annotate other patterns than
• Composite
• Decorator
• Strategy
• Builder?

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: ex09 task 4

Beitrag von meichholz » 19. Jan 2018 17:17

Hi,
LorenzB hat geschrieben:
19. Jan 2018 12:52
1. What's the difference between drawNode and drawText? Since they both take a text-argument
For the SVG output it doesn't make any difference, however, for Text output it does.
LorenzB hat geschrieben:
19. Jan 2018 12:52
2. When is svg-ellipse used ans when the text-"Node at x,y"? Is an Node represented by an circle/"node" an the text?
svg.ellipse is used for drawing borders. "Node at x,y" is used to draw a node on a text canvas. No, a circle is only drawn when the node has border.
LorenzB hat geschrieben:
19. Jan 2018 12:52
3. Do we have to print the result of draw in the console?
No, please have a look here viewtopic.php?f=234&t=37473
LorenzB hat geschrieben:
19. Jan 2018 12:52
4. Has the containerElement a own position or is the location calculated based on the contained elements? Is it visualisated?
Use the center of the container element as its position. Only the contained nodes are visualized, not the container element itself.
LorenzB hat geschrieben:
19. Jan 2018 12:52
5. I expect that the border of an element (task 2) is rectangular: Is it represented by 4 svg-lines?
See answer 2.
LorenzB hat geschrieben:
19. Jan 2018 12:52
6. I expect that a Edge and the connected elements have to be added to the graph. Is the location of edge the location of the first connected element or the centre between them?
The location is the center between the two connected nodes.
LorenzB hat geschrieben:
19. Jan 2018 15:43
And do we have to annotate other patterns than
• Composite
• Decorator
• Strategy
• Builder?
You only have to annotate these four patterns.

Best,
Matthias

LorenzB
Windoof-User
Windoof-User
Beiträge: 28
Registriert: 1. Sep 2015 12:27

Re: ex09 task 4

Beitrag von LorenzB » 19. Jan 2018 18:11

Okay,
meichholz hat geschrieben:
19. Jan 2018 17:17
LorenzB hat geschrieben:
19. Jan 2018 12:52
1. What's the difference between drawNode and drawText? Since they both take a text-argument
For the SVG output it doesn't make any difference, however, for Text output it does.
LorenzB hat geschrieben:
19. Jan 2018 12:52
2. When is the text-"Node at x,y" used?
"Node at x,y" is used to draw a node on a text canvas.
but i don't understand, when drawNode and drawText is used. When drawNode is used for Nodes, i see no usage of drawText.

On SVG the output of a Node is its text, right?


Thank you

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: ex09 task 4

Beitrag von meichholz » 22. Jan 2018 11:07

Hi,
LorenzB hat geschrieben:
19. Jan 2018 18:11
On SVG the output of a Node is its text, right?
Yes.

Best,
Matthias

LorenzB
Windoof-User
Windoof-User
Beiträge: 28
Registriert: 1. Sep 2015 12:27

Re: ex09 task 4

Beitrag von LorenzB » 22. Jan 2018 13:55

LorenzB hat geschrieben:
19. Jan 2018 18:11
but i don't understand, when drawNode and drawText is used. When drawNode is used for Nodes, i see no usage of drawText.
please answer this

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: ex09 task 4

Beitrag von meichholz » 22. Jan 2018 15:46

Hi,

In the resulting SVG a node is represented by the String, so in this case there is not really a difference between drawNode and drawText. Originally there was the idea to have labels for all elements of the graph (including edges). In this case the drawText method could have been used. However, since we dropped this from the task, the drawText method has indeed not so much use.

Best,
Matthias

LorenzB
Windoof-User
Windoof-User
Beiträge: 28
Registriert: 1. Sep 2015 12:27

Re: ex09 task 4

Beitrag von LorenzB » 22. Jan 2018 15:52

thank you :D

Antworten

Zurück zu „Archiv“