Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
06c8820
Update unix-getting-started.rst
bjb211 Jul 9, 2022
d1ef810
Update unix-getting-started.rst
bjb211 Jul 9, 2022
577da89
Update unix-getting-started.rst
bjb211 Jul 9, 2022
248b0a7
Update unix-getting-started.rst
bjb211 Jul 9, 2022
48b8e1e
Update unix-getting-started.rst
bjb211 Jul 9, 2022
14514de
Moved windows/mac setup tutorials to this directory from the exercise…
bjb211 Jul 9, 2022
f9a8da5
Update unix-getting-started.rst
bjb211 Jul 9, 2022
85bc929
Update MacOS.md
bjb211 Jul 9, 2022
c60d66d
Update MacOS.md
bjb211 Jul 9, 2022
b8499a8
Update MacOS.md
bjb211 Jul 9, 2022
a033603
Update Windows.md
bjb211 Jul 9, 2022
353ff27
added image for windows setup tutorial
bjb211 Jul 9, 2022
013ae5d
Update Windows.md
bjb211 Jul 9, 2022
e96bec2
Update octal-mode.md
bjb211 Jul 9, 2022
7776426
Update octal-mode.md
bjb211 Jul 9, 2022
8da6312
Update unix-tutorial.rst
bjb211 Jul 9, 2022
e19af85
Update unix-tutorial.rst
bjb211 Jul 9, 2022
53441fd
Update unix-tutorial.rst
bjb211 Jul 10, 2022
dd79cbd
Update unix-tutorial.rst
bjb211 Jul 10, 2022
644512a
Update unix-tutorial.rst
bjb211 Jul 10, 2022
b3f7d32
Update unix-getting-started.rst
bjb211 Jul 10, 2022
ea07d43
Update unix-tutorial.rst
bjb211 Jul 10, 2022
284cb19
Update unix-tutorial.rst
bjb211 Jul 10, 2022
80f016b
Update unix-tutorial.rst
bjb211 Jul 10, 2022
7b1a897
Update emacs.md
bjb211 Jul 11, 2022
e0d6799
Update MacOS.md
bjb211 Jul 19, 2022
c1d4360
Update variables.md
bjb211 Jul 19, 2022
66ee1c8
Update variables.md
bjb211 Jul 19, 2022
8b7d253
Update emacs.md
bjb211 Jul 21, 2022
208b0a6
Update emacs.md
bjb211 Jul 21, 2022
b648f4a
Update emacs.md
bjb211 Jul 21, 2022
894b8d1
Update interfaces.md
bjb211 Jul 23, 2022
e46f60f
Update interfaces.md
bjb211 Jul 24, 2022
91aaf2f
Update exceptions.md
bjb211 Jul 24, 2022
2871645
Update javadoc.md
bjb211 Jul 24, 2022
ac8ba55
Split exceptions tutorial into 2 parts
bjb211 Jul 24, 2022
3638f21
Update exceptions1.md
bjb211 Jul 24, 2022
9228547
Update exceptions1.md
bjb211 Jul 24, 2022
87a6994
Update exceptions2.md
bjb211 Jul 24, 2022
b44b518
Update exceptions2.md
bjb211 Jul 24, 2022
feeb1c0
Update interfaces.md
bjb211 Jul 30, 2022
95cd214
Update interfaces.md
bjb211 Jul 30, 2022
de5f8fe
Update packages.md
bjb211 Aug 1, 2022
9a28233
Update packages.md
bjb211 Aug 1, 2022
2353426
Update inheritance.md
bjb211 Aug 4, 2022
b99462e
Update cla.md
bjb211 Aug 14, 2022
f6cdd7a
Update packages.md
bjb211 Aug 15, 2022
e0059dd
Copied packages tutorial to prepare to split the reading into two parts
bjb211 Aug 15, 2022
7d04f58
Update packages1.md
bjb211 Aug 15, 2022
03a698f
Update packages2.md
bjb211 Aug 15, 2022
0f867fe
Update packages2.md
bjb211 Aug 15, 2022
1c22e92
Update packages2.md
bjb211 Aug 15, 2022
de81995
Update packages2.md
bjb211 Aug 15, 2022
9a087fa
Update exceptions1.md
bjb211 Aug 16, 2022
34c319c
Update exceptions2.md
bjb211 Aug 16, 2022
82be2c4
Update packages1.md
bjb211 Aug 16, 2022
a4208fc
Update exceptions1.md
bjb211 Aug 16, 2022
cf97a90
Update exceptions1.md
bjb211 Aug 16, 2022
250309d
Update exceptions1.md
bjb211 Aug 17, 2022
725691a
Update exceptions1.md
bjb211 Aug 17, 2022
816b281
Update interfaces.md
bjb211 Aug 20, 2022
a9363ca
Update unix-tutorial.rst
bjb211 Aug 22, 2022
1ddb48c
Update unix-tutorial.rst
bjb211 Aug 22, 2022
1864b6d
Update cla.md
bjb211 Aug 24, 2022
273abe4
Update interfaces.md
bjb211 Aug 24, 2022
d51f5ed
Update emacs.md
bjb211 Aug 25, 2022
4b08524
Update javadoc.md
bjb211 Aug 26, 2022
5b064c4
Update interfaces.md
bjb211 Aug 26, 2022
fbee9bc
Update inheritance.md
bjb211 Aug 26, 2022
0d3fd49
Update uml.md
bjb211 Aug 27, 2022
cf4b40d
Update uml.md
bjb211 Aug 27, 2022
acc8e4d
Update inheritance.md
bjb211 Aug 27, 2022
d65cd2d
Update packages2.md
bjb211 Sep 2, 2022
81a13bd
Update scripts.md
bjb211 Sep 7, 2022
ff44f89
Update varargs.md
bjb211 Sep 7, 2022
15d84c4
Update interfaces.md
bjb211 Sep 8, 2022
553ea57
Update packages2.md
bjb211 Sep 13, 2022
08800c0
combined public and private visibility readings
bjb211 Sep 17, 2022
abcd785
combined public and private visibility readings
bjb211 Sep 17, 2022
3c059b0
Update public-and-private.rst
bjb211 Sep 17, 2022
936311a
Update visibility.rst
bjb211 Sep 17, 2022
16a4c9b
Update package-private.rst
bjb211 Sep 17, 2022
715f155
Update protected.rst
bjb211 Sep 17, 2022
7bde465
Update visibility.rst
bjb211 Sep 17, 2022
59548f6
Update visibility.rst
bjb211 Sep 17, 2022
670efcd
Update scripts.md
bjb211 Sep 21, 2022
7c0ccbe
Update adt-and-links.md
bjb211 Sep 27, 2022
76a2748
Update package-private.rst
bjb211 Sep 28, 2022
b58d945
Update generic-classes.md
bjb211 Oct 4, 2022
4e31651
Update generic-methods.md
bjb211 Oct 4, 2022
fe3d6d1
Update generic-classes.md
bjb211 Oct 5, 2022
6ff9993
Update generic-methods.md
bjb211 Oct 5, 2022
8e77b78
Update lambda.rst
bjb211 Oct 12, 2022
ba9df62
Update lambda.rst
bjb211 Oct 12, 2022
dcaef77
Update unix-getting-started.rst
mepcotterell Oct 13, 2022
9f72577
Update javafx.md
bjb211 Oct 19, 2022
901cb50
Update lambda.rst
bjb211 Oct 20, 2022
5c55458
Update javafx.md
bjb211 Oct 23, 2022
af02d05
Update javafx.md
bjb211 Oct 23, 2022
5d447a0
Update components.md
bjb211 Oct 28, 2022
c69e6b3
Update ImageApp.java
bjb211 Oct 28, 2022
d588c22
Update components.md
bjb211 Oct 28, 2022
ca8fb7f
Update components.md
bjb211 Oct 28, 2022
f9a70c0
Update components.md
bjb211 Oct 28, 2022
4eb9254
Update components.md
bjb211 Oct 28, 2022
a154a42
Update components.md
bjb211 Oct 28, 2022
d625616
Update ImageDriver.java
bjb211 Oct 28, 2022
f90ecf0
Updated ImageApp to use methods from JavaFX lifecycle.
bjb211 Oct 28, 2022
cee3897
Updated setup script to pull code from alsi branch
bjb211 Oct 28, 2022
deebb7a
Changed branch back to master in setup script
bjb211 Oct 28, 2022
88714bb
Update maven.md
bjb211 Nov 2, 2022
38b465d
Update brief-intro-threads.md
bjb211 Nov 2, 2022
59e4663
Update MacOS.md
bjb211 Jan 4, 2023
13b7b3f
Update variables.md
bjb211 Jan 4, 2023
2b51625
Update unix-getting-started.rst
bjb211 Jan 4, 2023
67a91b7
Update unix-tutorial.rst
bjb211 Jan 4, 2023
a8c880c
Update Windows.md
bjb211 Jan 9, 2023
f495b9d
Update Windows.md
bjb211 Jan 9, 2023
edfc61a
Update emacs.md
bjb211 Jan 12, 2023
6bb54c5
Update packages1.md
bjb211 Jan 12, 2023
33a3488
Update packages2.md
bjb211 Jan 12, 2023
5e11697
Update octal-mode.md
bjb211 Jan 12, 2023
d654606
Update cla.md
bjb211 Jan 12, 2023
3c7ddd6
Update packages1.md
bjb211 Jan 14, 2023
123c348
Update packages1.md
bjb211 Jan 14, 2023
31cf24d
Update packages1.md
bjb211 Jan 14, 2023
39201d1
Update packages1.md
bjb211 Jan 18, 2023
2161585
Update exceptions1.md
bjb211 Jan 19, 2023
8ec1029
Update exceptions2.md
bjb211 Jan 19, 2023
5729ca9
Update exceptions1.md
bjb211 Jan 25, 2023
0cd3b1c
Update exceptions2.md
bjb211 Jan 25, 2023
8674f0e
Update emacs.md
mepcotterell Jan 26, 2023
f00e0ab
Update interfaces.md
bjb211 Jan 26, 2023
2ddfe3d
Update interfaces.md
bjb211 Jan 26, 2023
25e56b0
Update javadoc.md
bjb211 Jan 26, 2023
45d59c1
Update uml.md
bjb211 Jan 26, 2023
9d3ff26
Update scripts.md
bjb211 Jan 26, 2023
634f1c8
Update varargs.md
bjb211 Jan 26, 2023
6ce374c
Update unix-tutorial.rst
mepcotterell Jan 27, 2023
d2d802a
Update unix-tutorial.rst
mepcotterell Jan 27, 2023
ce66a16
Update inheritance.md
bjb211 Feb 6, 2023
5c4f291
Update inheritance.md
bjb211 Feb 7, 2023
b295d55
Update visibility.rst
bjb211 Feb 7, 2023
c5f5677
Update public-and-private.rst
bjb211 Feb 7, 2023
5cec954
Update protected.rst
bjb211 Feb 12, 2023
2b9fd79
Update package-private.rst
bjb211 Feb 12, 2023
597221f
Update adt-and-links.md
bjb211 Feb 12, 2023
508d2a6
Update visibility.rst
bjb211 Feb 15, 2023
952f8e1
Update visibility.rst
bjb211 Feb 15, 2023
a4b8de8
Update generic-classes.md
bjb211 Feb 19, 2023
d67b1c8
Update generic-methods.md
bjb211 Feb 19, 2023
5a3d9e4
Update generic-methods.md
bjb211 Feb 19, 2023
ec532dc
Update generic-classes.md
bjb211 Feb 19, 2023
18bc7af
Update scripts.md
mepcotterell Feb 24, 2023
a69be86
Update lambda.rst
bjb211 Mar 9, 2023
341fdb8
Update javafx.md
bjb211 Mar 16, 2023
11077b7
Update javafx.md
bjb211 Mar 28, 2023
cff648a
Update components.md
bjb211 Mar 30, 2023
bc3ece3
Update brief-intro-threads.md
bjb211 Mar 30, 2023
a79d94d
Update maven.md
bjb211 Mar 30, 2023
53d6a9d
Update variables.md
bjb211 Aug 12, 2023
ee37205
Update unix-getting-started.rst
bjb211 Aug 12, 2023
f1c5577
Update MacOS.md
bjb211 Aug 12, 2023
9b40349
Update Windows.md
bjb211 Aug 12, 2023
1b3691a
Update unix-tutorial.rst
bjb211 Aug 12, 2023
08ce7fe
Update emacs.md
bjb211 Aug 12, 2023
8e923df
Update cla.md
bjb211 Aug 21, 2023
915aef7
Update octal-mode.md
bjb211 Aug 21, 2023
13a8c7e
Update packages1.md
bjb211 Aug 21, 2023
37ab5c6
Update packages2.md
bjb211 Aug 21, 2023
4a3be7e
Update exceptions1.md
bjb211 Aug 21, 2023
b775a2e
Update MacOS.md
bjb211 Aug 22, 2023
847d96c
Update exceptions2.md
bjb211 Aug 27, 2023
82f6667
Update javadoc.md
bjb211 Aug 27, 2023
b0ffd2f
Update interfaces.md
bjb211 Aug 27, 2023
96d27c6
[typo] desirabe > desirable
charleskimbac Aug 30, 2023
26753c9
Merge pull request #12 from charleskimbac/patch-1
bjb211 Aug 30, 2023
83bda17
Update exceptions1.md
bjb211 Aug 30, 2023
1fe6b93
[typos] 3
charleskimbac Aug 30, 2023
e232891
[typos] 3
charleskimbac Aug 30, 2023
2eba3a2
Merge pull request #13 from charleskimbac/patch-2
bjb211 Aug 30, 2023
ab2ce4f
Merge pull request #14 from charleskimbac/patch-3
bjb211 Aug 30, 2023
ae845aa
Update javadoc.md
bjb211 Aug 30, 2023
fd49395
Update exceptions1.md
mepcotterell Aug 31, 2023
afa221f
Update exceptions1.md
mepcotterell Aug 31, 2023
bff1bea
Update exceptions1.md
mepcotterell Aug 31, 2023
ffc333a
Update setup.sh
mepcotterell Sep 5, 2023
4c17116
Update javadoc.md
mepcotterell Sep 5, 2023
f73779c
Update setup.sh
mepcotterell Sep 5, 2023
5e0af2c
Update setup.sh
mepcotterell Sep 5, 2023
e7cfd10
Update setup.sh
mepcotterell Sep 5, 2023
0ebcf2d
Update setup.sh
mepcotterell Sep 5, 2023
3bf9840
Update setup.sh
mepcotterell Sep 5, 2023
503b4d4
Update setup.sh
mepcotterell Sep 5, 2023
26061da
Update setup.sh
mepcotterell Sep 5, 2023
38a2dee
Update setup.sh
mepcotterell Sep 5, 2023
604fd20
Update setup.sh
mepcotterell Sep 5, 2023
63e4415
Update uml.md
bjb211 Sep 6, 2023
bad8733
Update scripts.md
bjb211 Sep 6, 2023
4f2b072
Update varargs.md
bjb211 Sep 6, 2023
f7cf4b9
Update inheritance.md
bjb211 Sep 6, 2023
72fca8a
Update exceptions2.md
charleskimbac Sep 9, 2023
b4223d8
Merge pull request #17 from charleskimbac/patch-5
bjb211 Sep 10, 2023
bf9cce3
Update uml.md
charleskimbac Sep 11, 2023
54db9e6
Merge pull request #18 from charleskimbac/patch-7
bjb211 Sep 11, 2023
fc1dfc9
Update visibility.rst
bjb211 Sep 17, 2023
9db7405
Update public-and-private.rst
bjb211 Sep 17, 2023
ed43cbd
Update package-private.rst
bjb211 Sep 17, 2023
cea5638
Update protected.rst
bjb211 Sep 17, 2023
c95c5da
Update unix-getting-started.rst
mepcotterell Sep 18, 2023
84ff590
Update scripts.md
charleskimbac Sep 19, 2023
ee7e9bb
Merge pull request #19 from charleskimbac/patch-8
bjb211 Sep 19, 2023
708f2cf
Update varargs.md
charleskimbac Sep 19, 2023
8c48a93
Update inheritance.md
charleskimbac Sep 19, 2023
f5fb3b7
Merge pull request #20 from charleskimbac/patch-9
bjb211 Sep 19, 2023
52443c2
Merge pull request #21 from charleskimbac/patch-10
bjb211 Sep 19, 2023
7c4fe6e
Update adt-and-links.md
bjb211 Sep 23, 2023
225c55c
Update visibility.rst
charleskimbac Sep 28, 2023
3964430
Update public-and-private.rst
charleskimbac Sep 28, 2023
7884943
Merge pull request #23 from charleskimbac/patch-13
bjb211 Sep 28, 2023
8424d50
Merge pull request #24 from charleskimbac/patch-14
bjb211 Sep 28, 2023
ba016ae
Fixed typos "it's" to "its" and "access access" to "access"
nivedhanatarajan7 Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adt-and-links/adt-and-links.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADTs and Lists Tutorial

![Approved for: Spring 2022](https://img.shields.io/badge/Approved%20for-Spring%202022-purple)
![Approved for: Fall 2023](https://img.shields.io/badge/Approved%20for-Fall%202023-green)

## Introduction

Expand Down
41 changes: 23 additions & 18 deletions cla/cla.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Command-Line Arguments

![Approved for: Spring 2022](https://img.shields.io/badge/Approved%20for-Spring%202022-purple)
![Approved for: Fall 2023](https://img.shields.io/badge/Approved%20for-Fall%202023-green)

When working in a Unix-like environment, programs are launched when the user
enters the program's name into the shell (i.e., they type it in, then press
Expand All @@ -9,34 +9,35 @@ pieces of information, called **command-line arguments**, after the program's
name in order to adjust the program's settings and supply values that the
program needs to execute. For example, consider using `ls` to list all of the
entries in `~/public_html` using the long listing format (`-l`), including
files that being with a dor (`-a`):
hidden files that begin with a dot `.` (`-a`):

```
$ ls -l -a ~/public_html
```

In the example above, the base command (program) is `ls` and the command-line
arguments used are `-l`, `-a`, and `~/public_html`. Each of the command-line
arguments provides information to the program about how it should run.

When the program is launched, the command-line arguments are passed into
to the program through its `main` method. Like many Unix programs, `ls` is
to the program through its `main` method. The program reads these values as
input and determines how to respond. Like many Unix programs, `ls` is
written in C, but support for command-line arguments extends to other
languges as well, including Java. Let's try it!

1. Create a directory for this tutorial called `cs1302-cla`, then change into it.

1. Create a `src` and `bin` directory, then create the `.java` file for a class
called `ArgTester` in a package called `cs1302.cla` such that the `src` directory
is the _default package for source code_.
called `ArgTester` and place `ArgTester.java` in the `src` directory.

```
cs1302-cla
├── bin
└── src
└── cs1302
└── cla
└── ArgTester.java
└── ArgTester.java
```

1. In `ArgTester.java`, add the appropriate package statement, then
add the declaration for the `ArgTester` class.
1. In `ArgTester.java`, add the declaration for the `ArgTester` class.

1. In your `ArgTester` class, add the following `main` method:

Expand All @@ -52,16 +53,20 @@ languges as well, including Java. Let's try it!

1. Take a few minutes to carefully read through the code above. Try and understand what it's doing.
Note: Up until this point, you've always typed `String[] args` as a parameter to `main` but you've
never used it. That parameter is a reference to an array of command-line arguments.
probably never used it. That parameter is a reference to an array containing the command-line arguments.

1. Compile the `ArgTester` class, specifying `bin` as the destination directory.

1. Run `cs1302.cla.ArgTester` as usual using the `java` command. Here is what the command looks
```
javac -d bin ArgTester.java
```

1. Run `ArgTester` as usual using the `java` command. Here is what the command looks
like with the expected program output, assuming you are running it from the `cs1302-cla`
directory:

```
$ java -cp bin cs1302.cla.ArgTester
$ java -cp bin ArgTester
arguments:
```

Expand All @@ -71,10 +76,10 @@ languges as well, including Java. Let's try it!
1. Now try the following command:

```
$ java -cp bin cs1302.cla.ArgTester one two three
$ java -cp bin ArgTester one two three
```

What happened? It looks like the for-loop iterated. The array referred to by `args` is not
What happened when you ran it? It looks like the for-loop iterated. The array referred to by `args` is not
empty. That's right, we've actually used the `args` array for something! Here's the
expected output:

Expand All @@ -92,15 +97,15 @@ languges as well, including Java. Let's try it!
different command-line arguments are parsed. Try the following commands:

```
$ java -cp bin cs1302.cla.ArgTester "one two" three
$ java -cp bin ArgTester "one two" three
```

```
$ java -cp bin cs1302.cla.ArgTester --help "some topic"
$ java -cp bin ArgTester --help "some topic"
```

```
$ java -cp bin cs1302.cla.ArgTester --string "my \"awesome\" day"
$ java -cp bin ArgTester --string "my \"awesome\" day"
```

2. That's it! The rest is purely in the realm of code. We've shown you how command-line
Expand Down
63 changes: 35 additions & 28 deletions components/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JavaFX Custom Component Tutorial

![Approved for: Spring 2022](https://img.shields.io/badge/Approved%20for-Spring%202022-purple)
![Approved for: Spring 2023](https://img.shields.io/badge/Approved%20for-Spring%202023-magenta)

JavaFX is a library for creating and delivering applications with graphical user interfaces (GUIs)
in Java. In this tutorial, we will use JavaFX 17. The API documentation for
Expand All @@ -26,8 +26,8 @@ using inheritance and polymorphism to emphasize code reuse.

If you encounter problems in this step, then please ensure that you have followed the
instructions provided at the beginning of the semester for
[MacOS users](https://github.com/cs1302uga/cs1302-exercises/blob/master/misc/MacOS.md) or
[Windows 10 users](https://github.com/cs1302uga/cs1302-exercises/blob/master/misc/Windows10.md).
[MacOS users](https://github.com/cs1302uga/cs1302-tutorials/blob/alsi/setup/MacOS.md) or
[Windows 10 users](https://github.com/cs1302uga/cs1302-tutorials/blob/alsi/setup/Windows.md).

Also, the `-X` and `-Y` options can be used individually with or without each other.
See the manual page for `ssh` for more information about the differences between
Expand All @@ -50,14 +50,14 @@ using inheritance and polymorphism to emphasize code reuse.
```

1. Compile and run the provided code without any errors or warnings. If you need a reminder of the compile commands, review
the relevant parts of the [JavaFX Tutorial](https://github.com/cs1302uga/cs1302-tutorials/blob/master/javafx/javafx.md).
the relevant parts of the [JavaFX Tutorial](https://github.com/cs1302uga/cs1302-tutorials/blob/alsi/javafx/javafx.md).
We recommend creating a compile script so you don't have to retype these commands. If you completed the previous steps
correctly, your app should look similar to the screenshot below. You may also find it helpful to review
the scene graph for this app (also seen below).

<table>
<tr>
<td><img src="https://github.com/cs1302uga/cs1302-tutorials/raw/master/components/ScreenShot.png?raw=true" width=300>
<td><img src="https://github.com/cs1302uga/cs1302-tutorials/raw/alsi/components/ScreenShot.png?raw=true" width=300>
<td><pre><code> --|
Stage |
| |
Expand All @@ -77,8 +77,6 @@ using inheritance and polymorphism to emphasize code reuse.
1. The default size for the image in the ImageView container is 500x500 (Even though the image says 300x300).
Do a quick google search for "500x500 images" and load one or two of the images to make sure the app is
functioning properly. **Note:** the `Image` class only supports the BMP, GIF, JPEG, and PNG filetypes.

1. Congratulations on compiling and running a good looking app!

## Creating a Custom Component

Expand All @@ -88,7 +86,7 @@ using inheritance and polymorphism to emphasize code reuse.
reusable component based on the set of existing components contained
in the application.

Consider the following containment hieararchy:
Consider the following containment hierarchy:

```
--|
Expand Down Expand Up @@ -163,14 +161,14 @@ using inheritance and polymorphism to emphasize code reuse.
1. The class should contain the `static` constants from
the `ImageApp` class. They can be cut and paste directly
from that class, perhaps changing them to `protected`
visibility if you wish to do so.

1. Your class should have instance variables for the other
nodes in the sub-graph (make sure to import all required classes).
For example, you will need
an instance variable called `urlLayer` of type `HBox`
as well as instance variables for the remaining nodes.
For the most part, these can be cut and paste from the
visibility if you wish to do so. That way they can be accessed
by the other classes in the package.

1. Your `ImageLoader` class should contain instance variables for the
nodes in the sub-graph above (`HBox`, `TextField`, `Button`, and `ImageView`).
You do not need an instance variable for `VBox` because the `ImageLoader` itself
is a `VBox`!
For the most part, the required instance variables can be cut and paste from the
`ImageApp` class. Any instance variables that you move
into the `ImageLoader` class can be removed from `ImageApp`. You can
also remove any imports that are no longer needed in `ImageApp`.
Expand All @@ -184,7 +182,9 @@ using inheritance and polymorphism to emphasize code reuse.
Use this knowledge to add your newly created nodes to the
sub-graph rooted at `this` similar to how they are
added to the `VBox` node in the `ImageApp` class.
Your code will likely look something like this:
Your code will likely look something like the code below with
additional statements to instantiate the components and connect
them:

```java
public ImageLoader() {
Expand All @@ -195,23 +195,30 @@ using inheritance and polymorphism to emphasize code reuse.
} // ImageLoader
```

1. If you haven't done so already, remove the code to create the subgraph
(`HBox`, `ImageView`, `TextField`, and `Button`) from the `start` method
of `ImageApp`. All of that code will be run when we create a new `ImageLoader`
object.
1. Remove the code to create the subgraph
(`HBox`, `ImageView`, `TextField`, and `Button`) from the constructor and `init` methods
of `ImageApp`. All of that code will now be run when we create a new `ImageLoader`
object. This includes the code to initialize the `ImageView` and set up the button handler.

1. Take a moment to think about what you are doing. You have created your own, custom class that extends
the JavaFX `VBox` class. This class is essentially a `VBox` with some of the components
built into it. Once we complete this class, we will be able to add objects of this class to a
scene graph and all the messy details of creating that object will be hidden inside of `ImageLoader`!

1. Move the `loadImage` method from `ImageApp` to `ImageLoader`.
Don't forget to set the handler on your `ImageLoader`'s button.
1. Now, move the `loadImage` method from `ImageApp` to `ImageLoader`. This is the method that is
called when the button is clicked. Don't forget to set the handler on your `ImageLoader`'s button.

1. You've probably noticed that `ImageApp` has significantly decreased
in size. We moved a lot of that code over into our custom component!
Now, instantiate two objects of type `ImageLoader` within the `start`
method of `ImageApp`.
Now, instantiate two objects of type `ImageLoader` within the constructor
of `ImageApp`.

1. Instantiate an `HBox` object within the `start` method of `ImageApp`. This
1. Create an `HBox` instance variable in the `ImageApp` class and instantiate
it within the constructor. This
will serve as the container for our `ImageLoader` objects. Set
the `spacing` property of the `HBox` to 10 by passing 10 into the `HBox`
constructor. Now, Add the two `ImgLoader` objects to the `HBox` object of `ImageApp`.
constructor. Now, in the `init` method, add the two `ImgLoader` objects to
the `HBox` object of `ImageApp`.

1. Make sure you pass the reference to your newly created `HBox` object into the
`Scene` constructor within the `start` method of `ImageApp`. Previously, the
Expand All @@ -221,7 +228,7 @@ using inheritance and polymorphism to emphasize code reuse.
1. Compile and run your new app and load up a few 500x500 images. You
should see something like the image below:

<img src="https://github.com/cs1302uga/cs1302-tutorials/raw/master/components/TwoPaneScreenShot.png?raw=true" width=300>
<img src="https://github.com/cs1302uga/cs1302-tutorials/raw/alsi/components/TwoPaneScreenShot.png?raw=true" width=300>

1. Imagine all the ways you could use your new, custom component! Also, think
of other custom components you could build by extending existing JavaFX
Expand Down
4 changes: 2 additions & 2 deletions components/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

1;95;0c
TUTNAME="components"
DIR="cs1302-$TUTNAME"
if [ ! -d $DIR ]; then
Expand All @@ -20,4 +20,4 @@ if [ ! -d $DIR ]; then
echo "subdirectory $DIR successfully created"
else
>&2 echo "subdirectory $DIR already exists"
fi
fi
Loading