Skip to content

Commit

Permalink
New Format for the Tasklists
Browse files Browse the repository at this point in the history
  • Loading branch information
kclick91 authored Aug 2, 2018
1 parent 4fc3f28 commit 68afc93
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 8 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tasklist /fo list > tasks.txt
@EXIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tasklist /fo list > tasksTwo.txt
@EXIT
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@
<children>
<ScrollPane layoutX="30.0" layoutY="41.0" prefHeight="275.0" prefWidth="237.0">
<content>
<AnchorPane focusTraversable="true" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="15000.0" prefWidth="1000.0">
<AnchorPane focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="100000.0" prefWidth="1000.0">
<children>
<Label fx:id="taskLabelOne" layoutX="8.0" layoutY="14.0" text="Tasks Will Appear Here" />
</children></AnchorPane>
</content>
</ScrollPane>
<ScrollPane layoutX="272.0" layoutY="41.0" prefHeight="275.0" prefWidth="237.0">
<content>
<AnchorPane focusTraversable="true" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="15000.0" prefWidth="1000.0">
<AnchorPane focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="100000.0" prefWidth="1000.0">
<children>
<Label fx:id="taskLabelTwo" layoutX="14.0" layoutY="14.0" text="Tasks Will Appear Here" />
</children></AnchorPane>
</content>
</ScrollPane>
<Label layoutX="30.0" layoutY="24.0" text="List One" />
<Label layoutX="272.0" layoutY="24.0" text="List Two" />
<Button layoutX="31.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOne" style="-fx-background-color: grey; -fx-border-width: 2px; -fx-border-color: black;" text="Run List One" />
<Button layoutX="315.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwo" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 2px;" text="Run List Two" />
<Button layoutX="415.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwoList" style="-fx-background-color: lightgrey; -fx-border-color: black; -fx-border-width: 1.3;" text="Run Second Format" />
<Button layoutX="31.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOne" style="-fx-background-color: grey; -fx-border-width: 1.5; -fx-border-color: black;" text="Run List One" />
<Button layoutX="315.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwo" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 1.3;" text="Run List Two" />
<Button layoutX="131.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOneList" style="-fx-background-color: lightgrey; -fx-border-color: black; -fx-border-width: 1.5;" text="Run Second Format" />
<Button layoutX="4.0" layoutY="434.0" mnemonicParsing="false" onAction="#Filter" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 2;" text="Filter" />
</children>
</Pane>
Expand Down
2 changes: 2 additions & 0 deletions WindowsProcessesGUI/processesList.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tasklist /fo list > tasks.txt
@EXIT
2 changes: 2 additions & 0 deletions WindowsProcessesGUI/processesTwoList.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tasklist /fo list > tasksTwo.txt
@EXIT
33 changes: 33 additions & 0 deletions WindowsProcessesGUI/src/sample/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,36 @@ public void WriteToFileTwo()
e.printStackTrace();
}
}

public void WriteToFileOneList() {
String batch = "processesList.bat";
String command = "cmd /c start \"\" ";
try {
//The executables will be written to a text file
Process p = Runtime.getRuntime().exec(command + batch);
Thread.sleep(1000);
ReadFileOne();

} catch (Exception e) {
e.printStackTrace();
}

}

public void WriteToFileTwoList()
{
String batch = "processesTwoList.bat";
String command = "cmd /c start \"\" ";
try {
//The executables will be written to a text file
Process p = Runtime.getRuntime().exec(command + batch);
Thread.sleep(1000);
ReadFileTwo();

} catch (Exception e) {
e.printStackTrace();
}
}
public void ReadFileOne() throws IOException {
processesOne = new ArrayList<>();
BufferedReader reader = new BufferedReader(new FileReader(new File("tasks.txt")));
Expand Down Expand Up @@ -112,4 +142,7 @@ public void UnFilter() throws IOException {
ReadFileOne();
ReadFileTwo();
}



}
10 changes: 6 additions & 4 deletions WindowsProcessesGUI/src/sample/sample.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@
<children>
<ScrollPane layoutX="30.0" layoutY="41.0" prefHeight="275.0" prefWidth="237.0">
<content>
<AnchorPane focusTraversable="true" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="15000.0" prefWidth="1000.0">
<AnchorPane focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="100000.0" prefWidth="1000.0">
<children>
<Label fx:id="taskLabelOne" layoutX="8.0" layoutY="14.0" text="Tasks Will Appear Here" />
</children></AnchorPane>
</content>
</ScrollPane>
<ScrollPane layoutX="272.0" layoutY="41.0" prefHeight="275.0" prefWidth="237.0">
<content>
<AnchorPane focusTraversable="true" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="15000.0" prefWidth="1000.0">
<AnchorPane focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="0.0" minWidth="0.0" prefHeight="100000.0" prefWidth="1000.0">
<children>
<Label fx:id="taskLabelTwo" layoutX="14.0" layoutY="14.0" text="Tasks Will Appear Here" />
</children></AnchorPane>
</content>
</ScrollPane>
<Label layoutX="30.0" layoutY="24.0" text="List One" />
<Label layoutX="272.0" layoutY="24.0" text="List Two" />
<Button layoutX="31.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOne" style="-fx-background-color: grey; -fx-border-width: 2px; -fx-border-color: black;" text="Run List One" />
<Button layoutX="315.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwo" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 2px;" text="Run List Two" />
<Button layoutX="415.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwoList" style="-fx-background-color: lightgrey; -fx-border-color: black; -fx-border-width: 1.3;" text="Run Second Format" />
<Button layoutX="31.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOne" style="-fx-background-color: grey; -fx-border-width: 1.5; -fx-border-color: black;" text="Run List One" />
<Button layoutX="315.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileTwo" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 1.3;" text="Run List Two" />
<Button layoutX="131.0" layoutY="333.0" mnemonicParsing="false" onAction="#WriteToFileOneList" style="-fx-background-color: lightgrey; -fx-border-color: black; -fx-border-width: 1.5;" text="Run Second Format" />
<Button layoutX="4.0" layoutY="434.0" mnemonicParsing="false" onAction="#Filter" style="-fx-background-color: grey; -fx-border-color: black; -fx-border-width: 2;" text="Filter" />
</children>
</Pane>
Expand Down

0 comments on commit 68afc93

Please sign in to comment.