fixed bug with color 'Rot'
added inverted text colors updates 'Ueber'-Button Dialog
This commit is contained in:
parent
77c387bfd0
commit
e924ee3036
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -8,7 +8,6 @@ import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
|
|
||||||
class DBController
|
class DBController
|
||||||
{
|
{
|
||||||
|
@ -19,6 +18,7 @@ class DBController
|
||||||
|
|
||||||
public String dbname;
|
public String dbname;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private Main main;
|
private Main main;
|
||||||
|
|
||||||
public void main()
|
public void main()
|
||||||
|
@ -75,7 +75,7 @@ class DBController
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// table Position section
|
// table Position section
|
||||||
public void createTablePositionen()
|
public void createTablePositionen()
|
||||||
|
@ -93,7 +93,7 @@ class DBController
|
||||||
|
|
||||||
// create 25 demo/default data entries
|
// create 25 demo/default data entries
|
||||||
for (int i = 0; i < 25; i++) {
|
for (int i = 0; i < 25; i++) {
|
||||||
fillPositionen(i + 1, "Noch frei", (float) 0.00, "#FAF0E6");
|
fillPositionen(i + 1, "Noch frei", (float) 0.00, "#ad0000");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,16 @@
|
||||||
package application;
|
package application;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.security.GeneralSecurityException;
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import javafx.animation.Animation;
|
import javafx.animation.Animation;
|
||||||
import javafx.animation.KeyFrame;
|
import javafx.animation.KeyFrame;
|
||||||
import javafx.animation.Timeline;
|
import javafx.animation.Timeline;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.application.Platform;
|
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.geometry.Insets;
|
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
import javafx.util.Pair;
|
|
||||||
import javafx.scene.Node;
|
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Alert;
|
|
||||||
import javafx.scene.control.Alert.AlertType;
|
|
||||||
import javafx.scene.control.ButtonBar.ButtonData;
|
|
||||||
import javafx.scene.control.ButtonType;
|
|
||||||
import javafx.scene.control.Dialog;
|
|
||||||
import javafx.scene.control.Label;
|
|
||||||
import javafx.scene.control.PasswordField;
|
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.image.Image;
|
|
||||||
import javafx.scene.image.ImageView;
|
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.GridPane;
|
|
||||||
|
|
||||||
public class Main extends Application
|
public class Main extends Application
|
||||||
{
|
{
|
||||||
|
@ -70,7 +48,7 @@ public class Main extends Application
|
||||||
|
|
||||||
Timeline timeline = new Timeline(
|
Timeline timeline = new Timeline(
|
||||||
new KeyFrame(Duration.seconds(1), ev -> {
|
new KeyFrame(Duration.seconds(1), ev -> {
|
||||||
mwc.updateTimeLabel(); //update time
|
mwc.updateTimeLabel(); // update time
|
||||||
}));
|
}));
|
||||||
timeline.setCycleCount(Animation.INDEFINITE);
|
timeline.setCycleCount(Animation.INDEFINITE);
|
||||||
timeline.play();
|
timeline.play();
|
||||||
|
|
|
@ -2,11 +2,7 @@ package application;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.scene.Node;
|
|
||||||
import javafx.scene.control.Alert;
|
|
||||||
import javafx.scene.control.Alert.AlertType;
|
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.ButtonBar.ButtonData;
|
|
||||||
import javafx.scene.control.ButtonType;
|
import javafx.scene.control.ButtonType;
|
||||||
import javafx.scene.control.Dialog;
|
import javafx.scene.control.Dialog;
|
||||||
import javafx.scene.control.TreeTableColumn;
|
import javafx.scene.control.TreeTableColumn;
|
||||||
|
@ -16,46 +12,29 @@ import javafx.scene.control.TreeItem;
|
||||||
import javafx.scene.control.TitledPane;
|
import javafx.scene.control.TitledPane;
|
||||||
import javafx.scene.control.Tooltip;
|
import javafx.scene.control.Tooltip;
|
||||||
import javafx.scene.control.ChoiceBox;
|
import javafx.scene.control.ChoiceBox;
|
||||||
import java.awt.Desktop;
|
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
import java.awt.datatransfer.Clipboard;
|
import java.awt.datatransfer.Clipboard;
|
||||||
import java.awt.datatransfer.StringSelection;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import javax.security.auth.callback.Callback;
|
|
||||||
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.TitlePaneLayout;
|
|
||||||
import javafx.application.Platform;
|
|
||||||
import javafx.beans.value.ChangeListener;
|
import javafx.beans.value.ChangeListener;
|
||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.ListCell;
|
|
||||||
import javafx.scene.control.ListView;
|
|
||||||
import javafx.scene.control.PasswordField;
|
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
|
|
||||||
public class MainWindowController
|
public class MainWindowController
|
||||||
{
|
{
|
||||||
private static final String String = null;
|
|
||||||
|
|
||||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||||
|
|
||||||
|
@ -273,6 +252,7 @@ public class MainWindowController
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tftNewDBName;
|
private TextField tftNewDBName;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private Main main;
|
private Main main;
|
||||||
|
|
||||||
private DBController dbc;
|
private DBController dbc;
|
||||||
|
@ -285,10 +265,8 @@ public class MainWindowController
|
||||||
private String selectedColorName;
|
private String selectedColorName;
|
||||||
|
|
||||||
private String databaseName;
|
private String databaseName;
|
||||||
|
|
||||||
private boolean lockState = false;
|
|
||||||
|
|
||||||
|
|
||||||
|
private boolean lockState = false;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
TreeItem<tableData> rootCurrentJob = new TreeItem<>(
|
TreeItem<tableData> rootCurrentJob = new TreeItem<>(
|
||||||
|
@ -311,7 +289,7 @@ public class MainWindowController
|
||||||
Dialog<Pair<String, String>> dialog = new Dialog<>();
|
Dialog<Pair<String, String>> dialog = new Dialog<>();
|
||||||
dialog.setTitle("Über jFxKasse");
|
dialog.setTitle("Über jFxKasse");
|
||||||
dialog.setHeaderText(
|
dialog.setHeaderText(
|
||||||
"Informationen und Lizenzen - Version 0.9 - Techdemo");
|
"Informationen und Lizenzen - Version 0.9.1 - Techdemo");
|
||||||
|
|
||||||
dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
|
dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
|
||||||
|
|
||||||
|
@ -320,11 +298,16 @@ public class MainWindowController
|
||||||
grid.setVgap(10);
|
grid.setVgap(10);
|
||||||
grid.setPadding(new Insets(20, 150, 10, 10));
|
grid.setPadding(new Insets(20, 150, 10, 10));
|
||||||
|
|
||||||
grid.add(new Label("Datenbank: sqlite.org - Public Domain"
|
grid.add(new Label(
|
||||||
+ " \nUI Design: eclipse.org/efxclipse/install.html - Eclipse Public License 1.0"
|
"Einfaches Kassensystem für kleine bis mittel große Veranstaltungen mit Bon-Drucker\n"
|
||||||
+ " \nUI - Datenbank Integration: basierend auf Project-HomeFlix - github.com/Seil0/Project-HomeFlix - GPLv3 \n"
|
+ "\nUnter Lizenz GPL-3.0 abrufbar auf https://github.com/Windoofs/jFxKasse\n"
|
||||||
+ " \nMaintainer: hendrik.schutter@coptersicht.de"
|
+ "\nDatenbank: sqlite.org - Public Domain"
|
||||||
+ " \n(c) 2018 Hendrik Schutter"), 0, 0);
|
+ " \nUI Design01: eclipse.org/efxclipse/install.html - Eclipse Public License 1.0"
|
||||||
|
+ " \nUI Design02: http://www.jfoenix.com/ - Apache License 2.0"
|
||||||
|
+ " \nUI - Datenbank Integration: basierend auf Project-HomeFlix - github.com/Seil0/Project-HomeFlix - GPLv3 \n"
|
||||||
|
+ " \nMaintainer: hendrik.schutter@coptersicht.de"
|
||||||
|
+ " \n(c) 2018 Hendrik Schutter"),
|
||||||
|
0, 0);
|
||||||
|
|
||||||
dialog.getDialogPane().setContent(grid); // Setzt die GridPane auf die
|
dialog.getDialogPane().setContent(grid); // Setzt die GridPane auf die
|
||||||
dialog.setResizable(true); // DialogPane
|
dialog.setResizable(true); // DialogPane
|
||||||
|
@ -407,16 +390,15 @@ public class MainWindowController
|
||||||
public void btnLockAction(ActionEvent event)
|
public void btnLockAction(ActionEvent event)
|
||||||
{
|
{
|
||||||
lockState = !lockState;
|
lockState = !lockState;
|
||||||
|
|
||||||
blockUI(lockState);
|
blockUI(lockState);
|
||||||
|
|
||||||
|
if (lockState) {
|
||||||
if(lockState) {
|
|
||||||
btnLock.setText("Kasse entsperren");
|
btnLock.setText("Kasse entsperren");
|
||||||
}else {
|
} else {
|
||||||
btnLock.setText("Kasse sperren");
|
btnLock.setText("Kasse sperren");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -685,6 +667,20 @@ public class MainWindowController
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Tooltip tooltipName = new Tooltip();
|
||||||
|
tooltipName.setText("Name der neuen Position");
|
||||||
|
tooltipName.setStyle("-fx-font: normal bold 20 Cantarell; "
|
||||||
|
+ "-fx-base: #AE3522; " + "-fx-text-fill: orange;");
|
||||||
|
tftNewPosition.setTooltip(tooltipName);
|
||||||
|
|
||||||
|
final Tooltip tooltipValue = new Tooltip();
|
||||||
|
tooltipValue
|
||||||
|
.setText("Preis der neuen Position.\nPunkt als Trennzeichen!");
|
||||||
|
tooltipValue.setStyle("-fx-font: normal bold 20 Cantarell; "
|
||||||
|
+ "-fx-base: #AE3522; " + "-fx-text-fill: orange;");
|
||||||
|
tftNewValue.setTooltip(tooltipValue);
|
||||||
|
labelNewValue.setTooltip(tooltipValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMain(Main main, DBController dbc)
|
public void setMain(Main main, DBController dbc)
|
||||||
|
@ -762,7 +758,7 @@ public class MainWindowController
|
||||||
{
|
{
|
||||||
switch (pColorName) {
|
switch (pColorName) {
|
||||||
case "Rot":
|
case "Rot":
|
||||||
return "#FF0000";
|
return "#ad0000";
|
||||||
case "Orange":
|
case "Orange":
|
||||||
return "#FF4500";
|
return "#FF4500";
|
||||||
case "Braun":
|
case "Braun":
|
||||||
|
@ -786,7 +782,7 @@ public class MainWindowController
|
||||||
private String getColorNames(String pColorCode)
|
private String getColorNames(String pColorCode)
|
||||||
{
|
{
|
||||||
switch (pColorCode) {
|
switch (pColorCode) {
|
||||||
case "#FF0000":
|
case "#ad0000":
|
||||||
return "Rot";
|
return "Rot";
|
||||||
case "#FF4500":
|
case "#FF4500":
|
||||||
return "Orange";
|
return "Orange";
|
||||||
|
@ -794,7 +790,7 @@ public class MainWindowController
|
||||||
return "Braun";
|
return "Braun";
|
||||||
case "#FAF0E6":
|
case "#FAF0E6":
|
||||||
return "Weiß";
|
return "Weiß";
|
||||||
case "#FFD700b":
|
case "#FFD700":
|
||||||
return "Gelb";
|
return "Gelb";
|
||||||
case "#556B2F":
|
case "#556B2F":
|
||||||
return "Gr\u00fcn";
|
return "Gr\u00fcn";
|
||||||
|
@ -811,7 +807,7 @@ public class MainWindowController
|
||||||
private Integer getColorID(String pColorCode)
|
private Integer getColorID(String pColorCode)
|
||||||
{
|
{
|
||||||
switch (pColorCode) {
|
switch (pColorCode) {
|
||||||
case "#FF0000":
|
case "#ad0000":
|
||||||
return 0;
|
return 0;
|
||||||
case "#FF4500":
|
case "#FF4500":
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -819,7 +815,7 @@ public class MainWindowController
|
||||||
return 2;
|
return 2;
|
||||||
case "#FAF0E6":
|
case "#FAF0E6":
|
||||||
return 3;
|
return 3;
|
||||||
case "#FFD700b":
|
case "#FFD700":
|
||||||
return 4;
|
return 4;
|
||||||
case "#556B2F":
|
case "#556B2F":
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -843,10 +839,10 @@ public class MainWindowController
|
||||||
btnSaveEntry.setDisable(pState);
|
btnSaveEntry.setDisable(pState);
|
||||||
btnCancelJob.setDisable(pState);
|
btnCancelJob.setDisable(pState);
|
||||||
|
|
||||||
for(int i = 0; i < 25; i++) {
|
for (int i = 0; i < 25; i++) {
|
||||||
getButtonByID(i).setDisable(pState);
|
getButtonByID(i).setDisable(pState);
|
||||||
}
|
}
|
||||||
|
|
||||||
tftNewPosition.setDisable(pState);
|
tftNewPosition.setDisable(pState);
|
||||||
tftNewValue.setDisable(pState);
|
tftNewValue.setDisable(pState);
|
||||||
colorChoise.setDisable(pState);
|
colorChoise.setDisable(pState);
|
||||||
|
@ -865,28 +861,34 @@ public class MainWindowController
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < 25; i++) {
|
for (int i = 0; i < 25; i++) {
|
||||||
|
|
||||||
getButtonByID(i).setText(dbc.getName(i+1));
|
getButtonByID(i).setText(dbc.getName(i + 1));
|
||||||
getButtonByID(i).setStyle("-fx-background-color: "+ dbc.getColor(i+1) +";");
|
|
||||||
|
if ((getColorID(dbc.getColor(i + 1)) == 0)
|
||||||
|
|| (getColorID(dbc.getColor(i + 1)) == 7)) {
|
||||||
|
getButtonByID(i).setStyle("-fx-background-color: "
|
||||||
|
+ dbc.getColor(i + 1) + "; -fx-text-fill: white;");
|
||||||
|
} else {
|
||||||
|
getButtonByID(i).setStyle("-fx-background-color: "
|
||||||
|
+ dbc.getColor(i + 1) + "; -fx-text-fill: black;");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 25; i++) {
|
for (int i = 0; i < 25; i++) {
|
||||||
|
|
||||||
if(dbc.getName(i+1).equals("Noch frei")) {
|
if (dbc.getName(i + 1).equals("Noch frei")) {
|
||||||
getButtonByID(i).setVisible(false);
|
getButtonByID(i).setVisible(false);
|
||||||
}else {
|
} else {
|
||||||
getButtonByID(i).setVisible(true);
|
getButtonByID(i).setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Button getButtonByID(int pID) {
|
public Button getButtonByID(int pID)
|
||||||
|
{
|
||||||
switch (pID) {
|
switch (pID) {
|
||||||
case 0:
|
case 0:
|
||||||
return gridButton01;
|
return gridButton01;
|
||||||
|
@ -942,9 +944,10 @@ public class MainWindowController
|
||||||
return gridButton01;
|
return gridButton01;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTimeLabel () {
|
public void updateTimeLabel()
|
||||||
//System.out.println(getSystemTime());
|
{
|
||||||
|
// System.out.println(getSystemTime());
|
||||||
labelTime.setText("Uhrzeit: " + getSystemTime());
|
labelTime.setText("Uhrzeit: " + getSystemTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue