diff --git a/assignments/PA1-ArrayIterator.pdf b/assignments/PA1-ArrayIterator.pdf new file mode 100644 index 0000000..1cde261 Binary files /dev/null and b/assignments/PA1-ArrayIterator.pdf differ diff --git a/javafx/VSCode-JavaFX.md b/javafx/VSCode-JavaFX.md new file mode 100644 index 0000000..bd9d30a --- /dev/null +++ b/javafx/VSCode-JavaFX.md @@ -0,0 +1,61 @@ +## Using JavaFX in VS Code + +To create a JavaFX project in VS Code, you need to add the JavaFX JAR files to the project. + +This is an issue for any Java project that uses libraries, not just JavaFX. + +You need to add the JavaFX JAR files to each project where you use JavaFX. +In Eclipse and IntelliJ you can define a Library once and then just refer to in your projects -- seems that VS Code does not have this. + +### Adding Dependencies (JAR files) + +1. Use Java Dependency Viewer (VS Code extension) - at the bottom of the project pane is a section named "JAVA DEPENDENCIES". Open this and you should see an item labeled "Referenced Libraries". Expand that item and look for the JavaFX jar files. It should look like: + +``` +JAVA DEPENDENCIES + v Referenced Libraries + javafx.base.jar + javafx.controls.jar + javafx.fxml.jar + javafx.graphics.jar + javafx.media.jar + javafx.swing.jar (you probably don't need this) + javafx-swt.jar (you probably don't need this) + javafx.web.jar +``` + +2. If you don't see these dependencies, click the "+" sign on the "Referenced Libraries" line. Then select the "lib" directory where you installed JavaFX, such as `/Library/javafx11/lib`. Then refresh the dependencies list (you may need to close and re-expand the item). It should show the javafx jar files. + +3. Edit the project `settings.json` file in the `.vscode` directory. This is an alternative way to add dependencies. You can directly edit it like this: +```json +{ + "java.project.referencedLibraries": [ + "lib/**/*.jar", + "/path/to/javafx11/lib/**/*.jar" + ] +} +``` + +## Running a JavaFX Application + +After you compile a JavaFX application in VS Code, you still have more pain to run it. + +If you enter (on Windows use ";" instead of ":" in classpath): +``` +# assumes you application main class is named Main + +java -cp /path/to/javafx11/lib/*:. Main +``` +Java prints: +``` +Error: JavaFX runtime components are missing, and are required to run this application +``` + +the message isn't very helpful. JavaFX 11 uses "modules" to define access to packages and classes. You need to add options to the `java` command like this: +``` +java --module-path /opt/java/javafx11/lib --add-modules javafx.base,javafx.controls HelloFX +``` +It appears that when you use modules you don't need to add them as the classpath elements. + + + diff --git a/patterns/Command-Pattern.docx b/patterns/Command-Pattern.docx new file mode 100644 index 0000000..dbde316 Binary files /dev/null and b/patterns/Command-Pattern.docx differ diff --git a/patterns/Composite-Pattern.pptx b/patterns/Composite-Pattern.pptx new file mode 100644 index 0000000..ab634ee Binary files /dev/null and b/patterns/Composite-Pattern.pptx differ diff --git a/patterns/Intro-Design-Patterns-with-Java.pptx b/patterns/Intro-Design-Patterns-with-Java.pptx new file mode 100644 index 0000000..3ab3591 Binary files /dev/null and b/patterns/Intro-Design-Patterns-with-Java.pptx differ diff --git a/patterns/Intro-Design-Patterns.ppt b/patterns/Intro-Design-Patterns.pptx similarity index 53% rename from patterns/Intro-Design-Patterns.ppt rename to patterns/Intro-Design-Patterns.pptx index 10f3af9..19a41d4 100644 Binary files a/patterns/Intro-Design-Patterns.ppt and b/patterns/Intro-Design-Patterns.pptx differ diff --git a/patterns/MVC-Pattern.pptx b/patterns/MVC-Pattern.pptx new file mode 100644 index 0000000..0bc613e Binary files /dev/null and b/patterns/MVC-Pattern.pptx differ diff --git a/patterns/Observer-Pattern.pptx b/patterns/Observer-Pattern.pptx new file mode 100644 index 0000000..c3c1970 Binary files /dev/null and b/patterns/Observer-Pattern.pptx differ diff --git a/patterns/diagrams/composite-calculator-ui.png b/patterns/diagrams/composite-calculator-ui.png new file mode 100644 index 0000000..3edf923 Binary files /dev/null and b/patterns/diagrams/composite-calculator-ui.png differ diff --git a/patterns/diagrams/composite-calculator-ui.uxf b/patterns/diagrams/composite-calculator-ui.uxf new file mode 100644 index 0000000..5a84e86 --- /dev/null +++ b/patterns/diagrams/composite-calculator-ui.uxf @@ -0,0 +1,247 @@ + + + 10 + + UMLClass + + 270 + 380 + 120 + 80 + + Button +('1') + + + + UMLClass + + 190 + 20 + 100 + 80 + + Tk +(Window +& +Container) + + + + UMLClass + + 190 + 130 + 100 + 70 + + CalculatorUI + + + + UMLClass + + 280 + 270 + 100 + 70 + + Frame +(Keypad) + + + + UMLClass + + 420 + 380 + 120 + 80 + + Button +('2') + + + + UMLClass + + 130 + 380 + 120 + 80 + + Button +('0') + + + + Relation + + 190 + 330 + 160 + 70 + + lt=<- + 10.0;50.0;140.0;10.0 + + + Relation + + 320 + 330 + 30 + 70 + + lt=<- + 10.0;50.0;10.0;10.0 + + + Relation + + 320 + 330 + 170 + 70 + + lt=<- + 150.0;50.0;10.0;10.0 + + + UMLClass + + 470 + 120 + 100 + 70 + + Widget + + + + UMLClass + + 630 + 260 + 100 + 70 + + Frame +(Operators) + + + + UMLClass + + 560 + 380 + 120 + 80 + + Button +('+') + + + + UMLClass + + 690 + 380 + 120 + 80 + + Button +('-') + + + + Relation + + 610 + 320 + 90 + 80 + + lt=<- + 10.0;60.0;70.0;10.0 + + + Relation + + 670 + 320 + 100 + 80 + + lt=<- + 80.0;60.0;10.0;10.0 + + + Relation + + 540 + 180 + 160 + 100 + + lt=<<- + 10.0;10.0;10.0;50.0;140.0;50.0;140.0;80.0 + + + Relation + + 320 + 180 + 190 + 110 + + lt=<<- + 170.0;10.0;170.0;50.0;10.0;50.0;10.0;90.0 + + + Relation + + 230 + 90 + 30 + 60 + + lt=<<- + 10.0;10.0;10.0;40.0 + + + Relation + + 280 + 150 + 210 + 40 + + lt=<<<<- +m2=* + 10.0;10.0;190.0;10.0 + + + UMLClass + + 470 + 260 + 100 + 60 + + Label +(display) + + + + Relation + + 510 + 180 + 30 + 100 + + lt=<<- + 10.0;10.0;10.0;80.0 + + diff --git a/unittesting/Python-Unit-Testing.pdf b/unittesting/Python-Unit-Testing.pdf new file mode 100644 index 0000000..cee1906 Binary files /dev/null and b/unittesting/Python-Unit-Testing.pdf differ diff --git a/unittesting/Python-Unit-Testing.pptx b/unittesting/Python-Unit-Testing.pptx new file mode 100644 index 0000000..99adb09 Binary files /dev/null and b/unittesting/Python-Unit-Testing.pptx differ