Changes for page KIML
Last modified by Richard Kreissig on 2025/01/30 12:04
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. msp1 +XWiki.cds - Content
-
... ... @@ -1,35 +1,130 @@ 1 +{{warning title="Work in Progress"}} 2 +This tutorial is still being worked on. Don't start working on it just yet. 3 +{{/warning}} 4 + 5 +Welcome to the second tutorial! We will work our way through installing a proper Eclipse setup and developing a first very basic layout algorithm. The layout algorithm will integrate with KIML (KIELER Infrastructure for Meta-Layout), our very own framework that connects graphical editors with layout algorithms. Once you're finished, you should be able to create new Eclipse plug-ins and know how to write layout algorithms for KIML. 6 + 7 +{{warning title="ToDo"}} 8 +Insert link to presentation slides. 9 +{{/warning}} 10 + 11 + 12 + 13 +{{toc/}} 14 + 15 += Preliminaries = 16 + 17 +There's a few things to do before we dive into the tutorial itself. For example, to do Eclipse programming, you will have to get your hands on an Eclipse installation first. Read through the following sections to get ready for the tutorial tasks. 18 + 19 +== Required Software == 20 + 21 +For this tutorial, we need you to have Eclipse and Git installed: 22 + 23 +1. Install Eclipse. For what we do, we recommend installing the Eclipse Modeling Tools, with a few extras. Our [[Wiki page on getting Eclipse>>doc:KIELER.Getting Eclipse]] has the details: simply follow the instructions for downloading and installing Eclipse and you should be set. 24 +1. You should already have obtained a working Git installation for the first tutorial. 25 + 26 +== General Remarks == 27 + 28 +Over the course of this tutorial, you will be writing a bit of code. Here's a few rules we ask you to follow: 29 + 30 +* All the Java code you write as part of tutorials should be in packages with the prefix {{code language="none"}}de.cau.cs.rtprak.login.tutorialN{{/code}}, where {{code language="none"}}login{{/code}} is your login name as used for your email address at the institute. This rule will apply to all tutorials – once we start with the actual practical projects, we will choose more meaningful package name. 31 +* All Java classes, fields, and methods should be thoroughly documented with the standard [[Javadoc>>url:http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#javadoctags||shape="rect"]] comment format. Javadoc comments are well supported by Eclipse through code completion, syntax highlighting, and further features that help you. The code inside your methods should also be well commented. Try to think about what kinds of information would help someone unfamiliar with your code understand it. 32 +* During this tutorial, we will be using Git mostly from the command line instead of using Eclipse's built-in Git support. This is because we've found Eclipse's Git support to be too unstable and buggy for us to trust it completely. 33 + 34 +== Finding Documentation == 35 + 36 +During the tutorial, we will cover each topic only briefly, so it is always a good idea to find more information online. Here's some more resources that will prove helpful: 37 + 38 +* [[Java Platform, Standard Edition 6 API Specification>>url:http://download.oracle.com/javase/6/docs/api/||shape="rect"]] 39 +As Java programmers, you will already know this one, but it's so important and helpful that it's worth repeating. The API documentation contains just about everything you need to know about the API provided by Java6. 40 +* [[Eclipse Help System>>url:http://help.eclipse.org/juno/index.jsp||shape="rect"]] 41 +Eclipse comes with its own help system that contains a wealth of information. You will be spending most of your time in the //Platform Plug-in Developer Guide//, which contains the following three important sections:\\ 42 +** Programmer's Guide 43 +When you encounter a new topic, such as SWT or JFace, the Programmer's Guide often contains helpful articles to give you a first overview. Recommended reading. 44 +** References -> API Reference 45 +One of the two most important parts of the Eclipse Help System, the API Reference contains the Javadoc documentation of all Eclipse framework classes. Extremely helpful. 46 +** References -> Extension Points Reference 47 +The other of the two most important parts of the Eclipse Help System, the Extension Point Reference lists all extension points of the Eclipse framework along with information about what they are and how to use them. Also extremely helpful. 48 +* [[Eclipsepedia>>url:http://wiki.eclipse.org/Main_Page||shape="rect"]] 49 +The official Eclipse Wiki. Contains a wealth of information on Eclipse programming. 50 +* [[Eclipse Resources>>url:http://www.eclipse.org/resources/||shape="rect"]] 51 +Provides forums, tutorials, articles, presentations, etc. on Eclipse and Eclipse-related topics. 52 + 53 +You will find that despite of all of these resources Eclipse is still not as well commented and documented as we'd like it to be. Finding out how stuff works in the world of Eclipse can thus sometimes be a challenge. However, this does not only apply to you, but also to many people who are conveniently connected by something called //The Internet//. It should go without saying that if all else fails, [[Google>>url:http://www.google.de||shape="rect"]] often turns up great tutorials or solutions to problems you may run into. And if it doesn't, Miro and I will be happy to help you as well. 54 + 55 +As far as KIML and layout algorithms are concerned, you can always refer to our Wiki which has a section about [[KIML and the KIELER layout projects>>doc:KIELER.Layout]]. The documentation is not complete, however, so feel free to ask Miro or Christoph Daniel for help if you have questions that the documentation fails to answer. 56 + 57 +== Preparing the Repository == 58 + 59 +We have created a Git repository for everyone to do his tutorials in. You can access the repository online through our Stash tool [[over here>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/PRAK/repos/12ws-eclipse-tutorials/browse||shape="rect"]]. You will first have to configure your Stash account: 60 + 61 +1. Login with your Rtsys account information. 62 +1. Through the button in the top right corner, access your profile. 63 +1. Switch to the //SSH keys// tab. 64 +1. Click //Add Key// and upload a public SSH key that you want to use to access the repository. 65 + 66 +You should now be able to access the repository. Clone it: 67 + 68 +1. Open a console window and navigate to an empty directory that the repository should be placed in. 69 +1. Enter the command [[ssh:~~/~~/git@git.rtsys.informatik.uni-kiel.de:7999/PRAK/13ss-layout-tutorials.git>>url:ssh://git@git.rtsys.informatik.uni-kiel.de:7999/PRAK/13ss-layout-tutorials.git||shape="rect"]]{{code language="none"}} .{{/code}} (including the final dot, which tells git to clone the repository into the current directory instead of a subdirectory). 70 +1. You should now have a clone of the repository in the current directory. 71 + 72 +You will use this repository for all your tutorial work, along with everyone else. To make sure that you don't interfere with each other, everyone will work on a different branch. This is not exactly how people usually use Git, but goes to demonstrate Git's flexibility... Add a branch for you to work in: 73 + 74 +1. Enter {{code language="none"}}git checkout -b login_name{{/code}} 75 + 76 +You have just added and checked out a new branch. Everything you commit will go to this branch. To push your local commits to the server (which you will need to do so we can access your results), do the following: 77 + 78 +1. Enter {{code language="none"}}git push origin login_name{{/code}} 79 + 80 +You would usually have to enter {{code language="none"}}git pull{{/code}} first, but since nobody will mess with your branch anyway this won't be necessary. By the way, you only need to mention {{code language="none"}}origin login_name{{/code}} with the first {{code language="none"}}git push{{/code}}, since Git doesn't know where to push the branch yet. After the first time, Git remembers the information and it will be enough to just enter {{code language="none"}}git push{{/code}}. 81 + 82 += Developing Your First Layout Algorithm = 83 + 84 +Now that the preliminaries are out of the way, it's time to develop your first layout algorithm! It will, however, be a very simple one. This tutorial focuses on creating Eclipse plug-ins and on learning how to develop with KIML; thinking of and implementing cool layout algorithms is what the rest of the practical will focus on, and that is where the fun will be had! 85 + 86 +{{note}} 87 +Remember to replace each occurrence of {{code language="none"}}login_name{{/code}} with your own login name (e.g. {{code language="none"}}msp{{/code}}), and each occurrence of {{code language="none"}}Login_name{{/code}} with your capitalized login name (e.g. {{code language="none"}}Msp{{/code}}). 88 +{{/note}} 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 1 1 This exercise will introduce the usage of the Eclipse Plugin Development Environment for developing new layout algorithms to be used in Eclipse diagram editors. Replace each <login> by your own login name (e.g. msp), and each <Login> by your login name with capitalized first letter (e.g. Msp). For any questions contact msp. 2 2 3 -1. [[Install and set up Eclipse>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/wiki/Eclipse||style=""shape="rect"class="wiki"]]4 -1. [[Checkout>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/wiki/Subversion||style=""shape="rect"class="wiki"]]thefollowingKIELER plugins:\\104 +1. Install and set up Eclipse ((% style="color: rgb(255,0,0);" %)TODO: describe steps to install and set up Eclipse(%%)) 105 +1. Import the following KIELER plugins: ((% style="color: rgb(255,0,0);" %)TODO: describe steps to access and import the KIELER plugins and update the list(%%))\\ 5 5 1*. de.cau.cs.kieler.core 6 6 1*. de.cau.cs.kieler.core.kgraph 7 -1*. de.cau.cs.kieler.core.kgraph.edit 8 -1*. de.cau.cs.kieler.core.ui 9 -1*. de.cau.cs.kieler.keg 10 -1*. de.cau.cs.kieler.keg.diagram 11 -1*. de.cau.cs.kieler.kiml.layout 108 +1*. (% style="font-size: 10.0pt;line-height: 13.0pt;" %)de.cau.cs.kieler.kiml 109 +1*. (% style="font-size: 10.0pt;line-height: 13.0pt;" %)de.cau.cs.kieler.kiml.service 12 12 1*. de.cau.cs.kieler.kiml.ui 13 -1*. de.cau.cs.kieler.kiml.viewer 14 -1*. de.cau.cs.kieler.klay.layered 111 +1*. (% style="font-size: 10.0pt;line-height: 13.0pt;" %)de.cau.cs.kieler.klay.layered 15 15 1. Create a new plugin\\ 16 -11. //File ->New->Other...->Plug-in Development->Plug-in Project//17 -11. Project name: de.cau.cs.rtprak.<login>. exercise118 -11. //Next// ->set version to //0.1.0.qualifier//, provider to //Christian-Albrechts-Universität zu Kiel//, and execution environment to //J2SE-1.5// (do this for all plugins that you create!)113 +11. //File → New →// Other... //→// Plug-in Development //→// Plug-in Project 114 +11. Project name: de.cau.cs.rtprak.<login>.tutorial2 115 +11. //Next// //→// set version to //0.1.0.qualifier//, provider to //Christian-Albrechts-Universität zu Kiel//, and execution environment to //J2SE-1.5// (do this for all plugins that you create!) 19 19 11. The checkboxes in the //Options// group can be deactivated -> //Finish// 20 -1. [[Check in>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/wiki/Subversion||style="" shape="rect" class="wiki"]] the new plugin project into [[https:~~/~~/rtsys.informatik.uni-kiel.de/svn/teaching/prak/10ss-layout/exercises/>>url:https://rtsys.informatik.uni-kiel.de/svn/teaching/prak/10ss-layout/exercises/||shape="rect"]]<login>/ 21 -1. Activate Checkstyle: right-click the project -> //Properties -> Checkstyle -> Checkstyle active for this project// 22 -1. Open the file META-INF/MANIFEST.MF -> //Dependencies// tab\\ 23 -1*. Add the plugins de.cau.cs.kieler.core and de.cau.cs.kieler.kiml.layout to the list of dependencies, then save the file 24 -1. Create a //layout provider// class with the //New -> Class// wizard\\ 25 -1*. Package: de.cau.cs.rtprak.<login>.exercise1 117 +1. Commit the new plugin project ((% style="color: rgb(255,0,0);" %)TODO: describe steps to commit plugin projects(%%)) 118 +1. (% style="font-size: 10.0pt;line-height: 13.0pt;" %)Open the file META-INF/MANIFEST.MF //→// //Dependencies// tab(%%)\\ 119 +1*. Add the plugins de.cau.cs.kieler.core and de.cau.cs.kieler.kiml to the list of dependencies, then save the file. 120 +1. Create a //layout provider// class with the //New →// Class wizard\\ 121 +1*. Package: de.cau.cs.rtprak.<login>.tutorial2 26 26 1*. Name: <Login>LayoutProvider 27 27 1*. Superclass: de.cau.cs.kieler.kiml.AbstractLayoutProvider 28 28 1. ((( 29 -Implement the [[(% class="icon" %) (%%)layout provider>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/layout/AbstractLayoutProvider.html||style="" shape="rect" class="ext-link"]] class 30 -1. You should now see a checkstyle warning for the doLayout method\\ 31 -1*. Add the keyword final to each method argument to eliminate the warning 32 -1. Add the following constant to the class:(% class="code" %) 125 +Implement the layout provider class 126 +1. (% style="font-size: 10.0pt;line-height: 13.0pt;" %)Add the following constant to the class: 127 +1. (% class="code" %) 33 33 ((( 34 34 (% class="cm" style="color: rgb(153,153,136);" %)/~*~* default value for spacing between nodes. */(% class="kd" %)privatestaticfinal(% class="kt" style="color: rgb(68,85,136);" %)float(% class="o" %)=(% class="mf" style="color: rgb(0,153,153);" %)15.0f(% class="o" %); 35 35 ... ... @@ -37,7 +37,7 @@ 37 37 DEFAULT_SPACING 38 38 }}} 39 39 ))) 40 -1. Write the following lines at the beginning of the doLayout method(see [[(%class="icon" %) (%%)IKielerProgressMonitor>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/alg/IKielerProgressMonitor.html||style="" shape="rect" class="ext-link"]] and [[(% class="icon"%) (%%)KimlLayoutUtil>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/layout/util/KimlLayoutUtil.html||style="" shape="rect" class="ext-link"]]):(% class="code" %)135 +1. Write the following lines at the beginning of the {{code language="none"}}doLayout{{/code}} method:(% class="code" %) 41 41 ((( 42 42 (% class="o" %).(% class="na" style="color: rgb(0,128,128);" %)begin(% class="o" %)((% class="s" style="color: rgb(187,136,68);" %)"<Login> Layouter"(% class="o" %),(% class="mi" style="color: rgb(0,153,153);" %)1(% class="o" %));=.(% class="na" style="color: rgb(0,128,128);" %)getData(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)class(% class="o" %));(% class="kt" style="color: rgb(68,85,136);" %)float(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getProperty(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)SPACING(% class="o" %));(% class="k" %)if(% class="o" %)(<(% class="mi" style="color: rgb(0,153,153);" %)0(% class="o" %)){=;}(% class="kt" style="color: rgb(68,85,136);" %)float(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getProperty(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)BORDER_SPACING(% class="o" %));(% class="k" %)if(% class="o" %)(<(% class="mi" style="color: rgb(0,153,153);" %)0(% class="o" %)){=;} 43 43 ... ... @@ -53,7 +53,7 @@ 53 53 54 54 }}} 55 55 ))) 56 -1. Write the following line at the end of the doLayout 151 +1. Write the following line at the end of the {{code language="none"}}doLayout{{/code}} method:(% class="code" %) 57 57 ((( 58 58 (% class="o" %).(% class="na" style="color: rgb(0,128,128);" %)done(% class="o" %)(); 59 59 ... ... @@ -61,9 +61,9 @@ 61 61 }}} 62 62 ))) 63 63 1. ((( 64 -Implement the rest of the layouter such that the nodes of the input graph are all put in a row 65 -* See the [[ (% class="icon" %) (%%)KGraph>>url:https://rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KGraph||style=""shape="rect" class="ext-link"]](% class="icon" %) (%%)KLayoutData>>url:https://rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KLayoutData||style=""shape="rect" class="ext-link"]][[(% class="icon" %) (%%)KNode>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/kgraph/KNode.html||style="" shape="rect" class="ext-link"]]and holds the nodes of the graph in its list of children66 -* Iterate over the nodes in the [[(%class="icon"%) (%%)getChildren()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/kgraph/KNode.html#getChildren()||style=""shape="rect"class="ext-link"]] listof the159 +Implement the rest of the layouter such that the nodes of the input graph are all put in a row. 160 +* See the [[KGraph>>doc:KIELER.KGraph Meta Model]] and [[KLayoutData>>doc:KIELER.KLayoutData Meta Model]] data structures: the input is a KNode and holds the nodes of the graph in its list of children 161 +* Iterate over the nodes in the {{code language="none"}}getChildren(){{/code}} list of the {{code language="none"}}layoutNode{{/code}} input 67 67 * Retrieve the size of a node using the following code:(% class="code" %) 68 68 ((( 69 69 (% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getData(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)class(% class="o" %));(% class="kt" style="color: rgb(68,85,136);" %)float(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getWidth(% class="o" %)();(% class="kt" style="color: rgb(68,85,136);" %)float(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getHeight(% class="o" %)(); ... ... @@ -81,63 +81,57 @@ 81 81 nodeLayouty 82 82 }}} 83 83 ))) 84 -* objectSpacing 85 -* borderSpacing 86 -* At the end of the method, set the width and height of parentLayout 87 -* Edges may be ignored for now 179 +* {{code language="none"}}objectSpacing{{/code}} shall be the spacing to be left between each pair of nodes. 180 +* {{code language="none"}}borderSpacing{{/code}} shall be the spacing to be left to the borders of the drawing: the first node's coordinates shall be (borderSpacing, borderSpacing). 181 +* At the end of the method, set the width and height of {{code language="none"}}parentLayout{{/code}} so that it is large enough to hold the whole drawing, including borders. 182 +* Edges may be ignored for now. 88 88 ))) 89 89 ))) 90 -1. Open the file META-INF/MANIFEST.MF ->//Extensions// tab\\185 +1. Open the file META-INF/MANIFEST.MF //→// //Extensions// tab\\ 91 91 11. Add an extension for de.cau.cs.kieler.kiml.layout.layoutProviders 92 -11. Right-click the extension ->//New//->//layoutProvider//93 -11. Set //name// to //<Login> Test Layouter//, //class// to de.cau.cs.rtprak.<login>. exercise1.<Login>LayoutProvider94 -11. Right-click the new //layoutProvider// ->//New//->//knownOption//, set //option// to de.cau.cs.kieler.layout.options.minSpacing95 -11. Add another //knownOption//, set to de.cau.cs.kieler. layout.options.borderSpacing96 -1. //Run// ->//Run Configurations...//->right-click //Eclipse Application//->//New//\\187 +11. Right-click the extension //→// //New// //→// //layoutProvider// 188 +11. Set //name// to //<Login> Test Layouter//, //class// to de.cau.cs.rtprak.<login>.tutorial2.<Login>LayoutProvider 189 +11. Right-click the new //layoutProvider// //→// //New// //→// //knownOption//, set //option// to de.cau.cs.kieler.spacing 190 +11. Add another //knownOption//, set to de.cau.cs.kieler.borderSpacing 191 +1. //Run// //→// //Run Configurations...// //→// right-click //Eclipse Application// //→// //New//\\ 97 97 11. Name: //Layout// 98 -11. For testing the layouter, a new workspace location will be created; you may configure its destination in //Workspace Data// ->//Location//99 -11. Add the program arguments -debug -consoleLog 193 +11. For testing the layouter, a new workspace location will be created; you may configure its destination in //Workspace Data// //→// //Location// 194 +11. Add the program arguments {{code language="none"}}-debug -consoleLog{{/code}} in the //Arguments// tab. 100 100 11. Go to //Plug-ins// tab, select //Launch with: plug-ins selected below only// 101 101 11. //Deselect All//, activate //Workspace// checkbox, //Add Required Plug-ins//, //Apply//, //Run// 102 102 1. Test the layouter in the new Eclipse instance:\\ 103 -11. //New// ->//Project...//->//General//->//Project//, name //test//104 -11. Right-click test project ->//New//->//Other...//->//GraphsDiagram//105 -11. Create a graph using the palette on the right 106 -11. //Window// ->//Show View//->//Other...//->//KIELER//->//Layout//107 -11. While the graph diagram is open, set //Layout Provider or Type// in the //Layout// view to //<Login> Test Layouter// 108 -11. Open the additional views //Layout Graph// and //Layout Time// 109 -11. Trigger layout with // -> //Layout// or Ctrl+R L (first Ctrl+R, then L)or the button in the toolbar110 -11. See the direct input and output of your algorithm in the //Layout Graph// view : //Pre-Layout// is the input, //Post-Layout// is the output111 -11. See the execution time analysis in the //Layout Time// view 198 +11. //New// //→// //Project...// //→// //General// //→// //Project//, name //test// 199 +11. Right-click test project //→// //New// //→// //Other...// //→// //KEG Diagram// ((% style="color: rgb(255,0,0);" %)TODO: if graphs shall be created in another way, describe it here(%%)) 200 +11. Create a graph using the palette on the right. 201 +11. //Window// //→// //Show View// //→// //Other...// //→// //KIELER// //→// //Layout// 202 +11. While the graph diagram is open, set //Layout Provider or Type// in the //Layout// view to //<Login> Test Layouter.// 203 +11. Open the additional views //Layout Graph// and //Layout Time.// 204 +11. Trigger layout with the //KIELER Layout// button in the toolbar or Ctrl+R L (first Ctrl+R, then L). 205 +11. See the direct input and output of your algorithm in the //Layout Graph// view. 206 +11. See the execution time analysis in the //Layout Time// view. 112 112 1. ((( 113 -Implement another class //EdgeRouter// with superclass de.cau.cs.kieler.core.alg.AbstractAlgorithm208 +Implement another class //EdgeRouter//. 114 114 1. Add the following method:(% class="code" %) 115 115 ((( 116 -(% class="cm" style="color: rgb(153,153,136);" %)/~*~* * Route the edges that are connected with the children of the given node. * * @param parentNode the parent node of the input graph */(% class="kd" %)public(% class="kt" style="color: rgb(68,85,136);" %)void(% class="nf" style="color: rgb(153,0,0);" %)routeEdges(% class="o" %)((% class="kd" %)final(% class="o" %)){().(% class="na" style="color: rgb(0,128,128);" %)begin(% class="o" %)((% class="s" style="color: rgb(187,136,68);" %)"Edge Routing"(% class="o" %),(% class="mi" style="color: rgb(0,153,153);" %)1(% class="o" %));().(% class="na" style="color: rgb(0,128,128);" %)done(% class="o" %)();} 117 117 118 -{{{ 119 - KNode parentNode 120 - getMonitor 121 - 122 - getMonitor 123 - 124 -}}} 212 +\\\\\\\\\\\\\\ 213 + 214 +{{{ /** * Route the edges that are connected with the children of the given node. * @param parentNode the parent node of the input graph */ public void routeEdges(final KNode parentNode) { getMonitor().begin("Edge Routing", 1); getMonitor().done(); }}}} 125 125 ))) 126 -1. Add the following code to the end of the doLayout 216 +1. Add the following code to the end of the {{code language="none"}}doLayout{{/code}} method in your layout provider:(% class="code" %) 127 127 ((( 128 -(% class="o" %)=(% class="k" %)new(% class="o" %)();.(% class="na" style="color: rgb(0,128,128);" %)r eset(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)subTask(% class="o" %)((% class="mi" style="color: rgb(0,153,153);" %)1(% class="o" %)));.(% class="na" style="color: rgb(0,128,128);" %)routeEdges(% class="o" %)();218 +(% class="o" %)=(% class="k" %)new(% class="o" %)();.(% class="na" style="color: rgb(0,128,128);" %)routeEdges(% class="o" %)(); 129 129 130 130 {{{ EdgeRouter edgeRouter EdgeRouter 131 - edgeRouterprogressMonitor 132 132 edgeRouterlayoutNode 133 133 }}} 134 134 ))) 135 135 1. ((( 136 -Implement the routeEdges 225 +Implement the {{code language="none"}}routeEdges{{/code}} method: 137 137 * Each edge shall be drawn with three line segments: one vertical segment starting below the source node, one horizonzal segment, and another vertical segment ending below the target node. 138 -* The horizontal segments of two different edges shall not have the same y-coordinate; for consecutive edges, the distance between their horizontal segments shall equal objectSpacing 139 -* See the attached image [[ test-drawing.png>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/attachment/wiki/Exercises/Introduction/test-drawing.png||style="" title="Attachment 'test-drawing.png' in Exercises/Introduction" shape="rect" class="attachment"]](% class="noprint" %) [[~[~[image:url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/chrome/common/download.png~]~]>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/10ss-layout/raw-attachment/wiki/Exercises/Introduction/test-drawing.png||style="" title="Download" shape="rect" class="trac-rawlink"]](%%)for an example140 -* Find the edges using [[(%class="icon"%) (%%)getOutgoingEdges()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/kgraph/KNode.html#getOutgoingEdges()||style="" shape="rect" class="ext-link"]]or [[(% class="icon"%) (%%)getIncomingEdges()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/kgraph/KNode.html#getIncomingEdges()||style=""shape="rect" class="ext-link"]]on a node227 +* The horizontal segments of two different edges shall not have the same y-coordinate; for consecutive edges, the distance between their horizontal segments shall equal {{code language="none"}}objectSpacing{{/code}}. 228 +* See the attached image [[attach:test-drawing.png]] for an example. 229 +* Find the edges using {{code language="none"}}getOutgoingEdges(){{/code}} or {{code language="none"}}getIncomingEdges(){{/code}} on a node. 141 141 * Get the edge layout of an edge to set bend points using this code:(% class="code" %) 142 142 ((( 143 143 (% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getData(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)class(% class="o" %)); ... ... @@ -152,8 +152,8 @@ 152 152 {{{ KPoint point KLayoutDataFactory 153 153 }}} 154 154 ))) 155 -* Use the [[(%class="icon"%) (%%)getBendPoints()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/layout/klayoutdata/KEdgeLayout.html#getBendPoints()||style=""shape="rect" class="ext-link"]] listonthe156 -* Set the values of the points returned by [[(%class="icon"%) (%%)getSourcePoint()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/layout/klayoutdata/KEdgeLayout.html#getSourcePoint()||style="" shape="rect" class="ext-link"]] and [[(% class="icon"%) (%%)getTargetPoint()>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/layout/klayoutdata/KEdgeLayout.html#getTargetPoint()||style=""shape="rect"class="ext-link"]] according to the positions where the edge leaves its source node and reches its target node244 +* Use the {{code language="none"}}getBendPoints(){{/code}} list on the {{code language="none"}}edgeLayout{{/code}} to add bend points (clear the list first to remove points from the previous layout). 245 +* Set the values of the points returned by {{code language="none"}}getSourcePoint(){{/code}} and {{code language="none"}}getTargetPoint(){{/code}} according to the positions where the edge leaves its source node and reches its target node. 157 157 ))) 158 158 ))) 159 159 1. Use your previous run configuration to test the edge router.
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 - 55052211 +6160457 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS13LayPract/pages/ 5505221/KIML1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS13LayPract/pages/6160457/KIML