Reset author name to chosen name

This commit is contained in:
2025-10-19 21:55:26 -05:00
parent a3e71f9673
commit 03c2474f78
1825 changed files with 8916 additions and 8921 deletions

View File

@@ -0,0 +1,85 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>BarChart.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.ST4 {font-family: monospace; font-weight: bold; font-style: italic}
.ST0 {color: #287bde}
.number {color: #6897bb}
.string {color: #6a8759}
.ST1 {color: #ffc66d}
.comment {color: #808080}
.whitespace {color: #505050}
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
.ST3 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/BarChart.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.layout.Pane;
<span class="literal">import</span> javafx.scene.paint.Color;
<span class="literal">import</span> javafx.scene.shape.Rectangle;
<span class="literal">import</span> javafx.scene.text.Text;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> BarChart <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
Pane pane = <span class="literal">new</span> Pane();
<span class="literal">double</span> height = <span class="number">300</span>;
<span class="literal">double</span> panelHeight = <span class="number">150</span>;
Rectangle r1 = <span class="literal">new</span> Rectangle(<span class="number">1</span><span class="number">0</span>, panelHeight - height * <span class="number">0.2</span>, <span class="number">1</span><span class="number">00</span>, height * <span class="number">0.2</span>);
r1.setFill(Color.<span class="ST2">RED</span>);
Text text1 = <span class="literal">new</span> Text(<span class="number">1</span><span class="number">0</span>, panelHeight - height * <span class="number">0.2</span> - <span class="number">10</span>, <span class="string">&quot;</span><span class="string">Project -- 20%</span><span class="string">&quot;</span>);
Rectangle r2 = <span class="literal">new</span> Rectangle(<span class="number">10</span> + <span class="number">110</span>, panelHeight - height * <span class="number">0.1</span>, <span class="number">1</span><span class="number">00</span>, height * <span class="number">0.1</span>);
r2.setFill(Color.<span class="ST2">BLUE</span>);
Text text2 = <span class="literal">new</span> Text(<span class="number">10</span> + <span class="number">110</span>, panelHeight - height * <span class="number">0.1</span> - <span class="number">10</span>, <span class="string">&quot;</span><span class="string">Quiz -- 10%</span><span class="string">&quot;</span>);
Rectangle r3 = <span class="literal">new</span> Rectangle(<span class="number">10</span> + <span class="number">220</span>, panelHeight - height * <span class="number">0.3</span>, <span class="number">1</span><span class="number">00</span>, height * <span class="number">0.3</span>);
r3.setFill(Color.<span class="ST2">GREEN</span>);
Text text3 = <span class="literal">new</span> Text(<span class="number">10</span> + <span class="number">220</span>, panelHeight - height * <span class="number">0.3</span> - <span class="number">10</span>, <span class="string">&quot;</span><span class="string">Midterm -- 30%</span><span class="string">&quot;</span>);
Rectangle r4 = <span class="literal">new</span> Rectangle(<span class="number">10</span> + <span class="number">330</span>, panelHeight - height * <span class="number">0.4</span>, <span class="number">1</span><span class="number">00</span>, height * <span class="number">0.4</span>);
r4.setFill(Color.<span class="ST2">ORANGE</span>);
Text text4 = <span class="literal">new</span> Text(<span class="number">10</span> + <span class="number">330</span>, panelHeight - height * <span class="number">0.4</span> - <span class="number">10</span>, <span class="string">&quot;</span><span class="string">Final -- 40%</span><span class="string">&quot;</span>);
pane.getChildren().addAll(r1, text1, r2, text2, r3, text3, r4, text4);
<span class="comment">// Create a scene and place it in the stage</span>
Scene scene = <span class="literal">new</span> Scene(pane, <span class="number">5</span><span class="number">00</span>, panelHeight);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">Bar Chart</span><span class="string">&quot;</span>);
primaryStage.setScene(scene);
primaryStage.show();
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST3">main</span>(String[] args) {
<span class="ST4">launch</span>(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,109 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Calculator.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
.ST0 {color: #287bde}
.number {color: #6897bb}
.string {color: #6a8759}
.ST1 {color: #ffc66d}
.comment {color: #808080}
.whitespace {color: #505050}
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/Calculator.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="comment">import</span> <span class="comment">static</span> <span class="comment">java</span><span class="comment">.</span><span class="comment">lang</span><span class="comment">.</span><span class="comment">Double</span><span class="comment">.</span><span class="comment">parseDouble</span><span class="comment">;</span>
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> javafx.geometry.Pos;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.control.Button;
<span class="literal">import</span> javafx.scene.control.Label;
<span class="literal">import</span> javafx.scene.control.TextField;
<span class="literal">import</span> javafx.scene.layout.BorderPane;
<span class="literal">import</span> javafx.scene.layout.FlowPane;
<span class="literal">import</span> javafx.scene.layout.HBox;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> Calculator <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
FlowPane pane = <span class="literal">new</span> FlowPane();
pane.setHgap(<span class="number">2</span>);
TextField tfNumber1 = <span class="literal">new</span> TextField();
TextField tfNumber2 = <span class="literal">new</span> TextField();
TextField tfResult = <span class="literal">new</span> TextField();
tfNumber1.setPrefColumnCount(<span class="number">3</span>);
tfNumber2.setPrefColumnCount(<span class="number">3</span>);
tfResult.setPrefColumnCount(<span class="number">3</span>);
pane.getChildren().addAll(<span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Number 1: </span><span class="string">&quot;</span>), tfNumber1, <span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Number 2</span><span class="string">&quot;</span>), tfNumber2, <span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Result: </span><span class="string">&quot;</span>), tfResult);
HBox hBox = <span class="literal">new</span> HBox(<span class="number">5</span>);
Button btAdd = <span class="literal">new</span> Button(<span class="string">&quot;</span><span class="string">Add</span><span class="string">&quot;</span>);
Button btSubtract = <span class="literal">new</span> Button(<span class="string">&quot;</span><span class="string">Subtract</span><span class="string">&quot;</span>);
Button btMultiply = <span class="literal">new</span> Button(<span class="string">&quot;</span><span class="string">Multiply</span><span class="string">&quot;</span>);
Button btDivide = <span class="literal">new</span> Button(<span class="string">&quot;</span><span class="string">Divide</span><span class="string">&quot;</span>);
hBox.setAlignment(Pos.<span class="ST2">CENTER</span>);
hBox.getChildren().addAll(btAdd, btSubtract, btMultiply, btDivide);
BorderPane borderPane = <span class="literal">new</span> BorderPane();
borderPane.setCenter(pane);
borderPane.setBottom(hBox);
BorderPane.<span class="ST3">setAlignment</span>(hBox, Pos.<span class="ST2">TOP_CENTER</span>);
Scene scene = <span class="literal">new</span> Scene(borderPane, <span class="number">2</span><span class="number">50</span>, <span class="number">1</span><span class="number">50</span>);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">Calculator</span><span class="string">&quot;</span>);
primaryStage.setScene(scene);
primaryStage.show();
btAdd.setOnAction(e -&gt; {
tfResult.setText(Double.<span class="ST3">parseDouble</span>(tfNumber1.getText())
+ Double.<span class="ST3">parseDouble</span>(tfNumber2.getText()) + <span class="string">&quot;&quot;</span>);
});
btSubtract.setOnAction(e -&gt; {
tfResult.setText(Double.<span class="ST3">parseDouble</span>(tfNumber1.getText())
- Double.<span class="ST3">parseDouble</span>(tfNumber2.getText()) + <span class="string">&quot;&quot;</span>);
});
btMultiply.setOnAction(e -&gt; {
tfResult.setText(Double.<span class="ST3">parseDouble</span>(tfNumber1.getText())
* Double.<span class="ST3">parseDouble</span>(tfNumber2.getText()) + <span class="string">&quot;&quot;</span>);
});
btDivide.setOnAction(e -&gt; {
tfResult.setText(Double.<span class="ST3">parseDouble</span>(tfNumber1.getText())
/ Double.<span class="ST3">parseDouble</span>(tfNumber2.getText()) + <span class="string">&quot;&quot;</span>);
});
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args) {
<span class="ST3">launch</span>(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,97 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Investment.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
.ST0 {color: #287bde}
.string {color: #6a8759}
.number {color: #6897bb}
.ST1 {color: #ffc66d}
.comment {color: #808080}
.whitespace {color: #505050}
.ST2 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
.ST4 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/Investment.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="literal">import</span> java.text.NumberFormat;
<span class="literal">import</span> java.util.Locale;
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> javafx.geometry.Pos;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.control.Button;
<span class="literal">import</span> javafx.scene.control.Label;
<span class="literal">import</span> javafx.scene.control.TextField;
<span class="literal">import</span> javafx.scene.layout.GridPane;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> Investment <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
GridPane gPane = <span class="literal">new</span> GridPane();
gPane.setAlignment(Pos.<span class="ST2">CENTER</span>);
gPane.add(<span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Investment Amount</span><span class="string">&quot;</span>), <span class="number">0</span>, <span class="number">0</span>);
TextField investmentAmount = <span class="literal">new</span> TextField();
gPane.add(investmentAmount, <span class="number">1</span>, <span class="number">0</span>);
gPane.add(<span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Number of Years: </span><span class="string">&quot;</span>), <span class="number">0</span>, <span class="number">1</span>);
TextField numOfYears = <span class="literal">new</span> TextField();
gPane.add(numOfYears, <span class="number">1</span>, <span class="number">1</span>);
gPane.add(<span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Annual Interest Rate:</span><span class="string">&quot;</span>), <span class="number">0</span>, <span class="number">2</span>);
TextField annualInterestRate = <span class="literal">new</span> TextField();
gPane.add(annualInterestRate, <span class="number">1</span>, <span class="number">2</span>);
gPane.add(<span class="literal">new</span> Label(<span class="string">&quot;</span><span class="string">Future value:</span><span class="string">&quot;</span>), <span class="number">0</span>, <span class="number">3</span>);
TextField futureValue = <span class="literal">new</span> TextField();
gPane.add(futureValue, <span class="number">1</span>, <span class="number">3</span>);
Button calculateButton = <span class="literal">new</span> Button(<span class="string">&quot;</span><span class="string">Calculate</span><span class="string">&quot;</span>);
gPane.add(calculateButton, <span class="number">1</span>, <span class="number">4</span>);
calculateButton.alignmentProperty().set(Pos.<span class="ST2">CENTER_RIGHT</span>);
calculateButton.setOnAction(e -&gt; {
<span class="literal">double</span> investment = Double.<span class="ST3">parseDouble</span>(investmentAmount.getText());
<span class="literal">double</span> rate = Double.<span class="ST3">parseDouble</span>(annualInterestRate.getText()) / <span class="number">100.0</span>;
<span class="literal">double</span> years = Double.<span class="ST3">parseDouble</span>(numOfYears.getText());
<span class="literal">double</span> output = investment * Math.<span class="ST3">pow</span>(<span class="number">1</span> + rate / <span class="number">12</span>, <span class="number">12</span> * years);
<span class="comment">// Round off</span>
<span class="comment">// double scale = Math.pow(10, 2);</span>
<span class="comment">//output = Math.round(output * scale) / scale;</span>
NumberFormat nf = NumberFormat.<span class="ST3">getCurrencyInstance</span>(Locale.<span class="ST2">US</span>);
futureValue.setText(nf.format(output));
System.<span class="ST2">out</span>.println(output + <span class="string">&quot;</span><span class="string">, </span><span class="string">&quot;</span> + nf.format(output));
});
Scene scene = <span class="literal">new</span> Scene(gPane);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">ROI Calculator</span><span class="string">&quot;</span>);
primaryStage.setScene(scene);
primaryStage.show();
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args) {
<span class="ST3">launch</span>(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,132 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PieChart.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
.ST0 {color: #287bde}
.number {color: #6897bb}
.string {color: #6a8759}
.ST1 {color: #ffc66d}
.ST4 {color: #8a653b}
.comment {color: #808080}
.whitespace {color: #505050}
.ST3 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
.ST5 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/PieChart.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="literal">import</span> java.util.ArrayList;
<span class="literal">import</span> javafx.application.Application;
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">geometry</span><span class="comment">.</span><span class="comment">Pos</span><span class="comment">;</span>
<span class="literal">import</span> javafx.scene.Group;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.layout.Pane;
<span class="comment">import</span> <span class="comment">javafx</span><span class="comment">.</span><span class="comment">scene</span><span class="comment">.</span><span class="comment">layout</span><span class="comment">.</span><span class="comment">StackPane</span><span class="comment">;</span>
<span class="literal">import</span> javafx.scene.paint.Color;
<span class="literal">import</span> javafx.scene.shape.Arc;
<span class="literal">import</span> javafx.scene.shape.ArcType;
<span class="literal">import</span> javafx.scene.text.Text;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> PieChart <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> <span class="ST1">start</span>(Stage primaryStage) <span class="literal">throws</span> Exception {
<span class="comment">// Create pane</span>
Pane pane = <span class="literal">new</span> Pane();
ArrayList&lt;Arc&gt; pie = <span class="literal">new</span> ArrayList&lt;Arc&gt;();
ArrayList&lt;Text&gt; pieDesc = <span class="literal">new</span> ArrayList&lt;Text&gt;();
ArrayList&lt;Group&gt; layoutSlice = <span class="literal">new</span> ArrayList&lt;Group&gt;();
<span class="literal">float</span>[] pieValues = {<span class="number">20.0f</span>, <span class="number">10.0f</span>, <span class="number">20.0f</span>, <span class="number">40.0f</span>, <span class="number">30.0f</span>}; <span class="comment">// First value controls the initial angle</span>
String[] textValues = { <span class="string">&quot;</span><span class="string">Quiz</span><span class="string">&quot;</span>, <span class="string">&quot;</span><span class="string">Project</span><span class="string">&quot;</span>, <span class="string">&quot;</span><span class="string">Final</span><span class="string">&quot;</span>, <span class="string">&quot;</span><span class="string">Midterm</span><span class="string">&quot;</span>};
<span class="literal">float</span>[][] textPos = { {<span class="number">165</span>, <span class="number">50</span>}, {<span class="number">70</span>, <span class="number">120</span>}, {<span class="number">150</span>, <span class="number">300</span>}, {<span class="number">250</span>, <span class="number">204</span>} }; <span class="comment">// I really didn&#39;t want to hard code the coords for the text, but JavaFX forced my hand</span>
<span class="literal">int</span> j = <span class="number">1</span>;
<span class="literal">float</span> startAngle = <span class="number">0.0f</span>;
<span class="literal">final</span> <span class="literal">float</span> PIE_SIZE = <span class="number">200.0f</span>;
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i &lt; <span class="number">4</span>; i++) {
<span class="comment">// Arc</span>
startAngle = startAngle + <span class="ST2">toDegrees</span>(pieValues[i]);
System.<span class="ST3">out</span>.println(<span class="string">&quot;</span><span class="string">i:</span><span class="string">&quot;</span> + <span class="ST2">toDegrees</span>(pieValues[i]) + <span class="string">&quot;</span><span class="string"> j: </span><span class="string">&quot;</span> + <span class="ST2">toDegrees</span>(pieValues[j]));
Arc pieSlice = <span class="literal">new</span> Arc();
pieSlice.setCenterX(PIE_SIZE);
pieSlice.setCenterY(PIE_SIZE);
pieSlice.setRadiusX(PIE_SIZE);
pieSlice.setRadiusY(PIE_SIZE);
pieSlice.setStartAngle(startAngle); <span class="comment">//toDegrees(pieValues[i])</span>
pieSlice.setLength(<span class="ST2">t</span><span class="ST2">oDegrees</span>(pieValues[j]));
pieSlice.setType(ArcType.<span class="ST3">ROUND</span>);
<span class="comment">// Text</span>
String descriptionString = textValues[i] + <span class="string">&quot;</span><span class="string">--</span><span class="string">&quot;</span> + pieValues[j] + <span class="string">&quot;</span><span class="string">%</span><span class="string">&quot;</span>;
Text descText = <span class="literal">new</span> Text(textPos[i][<span class="number">0</span>], textPos[i][<span class="number">1</span>], descriptionString);
<span class="comment">// Add Arcs and text together into a Group</span>
Group pieSliceStack = <span class="literal">new</span> Group();
pieSliceStack.getChildren().addAll(pieSlice, descText);
<span class="comment">// Add Arc and text to respective ArrayLists</span>
pie.add(pieSlice);
pieDesc.add(descText);
layoutSlice.add(pieSliceStack);
j++;
}
pie.get(<span class="number">0</span>).setFill(Color.<span class="ST3">BLUE</span>);
pie.get(<span class="number">1</span>).setFill(Color.<span class="ST3">RED</span>);
pie.get(<span class="number">2</span>).setFill(Color.<span class="ST3">YELLOW</span>);
pie.get(<span class="number">3</span>).setFill(Color.<span class="ST3">GREEN</span>);
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">3</span>; i &gt;= <span class="number">0</span>; i--) {
pane.getChildren().add(layoutSlice.get(i));
}
Scene scene = <span class="literal">new</span> Scene(pane);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">Pie Chart</span><span class="string">&quot;</span>);
primaryStage.setScene(scene);
primaryStage.show();
}
<span class="comment">/**</span>
<span class="comment"> * </span><span class="comment">This</span> <span class="comment">function</span> <span class="comment">converts</span> <span class="comment">a</span> <span class="comment">value</span> <span class="comment">between</span><span class="comment"> 0 </span><span class="comment">and</span><span class="comment"> 100 </span><span class="comment">to</span> <span class="comment">a</span> <span class="comment">value</span> <span class="comment">between</span><span class="comment"> 0 </span><span class="comment">and</span><span class="comment"> 360, </span><span class="comment">while</span> <span class="comment">retaining</span> <span class="comment">the</span> <span class="comment">ratio</span> <span class="comment">between</span> <span class="comment">those</span> <span class="comment">two</span> <span class="comment">number</span> <span class="comment">values</span><span class="comment">.</span> <span class="comment">So</span> <span class="comment">for</span> <span class="comment">example</span><span class="comment">, 35 </span><span class="comment">turns</span> <span class="comment">into</span><span class="comment"> 90</span><span class="comment">.</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@param</span> <span class="ST4">oldValue</span>
<span class="comment"> * </span><span class="comment">@return</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">float</span> <span class="ST5">toDegrees</span>(<span class="literal">float</span> oldValue) {
<span class="literal">final</span> <span class="literal">float</span> oldMin = <span class="number">0</span>;
<span class="literal">final</span> <span class="literal">float</span> oldMax = <span class="number">100</span>;
<span class="literal">final</span> <span class="literal">float</span> newMin = <span class="number">0</span>;
<span class="literal">final</span> <span class="literal">float</span> newMax = <span class="number">360</span>;
<span class="literal">float</span> newValue = ((oldValue - oldMin) / (oldMax - oldMin)) * (newMax - newMin) + newMin;
<span class="literal">return</span> Math.<span class="ST2">round</span>(newValue);
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST5">main</span>(String[] args) {
<span class="ST2">launch</span>(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,75 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ThreeRandomCards.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.string {color: #6a8759}
.number {color: #6897bb}
.comment {color: #808080}
.whitespace {color: #505050}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/ThreeRandomCards.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> javafx.geometry.Pos;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.image.Image;
<span class="literal">import</span> javafx.scene.image.ImageView;
<span class="literal">import</span> javafx.scene.layout.GridPane;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> ThreeRandomCards <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> start(Stage primaryStage) <span class="literal">throws</span> Exception {
GridPane pane = <span class="literal">new</span> GridPane();
pane.setOnMouseClicked(e -&gt; {
addCards(pane);
});
System.out.println(<span class="string">&quot;</span><span class="string">Created GridPane. Executing addCards() to add cards to GridPane.</span><span class="string">&quot;</span>);
addCards(pane);
Scene scene = <span class="literal">new</span> Scene(pane);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">Three Random Cards</span><span class="string">&quot;</span>);
primaryStage.setScene(scene);
primaryStage.show();
}
<span class="literal">public</span> <span class="literal">void</span> addCards(GridPane imagePane) {
System.out.println(<span class="string">&quot;</span><span class="string">addCards() executed!</span><span class="string">&quot;</span>);
imagePane.setAlignment(Pos.CENTER);
imagePane.setHgap(<span class="number">5</span>);
imagePane.setVgap(<span class="number">5</span>);
<span class="comment">// Define Image objects</span>
<span class="literal">int</span> rand = <span class="number">0</span>;
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i &lt; <span class="number">3</span>; i++) {
rand = (<span class="literal">int</span>) ((Math.random() * <span class="number">54</span>) + <span class="number">1</span>);
imagePane.add(<span class="literal">new</span> ImageView(<span class="literal">new</span> Image(<span class="string">&quot;</span><span class="string">https://files.chloefontenot.com/image/card/</span><span class="string">&quot;</span> + rand + <span class="string">&quot;</span><span class="string">.png</span><span class="string">&quot;</span>)), i, <span class="number">0</span>);
System.out.println(<span class="string">&quot;</span><span class="string">added image </span><span class="string">&quot;</span> + rand + <span class="string">&quot;</span><span class="string"> to the imagePane.</span><span class="string">&quot;</span>);
}
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> main(String[] args) {
launch(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,77 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>TicTacToe.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.literal {color: #cc7832}
.string {color: #6a8759}
.number {color: #6897bb}
.comment {color: #808080}
.whitespace {color: #505050}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/chloe/ASDV-Java/Semester 3/Assignments/MP1_FX_ChloeFontenot/src/mp1_fx_chloefontenot/TicTacToe.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> mp1_fx_chloefontenot;
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> javafx.geometry.Pos;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.image.Image;
<span class="literal">import</span> javafx.scene.image.ImageView;
<span class="literal">import</span> javafx.scene.layout.GridPane;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">chloe</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> TicTacToe <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> start(Stage primaryStage) <span class="literal">throws</span> Exception {
<span class="literal">final</span> String BASE_URL = <span class="string">&quot;</span><span class="string">https://files.chloefontenot.com/</span><span class="string">&quot;</span>;
Image imageX = <span class="literal">new</span> Image(BASE_URL + <span class="string">&quot;</span><span class="string">image/x.gif</span><span class="string">&quot;</span>);
Image imageO = <span class="literal">new</span> Image(BASE_URL + <span class="string">&quot;</span><span class="string">image/o.gif</span><span class="string">&quot;</span>);
GridPane pane = <span class="literal">new</span> GridPane();
pane.setAlignment(Pos.CENTER);
pane.setHgap(<span class="number">5</span>);
pane.setVgap(<span class="number">5</span>);
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i &lt; <span class="number">3</span>; i++) {
<span class="literal">for</span> (<span class="literal">int</span> j = <span class="number">0</span>; j &lt; <span class="number">3</span>; j++) {
<span class="literal">int</span> status = (<span class="literal">int</span>) (Math.random() * <span class="number">3</span>);
<span class="literal">if</span> (status == <span class="number">0</span>) {
pane.add(<span class="literal">new</span> ImageView(imageX), j, i);
} <span class="literal">else</span> <span class="literal">if</span> (status == <span class="number">1</span>) {
pane.add(<span class="literal">new</span> ImageView(imageO), j, i);
}
}
}
<span class="comment">// Create a scene and place it in the stage</span>
Scene scene = <span class="literal">new</span> Scene(pane);
primaryStage.setTitle(<span class="string">&quot;</span><span class="string">Tic Tac Toe</span><span class="string">&quot;</span>); <span class="comment">// Set the stage title</span>
primaryStage.setScene(scene); <span class="comment">// Place the scene in the stage</span>
primaryStage.show(); <span class="comment">// Display the stage</span>
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> main(String[] args) {
launch(args);
}
}
</pre></body>
</html>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="MP1_FX_ChloeFontenot" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project MP1_FX_ChloeFontenot.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. Those of them relevant for JavaFX project are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-jfx-jar: called before FX SDK specific <fx:jar> task
-post-jfx-jar: called after FX SDK specific <fx:jar> task
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting a HTML postprocessor after javaFX SDK deployment:
<target name="-post-jfx-deploy">
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
<custompostprocess>
<fileset dir="${jfx.deployment.html}"/>
</custompostprocess>
</target>
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
<echo message="Calling jar task from JavaFX SDK"/>
<fx:jar ...>
...
</fx:jar>
</target>
For more details about JavaFX SDK Ant tasks go to
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
For list of available properties check the files
nbproject/build-impl.xml and nbproject/jfx-impl.xml.
-->
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Some files were not shown because too many files have changed in this diff Show More