Skip to content

Commit

Permalink
Completed adding tabs to the java version of the lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrell committed Feb 10, 2017
1 parent 9bed2ea commit 2bd7904
Show file tree
Hide file tree
Showing 7 changed files with 396 additions and 658 deletions.
2 changes: 1 addition & 1 deletion Hello_World_Tutorials/CDLL.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h2>How does the CircDLelement&lt;E&gt; work?</h2>
that has two links, pointing to two other doubly linked elements. So
a CircDLelement&lt;E&gt; “knows” who
it’s pointing at, AND it knows who pointed at it.
<br><br><img src="./images/svg/cdl.svg"/><br><br>
<br><br><img class="img-responsive" width="600em" src="./images/svg/cdl.svg"/><br><br>
In this example, calling getNext() on CircDLelement2 will return CircDLelement3.
Calling getPrev() on CircDLelement2 will return CircDLelement1. CircDLelement3 points to CircDLelement1, and CircDLelement1 points to CircDLelement3.
<br><br>
Expand Down
64 changes: 56 additions & 8 deletions Hello_World_Tutorials/Java_CDLL.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,59 @@ <h3>Inside our Main</h3>
positive integer), and the remaining two parameters are your BRIDGES
credentials. You will need to replace the two fields in this call
with your own BRIDGES credentials. <p>
<li>Now create an array to hold Student objects.</li>
<pre class="prettyprint">
Student[] students = {
new Student(
"00000000000",
"Gretel Chaney",
"CS",
"[email protected]",
"magenta",
"blue",
9.0,
"https://randomuser.me/api/portraits/med/women/45.jpg"
),
new Student(
"00000000001",
"Karol Soderman",
"SIS",
"[email protected]",
"magenta",
"red",
11.0,
"https://randomuser.me/api/portraits/med/women/46.jpg"
),
new Student(
"00000000002",
"Lamont Kyler",
"BIO",
"[email protected]",
"yellow",
"green",
12.0,
"https://randomuser.me/api/portraits/med/men/80.jpg"
),
new Student(
"00000000003",
"Gladys Serino",
"CS","[email protected]",
"blue",
"magenta",
9.0,
"https://randomuser.me/api/portraits/med/women/2.jpg"
),
new Student("00000000004",
"Starr Mcginn",
"CS",
"[email protected]",
"red",
"yellow",
15.0,
"https://randomuser.me/api/portraits/med/men/87.jpg")
};
</pre>

<li>Then we can create our CircDLelements with the Student objects and link the DLements together.</li>
<pre class="prettyprint">

Expand All @@ -34,11 +87,11 @@ <h3>Inside our Main</h3>
*/
//initializing all elements with empty labels, and with the student data. See Object model.Student.java
CircDLelement<Student> el0 = null;
for(int i = 0; i < StudentProvider.getStudents().length; i++) {
for(int i = 0; i < students.length; i++) {
if(i > 0) {
el0 = insertFront(el0, new CircDLelement("",StudentProvider.getStudentAt(i)));
el0 = insertFront(el0, new CircDLelement("",students[i]));
}else{
el0 = new CircDLelement("",StudentProvider.getStudentAt(i));
el0 = new CircDLelement("",students[i]);
}
}

Expand Down Expand Up @@ -74,7 +127,6 @@ <h3>Here's the final code:</h3>
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Main.java</a></li>
<li><a href="#tab2" data-toggle="tab">Student.java</a></li>
<li><a href="#tab3" data-toggle="tab">StudentProvider.java</a></li>
</ul>
</div>
<div class="panel-body">
Expand All @@ -86,10 +138,6 @@ <h3>Here's the final code:</h3>
<div class="tab-pane fade" id="tab2">
<pre w3-include-html="tutorial-source-code/Student.java" class="prettyprint"></pre>
</div>

<div class="tab-pane fade" id="tab3">
<pre w3-include-html="tutorial-source-code/StudentProvider.java" class="prettyprint"></pre>
</div>
</div>
</div>

Expand Down
Loading

0 comments on commit 2bd7904

Please sign in to comment.