Skip to content

Commit

Permalink
Some changes in channel tab and some CSS styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tainfante committed Dec 22, 2017
1 parent 114fa50 commit 571276e
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 1,356 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,317 changes: 0 additions & 1,317 deletions .idea/workspace.xml___jb_tmp___

This file was deleted.

42 changes: 41 additions & 1 deletion src/mainwindow/Channel.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
package mainwindow;

public class Channel {
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.TextField;
import javafx.scene.paint.Color;

import java.net.URL;
import java.util.ResourceBundle;

public class Channel implements Initializable{

@FXML
private TextField nameText;
@FXML
private TextField unitText;
@FXML
private ChoiceBox channelBox;
@FXML
private ColorPicker colorPicker;

@Override
public void initialize(URL location, ResourceBundle resources) {
channelBox.getItems().add("Channel 1");
channelBox.getItems().add("Channel 2");
channelBox.getItems().add("Channel 3");
channelBox.getItems().add("Channel 4");
channelBox.getItems().add("Channel 5");
channelBox.getItems().add("Channel 6");
channelBox.getItems().add("Channel 7");
channelBox.getItems().add("Channel 8");
}

public void onSetAction(ActionEvent actionEvent) {
String channel=(String)channelBox.getSelectionModel().getSelectedItem();
String name=nameText.getText();
String units=unitText.getText();
Color color=colorPicker.getValue();

}
}
38 changes: 30 additions & 8 deletions src/mainwindow/Chart.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;

import java.net.URL;
import java.util.ResourceBundle;
Expand All @@ -25,20 +27,40 @@ public class Chart implements Initializable {
CategoryAxis xAxis = new CategoryAxis();
@FXML
NumberAxis yAxis = new NumberAxis();
@FXML
public CheckBox checkOne;
@FXML
public CheckBox checkTwo;
@FXML
public CheckBox checkThree;
@FXML
public CheckBox checkFour;
@FXML
public CheckBox checkFive;
@FXML
public CheckBox checkSix;
@FXML
public CheckBox checkSeven;
@FXML
public CheckBox checkEight;

@Override
public void initialize(URL location, ResourceBundle resources) {
xAxis.setLabel("Time");
lchart.setTitle("Serial Data");
series_1.setName("1");
series_1.setName("2");
series_1.setName("3");
series_1.setName("4");
series_1.setName("5");
series_1.setName("6");
series_1.setName("7");
series_1.setName("8");
lchart.getStyleClass().add("title");
series_1.setName("Channel 1");
series_2.setName("Channel 2");
series_3.setName("Channel 3");
series_4.setName("Channel 4");
series_5.setName("Channel 5");
series_6.setName("Channel 6");
series_7.setName("Channel 7");
series_8.setName("Channel 8");
lchart.getData().addAll(series_1,series_2,series_3,series_4,series_5,series_6,series_7,series_8);
lchart.setLegendVisible(false);



}

Expand Down
15 changes: 6 additions & 9 deletions src/mainwindow/channel.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="mainwindow.Channel"
prefHeight="400.0" prefWidth="600.0">
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="mainwindow.Channel">
<children>
<TextField layoutX="46.0" layoutY="118.0" />
<TextField layoutX="217.0" layoutY="118.0" />
<ColorPicker layoutX="396.0" layoutY="118.0" />
<Button layoutX="45.0" layoutY="149.0" mnemonicParsing="false" text="Set" />
<ChoiceBox layoutX="45.0" layoutY="53.0" prefWidth="150.0" />
<TextField fx:id="nameText" layoutX="46.0" layoutY="118.0" />
<TextField fx:id="unitText" layoutX="217.0" layoutY="118.0" />
<ColorPicker fx:id="colorPicker" layoutX="396.0" layoutY="118.0" />
<Button layoutX="45.0" layoutY="149.0" mnemonicParsing="false" onAction="#onSetAction" text="Set" />
<ChoiceBox fx:id="channelBox" layoutX="45.0" layoutY="53.0" prefWidth="150.0" />
<Label layoutX="48.0" layoutY="26.0" prefHeight="17.0" prefWidth="149.0" text="Choose channel" />
<Label layoutX="45.0" layoutY="91.0" prefHeight="17.0" prefWidth="152.0" text="Set curve name" />
<Label layoutX="217.0" layoutY="91.0" prefHeight="17.0" prefWidth="151.0" text="Set units" />
Expand Down
18 changes: 8 additions & 10 deletions src/mainwindow/chart.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
<center>
<LineChart fx:id="lchart" layoutY="37.0" prefHeight="226.0" prefWidth="455.0">

<Legend styleClass="legend" alignment="BOTTOM_CENTER"/>

<xAxis>
<CategoryAxis fx:id="xAxis" side="BOTTOM" />
</xAxis>
Expand All @@ -32,14 +30,14 @@
</center>
<right>
<VBox spacing="10.0" BorderPane.alignment="CENTER" styleClass="background">
<CheckBox layoutX="474.0" layoutY="87.0" mnemonicParsing="false" text="Channel 1" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="104.0" mnemonicParsing="false" text="Channel 2" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="121.0" mnemonicParsing="false" text="Channel 3" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="142.0" mnemonicParsing="false" text="Channel 4" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="161.0" mnemonicParsing="false" text="Channel 5" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="178.0" mnemonicParsing="false" text="Channel 6" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="53.0" mnemonicParsing="false" text="Channel 7" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="70.0" mnemonicParsing="false" text="Channel 8" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="87.0" mnemonicParsing="false" fx:id="checkOne" text="Channel 1" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="104.0" mnemonicParsing="false" fx:id="checkTwo" text="Channel 2" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="121.0" mnemonicParsing="false" fx:id="checkThree" text="Channel 3" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="142.0" mnemonicParsing="false" fx:id="checkFour" text="Channel 4" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="161.0" mnemonicParsing="false" fx:id="checkFive" text="Channel 5" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="178.0" mnemonicParsing="false" fx:id="checkSix" text="Channel 6" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="53.0" mnemonicParsing="false" fx:id="checkSeven" text="Channel 7" styleClass="checkedBox"/>
<CheckBox layoutX="474.0" layoutY="70.0" mnemonicParsing="false" fx:id="checkEight" text="Channel 8" styleClass="checkedBox"/>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
Expand Down
8 changes: 4 additions & 4 deletions src/mainwindow/portView.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@

<?import java.net.URL?>
<HBox alignment="BASELINE_LEFT" prefHeight="25.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="mainwindow.PortController">
xmlns:fx="http://javafx.com/fxml/1" fx:controller="mainwindow.PortController" styleClass="background">
<stylesheets>
<URL value="@../stylesheets/PortCSS.css"/>
</stylesheets>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<children>
<Label prefHeight="25.0" prefWidth="65.0" text="Port COM:" />
<Label prefHeight="25.0" prefWidth="65.0" text="Port COM:" styleClass="labels"/>
<ComboBox fx:id="selectPortComboBox" onAction="#onActionPortComboBox" onMouseClicked="#onMouseClickedSelectPort" prefWidth="200.0" />
<Label onMouseClicked="#onMouseClickedSelectPort" prefHeight="29.0" prefWidth="55.0" text="Baudrate:">
<Label onMouseClicked="#onMouseClickedSelectPort" prefHeight="29.0" prefWidth="55.0" text="Baudrate:" styleClass="labels">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
</Label>
<ComboBox fx:id="selectBaudrateComboBox" editable="true" onAction="#onActionSelectBaudrate" onDragEntered="#onActionSelectBaudrate" prefWidth="150.0" />

<Region maxWidth="Infinity" HBox.hgrow="ALWAYS" />
<Button fx:id="connectButton" mnemonicParsing="false" onAction="#onActionConnectButton" text="Connect">
<Button fx:id="connectButton" mnemonicParsing="false" onAction="#onActionConnectButton" text="Connect" styleClass="buttons">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
Expand Down
8 changes: 5 additions & 3 deletions src/stylesheets/ChartCSS.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

}
.background {
-fx-background-color: #444444;
-fx-background-color: #CCCCFF;
}
.checkedBox{
-fx-text-fill: yellow;
-fx-text-fill: #000066;
-fx-font-size: 15px;
}
.uncheckedBox{

}
.title{
-fx-text-fill: #000066;
-fx-font-size: 20px;

}
.axis{

}
#lchart{
-fx-background-color: #444444;
-fx-background-color: #CCCCFF;


}
Expand Down
13 changes: 10 additions & 3 deletions src/stylesheets/PortCSS.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
.buttons{
-fx-border-radius: 5;
-fx-background-color: #DFB951;
-fx-border-color: #222222;
-fx-text-fill: #333333;
-fx-background-color: #CCCCFF;
-fx-border-color: #000066;
-fx-text-fill: #000066;
}
.background{
-fx-background-color: #000066;
}
.labels{
-fx-text-fill: white;
-fx-font-size: 12px;
}

0 comments on commit 571276e

Please sign in to comment.