new sample app and hachathon apps
@@ -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="AutomationFX" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
|
||||
<description>Builds, tests, and runs the project AutomationFX.</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>
|
||||
@@ -0,0 +1,4 @@
|
||||
#Sun, 22 Sep 2013 13:59:27 -0300
|
||||
|
||||
|
||||
/media/Vinicius/Education/RPi-weekend/AutomationFX/AutomationFX-Project=
|
||||
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import java.net.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.chart.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.effect.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.shape.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
|
||||
<VBox id="AnchorPane" minHeight="464.0" prefHeight="464.0" prefWidth="800.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="automationfx.AutomationController">
|
||||
<children>
|
||||
<GridPane alignment="CENTER" minHeight="113.0" prefHeight="113.0" prefWidth="790.0" VBox.vgrow="NEVER">
|
||||
<children>
|
||||
<ToggleButton fx:id="toggleButton1" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="0" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton2" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="1" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton3" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="2" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton4" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="3" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton5" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="4" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton6" maxHeight="61.0" maxWidth="32.0" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="" GridPane.columnIndex="5" GridPane.rowIndex="0" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 1" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0" fx:id="x1" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 2" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0" fx:id="x1" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 3" GridPane.columnIndex="2" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 4" GridPane.columnIndex="3" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 5" GridPane.columnIndex="4" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="100.0" promptText="Relê 6" GridPane.columnIndex="5" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="98.0" minHeight="10.0" prefHeight="68.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="67.0" minHeight="10.0" prefHeight="53.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<VBox.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</VBox.margin>
|
||||
</GridPane>
|
||||
<GridPane alignment="CENTER" gridLinesVisible="false" maxHeight="-1.0" minHeight="338.0" prefHeight="338.0" prefWidth="780.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<LineChart fx:id="temperaturaChart" alternativeColumnFillVisible="false" createSymbols="true" title="Temperaturas (°C)" GridPane.columnIndex="1" GridPane.columnSpan="2147483647" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
|
||||
<xAxis>
|
||||
<CategoryAxis label="Hora" side="BOTTOM" />
|
||||
</xAxis>
|
||||
<yAxis>
|
||||
<NumberAxis side="LEFT" />
|
||||
</yAxis>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
</LineChart>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@images/servo-motor.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label text="Servo Motor">
|
||||
<font>
|
||||
<Font size="20.0" fx:id="x2" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" right="10.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Button fx:id="botaoGirarServoMotor" mnemonicParsing="false" text="Girar" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Slider fx:id="servoMotorSlider" max="180.0" prefHeight="16.0" prefWidth="252.0" showTickLabels="true" showTickMarks="true" snapToTicks="false" />
|
||||
</children>
|
||||
</VBox>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
||||
<children>
|
||||
<ImageView fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<effect>
|
||||
<DropShadow />
|
||||
</effect>
|
||||
<image>
|
||||
<Image url="@images/led-tape.png" />
|
||||
</image>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</ImageView>
|
||||
<TextField fx:id="textColorValue" prefWidth="98.0" promptText="0-255">
|
||||
<HBox.margin>
|
||||
<Insets left="15.0" />
|
||||
</HBox.margin>
|
||||
</TextField>
|
||||
<VBox alignment="CENTER" prefHeight="87.0" prefWidth="58.0">
|
||||
<children>
|
||||
<Button fx:id="btnRed" mnemonicParsing="false" style="-fx-background-color: red;" text="">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" fx:id="x5" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="btnGreen" mnemonicParsing="false" style="-fx-background-color: green;" text="" VBox.margin="$x5" />
|
||||
<Button fx:id="btnBlue" mnemonicParsing="false" style="-fx-background-color: blue;" text="" VBox.margin="$x5" />
|
||||
</children>
|
||||
<HBox.margin>
|
||||
<Insets left="20.0" />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="0" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" GridPane.valignment="CENTER" GridPane.vgrow="NEVER">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<ImageView fx:id="imgHumidity" fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<effect>
|
||||
<DropShadow />
|
||||
</effect>
|
||||
<image>
|
||||
<Image url="@images/humidity.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label fx:id="humidityLabel" alignment="CENTER_RIGHT" contentDisplay="RIGHT" prefHeight="56.0" prefWidth="122.0" text="50.0">
|
||||
<effect>
|
||||
<DropShadow height="9.0" offsetX="2.0" offsetY="2.0" radius="4.0" width="9.0" />
|
||||
</effect>
|
||||
<font>
|
||||
<Font size="48.0" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" right="10.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label prefHeight="45.0" prefWidth="32.0" text="\%">
|
||||
<font>
|
||||
<Font name="System Bold" size="16.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="72.0" fitWidth="76.0" pickOnBounds="true" preserveRatio="true" x="0.0">
|
||||
<image>
|
||||
<Image url="@images/temperature.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label font="$x2" prefHeight="62.0" text="Temperatura" />
|
||||
</children>
|
||||
</HBox>
|
||||
<GridPane prefHeight="88.0" prefWidth="225.0">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
|
||||
<children>
|
||||
<Label fx:id="labelTempInterna" alignment="CENTER_RIGHT" prefWidth="113.0" text="25">
|
||||
<font>
|
||||
<Font size="42.0" fx:id="x3" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="°C" />
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<Label fx:id="labelTempExterna" alignment="CENTER_RIGHT" font="$x3" prefWidth="113.0" text="18" />
|
||||
<Label text="°C" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="Interna" GridPane.columnIndex="0" GridPane.rowIndex="0">
|
||||
<font>
|
||||
<Font size="16.0" fx:id="x4" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label font="$x4" text="Externa" GridPane.columnIndex="0" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="80.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="145.0" minWidth="10.0" prefWidth="145.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="40.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="ALWAYS" maxWidth="419.0" minWidth="10.0" percentWidth="30.0" prefWidth="412.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="325.0" minWidth="10.0" percentWidth="40.0" prefWidth="238.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="325.0" minWidth="10.0" percentWidth="30.0" prefWidth="238.0" />
|
||||
</columnConstraints>
|
||||
<padding>
|
||||
<Insets left="15.0" right="15.0" />
|
||||
</padding>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="225.0" minHeight="10.0" percentHeight="25.761772853185594" prefHeight="225.0" vgrow="ALWAYS" />
|
||||
<RowConstraints maxHeight="106.0" minHeight="10.0" percentHeight="74.79224376731301" prefHeight="36.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</GridPane>
|
||||
</children>
|
||||
<stylesheets>
|
||||
<URL value="@automation.css" />
|
||||
</stylesheets>
|
||||
</VBox>
|
||||
@@ -0,0 +1,27 @@
|
||||
.main {
|
||||
-fx-background-color: #000000;
|
||||
}
|
||||
|
||||
.button-image {
|
||||
-fx-background-image: url('images/button-off.png');
|
||||
}
|
||||
|
||||
.button-image:selected {
|
||||
-fx-background-image: url('images/button-on.png');
|
||||
}
|
||||
|
||||
.button-image:selected:focused,.button-image:focused {
|
||||
-fx-background-color:
|
||||
-fx-shadow-highlight-color,
|
||||
linear-gradient(to bottom, derive(-fx-color,-22%) 0%, derive(-fx-color,-15%) 100%),
|
||||
linear-gradient(to bottom, derive(-fx-color,-15%) 0%, derive(-fx-color,-10%) 50%, derive(-fx-color,-8%) 98%, derive(-fx-color,-12%) 100%);
|
||||
}
|
||||
|
||||
.color-picker {
|
||||
-fx-background-color: #666666;
|
||||
-fx-background-radius: 0 10 10 0;
|
||||
}
|
||||
|
||||
.color-picker .color-picker-label .text {
|
||||
-fx-fill: #ccffcc;
|
||||
}
|
||||
|
Depois Largura: | Altura: | Tamanho: 3.2 KiB |
|
Depois Largura: | Altura: | Tamanho: 4.0 KiB |
|
Depois Largura: | Altura: | Tamanho: 3.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 3.1 KiB |
|
Depois Largura: | Altura: | Tamanho: 19 KiB |
|
Depois Largura: | Altura: | Tamanho: 7.1 KiB |
|
Depois Largura: | Altura: | Tamanho: 9.0 KiB |
|
Depois Largura: | Altura: | Tamanho: 26 KiB |
|
Depois Largura: | Altura: | Tamanho: 28 KiB |
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar como WebStart
|
||||
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar no Browser
|
||||
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=bb810153
|
||||
build.xml.script.CRC32=38628551
|
||||
build.xml.stylesheet.CRC32=28e38971@1.56.1.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=bb810153
|
||||
nbproject/build-impl.xml.script.CRC32=8f0dfeb8
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
|
||||
@@ -0,0 +1,4 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar como WebStart
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
javafx.run.as=webstart
|
||||
@@ -0,0 +1,4 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar no Browser
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
javafx.run.as=embedded
|
||||
@@ -0,0 +1,7 @@
|
||||
auxiliary.org-netbeans-modules-projectapi.issue214819_5f_fx_5f_enabled=true
|
||||
compile.on.save=true
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
user.properties.file=/home/vsenger/.netbeans/7.3.1/build.properties
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
</project-private>
|
||||
@@ -0,0 +1,134 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=AutomationFX
|
||||
application.vendor=bruno
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
compile.on.save=true
|
||||
compile.on.save.unsupported.javafx=true
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/AutomationFX.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.cglib-2.1.88.jar=../lib/cglib-2.1.88.jar
|
||||
file.reference.guava-14.0.1.jar=../lib/guava-14.0.1.jar
|
||||
file.reference.hk2-api-2.1.88.jar=../lib/hk2-api-2.1.88.jar
|
||||
file.reference.hk2-locator-2.1.88.jar=../lib/hk2-locator-2.1.88.jar
|
||||
file.reference.hk2-utils-2.1.88.jar=../lib/hk2-utils-2.1.88.jar
|
||||
file.reference.javax.inject-2.1.88.jar=../lib/javax.inject-2.1.88.jar
|
||||
file.reference.javax.ws.rs-api-2.0.jar=../lib/javax.ws.rs-api-2.0.jar
|
||||
file.reference.jersey-client.jar=../lib/jersey-client.jar
|
||||
file.reference.jersey-common.jar=../lib/jersey-common.jar
|
||||
includes=**
|
||||
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
|
||||
jar.archive.disabled=true
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${javafx.runtime}/lib/jfxrt.jar:\
|
||||
${javafx.runtime}/lib/deploy.jar:\
|
||||
${javafx.runtime}/lib/javaws.jar:\
|
||||
${javafx.runtime}/lib/plugin.jar:\
|
||||
${file.reference.cglib-2.1.88.jar}:\
|
||||
${file.reference.guava-14.0.1.jar}:\
|
||||
${file.reference.hk2-api-2.1.88.jar}:\
|
||||
${file.reference.hk2-locator-2.1.88.jar}:\
|
||||
${file.reference.hk2-utils-2.1.88.jar}:\
|
||||
${file.reference.javax.inject-2.1.88.jar}:\
|
||||
${file.reference.javax.ws.rs-api-2.0.jar}:\
|
||||
${file.reference.jersey-client.jar}:\
|
||||
${file.reference.jersey-common.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.7
|
||||
javac.target=1.7
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
javafx.binarycss=false
|
||||
javafx.deploy.adddesktopshortcut=false
|
||||
javafx.deploy.addstartmenushortcut=false
|
||||
javafx.deploy.allowoffline=true
|
||||
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
|
||||
javafx.deploy.backgroundupdate=false
|
||||
javafx.deploy.embedJNLP=true
|
||||
javafx.deploy.includeDT=true
|
||||
javafx.deploy.installpermanently=false
|
||||
javafx.deploy.permissionselevated=true
|
||||
# Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
|
||||
javafx.disable.concurrent.runs=false
|
||||
# Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
|
||||
javafx.enable.concurrent.external.runs=false
|
||||
# This is a JavaFX project
|
||||
javafx.enabled=true
|
||||
javafx.fallback.class=com.javafx.main.NoJavaFXFallback
|
||||
# Main class for JavaFX
|
||||
javafx.main.class=automationfx.AutomationFX
|
||||
javafx.native.bundling.enabled=false
|
||||
javafx.native.bundling.type=none
|
||||
javafx.preloader.class=
|
||||
# This project does not use Preloader
|
||||
javafx.preloader.enabled=false
|
||||
javafx.preloader.jar.filename=
|
||||
javafx.preloader.jar.path=
|
||||
javafx.preloader.project.path=
|
||||
javafx.preloader.type=none
|
||||
# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
|
||||
javafx.rebase.libs=false
|
||||
javafx.run.height=600
|
||||
javafx.run.width=800
|
||||
javafx.runtime=${platforms.Plataforma_JavaFX_Default.javafx.runtime.home}
|
||||
javafx.sdk=${platforms.Plataforma_JavaFX_Default.javafx.sdk.home}
|
||||
javafx.signing.enabled=true
|
||||
javafx.signing.type=self
|
||||
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
|
||||
jnlp.enabled=false
|
||||
# Main class for Java launcher
|
||||
main.class=com.javafx.main.Main
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=Plataforma_JavaFX_Default
|
||||
run.classpath=\
|
||||
${dist.jar}:\
|
||||
${javac.classpath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
|
||||
<extension file="jfx-impl.xml" id="jfx">
|
||||
<dependency dependsOn="-check-javafx" target="-init-check"/>
|
||||
<dependency dependsOn="-jfx-copylibs" target="-post-jar"/>
|
||||
<dependency dependsOn="-rebase-libs" target="-post-jar"/>
|
||||
<dependency dependsOn="jfx-deployment" target="-post-jar"/>
|
||||
<dependency dependsOn="jar" target="debug"/>
|
||||
<dependency dependsOn="-jfx-copylibs" target="jar"/>
|
||||
<dependency dependsOn="-rebase-libs" target="jar"/>
|
||||
<dependency dependsOn="jar" target="profile"/>
|
||||
<dependency dependsOn="jar" target="run"/>
|
||||
</extension>
|
||||
</buildExtensions>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>AutomationFX</name>
|
||||
<explicit-platform explicit-source-supported="true"/>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
CLASSPATH=%JAVA_HOME%/jre/lib/jfxrt.jar
|
||||
CLASSPATH=%CLASSPATH;lib/cglib-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/guava-14.0.1.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-api-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-locator-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-utils-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/javax.inject-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/javax.ws.rs-api-2.0.jar
|
||||
CLASSPATH=%CLASSPATH;lib/jersey-client.jar
|
||||
CLASSPATH=%CLASSPATH;lib/jersey-common.jar
|
||||
CLASSPATH=%CLASSPATH;AutomationFX.jar
|
||||
|
||||
java -Dcom.sun.javafx.isEmbedded=false -Djavafx.platform=eglfb -cp %CLASSPATH% automationfx.AutomationFX
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
JAVA_HOME=/home/pi/java/jdk1.8.0
|
||||
CLASSPATH=$JAVA_HOME/jre/lib/jfxrt.jar
|
||||
CLASSPATH=$CLASSPATH:lib/cglib-2.1.88.jar
|
||||
CLASSPATH=$CLASSPATH:lib/guava-14.0.1.jar
|
||||
CLASSPATH=$CLASSPATH:lib/hk2-api-2.1.88.jar
|
||||
CLASSPATH=$CLASSPATH:lib/hk2-locator-2.1.88.jar
|
||||
CLASSPATH=$CLASSPATH:lib/hk2-utils-2.1.88.jar
|
||||
CLASSPATH=$CLASSPATH:lib/javax.inject-2.1.88.jar
|
||||
CLASSPATH=$CLASSPATH:lib/javax.ws.rs-api-2.0.jar
|
||||
CLASSPATH=$CLASSPATH:lib/jersey-client.jar
|
||||
CLASSPATH=$CLASSPATH:lib/jersey-common.jar
|
||||
CLASSPATH=$CLASSPATH:AutomationFX.jar
|
||||
|
||||
export JAVA_HOME CLASSPATH
|
||||
|
||||
$JAVA_HOME/bin/java -Dcom.sun.javafx.isEmbedded=false -Djavafx.platform=eglfb -cp $CLASSPATH automationfx.AutomationFX
|
||||
@@ -0,0 +1,175 @@
|
||||
package automationfx;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Slider;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class AutomationController implements Initializable {
|
||||
|
||||
@FXML
|
||||
private ImageView imgHumidity;
|
||||
@FXML
|
||||
private ToggleButton toggleButton1;
|
||||
@FXML
|
||||
private ToggleButton toggleButton2;
|
||||
@FXML
|
||||
private ToggleButton toggleButton3;
|
||||
@FXML
|
||||
private ToggleButton toggleButton4;
|
||||
@FXML
|
||||
private ToggleButton toggleButton5;
|
||||
@FXML
|
||||
private ToggleButton toggleButton6;
|
||||
@FXML
|
||||
private LineChart temperaturaChart;
|
||||
@FXML
|
||||
private Slider servoMotorSlider;
|
||||
@FXML
|
||||
private Button botaoGirarServoMotor;
|
||||
@FXML
|
||||
private Label humidityLabel;
|
||||
@FXML
|
||||
private Label labelTempInterna;
|
||||
@FXML
|
||||
private Label labelTempExterna;
|
||||
@FXML
|
||||
private Button btnRed;
|
||||
@FXML
|
||||
private Button btnGreen;
|
||||
@FXML
|
||||
private Button btnBlue;
|
||||
@FXML
|
||||
private TextField textColorValue;
|
||||
private RelayController rele1;
|
||||
private RelayController rele2;
|
||||
private RelayController rele3;
|
||||
private RelayController rele4;
|
||||
private RelayController rele5;
|
||||
private RelayController rele6;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
ThingsClientREST thingsClient = new ThingsClientREST();
|
||||
|
||||
// TEMPERATURA MONITOR
|
||||
TemperatureMonitor tempMonitor = new TemperatureMonitor(thingsClient.createTarget(), temperaturaChart);
|
||||
labelTempExterna.textProperty().bind(tempMonitor.temperatureOutProperty());
|
||||
labelTempInterna.textProperty().bind(tempMonitor.temperatureInProperty());
|
||||
tempMonitor.start();
|
||||
|
||||
// HUMIDITY MONITOR
|
||||
HumidityMonitor humidityMonitor = new HumidityMonitor(thingsClient.createTarget());
|
||||
humidityLabel.textProperty().bind(humidityMonitor.valueProperty());
|
||||
humidityMonitor.start();
|
||||
|
||||
// SERVO MOTOR CONTROLLER
|
||||
final ServoMotorController servoMotorController = new ServoMotorController(thingsClient.createTarget());
|
||||
servoMotorController.valueProperty().bind(servoMotorSlider.valueProperty());
|
||||
botaoGirarServoMotor.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
servoMotorController.girar();
|
||||
}
|
||||
});
|
||||
|
||||
// RELAYS
|
||||
WebTarget relayInitTarget = thingsClient.createTarget();
|
||||
rele1 = new RelayController(relayInitTarget, 1);
|
||||
rele2 = new RelayController(relayInitTarget, 2);
|
||||
rele3 = new RelayController(relayInitTarget, 3);
|
||||
rele4 = new RelayController(relayInitTarget, 4);
|
||||
rele5 = new RelayController(relayInitTarget, 5);
|
||||
rele6 = new RelayController(relayInitTarget, 6);
|
||||
|
||||
// State-ish Bindings
|
||||
rele1.stateProperty().bindBidirectional(toggleButton1.selectedProperty());
|
||||
rele2.stateProperty().bindBidirectional(toggleButton2.selectedProperty());
|
||||
rele3.stateProperty().bindBidirectional(toggleButton3.selectedProperty());
|
||||
rele4.stateProperty().bindBidirectional(toggleButton4.selectedProperty());
|
||||
rele5.stateProperty().bindBidirectional(toggleButton5.selectedProperty());
|
||||
rele6.stateProperty().bindBidirectional(toggleButton6.selectedProperty());
|
||||
|
||||
// Disable-ish Bindings
|
||||
toggleButton1.disableProperty().bind(rele1.runningProperty());
|
||||
toggleButton2.disableProperty().bind(rele2.runningProperty());
|
||||
toggleButton3.disableProperty().bind(rele3.runningProperty());
|
||||
toggleButton4.disableProperty().bind(rele4.runningProperty());
|
||||
toggleButton5.disableProperty().bind(rele5.runningProperty());
|
||||
toggleButton6.disableProperty().bind(rele6.runningProperty());
|
||||
|
||||
// LED COLORS
|
||||
|
||||
final LedTapeController ledTapeController = new LedTapeController(thingsClient.createTarget());
|
||||
|
||||
btnRed.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
int color = getTextColorValue();
|
||||
if (color > -1) {
|
||||
ledTapeController.updateColor("red", color);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
btnGreen.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
int color = getTextColorValue();
|
||||
if (color > -1) {
|
||||
ledTapeController.updateColor("green", color);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnBlue.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
int color = getTextColorValue();
|
||||
if (color > -1) {
|
||||
ledTapeController.updateColor("blue", color);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
imgHumidity.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent t) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int getTextColorValue() {
|
||||
String val = textColorValue.getText();
|
||||
int integer = -1;
|
||||
try {
|
||||
integer = Integer.parseInt(val);
|
||||
if (integer < 0 || integer > 255) {
|
||||
integer = -1;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (integer == -1) {
|
||||
textColorValue.textProperty().set("");
|
||||
}
|
||||
return integer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package automationfx;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class AutomationFX extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("AutomationUI.fxml"));
|
||||
Scene scene = new Scene(root);
|
||||
stage.setScene(scene);
|
||||
stage.setFullScreen(true);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import java.net.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.chart.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.effect.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.shape.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
|
||||
<VBox id="AnchorPane" minHeight="464.0" prefHeight="464.0" prefWidth="800.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="automationfx.AutomationController">
|
||||
<children>
|
||||
<GridPane alignment="CENTER" minHeight="113.0" prefHeight="113.0" prefWidth="790.0" VBox.vgrow="NEVER">
|
||||
<children>
|
||||
<ToggleButton fx:id="toggleButton1" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="0" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton2" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="1" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton3" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="2" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton4" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="3" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton5" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="ToggleButton" GridPane.columnIndex="4" GridPane.rowIndex="0" />
|
||||
<ToggleButton fx:id="toggleButton6" maxHeight="61.0" maxWidth="32.0" minHeight="61.0" minWidth="32.0" mnemonicParsing="false" prefHeight="61.0" prefWidth="32.0" styleClass="button-image" text="" GridPane.columnIndex="5" GridPane.rowIndex="0" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 1" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0" fx:id="x1" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 2" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0" fx:id="x1" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 3" GridPane.columnIndex="2" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 4" GridPane.columnIndex="3" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="101.0" promptText="Relê 5" GridPane.columnIndex="4" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
<TextField prefHeight="40.0" prefWidth="100.0" promptText="Relê 6" GridPane.columnIndex="5" GridPane.margin="$x1" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="98.0" minHeight="10.0" prefHeight="68.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="67.0" minHeight="10.0" prefHeight="53.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<VBox.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</VBox.margin>
|
||||
</GridPane>
|
||||
<GridPane alignment="CENTER" gridLinesVisible="false" maxHeight="-1.0" minHeight="338.0" prefHeight="338.0" prefWidth="780.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<LineChart fx:id="temperaturaChart" alternativeColumnFillVisible="false" createSymbols="true" title="Temperaturas (°C)" GridPane.columnIndex="1" GridPane.columnSpan="2147483647" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
|
||||
<xAxis>
|
||||
<CategoryAxis label="Hora" side="BOTTOM" />
|
||||
</xAxis>
|
||||
<yAxis>
|
||||
<NumberAxis side="LEFT" />
|
||||
</yAxis>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
</LineChart>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@images/servo-motor.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label text="Servo Motor">
|
||||
<font>
|
||||
<Font size="20.0" fx:id="x2" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" right="10.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Button fx:id="botaoGirarServoMotor" mnemonicParsing="false" text="Girar" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Slider fx:id="servoMotorSlider" max="180.0" prefHeight="16.0" prefWidth="252.0" showTickLabels="true" showTickMarks="true" snapToTicks="false" />
|
||||
</children>
|
||||
</VBox>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
||||
<children>
|
||||
<ImageView fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<effect>
|
||||
<DropShadow />
|
||||
</effect>
|
||||
<image>
|
||||
<Image url="@images/led-tape.png" />
|
||||
</image>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</ImageView>
|
||||
<TextField fx:id="textColorValue" prefWidth="98.0" promptText="0-255">
|
||||
<HBox.margin>
|
||||
<Insets left="15.0" />
|
||||
</HBox.margin>
|
||||
</TextField>
|
||||
<VBox alignment="CENTER" prefHeight="87.0" prefWidth="58.0">
|
||||
<children>
|
||||
<Button fx:id="btnRed" mnemonicParsing="false" style="-fx-background-color: red;" text="">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" fx:id="x5" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="btnGreen" mnemonicParsing="false" style="-fx-background-color: green;" text="" VBox.margin="$x5" />
|
||||
<Button fx:id="btnBlue" mnemonicParsing="false" style="-fx-background-color: blue;" text="" VBox.margin="$x5" />
|
||||
</children>
|
||||
<HBox.margin>
|
||||
<Insets left="20.0" />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="0" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" GridPane.valignment="CENTER" GridPane.vgrow="NEVER">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<ImageView fx:id="imgHumidity" fitHeight="62.0" fitWidth="66.0" pickOnBounds="true" preserveRatio="true">
|
||||
<effect>
|
||||
<DropShadow />
|
||||
</effect>
|
||||
<image>
|
||||
<Image url="@images/humidity.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label fx:id="humidityLabel" alignment="CENTER_RIGHT" contentDisplay="RIGHT" prefHeight="56.0" prefWidth="122.0" text="50.0">
|
||||
<effect>
|
||||
<DropShadow height="9.0" offsetX="2.0" offsetY="2.0" radius="4.0" width="9.0" />
|
||||
</effect>
|
||||
<font>
|
||||
<Font size="48.0" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" right="10.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label prefHeight="45.0" prefWidth="32.0" text="\%">
|
||||
<font>
|
||||
<Font name="System Bold" size="16.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ImageView fitHeight="72.0" fitWidth="76.0" pickOnBounds="true" preserveRatio="true" x="0.0">
|
||||
<image>
|
||||
<Image url="@images/temperature.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label font="$x2" prefHeight="62.0" text="Temperatura" />
|
||||
</children>
|
||||
</HBox>
|
||||
<GridPane prefHeight="88.0" prefWidth="225.0">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
|
||||
<children>
|
||||
<Label fx:id="labelTempInterna" alignment="CENTER_RIGHT" prefWidth="113.0" text="25">
|
||||
<font>
|
||||
<Font size="42.0" fx:id="x3" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="°C" />
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<Label fx:id="labelTempExterna" alignment="CENTER_RIGHT" font="$x3" prefWidth="113.0" text="18" />
|
||||
<Label text="°C" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="Interna" GridPane.columnIndex="0" GridPane.rowIndex="0">
|
||||
<font>
|
||||
<Font size="16.0" fx:id="x4" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label font="$x4" text="Externa" GridPane.columnIndex="0" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="80.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="145.0" minWidth="10.0" prefWidth="145.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="40.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="ALWAYS" maxWidth="419.0" minWidth="10.0" percentWidth="30.0" prefWidth="412.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="325.0" minWidth="10.0" percentWidth="40.0" prefWidth="238.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="325.0" minWidth="10.0" percentWidth="30.0" prefWidth="238.0" />
|
||||
</columnConstraints>
|
||||
<padding>
|
||||
<Insets left="15.0" right="15.0" />
|
||||
</padding>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="225.0" minHeight="10.0" percentHeight="25.761772853185594" prefHeight="225.0" vgrow="ALWAYS" />
|
||||
<RowConstraints maxHeight="106.0" minHeight="10.0" percentHeight="74.79224376731301" prefHeight="36.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</GridPane>
|
||||
</children>
|
||||
<stylesheets>
|
||||
<URL value="@automation.css" />
|
||||
</stylesheets>
|
||||
</VBox>
|
||||
@@ -0,0 +1,81 @@
|
||||
package automationfx;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.FloatProperty;
|
||||
import javafx.beans.property.ReadOnlyFloatProperty;
|
||||
import javafx.beans.property.ReadOnlyStringProperty;
|
||||
import javafx.beans.property.SimpleFloatProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class HumidityMonitor {
|
||||
|
||||
private static final long DELAY = 15000; // 15s
|
||||
private FloatProperty floatValue = new SimpleFloatProperty();
|
||||
private StringProperty value = new SimpleStringProperty();
|
||||
private final WebTarget target;
|
||||
|
||||
public HumidityMonitor(WebTarget target) {
|
||||
this.target = target.path("/humidity");
|
||||
}
|
||||
|
||||
public void start() {
|
||||
Timer timer = new Timer(true);
|
||||
timer.schedule(new MonitorService(), 5000, 5000);
|
||||
}
|
||||
|
||||
class MonitorService extends TimerTask {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(HumidityMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
String sHumidity = target.request().get(String.class);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(HumidityMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
sHumidity = target.request().get(String.class);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(HumidityMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
sHumidity = target.request().get(String.class);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(HumidityMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
final float humidity = new Float(sHumidity);
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
floatValue.set(humidity);
|
||||
value.set(Float.toString(humidity));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlyStringProperty valueProperty() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public ReadOnlyFloatProperty floatProperty() {
|
||||
return floatValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package automationfx;
|
||||
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class LedTapeController {
|
||||
|
||||
private final WebTarget ledTarget;
|
||||
|
||||
LedTapeController(WebTarget restClient) {
|
||||
ledTarget = restClient.path("/{color}/{value}");
|
||||
}
|
||||
|
||||
public void updateColor(String color, int value) {
|
||||
ledTarget.resolveTemplate("value", value)
|
||||
.resolveTemplate("color", color)
|
||||
.request()
|
||||
.async()
|
||||
.get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package automationfx;
|
||||
|
||||
import java.net.NoRouteToHostException;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class RelayController {
|
||||
|
||||
private final BooleanProperty running = new SimpleBooleanProperty();
|
||||
private final BooleanProperty state = new SimpleBooleanProperty();
|
||||
private final WebTarget relayTarget;
|
||||
|
||||
public RelayController(WebTarget target, int relay) {
|
||||
relayTarget = target.path("/relay" + relay + "/{state}");
|
||||
|
||||
state.addListener(new ChangeListener<Boolean>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
|
||||
if (running.get() == false) {
|
||||
running.set(true);
|
||||
callRestURL(t1.booleanValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void callRestURL(final boolean bState) {
|
||||
Runnable callURLTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int value = bState ? 1 : 0;
|
||||
WebTarget target = relayTarget.resolveTemplate("state", value);
|
||||
try {
|
||||
Response res = target.request().get();
|
||||
final int status = res.getStatus();
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (status != 200) {
|
||||
state.set(false);
|
||||
}
|
||||
running.set(false);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
if (e instanceof NoRouteToHostException) {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
state.set(false);
|
||||
running.set(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Thread t = new Thread(callURLTask);
|
||||
t.setDaemon(true);
|
||||
t.start();
|
||||
}
|
||||
|
||||
public boolean getState() {
|
||||
return state.get();
|
||||
}
|
||||
|
||||
public void setState(boolean b) {
|
||||
this.state.set(b);
|
||||
}
|
||||
|
||||
public BooleanProperty stateProperty() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public BooleanProperty runningProperty() {
|
||||
return running;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package automationfx;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class ServoMotorController {
|
||||
|
||||
private WebTarget target;
|
||||
private IntegerProperty value = new SimpleIntegerProperty();
|
||||
|
||||
public ServoMotorController(WebTarget webTarget) {
|
||||
this.target = webTarget.path("/servo/{value}");
|
||||
}
|
||||
|
||||
public IntegerProperty valueProperty() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void girar() {
|
||||
target.resolveTemplate("value", value.intValue()).request().async().get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package automationfx;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author bruno.borges@oracle.com
|
||||
*/final
|
||||
public class TemperatureMonitor {
|
||||
|
||||
private static final long FIXED_DELAY = 5000; // 5s
|
||||
private final XYChart.Series tempExternaData;
|
||||
private final XYChart.Series tempInternaData;
|
||||
private final WebTarget targetTempIn;
|
||||
private WebTarget targetTempOut;
|
||||
private StringProperty temperatureOutProperty = new SimpleStringProperty();
|
||||
private StringProperty temperatureInProperty = new SimpleStringProperty();
|
||||
|
||||
public StringProperty temperatureOutProperty() {
|
||||
return temperatureOutProperty;
|
||||
}
|
||||
|
||||
public StringProperty temperatureInProperty() {
|
||||
return temperatureInProperty;
|
||||
}
|
||||
|
||||
public TemperatureMonitor(WebTarget webTarget, LineChart chart) {
|
||||
tempInternaData = new XYChart.Series();
|
||||
tempInternaData.setName("Interna");
|
||||
|
||||
tempExternaData = new XYChart.Series();
|
||||
tempExternaData.setName("Externa");
|
||||
|
||||
chart.getData().addAll(tempInternaData, tempExternaData);
|
||||
targetTempOut = webTarget.path("/temp_out");
|
||||
targetTempIn = webTarget.path("/temp_in");
|
||||
|
||||
}
|
||||
|
||||
// calculate out temperature
|
||||
private float toCelsius(int value) {
|
||||
return (value * 500) / 1024;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
Timer timer = new Timer(true);
|
||||
timer.schedule(new MonitorService(), 5000, FIXED_DELAY);
|
||||
}
|
||||
|
||||
class MonitorService extends TimerTask {
|
||||
|
||||
private static final int MAX_ITEMS = 18;
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("mm:ss");
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// temperatures
|
||||
String sTempIn = targetTempIn.request().get(String.class);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(TemperatureMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
String sTempOut = targetTempOut.request().get(String.class);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(TemperatureMonitor.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
final float tempIn = toCelsius(new Integer(sTempIn));
|
||||
final float tempOut = new Float(sTempOut);
|
||||
|
||||
// category time
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date date = cal.getTime();
|
||||
final String category = sdf.format(date);
|
||||
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (tempInternaData.getData().size() == MAX_ITEMS) {
|
||||
tempInternaData.getData().remove(0);
|
||||
tempExternaData.getData().remove(0);
|
||||
}
|
||||
|
||||
temperatureInProperty.set(Float.toString(tempIn));
|
||||
temperatureOutProperty.set(Float.toString(tempOut));
|
||||
|
||||
tempInternaData.getData().add(new XYChart.Data(category, tempIn));
|
||||
tempExternaData.getData().add(new XYChart.Data(category, tempOut));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package automationfx;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.client.Client;
|
||||
import javax.ws.rs.client.ClientBuilder;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.ws.rs.core.UriBuilder;
|
||||
|
||||
/**
|
||||
* @author bruno.borges@oracle.com
|
||||
*/
|
||||
public class ThingsClientREST {
|
||||
|
||||
private Client client = ClientBuilder.newClient();
|
||||
private final URI thingsServerURI;
|
||||
|
||||
public ThingsClientREST() {
|
||||
String uriTemplate = "http://{host}:{port}/things";
|
||||
String host = System.getProperty("things.host", "192.168.1.11");
|
||||
String port = System.getProperty("things.port", "8080");
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("host", host);
|
||||
params.put("port", port);
|
||||
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(uriTemplate);
|
||||
this.thingsServerURI = uriBuilder.buildFromMap(params);
|
||||
}
|
||||
|
||||
public WebTarget createTarget() {
|
||||
return client.target(thingsServerURI);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
.main {
|
||||
-fx-background-color: #000000;
|
||||
}
|
||||
|
||||
.button-image {
|
||||
-fx-background-image: url('images/button-off.png');
|
||||
}
|
||||
|
||||
.button-image:selected {
|
||||
-fx-background-image: url('images/button-on.png');
|
||||
}
|
||||
|
||||
.button-image:selected:focused,.button-image:focused {
|
||||
-fx-background-color:
|
||||
-fx-shadow-highlight-color,
|
||||
linear-gradient(to bottom, derive(-fx-color,-22%) 0%, derive(-fx-color,-15%) 100%),
|
||||
linear-gradient(to bottom, derive(-fx-color,-15%) 0%, derive(-fx-color,-10%) 50%, derive(-fx-color,-8%) 98%, derive(-fx-color,-12%) 100%);
|
||||
}
|
||||
|
||||
.color-picker {
|
||||
-fx-background-color: #666666;
|
||||
-fx-background-radius: 0 10 10 0;
|
||||
}
|
||||
|
||||
.color-picker .color-picker-label .text {
|
||||
-fx-fill: #ccffcc;
|
||||
}
|
||||
|
Depois Largura: | Altura: | Tamanho: 3.2 KiB |
|
Depois Largura: | Altura: | Tamanho: 4.0 KiB |
|
Depois Largura: | Altura: | Tamanho: 3.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 3.1 KiB |
|
Depois Largura: | Altura: | Tamanho: 19 KiB |
|
Depois Largura: | Altura: | Tamanho: 7.1 KiB |
|
Depois Largura: | Altura: | Tamanho: 9.0 KiB |
|
Depois Largura: | Altura: | Tamanho: 26 KiB |
|
Depois Largura: | Altura: | Tamanho: 28 KiB |
@@ -0,0 +1,44 @@
|
||||
<html><head>
|
||||
<SCRIPT src="./web-files/dtjava.js"></SCRIPT>
|
||||
<script>
|
||||
function launchApplication(jnlpfile) {
|
||||
dtjava.launch( {
|
||||
url : 'AutomationFX.jnlp',
|
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPGpubHAgc3BlYz0iMS4wIiB4bWxuczpqZng9Imh0dHA6Ly9qYXZhZnguY29tIiBocmVmPSJBdXRvbWF0aW9uRlguam5scCI+CiAgPGluZm9ybWF0aW9uPgogICAgPHRpdGxlPkF1dG9tYXRpb25GWDwvdGl0bGU+CiAgICA8dmVuZG9yPmJydW5vPC92ZW5kb3I+CiAgICA8ZGVzY3JpcHRpb24+U2FtcGxlIEphdmFGWCAyLjAgYXBwbGljYXRpb24uPC9kZXNjcmlwdGlvbj4KICAgIDxvZmZsaW5lLWFsbG93ZWQvPgogIDwvaW5mb3JtYXRpb24+CiAgPHJlc291cmNlcz4KICAgIDxqZng6amF2YWZ4LXJ1bnRpbWUgdmVyc2lvbj0iMi4yKyIgaHJlZj0iaHR0cDovL2phdmFkbC5zdW4uY29tL3dlYmFwcHMvZG93bmxvYWQvR2V0RmlsZS9qYXZhZngtbGF0ZXN0L3dpbmRvd3MtaTU4Ni9qYXZhZngyLmpubHAiLz4KICA8L3Jlc291cmNlcz4KICA8cmVzb3VyY2VzPgogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPgogICAgPGphciBocmVmPSJBdXRvbWF0aW9uRlguamFyIiBzaXplPSIxNDg5MzQiIGRvd25sb2FkPSJlYWdlciIgLz4KICAgIDxqYXIgaHJlZj0ibGliL2NnbGliLTIuMS44OC5qYXIiIHNpemU9IjMwNzU5NSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvZ3VhdmEtMTQuMC4xLmphciIgc2l6ZT0iMjMzMzc0OCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvaGsyLWFwaS0yLjEuODguamFyIiBzaXplPSIxMjU2NjIiIGRvd25sb2FkPSJlYWdlciIgLz4KICAgIDxqYXIgaHJlZj0ibGliL2hrMi1sb2NhdG9yLTIuMS44OC5qYXIiIHNpemU9IjEzNDY1OSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvaGsyLXV0aWxzLTIuMS44OC5qYXIiIHNpemU9IjU2OTk0IiBkb3dubG9hZD0iZWFnZXIiIC8+CiAgICA8amFyIGhyZWY9ImxpYi9qYXZheC5pbmplY3QtMi4xLjg4LmphciIgc2l6ZT0iODYwOCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamF2YXgud3MucnMtYXBpLTIuMC5qYXIiIHNpemU9IjEyNTEwOSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamVyc2V5LWNsaWVudC5qYXIiIHNpemU9IjEyMzkzNiIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamVyc2V5LWNvbW1vbi5qYXIiIHNpemU9IjYyMDI1NSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogIDwvcmVzb3VyY2VzPgo8c2VjdXJpdHk+CiAgPGFsbC1wZXJtaXNzaW9ucy8+Cjwvc2VjdXJpdHk+CiAgPGFwcGxldC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0iY29tLmphdmFmeC5tYWluLk5vSmF2YUZYRmFsbGJhY2siICBuYW1lPSJBdXRvbWF0aW9uRlgiID4KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjIuMisiLz4KICA8L2FwcGxldC1kZXNjPgogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJhdXRvbWF0aW9uZnguQXV0b21hdGlvbkZYIiAgbmFtZT0iQXV0b21hdGlvbkZYIiAvPgogIDx1cGRhdGUgY2hlY2s9ImFsd2F5cyIvPgo8L2pubHA+Cg=='
|
||||
},
|
||||
{
|
||||
javafx : '2.2+'
|
||||
},
|
||||
{}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function javafxEmbed() {
|
||||
dtjava.embed(
|
||||
{
|
||||
url : 'AutomationFX.jnlp',
|
||||
placeholder : 'javafx-app-placeholder',
|
||||
width : 800,
|
||||
height : 600,
|
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPGpubHAgc3BlYz0iMS4wIiB4bWxuczpqZng9Imh0dHA6Ly9qYXZhZnguY29tIiBocmVmPSJBdXRvbWF0aW9uRlguam5scCI+CiAgPGluZm9ybWF0aW9uPgogICAgPHRpdGxlPkF1dG9tYXRpb25GWDwvdGl0bGU+CiAgICA8dmVuZG9yPmJydW5vPC92ZW5kb3I+CiAgICA8ZGVzY3JpcHRpb24+U2FtcGxlIEphdmFGWCAyLjAgYXBwbGljYXRpb24uPC9kZXNjcmlwdGlvbj4KICAgIDxvZmZsaW5lLWFsbG93ZWQvPgogIDwvaW5mb3JtYXRpb24+CiAgPHJlc291cmNlcz4KICAgIDxqZng6amF2YWZ4LXJ1bnRpbWUgdmVyc2lvbj0iMi4yKyIgaHJlZj0iaHR0cDovL2phdmFkbC5zdW4uY29tL3dlYmFwcHMvZG93bmxvYWQvR2V0RmlsZS9qYXZhZngtbGF0ZXN0L3dpbmRvd3MtaTU4Ni9qYXZhZngyLmpubHAiLz4KICA8L3Jlc291cmNlcz4KICA8cmVzb3VyY2VzPgogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPgogICAgPGphciBocmVmPSJBdXRvbWF0aW9uRlguamFyIiBzaXplPSIxNDg5MzQiIGRvd25sb2FkPSJlYWdlciIgLz4KICAgIDxqYXIgaHJlZj0ibGliL2NnbGliLTIuMS44OC5qYXIiIHNpemU9IjMwNzU5NSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvZ3VhdmEtMTQuMC4xLmphciIgc2l6ZT0iMjMzMzc0OCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvaGsyLWFwaS0yLjEuODguamFyIiBzaXplPSIxMjU2NjIiIGRvd25sb2FkPSJlYWdlciIgLz4KICAgIDxqYXIgaHJlZj0ibGliL2hrMi1sb2NhdG9yLTIuMS44OC5qYXIiIHNpemU9IjEzNDY1OSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvaGsyLXV0aWxzLTIuMS44OC5qYXIiIHNpemU9IjU2OTk0IiBkb3dubG9hZD0iZWFnZXIiIC8+CiAgICA8amFyIGhyZWY9ImxpYi9qYXZheC5pbmplY3QtMi4xLjg4LmphciIgc2l6ZT0iODYwOCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamF2YXgud3MucnMtYXBpLTIuMC5qYXIiIHNpemU9IjEyNTEwOSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamVyc2V5LWNsaWVudC5qYXIiIHNpemU9IjEyMzkzNiIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvamVyc2V5LWNvbW1vbi5qYXIiIHNpemU9IjYyMDI1NSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogIDwvcmVzb3VyY2VzPgo8c2VjdXJpdHk+CiAgPGFsbC1wZXJtaXNzaW9ucy8+Cjwvc2VjdXJpdHk+CiAgPGFwcGxldC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0iY29tLmphdmFmeC5tYWluLk5vSmF2YUZYRmFsbGJhY2siICBuYW1lPSJBdXRvbWF0aW9uRlgiID4KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjIuMisiLz4KICA8L2FwcGxldC1kZXNjPgogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJhdXRvbWF0aW9uZnguQXV0b21hdGlvbkZYIiAgbmFtZT0iQXV0b21hdGlvbkZYIiAvPgogIDx1cGRhdGUgY2hlY2s9ImFsd2F5cyIvPgo8L2pubHA+Cg=='
|
||||
},
|
||||
{
|
||||
javafx : '2.2+'
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
<!-- Embed FX application into web page once page is loaded -->
|
||||
dtjava.addOnloadCallback(javafxEmbed);
|
||||
</script>
|
||||
|
||||
</head><body>
|
||||
<h2>Test page for <b>AutomationFX</b></h2>
|
||||
<b>Webstart:</b> <a href='AutomationFX.jnlp' onclick="return launchApplication('AutomationFX.jnlp');">click to launch this app as webstart</a><br><hr><br>
|
||||
|
||||
<!-- Applet will be inserted here -->
|
||||
<div id='javafx-app-placeholder'></div>
|
||||
</body></html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="AutomationFX.jnlp">
|
||||
<information>
|
||||
<title>AutomationFX</title>
|
||||
<vendor>bruno</vendor>
|
||||
<description>Sample JavaFX 2.0 application.</description>
|
||||
<offline-allowed/>
|
||||
</information>
|
||||
<resources>
|
||||
<jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
|
||||
</resources>
|
||||
<resources>
|
||||
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
|
||||
<jar href="AutomationFX.jar" size="148934" download="eager" />
|
||||
<jar href="lib/cglib-2.1.88.jar" size="307595" download="eager" />
|
||||
<jar href="lib/guava-14.0.1.jar" size="2333748" download="eager" />
|
||||
<jar href="lib/hk2-api-2.1.88.jar" size="125662" download="eager" />
|
||||
<jar href="lib/hk2-locator-2.1.88.jar" size="134659" download="eager" />
|
||||
<jar href="lib/hk2-utils-2.1.88.jar" size="56994" download="eager" />
|
||||
<jar href="lib/javax.inject-2.1.88.jar" size="8608" download="eager" />
|
||||
<jar href="lib/javax.ws.rs-api-2.0.jar" size="125109" download="eager" />
|
||||
<jar href="lib/jersey-client.jar" size="123936" download="eager" />
|
||||
<jar href="lib/jersey-common.jar" size="620255" download="eager" />
|
||||
</resources>
|
||||
<security>
|
||||
<all-permissions/>
|
||||
</security>
|
||||
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="AutomationFX" >
|
||||
<param name="requiredFXVersion" value="2.2+"/>
|
||||
</applet-desc>
|
||||
<jfx:javafx-desc width="800" height="600" main-class="automationfx.AutomationFX" name="AutomationFX" />
|
||||
<update check="always"/>
|
||||
</jnlp>
|
||||
@@ -0,0 +1,13 @@
|
||||
CLASSPATH=%JAVA_HOME%/jre/lib/jfxrt.jar
|
||||
CLASSPATH=%CLASSPATH;lib/cglib-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/guava-14.0.1.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-api-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-locator-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/hk2-utils-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/javax.inject-2.1.88.jar
|
||||
CLASSPATH=%CLASSPATH;lib/javax.ws.rs-api-2.0.jar
|
||||
CLASSPATH=%CLASSPATH;lib/jersey-client.jar
|
||||
CLASSPATH=%CLASSPATH;lib/jersey-common.jar
|
||||
CLASSPATH=%CLASSPATH;AutomationFX.jar
|
||||
|
||||
java -Dthings.host=192.168.1.147 -Dthings.port=8080 -Dcom.sun.javafx.isEmbedded=false -Djavafx.platform=eglfb -cp %CLASSPATH% automationfx.AutomationFX
|
||||
@@ -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="PiFit" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
|
||||
<description>Builds, tests, and runs the project PiFit.</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>
|
||||
@@ -0,0 +1,4 @@
|
||||
#Mon, 23 Sep 2013 18:51:46 -0700
|
||||
|
||||
|
||||
/media/Vinicius/Education/2013-JavaOneUS/java/PiFit=
|
||||
|
Depois Largura: | Altura: | Tamanho: 580 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 MiB |
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Document : newCascadeStyleSheet
|
||||
Created on : 13/07/2013, 12:20:45
|
||||
Author : Rogério
|
||||
Description:
|
||||
Purpose of the stylesheet follows.
|
||||
*/
|
||||
|
||||
root {
|
||||
display: block;
|
||||
}
|
||||
.root{
|
||||
-fx-background-image: url("bg_1024.png");
|
||||
-fx-background-repeat: stretch;
|
||||
}
|
||||
.heart{
|
||||
-fx-alignment: TOP_RIGHT;
|
||||
|
||||
}
|
||||
|
Depois Largura: | Altura: | Tamanho: 54 KiB |
|
Depois Largura: | Altura: | Tamanho: 7.8 KiB |
@@ -0,0 +1,44 @@
|
||||
<html><head>
|
||||
<SCRIPT src="./web-files/dtjava.js"></SCRIPT>
|
||||
<script>
|
||||
function launchApplication(jnlpfile) {
|
||||
dtjava.launch( {
|
||||
url : 'PiFit.jnlp',
|
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPGpubHAgc3BlYz0iMS4wIiB4bWxuczpqZng9Imh0dHA6Ly9qYXZhZnguY29tIiBocmVmPSJQaUZpdC5qbmxwIj4KICA8aW5mb3JtYXRpb24+CiAgICA8dGl0bGU+UGlGaXQ8L3RpdGxlPgogICAgPHZlbmRvcj5JbmFjaW88L3ZlbmRvcj4KICAgIDxkZXNjcmlwdGlvbj5TYW1wbGUgSmF2YUZYIDIuMCBhcHBsaWNhdGlvbi48L2Rlc2NyaXB0aW9uPgogICAgPG9mZmxpbmUtYWxsb3dlZC8+CiAgPC9pbmZvcm1hdGlvbj4KICA8cmVzb3VyY2VzPgogICAgPGpmeDpqYXZhZngtcnVudGltZSB2ZXJzaW9uPSIyLjIrIiBocmVmPSJodHRwOi8vamF2YWRsLnN1bi5jb20vd2ViYXBwcy9kb3dubG9hZC9HZXRGaWxlL2phdmFmeC1sYXRlc3Qvd2luZG93cy1pNTg2L2phdmFmeDIuam5scCIvPgogIDwvcmVzb3VyY2VzPgogIDxyZXNvdXJjZXM+CiAgICA8ajJzZSB2ZXJzaW9uPSIxLjYrIiBocmVmPSJodHRwOi8vamF2YS5zdW4uY29tL3Byb2R1Y3RzL2F1dG9kbC9qMnNlIi8+CiAgICA8amFyIGhyZWY9IlBpRml0LmphciIgc2l6ZT0iMjA3NzI3OCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvUlhUWGNvbW0uamFyIiBzaXplPSI1OTQ2NCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvdGhpbmdzLWFwaS0xLjAtU05BUFNIT1QuamFyIiBzaXplPSIyNDgwNSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogIDwvcmVzb3VyY2VzPgogIDxhcHBsZXQtZGVzYyAgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiIG1haW4tY2xhc3M9ImNvbS5qYXZhZngubWFpbi5Ob0phdmFGWEZhbGxiYWNrIiAgbmFtZT0iUGlGaXQiID4KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjIuMisiLz4KICA8L2FwcGxldC1kZXNjPgogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJQaUZpdCIgIG5hbWU9IlBpRml0IiAvPgogIDx1cGRhdGUgY2hlY2s9ImFsd2F5cyIvPgo8L2pubHA+Cg=='
|
||||
},
|
||||
{
|
||||
javafx : '2.2+'
|
||||
},
|
||||
{}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function javafxEmbed() {
|
||||
dtjava.embed(
|
||||
{
|
||||
url : 'PiFit.jnlp',
|
||||
placeholder : 'javafx-app-placeholder',
|
||||
width : 800,
|
||||
height : 600,
|
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPGpubHAgc3BlYz0iMS4wIiB4bWxuczpqZng9Imh0dHA6Ly9qYXZhZnguY29tIiBocmVmPSJQaUZpdC5qbmxwIj4KICA8aW5mb3JtYXRpb24+CiAgICA8dGl0bGU+UGlGaXQ8L3RpdGxlPgogICAgPHZlbmRvcj5JbmFjaW88L3ZlbmRvcj4KICAgIDxkZXNjcmlwdGlvbj5TYW1wbGUgSmF2YUZYIDIuMCBhcHBsaWNhdGlvbi48L2Rlc2NyaXB0aW9uPgogICAgPG9mZmxpbmUtYWxsb3dlZC8+CiAgPC9pbmZvcm1hdGlvbj4KICA8cmVzb3VyY2VzPgogICAgPGpmeDpqYXZhZngtcnVudGltZSB2ZXJzaW9uPSIyLjIrIiBocmVmPSJodHRwOi8vamF2YWRsLnN1bi5jb20vd2ViYXBwcy9kb3dubG9hZC9HZXRGaWxlL2phdmFmeC1sYXRlc3Qvd2luZG93cy1pNTg2L2phdmFmeDIuam5scCIvPgogIDwvcmVzb3VyY2VzPgogIDxyZXNvdXJjZXM+CiAgICA8ajJzZSB2ZXJzaW9uPSIxLjYrIiBocmVmPSJodHRwOi8vamF2YS5zdW4uY29tL3Byb2R1Y3RzL2F1dG9kbC9qMnNlIi8+CiAgICA8amFyIGhyZWY9IlBpRml0LmphciIgc2l6ZT0iMjA3NzI3OCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvUlhUWGNvbW0uamFyIiBzaXplPSI1OTQ2NCIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogICAgPGphciBocmVmPSJsaWIvdGhpbmdzLWFwaS0xLjAtU05BUFNIT1QuamFyIiBzaXplPSIyNDgwNSIgZG93bmxvYWQ9ImVhZ2VyIiAvPgogIDwvcmVzb3VyY2VzPgogIDxhcHBsZXQtZGVzYyAgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiIG1haW4tY2xhc3M9ImNvbS5qYXZhZngubWFpbi5Ob0phdmFGWEZhbGxiYWNrIiAgbmFtZT0iUGlGaXQiID4KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjIuMisiLz4KICA8L2FwcGxldC1kZXNjPgogIDxqZng6amF2YWZ4LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJQaUZpdCIgIG5hbWU9IlBpRml0IiAvPgogIDx1cGRhdGUgY2hlY2s9ImFsd2F5cyIvPgo8L2pubHA+Cg=='
|
||||
},
|
||||
{
|
||||
javafx : '2.2+'
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
<!-- Embed FX application into web page once page is loaded -->
|
||||
dtjava.addOnloadCallback(javafxEmbed);
|
||||
</script>
|
||||
|
||||
</head><body>
|
||||
<h2>Test page for <b>PiFit</b></h2>
|
||||
<b>Webstart:</b> <a href='PiFit.jnlp' onclick="return launchApplication('PiFit.jnlp');">click to launch this app as webstart</a><br><hr><br>
|
||||
|
||||
<!-- Applet will be inserted here -->
|
||||
<div id='javafx-app-placeholder'></div>
|
||||
</body></html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="PiFit.jnlp">
|
||||
<information>
|
||||
<title>PiFit</title>
|
||||
<vendor>Inacio</vendor>
|
||||
<description>Sample JavaFX 2.0 application.</description>
|
||||
<offline-allowed/>
|
||||
</information>
|
||||
<resources>
|
||||
<jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
|
||||
</resources>
|
||||
<resources>
|
||||
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
|
||||
<jar href="PiFit.jar" size="2077278" download="eager" />
|
||||
<jar href="lib/RXTXcomm.jar" size="59464" download="eager" />
|
||||
<jar href="lib/things-api-1.0-SNAPSHOT.jar" size="24805" download="eager" />
|
||||
</resources>
|
||||
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="PiFit" >
|
||||
<param name="requiredFXVersion" value="2.2+"/>
|
||||
</applet-desc>
|
||||
<jfx:javafx-desc width="800" height="600" main-class="PiFit" name="PiFit" />
|
||||
<update check="always"/>
|
||||
</jnlp>
|
||||
|
Depois Largura: | Altura: | Tamanho: 725 B |
|
Depois Largura: | Altura: | Tamanho: 9.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 11 KiB |
|
Depois Largura: | Altura: | Tamanho: 11 KiB |
|
Depois Largura: | Altura: | Tamanho: 18 KiB |
|
Depois Largura: | Altura: | Tamanho: 2.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 11 KiB |
|
Depois Largura: | Altura: | Tamanho: 13 KiB |
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar como WebStart
|
||||
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar no Browser
|
||||
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=bc90070f
|
||||
build.xml.script.CRC32=67a49460
|
||||
build.xml.stylesheet.CRC32=28e38971@1.56.1.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=bc90070f
|
||||
nbproject/build-impl.xml.script.CRC32=8fb7498c
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
|
||||
@@ -0,0 +1,4 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar como WebStart
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
javafx.run.as=webstart
|
||||
@@ -0,0 +1,4 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Executar no Browser
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
javafx.run.as=embedded
|
||||
@@ -0,0 +1,7 @@
|
||||
auxiliary.org-netbeans-modules-projectapi.issue214819_5f_fx_5f_enabled=true
|
||||
compile.on.save=true
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
user.properties.file=/home/vsenger/.netbeans/7.3.1/build.properties
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
</project-private>
|
||||
@@ -0,0 +1,120 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=PiFit
|
||||
application.vendor=Inacio
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
compile.on.save=true
|
||||
compile.on.save.unsupported.javafx=true
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/PiFit.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.RXTXcomm.jar=/java/rxtx-2.1-7-bins-r2/RXTXcomm.jar
|
||||
file.reference.things-api-1.0-SNAPSHOT.jar=things-api-1.0-SNAPSHOT.jar
|
||||
includes=**
|
||||
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
|
||||
jar.archive.disabled=true
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${javafx.runtime}/lib/jfxrt.jar:\
|
||||
${javafx.runtime}/lib/deploy.jar:\
|
||||
${javafx.runtime}/lib/javaws.jar:\
|
||||
${javafx.runtime}/lib/plugin.jar:\
|
||||
${file.reference.things-api-1.0-SNAPSHOT.jar}:\
|
||||
${file.reference.RXTXcomm.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.7
|
||||
javac.target=1.7
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
javafx.binarycss=false
|
||||
javafx.deploy.adddesktopshortcut=false
|
||||
javafx.deploy.addstartmenushortcut=false
|
||||
javafx.deploy.allowoffline=true
|
||||
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
|
||||
javafx.deploy.backgroundupdate=false
|
||||
javafx.deploy.embedJNLP=true
|
||||
javafx.deploy.includeDT=true
|
||||
javafx.deploy.installpermanently=false
|
||||
javafx.deploy.permissionselevated=false
|
||||
# Definir como verdadeiro impede a cria\u00e7\u00e3o de c\u00f3pia tempor\u00e1ria de artefatos de implanta\u00e7\u00e3o antes de cada execu\u00e7\u00e3o (desativa as execu\u00e7\u00f5es atuais)
|
||||
javafx.disable.concurrent.runs=false
|
||||
# Definir como verdadeiro ativa v\u00e1rias execu\u00e7\u00f5es simult\u00e2neas do mesmo WebStart ou projeto Run-in-Browser
|
||||
javafx.enable.concurrent.external.runs=false
|
||||
# This is a JavaFX project
|
||||
javafx.enabled=true
|
||||
javafx.fallback.class=com.javafx.main.NoJavaFXFallback
|
||||
# Main class for JavaFX
|
||||
javafx.main.class=PiFit
|
||||
javafx.native.bundling.enabled=false
|
||||
javafx.native.bundling.type=none
|
||||
javafx.preloader.class=
|
||||
# This project does not use Preloader
|
||||
javafx.preloader.enabled=false
|
||||
javafx.preloader.jar.filename=
|
||||
javafx.preloader.jar.path=
|
||||
javafx.preloader.project.path=
|
||||
javafx.preloader.type=none
|
||||
# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
|
||||
javafx.rebase.libs=false
|
||||
javafx.run.height=600
|
||||
javafx.run.width=800
|
||||
javafx.runtime=${platforms.Plataforma_JavaFX_Default.javafx.runtime.home}
|
||||
javafx.sdk=${platforms.Plataforma_JavaFX_Default.javafx.sdk.home}
|
||||
javafx.signing.enabled=false
|
||||
javafx.signing.type=notsigned
|
||||
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
|
||||
jnlp.enabled=false
|
||||
# Main class for Java launcher
|
||||
main.class=com.javafx.main.Main
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=Plataforma_JavaFX_Default
|
||||
run.classpath=\
|
||||
${dist.jar}:\
|
||||
${javac.classpath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
|
||||
<extension file="jfx-impl.xml" id="jfx">
|
||||
<dependency dependsOn="-check-javafx" target="-init-check"/>
|
||||
<dependency dependsOn="-jfx-copylibs" target="-post-jar"/>
|
||||
<dependency dependsOn="-rebase-libs" target="-post-jar"/>
|
||||
<dependency dependsOn="jfx-deployment" target="-post-jar"/>
|
||||
<dependency dependsOn="jar" target="debug"/>
|
||||
<dependency dependsOn="-jfx-copylibs" target="jar"/>
|
||||
<dependency dependsOn="-rebase-libs" target="jar"/>
|
||||
<dependency dependsOn="jar" target="profile"/>
|
||||
<dependency dependsOn="jar" target="run"/>
|
||||
</extension>
|
||||
</buildExtensions>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>PiFit</name>
|
||||
<explicit-platform explicit-source-supported="true"/>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
public final class FrequenciaCardiaca{
|
||||
|
||||
private final Integer batimentos;
|
||||
|
||||
public FrequenciaCardiaca(Integer vBatimentos){
|
||||
this.batimentos = vBatimentos;
|
||||
}
|
||||
|
||||
public Integer getBatimentos(){
|
||||
return this.batimentos;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//package br.com.pifit.batimento;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.things.Device;
|
||||
import org.things.Things;
|
||||
import org.things.device.SerialDevice;
|
||||
|
||||
public class FrequenciaCardiacaManager {
|
||||
private static Device things;
|
||||
|
||||
public static void iniciar(String porta) throws Exception{
|
||||
things = new SerialDevice(porta, 9600);
|
||||
things.open();
|
||||
Things.delay(1500);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args
|
||||
* @throws IOException
|
||||
*/
|
||||
public static FrequenciaCardiaca ler() throws IOException, Exception {
|
||||
//Device things = new SerialDevice(porta, 9600);
|
||||
//things.open();
|
||||
//Things.delay(1500);
|
||||
things.send("G1\r");
|
||||
Things.delay(100);
|
||||
|
||||
String s = things.receive();
|
||||
String batimento = null;
|
||||
FrequenciaCardiaca fc;
|
||||
if(s != null){
|
||||
batimento = s.split(" ")[2];
|
||||
fc = new FrequenciaCardiaca(Integer.valueOf(batimento));
|
||||
}else{
|
||||
throw new Exception("O sensor retornou nulo.");
|
||||
}
|
||||
//things.close();
|
||||
|
||||
return fc;
|
||||
}
|
||||
|
||||
public static void encerrar() throws Exception{
|
||||
things.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
import com.sun.javafx.collections.ObservableListWrapper;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Observable;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.value.ObservableListValue;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.chart.NumberAxis;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.ColumnConstraints;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rogério
|
||||
*/
|
||||
public class PiFit extends Application {
|
||||
|
||||
GridPane mainPane = new GridPane();
|
||||
Scene scene;
|
||||
XYChart.Series series;
|
||||
Label lblFrequenciaCardiacaValor = null;
|
||||
long cont = 0;
|
||||
private static final long FIXED_DELAY = 1000;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
|
||||
//Platform.runLater(null);
|
||||
|
||||
String strIP = System.getProperty("d");
|
||||
|
||||
this.setPageLayout();
|
||||
this.setImages();
|
||||
this.createChart();
|
||||
this.createLabels();
|
||||
|
||||
//primaryStage.setFullScreen(true);
|
||||
primaryStage.setTitle("PiFit");
|
||||
|
||||
scene.getStylesheets().add("layout.css");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
|
||||
Timer timer = new Timer(true);
|
||||
timer.schedule(new Looping(), 0, 1000);
|
||||
}
|
||||
|
||||
private void setPageLayout() {
|
||||
|
||||
mainPane.setAlignment(Pos.CENTER);
|
||||
|
||||
mainPane.setHgap(20);
|
||||
|
||||
ColumnConstraints column1 = new ColumnConstraints();
|
||||
column1.setPercentWidth(10);
|
||||
ColumnConstraints column2 = new ColumnConstraints();
|
||||
column2.setPercentWidth(80);
|
||||
|
||||
ColumnConstraints column3 = new ColumnConstraints();
|
||||
column3.setPercentWidth(10);
|
||||
|
||||
// RowConstraints row1 = new RowConstraints();
|
||||
// row1.set
|
||||
//
|
||||
// RowConstraints row2 = new RowConstraints();
|
||||
// row2.setPrefHeight(700);
|
||||
|
||||
// RowConstraints row3 = new RowConstraints();
|
||||
// row3.setPercentHeight(30);
|
||||
|
||||
|
||||
mainPane.getColumnConstraints().addAll(column1, column2, column3); // each get 50% of width
|
||||
//mainPane.getRowConstraints().addAll(row1,row2);
|
||||
|
||||
|
||||
//
|
||||
// Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
|
||||
//
|
||||
//
|
||||
//
|
||||
// scene = new Scene(mainPane, screenBounds.getWidth(), screenBounds.getHeight() - 50);
|
||||
scene = new Scene(mainPane, 1024, 768);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The main() method is ignored in correctly deployed JavaFX application.
|
||||
* main() serves only as fallback in case the application can not be
|
||||
* launched through deployment artifacts, e.g., in IDEs with limited FX
|
||||
* support. NetBeans ignores main().
|
||||
*
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
private void setImages() {
|
||||
Image logo = new Image("raspberry_heart.gif");
|
||||
|
||||
ImageView iv1 = new ImageView();
|
||||
iv1.setImage(logo);
|
||||
iv1.setPreserveRatio(true);
|
||||
iv1.setFitHeight(114);
|
||||
|
||||
iv1.setId("heart");
|
||||
GridPane.setRowIndex(iv1, 0);
|
||||
GridPane.setColumnIndex(iv1, 2);
|
||||
|
||||
mainPane.getChildren().add(iv1);
|
||||
}
|
||||
|
||||
NumberAxis xAxis = new NumberAxis();
|
||||
final NumberAxis yAxis = new NumberAxis();
|
||||
private void createChart() {
|
||||
|
||||
xAxis.setLabel("Segundos");
|
||||
yAxis.setLabel("Batimentos");
|
||||
//creating the chart
|
||||
final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
|
||||
|
||||
lineChart.setTitle("PiFit");
|
||||
GridPane.setRowIndex(lineChart, 3);
|
||||
GridPane.setColumnIndex(lineChart, 1);
|
||||
|
||||
//defining a series
|
||||
series = new XYChart.Series();
|
||||
series.setName("Frequência Cardíaca");
|
||||
|
||||
lineChart.getData().add(series);
|
||||
|
||||
mainPane.getChildren().add(lineChart);
|
||||
}
|
||||
|
||||
private void createLabels() {
|
||||
Font fntLabel = Font.font("Terminus", FontWeight.NORMAL, 40);
|
||||
|
||||
Font fntLabelValor = Font.font("Terminus", FontWeight.BOLD, 50);
|
||||
|
||||
Label lblFrequenciaCardiaca = new Label("Freq. Cardíaca");
|
||||
lblFrequenciaCardiaca.setFont(fntLabel);
|
||||
GridPane.setRowIndex(lblFrequenciaCardiaca, 5);
|
||||
GridPane.setColumnIndex(lblFrequenciaCardiaca, 1);
|
||||
|
||||
lblFrequenciaCardiacaValor = new Label("--");
|
||||
lblFrequenciaCardiacaValor.setFont(fntLabelValor);
|
||||
GridPane.setRowIndex(lblFrequenciaCardiacaValor, 6);
|
||||
GridPane.setColumnIndex(lblFrequenciaCardiacaValor, 1);
|
||||
/*
|
||||
Label lblTemperatura = new Label("Temp. Corporal");
|
||||
GridPane.setRowIndex(lblTemperatura, 8);
|
||||
GridPane.setColumnIndex(lblTemperatura, 1);
|
||||
|
||||
Label lblTemperaturaValor = new Label("37");
|
||||
|
||||
GridPane.setRowIndex(lblTemperaturaValor, 9);
|
||||
GridPane.setColumnIndex(lblTemperaturaValor, 1);
|
||||
* mainPane.getChildren().addAll(lblFrequenciaCardiaca, lblFrequenciaCardiacaValor, lblTemperatura, lblTemperaturaValor);
|
||||
*/
|
||||
mainPane.getChildren().addAll(lblFrequenciaCardiaca, lblFrequenciaCardiacaValor);
|
||||
}
|
||||
|
||||
List<XYChart.Data> temp = new ArrayList<>();
|
||||
private void addChartEntry(Integer x, Integer y) {
|
||||
|
||||
/*if (series.getData().size() > 20) {
|
||||
series.getData().remove(0);
|
||||
}
|
||||
* */
|
||||
|
||||
//System.out.println("Tamanho do temp: "+temp.size());
|
||||
this.lblFrequenciaCardiacaValor.setText(y.toString());
|
||||
//adiciona o valor no grafico
|
||||
/*if(cont > 5){
|
||||
series.getData().remove(0);
|
||||
xAxis.setLowerBound(cont-5);
|
||||
series.getData().add(new XYChart.Data(cont, y));*/
|
||||
/* System.out.println("maior que 5");
|
||||
for(int i=1;i<=5;i++){
|
||||
System.out.println(i);
|
||||
temp.set(i-1, temp.get(i));
|
||||
series.getData().set(i-1, temp.get(i));
|
||||
}
|
||||
temp.set(5, new XYChart.Data(cont,y));
|
||||
series.getData().set(5, new XYChart.Data(cont,y));*/
|
||||
|
||||
|
||||
//series.setData(new ObservableListWrapper(temp));
|
||||
//series.getData().add(new XYChart.Data(cont-1, y));
|
||||
//}else{
|
||||
// temp.add(new XYChart.Data(cont, y));
|
||||
// if(cont > 5){
|
||||
series.getData().add(new XYChart.Data(cont, y));
|
||||
//series.getData().remove(0);
|
||||
//System.out.println("lowerbound: "+xAxis.getLowerBound());
|
||||
//xAxis.setLowerBound(xAxis.getLowerBound()+1);
|
||||
// }else{
|
||||
// series.getData().add(new XYChart.Data(cont, y));
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
cont++;
|
||||
}
|
||||
|
||||
public void looping() throws Exception {
|
||||
}
|
||||
|
||||
public class Looping extends TimerTask {
|
||||
//String porta = "COM5";
|
||||
String porta = "/dev/ttyUSB0";
|
||||
|
||||
private boolean iniciou = false;
|
||||
private int cont = 0;
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
if (!iniciou) {
|
||||
System.out.println("porta " + porta);
|
||||
System.setProperty("gnu.io.rxtx.SerialPorts", porta);
|
||||
FrequenciaCardiacaManager.iniciar(porta);
|
||||
iniciou = true;
|
||||
}
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
|
||||
FrequenciaCardiaca fc = null;
|
||||
fc = FrequenciaCardiacaManager.ler(); //read
|
||||
|
||||
if(fc != null){
|
||||
//cont++;
|
||||
//addChartEntry(series.getData().size(), fc.getBatimentos());
|
||||
addChartEntry(cont, fc.getBatimentos());
|
||||
}else{
|
||||
addChartEntry(cont, 0);
|
||||
}
|
||||
//FrequenciaCardiacaManager.encerrar();
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(PiFit.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(PiFit.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(PiFit.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Depois Largura: | Altura: | Tamanho: 580 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 MiB |
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Document : newCascadeStyleSheet
|
||||
Created on : 13/07/2013, 12:20:45
|
||||
Author : Rogério
|
||||
Description:
|
||||
Purpose of the stylesheet follows.
|
||||
*/
|
||||
|
||||
root {
|
||||
display: block;
|
||||
}
|
||||
.root{
|
||||
-fx-background-image: url("bg_1024.png");
|
||||
-fx-background-repeat: stretch;
|
||||
}
|
||||
.heart{
|
||||
-fx-alignment: TOP_RIGHT;
|
||||
|
||||
}
|
||||
|
Depois Largura: | Altura: | Tamanho: 54 KiB |
|
Depois Largura: | Altura: | Tamanho: 7.8 KiB |
@@ -0,0 +1,74 @@
|
||||
<?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. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="LcdI2C" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project LcdI2C.</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. They 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-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
||||
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="LcdI2C-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
Sealed: true
|
||||
Main-Class: twitter.pi.Tweet4Pi
|
||||
Class-Path: lib/things-api-1.0-SNAPSHOT.jar lib/twitter4j-core-3.0.3.jar lib/pi4j-core.jar
|
||||
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=4f0df28c
|
||||
build.xml.script.CRC32=252d0b9c
|
||||
build.xml.stylesheet.CRC32=28e38971@1.56.1.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=4f0df28c
|
||||
nbproject/build-impl.xml.script.CRC32=1cf003ca
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
|
||||
@@ -0,0 +1,7 @@
|
||||
compile.on.save=true
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
file.reference.pi4j-core.jar-1=/media/vsenger/Vinicius/Education/2013-JavaOneUS/java/LcdI2C/lib/pi4j-core.jar
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
user.properties.file=/home/vsenger/.netbeans/7.3.1/build.properties
|
||||
@@ -0,0 +1,86 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=LcdI2C
|
||||
application.vendor=vsenger
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/LcdI2C.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.pi4j-core.jar-1=lib/pi4j-core.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
jar.compress=false
|
||||
jar.index=${jnlp.enabled}
|
||||
javac.classpath=\
|
||||
${file.reference.pi4j-core.jar-1}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.7
|
||||
javac.target=1.7
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
jnlp.codebase.type=no.codebase
|
||||
jnlp.descriptor=application
|
||||
jnlp.enabled=false
|
||||
jnlp.mixed.code=default
|
||||
jnlp.offline-allowed=false
|
||||
jnlp.signed=false
|
||||
jnlp.signing=
|
||||
jnlp.signing.alias=
|
||||
jnlp.signing.keystore=
|
||||
main.class=lcd.LcdAdafruit
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||