Skip to content

Commit

Permalink
add pattern documents and a few others
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrucker committed Oct 6, 2024
1 parent fb2866f commit bcd5a2c
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 0 deletions.
Binary file added assignments/PA1-ArrayIterator.pdf
Binary file not shown.
61 changes: 61 additions & 0 deletions javafx/VSCode-JavaFX.md
Original file line number Diff line number Diff line change
@@ -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.



Binary file added patterns/Command-Pattern.docx
Binary file not shown.
Binary file added patterns/Composite-Pattern.pptx
Binary file not shown.
Binary file added patterns/Intro-Design-Patterns-with-Java.pptx
Binary file not shown.
Binary file not shown.
Binary file added patterns/MVC-Pattern.pptx
Binary file not shown.
Binary file added patterns/Observer-Pattern.pptx
Binary file not shown.
Binary file added patterns/diagrams/composite-calculator-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
247 changes: 247 additions & 0 deletions patterns/diagrams/composite-calculator-ui.uxf
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.2">
<zoom_level>10</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>270</x>
<y>380</y>
<w>120</w>
<h>80</h>
</coordinates>
<panel_attributes>Button
('1')</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>190</x>
<y>20</y>
<w>100</w>
<h>80</h>
</coordinates>
<panel_attributes>Tk
(Window
&amp;
Container)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>190</x>
<y>130</y>
<w>100</w>
<h>70</h>
</coordinates>
<panel_attributes>CalculatorUI</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>280</x>
<y>270</y>
<w>100</w>
<h>70</h>
</coordinates>
<panel_attributes>Frame
(Keypad)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>420</x>
<y>380</y>
<w>120</w>
<h>80</h>
</coordinates>
<panel_attributes>Button
('2')</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>130</x>
<y>380</y>
<w>120</w>
<h>80</h>
</coordinates>
<panel_attributes>Button
('0')</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>190</x>
<y>330</y>
<w>160</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;50.0;140.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>320</x>
<y>330</y>
<w>30</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>320</x>
<y>330</y>
<w>170</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>150.0;50.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>470</x>
<y>120</y>
<w>100</w>
<h>70</h>
</coordinates>
<panel_attributes>Widget</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>630</x>
<y>260</y>
<w>100</w>
<h>70</h>
</coordinates>
<panel_attributes>Frame
(Operators)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>560</x>
<y>380</y>
<w>120</w>
<h>80</h>
</coordinates>
<panel_attributes>Button
('+')</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>690</x>
<y>380</y>
<w>120</w>
<h>80</h>
</coordinates>
<panel_attributes>Button
('-')</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>610</x>
<y>320</y>
<w>90</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;60.0;70.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>670</x>
<y>320</y>
<w>100</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>80.0;60.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>540</x>
<y>180</y>
<w>160</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0;140.0;50.0;140.0;80.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>320</x>
<y>180</y>
<w>190</w>
<h>110</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>170.0;10.0;170.0;50.0;10.0;50.0;10.0;90.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>230</x>
<y>90</y>
<w>30</w>
<h>60</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;40.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>280</x>
<y>150</y>
<w>210</w>
<h>40</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;&lt;&lt;-
m2=*</panel_attributes>
<additional_attributes>10.0;10.0;190.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>470</x>
<y>260</y>
<w>100</w>
<h>60</h>
</coordinates>
<panel_attributes>Label
(display)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>510</x>
<y>180</y>
<w>30</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;80.0</additional_attributes>
</element>
</diagram>
Binary file added unittesting/Python-Unit-Testing.pdf
Binary file not shown.
Binary file added unittesting/Python-Unit-Testing.pptx
Binary file not shown.

0 comments on commit bcd5a2c

Please sign in to comment.