Skip to content

Commit

Permalink
IncluindoJavaFX11
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSirtoriCorrea committed Jul 27, 2020
1 parent 5725769 commit 844e857
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 12 deletions.
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - Main",
"request": "launch",
"vmArgs": "--module-path C:/Users/Gazebo/Downloads/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml,javafx.base,javafx.graphics,javafx.media,javafx.swing,javafx.web",
"mainClass": "Interface.MainApp"
}
]
}
58 changes: 58 additions & 0 deletions Interface/SextaFeiraInterface/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="lib" path="C:/Users/Gazebo/Downloads/javafx-sdk-11.0.2/lib/javafx.base.jar"/>
<classpathentry kind="lib" path="C:/Users/Gazebo/Downloads/javafx-sdk-11.0.2/lib/javafx.graphics.jar"/>
<classpathentry kind="lib" path="C:/Users/Gazebo/Downloads/javafx-sdk-11.0.2/lib/javafx.controls.jar"/>
<classpathentry kind="lib" path="C:/Users/Gazebo/Downloads/javafx-sdk-11.0.2/lib/javafx.fxml.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
</classpath>
23 changes: 23 additions & 0 deletions Interface/SextaFeiraInterface/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SextaFeiraInterface</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void connectionLoop() {

if (!tableView.getColumns().contains(commandColumn)) {
imageView.setVisible(false);
setTableData("getInteractions");
setTableData();

addInteractionsColumns();

Expand All @@ -137,15 +137,15 @@ private void connectionLoop() {
case 2:
if (!tableView.getColumns().contains(homeWorkColumn)) {
imageView.setVisible(false);
setTableData("getHomeWorks");
setTableData();
addHomeWorksColumns();
}
break;

case 3:
if (!tableView.getColumns().contains(projectColumn)) {
imageView.setVisible(false);
setTableData("getProjects");
setTableData();
addProjectsColumns();
}
break;
Expand All @@ -154,7 +154,7 @@ private void connectionLoop() {

if (!tableView.getColumns().contains(DeviceColumn)) {
imageView.setVisible(false);
setTableData("getDevices");
setTableData();

addDevicesColumns();

Expand Down Expand Up @@ -383,10 +383,10 @@ public ObservableValue<String> call(CellDataFeatures<JSONArray, String> param) {
tableView.setVisible(true);
}

private void setTableData(String request){
private void setTableData(){
tableView.getItems().clear();

response = (JSONObject) connection.receive(request);
response = (JSONObject) FridayComunication.readJsonFile().get("content");
System.out.println(response);

for (int c = 0; c < response.size(); c++) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 34 additions & 0 deletions Interface/SextaFeiraInterface/target/classes/fxml/Scene.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.text.*?>
<?import javafx.scene.image.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" styleClass="bodybg" stylesheets="@../styles/Styles.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Interface.FXMLController">
<children>
<Label fx:id="lblTime" layoutX="120.0" layoutY="41.0" prefHeight="112.0" prefWidth="187.0" text="12:20" textFill="#ff6600" AnchorPane.leftAnchor="120.0" AnchorPane.topAnchor="41.0">
<font>
<Font name="Impact" size="68.0" />
</font>
</Label>
<Label fx:id="lblWeekDay" layoutX="952.0" layoutY="55.0" prefHeight="84.0" prefWidth="358.0" text="Sexta-Feira " textFill="#ff6600" AnchorPane.rightAnchor="-30.0" AnchorPane.topAnchor="55.0">
<font>
<Font name="Impact" size="55.0" />
</font>
</Label>
<Label fx:id="lblDayMonth" layoutX="709.0" layoutY="63.0" text="30/06" textFill="#ff6600" AnchorPane.rightAnchor="431.0" AnchorPane.topAnchor="63.0">
<font>
<Font name="Impact" size="55.0" />
</font>
</Label>
<TableView fx:id="tableView" editable="true" layoutX="72.0" layoutY="163.0" prefHeight="494.0" prefWidth="1082.0" visible="false" AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="120.0" AnchorPane.rightAnchor="80.0" AnchorPane.topAnchor="200.0">
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy></TableView>
<ImageView fx:id="imageView" fitHeight="589.0" fitWidth="967.0" layoutX="375.0" layoutY="147.0" nodeOrientation="INHERIT" pickOnBounds="true" visible="false" AnchorPane.leftAnchor="400.0" AnchorPane.topAnchor="200.0" />
</children>
</AnchorPane>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.bodybg{
-fx-background-image: url('BackgroundFriday.jpg');
-fx-background-size: 100% 100%;
}
6 changes: 6 additions & 0 deletions Server/DevicesStatus.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"Friday": {
"action": 0,
"content":{

},
"url": ".com"
},
"Interface": {
"action": 1,
"content":{

},
"url": ".com"
}
}
3 changes: 0 additions & 3 deletions Server/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def setDevicesStatus(receiverID, action, url):

newJson[receiverID]['action'] = action
newJson[receiverID]['url'] = url
newJson.update()

writeFile = open('E:/Sexta-Feira-Mark_6/Server/DevicesStatus.json', 'w')
json.dump(newJson, writeFile, indent=4)
Expand Down Expand Up @@ -234,8 +233,6 @@ def handle(self):
clientRequest['command'])

self.request.send(json.dumps({'requestStatus': True}).encode())


else:
break

Expand Down
7 changes: 4 additions & 3 deletions Sexta-Feira(A.I.)/Commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def updateFriday(speech, connection):
os.system('git reset --hard origin/master')

def sendCloseToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 0, '.com'))

Functions.setFridayComunication(0, None, ".com")
def sendInteractionsToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 1, '.com'))
response = connection.send(Functions.setRequestJson('getInteractions', 'Interface', 1, '.com'))
Functions.setFridayComunication(1, response, ".com")

def sendHomeWorksToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 2, '.com'))
Expand Down
12 changes: 12 additions & 0 deletions Sexta-Feira(A.I.)/Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,19 @@ def run(self):
writeFile = open('E:/Sexta-Feira-Mark_6/Interface/Interface/FridayComunication.json', 'w')
json.dump(response['Interface'], writeFile, indent=4)

def setFridayComunication(action, content, url):
readFile = open('E:/Sexta-Feira-Mark_6/Interface/Interface/FridayComunication.json', 'r')

newJson = json.load(readFile)

print(newJson)

newJson['action'] = action
newJson['content'] = action
newJson['url'] = url

writeFile = open('E:/Sexta-Feira-Mark_6/Interface/Interface/FridayComunication.json', 'w')
json.dump(newJson, writeFile, indent=4)



0 comments on commit 844e857

Please sign in to comment.