Compare commits
40 Commits
3.0.1
..
778402910f
| Author | SHA1 | Date | |
|---|---|---|---|
| 778402910f | |||
| b66958697b | |||
| b406ee3e0b | |||
| f08c67cf79 | |||
| 0d761c2ab2 | |||
| 0d28b37a93 | |||
| cf8f8589d8 | |||
| 7e356c6c6a | |||
| 1188c65802 | |||
| 809c571398 | |||
| b050e500e6 | |||
| fd6f074dda | |||
| 1dfdab763b | |||
| 2fb7e24aac | |||
| e123721e18 | |||
| 2ad2d85c58 | |||
| 342f62dedd | |||
| 18a849dfa6 | |||
| 1b589d0fb5 | |||
| ee552e647c | |||
| 624c2bf388 | |||
| e93004ee0d | |||
| 6284ac0663 | |||
| 89d30b8ac9 | |||
| 9cc55be771 | |||
| 71b06ff075 | |||
| 5344efd62c | |||
| 6fb81c27aa | |||
| 2eb3b4e18d | |||
| 235b07763b | |||
| 68eb4e3be4 | |||
| a29fb6d0f5 | |||
| c52dbcd716 | |||
| fe078f9fb8 | |||
| c2942a7455 | |||
| 69243d9cb2 | |||
| 1d4056bc99 | |||
| c676ae8400 | |||
| deb2f49fb6 | |||
| ded6accd29 |
Generated
+2
-2
@@ -1,11 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Main" type="Application" factoryName="Application" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="fi.lpam.ruokamanageri.Main" />
|
||||
<option name="MAIN_CLASS_NAME" value="fi.lpam.Main" />
|
||||
<module name="Ruokamanageri" />
|
||||
<option name="PROGRAM_PARAMETERS" value="DEV" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="fi.lpam.ruokamanageri.*" />
|
||||
<option name="PATTERN" value="fi.lpam.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="PROJECT" dialect="SQLite" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +1,6 @@
|
||||
# [LICENSE](LICENSE)
|
||||
|
||||
# [Versiohistoria](CHANGELOG.md)
|
||||
# [Versiohistoria](src/main/resources/CHANGELOG.md)
|
||||
|
||||
# Kuvaus
|
||||
Pienen kotiateriapalvelun käyttöön rakennettu ohjelma sisältäen seuraavat ominaisuudet
|
||||
@@ -9,19 +9,19 @@ Pienen kotiateriapalvelun käyttöön rakennettu ohjelma sisältäen seuraavat o
|
||||
- Kuljetuslistojen luominen
|
||||
- Kuljetettujen määrien raportointi
|
||||
|
||||
## Toteutus
|
||||
# Toteutus
|
||||
- SQLite tietokanta
|
||||
- JavaFX GUI
|
||||
- Java 25
|
||||
- Maven
|
||||
|
||||
## Käyttöönotto
|
||||
# Käyttöönotto
|
||||
- Vaatimukset
|
||||
- Windows
|
||||
- Windows (Linux melkein täydellisellä yhteensopivuudella)
|
||||
- Java 25+
|
||||
- Usean tietokoneen käyttöön OneDrive -tili (samanaikaisuus ei tuettu)
|
||||
- Lataa haluamasi julkaisuversio lähdekoodista
|
||||
- Maven `package` komennolla projektista luodaan .jar tiedosto
|
||||
- .jar tiedosto sisältää kaikki riippuvuudet
|
||||
- Tietokantatiedosto asuu osoitteessa `$KOTIKANSIO/OneDrive/Kuljetusruokasovellus/tietokanta.db`
|
||||
- Lataa haluamasi ohjelmaversio julkaisuista
|
||||
- Aja .JAR tiedosto
|
||||
- Tietokanta sijaitsee osoitteessa `~/OneDrive/Kuljetusruokasovellus/tietokanta.db`
|
||||
- Asetukset sijaitsee osoitteessa `~/OneDrive/Kuljetusruokasovellus/asetukset.properties`
|
||||
- Ohjelma luo tietokannan, mikäli sitä ei löydy.
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fi.lpam.ruokamanageri</groupId>
|
||||
<artifactId>Ruokamanageri</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.2.0</version>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>25</maven.compiler.source>
|
||||
@@ -43,26 +43,31 @@
|
||||
<dependency>
|
||||
<groupId>com.dlsc.gemsfx</groupId>
|
||||
<artifactId>gemsfx</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<version>4.0.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>pdfbox</artifactId>
|
||||
<version>3.0.6</version>
|
||||
<version>3.0.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.3.5</version>
|
||||
<version>1.3.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.51.2.0</version>
|
||||
<version>3.53.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>one.jpro.platform</groupId>
|
||||
<artifactId>jpro-mdfx</artifactId>
|
||||
<version>0.6.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -92,7 +97,7 @@
|
||||
<!-- Usage: mvn clean javafx:run -->
|
||||
<id>default-cli</id>
|
||||
<configuration>
|
||||
<mainClass>fi.lpam.ruokamanageri.Main</mainClass>
|
||||
<mainClass>fi.lpam.Main</mainClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
@@ -114,7 +119,7 @@
|
||||
<transformers>
|
||||
<transformer implementation=
|
||||
"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>fi.lpam.ruokamanageri.Main</mainClass>
|
||||
<mainClass>fi.lpam.Main</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package fi.lpam;
|
||||
import fi.lpam.dataluokat.Tietokanta;
|
||||
import fi.lpam.gui.*;
|
||||
import fi.lpam.gui.elementit.MuutosIlmoitus;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Side;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@SuppressWarnings("InstantiationOfUtilityClass")
|
||||
public class App extends Application {
|
||||
TabPohja asiakasHallinta, kierrostenHallinta, kuljetusListat, kuljetetut, asetukset;
|
||||
|
||||
static void main() {
|
||||
launch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
new Tietokanta(Main.dev);
|
||||
|
||||
StringBuilder title = new StringBuilder();
|
||||
title.append("Ruokamanageri");
|
||||
title.append(" v").append(Main.properties.getProperty("version"));
|
||||
if (Main.dev) title.append(" KEHITYS");
|
||||
primaryStage.setTitle(title.toString());
|
||||
|
||||
primaryStage.setMaximized(true);
|
||||
|
||||
primaryStage.getIcons().add(new Image(Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream("kuljetusruokalaatikko.jpg"))));
|
||||
|
||||
TabPane tabPane = new TabPane();
|
||||
tabPane.setSide(Side.LEFT);
|
||||
tabPane.setTabMinWidth(50);
|
||||
tabPane.setTabMinHeight(Double.parseDouble(Main.properties.getProperty("buttonFonttiKoko"))*2);
|
||||
tabPane.setTabMaxHeight(Double.parseDouble(Main.properties.getProperty("buttonFonttiKoko"))*2);
|
||||
|
||||
asiakasHallinta = new Asiakashallinta();
|
||||
kierrostenHallinta = new Kierroshallinta();
|
||||
kuljetusListat = new KuljetusListat();
|
||||
kuljetetut = new KuljetusRaportit();
|
||||
asetukset = new Asetukset();
|
||||
tabPane.getTabs().addAll(asiakasHallinta, kierrostenHallinta, kuljetusListat, kuljetetut, asetukset);
|
||||
|
||||
Scene scene = new Scene(tabPane);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
|
||||
if (!Main.properties.getProperty("version").equals(Main.properties.getProperty("viimeisinVersio", "0.0.0"))) new MuutosIlmoitus();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package fi.lpam;
|
||||
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Main {
|
||||
public static boolean dev;
|
||||
public static Properties properties;
|
||||
|
||||
public static final File asetustiedosto = Path.of(SystemUtils.getUserHome().getAbsolutePath(), "OneDrive", "Kuljetusruokasovellus", "asetukset.properties").toFile();
|
||||
|
||||
static void main(String[] args) {
|
||||
//noinspection RedundantIfStatement
|
||||
if (args.length > 0) {
|
||||
dev = true;
|
||||
} else {
|
||||
dev = false;
|
||||
}
|
||||
|
||||
try {
|
||||
Properties defaults = new Properties();
|
||||
defaults.load(Main.class.getClassLoader().getResourceAsStream("defaults.properties"));
|
||||
properties = new Properties(defaults);
|
||||
properties.load(new FileInputStream(asetustiedosto));
|
||||
}
|
||||
catch (IOException e) {
|
||||
//noinspection CallToPrintStackTrace
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
App.main();
|
||||
|
||||
try (OutputStream os = new FileOutputStream(asetustiedosto)) {
|
||||
properties.store(os, "");
|
||||
} catch (IOException e) {
|
||||
//noinspection CallToPrintStackTrace
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.DayOfWeek;
|
||||
@@ -135,7 +135,7 @@ public class Asiakas implements TietokantaOlio {
|
||||
parsiResultSet(rs).forEach(asiakas -> asiakkaat.put(asiakas.getId(), asiakas));
|
||||
ArrayList<Asiakas> järjestetyt = new ArrayList<>(asiakkaat.size());
|
||||
for (int id : IDt) {
|
||||
järjestetyt.add(asiakkaat.get(id));
|
||||
if (asiakkaat.containsKey(id)) järjestetyt.add(asiakkaat.get(id)); //Huomioidaan, onko asiakas poistettu
|
||||
}
|
||||
return järjestetyt;
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.LocalDate;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.LocalDate;
|
||||
+9
-9
@@ -1,28 +1,28 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
|
||||
import fi.lpam.ruokamanageri.Main;
|
||||
import fi.lpam.Main;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.*;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Tietokanta {
|
||||
private static String osoite;
|
||||
private static String dbPath = SystemUtils.getUserHome().getAbsolutePath() + "\\OneDrive\\Kuljetusruokasovellus\\tietokanta.db";
|
||||
private static File tietokantatiedosto = Path.of(SystemUtils.getUserHome().getAbsolutePath(), "OneDrive", "Kuljetusruokasovellus", "tietokanta.db").toFile();
|
||||
|
||||
public Tietokanta(boolean dev) {
|
||||
if (dev) dbPath = "testikanta.db";
|
||||
File file = new File(dbPath);
|
||||
if (dev) tietokantatiedosto = new File("testikanta.db");
|
||||
try {
|
||||
boolean _ = file.getParentFile().mkdirs();
|
||||
boolean _ = file.createNewFile();
|
||||
boolean _ = tietokantatiedosto.getParentFile().mkdirs();
|
||||
boolean _ = tietokantatiedosto.createNewFile();
|
||||
}
|
||||
catch (Exception _) {}
|
||||
|
||||
osoite = "jdbc:sqlite:" + file.getAbsolutePath();
|
||||
osoite = "jdbc:sqlite:" + tietokantatiedosto.getAbsolutePath();
|
||||
|
||||
|
||||
try (Connection conn = haeYhteys()) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fi.lpam.ruokamanageri.dataluokat;
|
||||
package fi.lpam.dataluokat;
|
||||
|
||||
public interface TietokantaOlio {
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package fi.lpam.gui;
|
||||
|
||||
import fi.lpam.Main;
|
||||
import fi.lpam.gui.elementit.FontLabel;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.text.Font;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
public class Asetukset extends TabPohja {
|
||||
private static final Properties prop = Main.properties;
|
||||
private static final ObservableList<String> järjestelmäFontit = FXCollections.observableArrayList(Font.getFamilies());
|
||||
|
||||
|
||||
public Asetukset() {
|
||||
super("Asetukset");
|
||||
|
||||
HBox yläpalkki = new HBox();
|
||||
yläpalkki.setSpacing(5);
|
||||
yläpalkki.setAlignment(Pos.CENTER_RIGHT);
|
||||
Button btnNollaa = new Button("Palauta oletukset");
|
||||
btnNollaa.setFont(BUTTON_FONT);
|
||||
btnNollaa.setOnAction(_ -> palautaOletukset());
|
||||
yläpalkki.getChildren().addAll(
|
||||
new FontLabel(TEKSTI_FONT, "Muutokset astuvat voimaan sovelluksen käynnistyttyä uudelleen"),
|
||||
btnNollaa);
|
||||
root.setTop(yläpalkki);
|
||||
|
||||
root.setCenter(getFonttiAsetukset());
|
||||
|
||||
}
|
||||
|
||||
private Spinner<Integer> tekstiFonttiKoko, buttonFonttiKoko, tulostusFonttiKoko, insets;
|
||||
private ComboBox<String> tekstiFontti, buttonFontti;
|
||||
|
||||
/**
|
||||
* Luo paneelin fonttien asetusten säätämiseen
|
||||
* @return paneeli
|
||||
*/
|
||||
private GridPane getFonttiAsetukset() {
|
||||
GridPane root = new GridPane();
|
||||
root.setAlignment(Pos.CENTER);
|
||||
root.setHgap(SPACING *2);
|
||||
root.setVgap(SPACING *2);
|
||||
root.setBorder(BORDER);
|
||||
root.setPadding(INSETS);
|
||||
int row = 0;
|
||||
|
||||
Label otsikko = new Label("Fonttien asetukset");
|
||||
otsikko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, otsikko);
|
||||
|
||||
int minFonttiKoko = 8;
|
||||
int maxFonttiKoko = 18;
|
||||
int stepFontti = 1;
|
||||
tekstiFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("tekstiFonttiKoko")), stepFontti);
|
||||
tekstiFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("tekstiFonttiKoko", String.valueOf(tekstiFonttiKoko.getValue())));
|
||||
Label tekstinKoko = new Label("Tekstin koko");
|
||||
tekstinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tekstinKoko, tekstiFonttiKoko);
|
||||
|
||||
tekstiFontti = new ComboBox<>();
|
||||
tekstiFontti.setItems(järjestelmäFontit);
|
||||
tekstiFontti.getSelectionModel().select(prop.getProperty("tekstiFontti"));
|
||||
tekstiFontti.valueProperty().addListener((_) -> prop.setProperty("tekstiFontti", tekstiFontti.getValue()));
|
||||
Label tekstinFontti = new Label("Tekstin fontti");
|
||||
tekstinFontti.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tekstinFontti, tekstiFontti);
|
||||
|
||||
buttonFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("buttonFonttiKoko")), stepFontti);
|
||||
buttonFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("buttonFonttiKoko", String.valueOf(buttonFonttiKoko.getValue())));
|
||||
Label nappiTekstinKoko = new Label("Painikkeiden koko");
|
||||
nappiTekstinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, nappiTekstinKoko, buttonFonttiKoko);
|
||||
|
||||
buttonFontti = new ComboBox<>();
|
||||
buttonFontti.setItems(järjestelmäFontit);
|
||||
buttonFontti.getSelectionModel().select(prop.getProperty("buttonFontti"));
|
||||
buttonFontti.valueProperty().addListener((_) -> prop.setProperty("buttonFontti", buttonFontti.getValue()));
|
||||
Label napinFontti = new Label("Painikkeiden fontti");
|
||||
napinFontti.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, napinFontti, buttonFontti);
|
||||
|
||||
tulostusFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("tulostusFonttiKoko")), stepFontti);
|
||||
tulostusFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("tulostusFonttiKoko", String.valueOf(tulostusFonttiKoko.getValue())));
|
||||
Label tulostusFontinKoko = new Label("Tulostusfontin koko");
|
||||
tulostusFontinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tulostusFontinKoko, tulostusFonttiKoko);
|
||||
|
||||
insets = new Spinner<>(0, 10, Integer.parseInt(prop.getProperty("insets")), 1);
|
||||
insets.valueProperty().addListener((_) -> prop.setProperty("insets", String.valueOf(insets.getValue())));
|
||||
Label insetsi = new Label("Yleinen fyllinki");
|
||||
insetsi.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, insetsi, insets);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void palautaOletukset() {
|
||||
try {
|
||||
Properties defaults = new Properties();
|
||||
defaults.load(Main.class.getClassLoader().getResourceAsStream("defaults.properties"));
|
||||
|
||||
tekstiFonttiKoko.getValueFactory().setValue(Integer.valueOf(defaults.getProperty("tekstiFonttiKoko")));
|
||||
tekstiFontti.getSelectionModel().select(defaults.getProperty("tekstiFontti"));
|
||||
buttonFonttiKoko.getValueFactory().setValue(Integer.valueOf(defaults.getProperty("buttonFonttiKoko")));
|
||||
buttonFontti.getSelectionModel().select(defaults.getProperty("buttonFontti"));
|
||||
tulostusFonttiKoko.getValueFactory().setValue(Integer.valueOf(defaults.getProperty("tulostusFonttiKoko")));
|
||||
insets.getValueFactory().setValue(Integer.valueOf(defaults.getProperty("insets")));
|
||||
}
|
||||
catch (IOException e) {
|
||||
//noinspection CallToPrintStackTrace
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-14
@@ -1,10 +1,10 @@
|
||||
package fi.lpam.ruokamanageri.gui;
|
||||
package fi.lpam.gui;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.elementit.IntegerSpinner;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.TabPohja;
|
||||
import fi.lpam.ruokamanageri.Main;
|
||||
import fi.lpam.gui.elementit.IntegerSpinner;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import fi.lpam.Main;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.geometry.Side;
|
||||
@@ -52,13 +52,9 @@ public class AsiakasIkkuna extends Stage {
|
||||
}});
|
||||
|
||||
Tab tabKuljetusTiedot, tabAsiakastiedot;
|
||||
tabKuljetusTiedot = new Tab("Kuljetustiedot");
|
||||
tabAsiakastiedot = new Tab("Asiakastiedot");
|
||||
tabKuljetusTiedot = new TabPohja("Kuljetustiedot");
|
||||
tabAsiakastiedot = new TabPohja("Asiakastiedot");
|
||||
tabPane.getTabs().addAll(tabKuljetusTiedot, tabAsiakastiedot);
|
||||
for (Tab tab : tabPane.getTabs()) {
|
||||
tab.setClosable(false);
|
||||
tab.setStyle("-fx-font-size: 18px; -fx-font-weight: bold; -fx-font-family: Open Sans");
|
||||
}
|
||||
|
||||
GridPane kuljetusTiedot = new GridPane();
|
||||
kuljetusTiedot.setPadding(new Insets(15));
|
||||
@@ -158,15 +154,15 @@ public class AsiakasIkkuna extends Stage {
|
||||
|
||||
HBox napit = new HBox();
|
||||
Button peruuta = new Button("Peruuta");
|
||||
peruuta.setFont(TabPohja.buttonFont);
|
||||
peruuta.setFont(TabPohja.BUTTON_FONT);
|
||||
peruuta.setOnAction(_ -> this.close());
|
||||
Button tallenna = new Button("Tallenna");
|
||||
tallenna.setFont(TabPohja.buttonFont);
|
||||
tallenna.setFont(TabPohja.BUTTON_FONT);
|
||||
tallenna.setOnAction(_ -> tallenna());
|
||||
napit.getChildren().addAll(peruuta, tallenna);
|
||||
napit.setAlignment(Pos.CENTER_RIGHT);
|
||||
napit.setSpacing(10);
|
||||
napit.setPadding(TabPohja.oletusInsets);
|
||||
napit.setPadding(TabPohja.INSETS);
|
||||
|
||||
|
||||
VBox root = new VBox();
|
||||
+63
-55
@@ -1,8 +1,10 @@
|
||||
package fi.lpam.ruokamanageri.gui;
|
||||
package fi.lpam.gui;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.MaaraTableColumn;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.TabPohja;
|
||||
import fi.lpam.Main;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
import fi.lpam.gui.elementit.FontLabel;
|
||||
import fi.lpam.gui.elementit.MaaraTableColumn;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -13,7 +15,6 @@ import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -26,45 +27,9 @@ public class Asiakashallinta extends TabPohja {
|
||||
final TableView<Asiakas> tvAsiakkaat = new TableView<>();
|
||||
|
||||
public Asiakashallinta() {
|
||||
BorderPane root = new BorderPane();
|
||||
this.getChildren().add(root);
|
||||
root.setPadding(oletusInsets);
|
||||
super("Asiakashallinta");
|
||||
root.setTop(getYläpalkki());
|
||||
|
||||
BorderPane yläpalkki = new BorderPane();
|
||||
root.setTop(yläpalkki);
|
||||
Label otsikko = new Label("Asiakashallinta");
|
||||
otsikko.setFont(tekstiFont);
|
||||
yläpalkki.setLeft(otsikko);
|
||||
|
||||
HBox yläpalkinNapit = new HBox();
|
||||
yläpalkinNapit.setSpacing(5);
|
||||
yläpalkki.setRight(yläpalkinNapit);
|
||||
|
||||
Button avaaVersioloki = new Button("VERSIOLOKI");
|
||||
avaaVersioloki.setFont(buttonFont);
|
||||
avaaVersioloki.setOnAction(_ -> {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://git.lpam.fi/laurimaaninka/Ruokamanageri/src/branch/master/CHANGELOG.md"));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
});
|
||||
yläpalkinNapit.getChildren().add(avaaVersioloki);
|
||||
|
||||
Button poistaValittu = new Button("Poista");
|
||||
poistaValittu.setOnAction(_ -> poistaValittu());
|
||||
poistaValittu.setFont(buttonFont);
|
||||
yläpalkinNapit.getChildren().add(poistaValittu);
|
||||
|
||||
Button muokkaaAsiakasta = new Button("Muokkaa");
|
||||
muokkaaAsiakasta.setOnAction(_ -> muokkaaValittua());
|
||||
muokkaaAsiakasta.setFont(buttonFont);
|
||||
yläpalkinNapit.getChildren().add(muokkaaAsiakasta);
|
||||
|
||||
Button uusiAsiakas = new Button("Uusi asiakas");
|
||||
uusiAsiakas.setOnAction(_ -> uusiAsiakas());
|
||||
uusiAsiakas.setFont(buttonFont);
|
||||
yläpalkinNapit.getChildren().add(uusiAsiakas);
|
||||
|
||||
tvAsiakkaat.setEditable(false);
|
||||
tvAsiakkaat.setPlaceholder(new Label("Ei vielä tietoja"));
|
||||
@@ -118,40 +83,72 @@ public class Asiakashallinta extends TabPohja {
|
||||
tcKuljetusmäärät.getColumns().addAll(tcSalaatit, tcPääruoat, tcJälkiruoat);
|
||||
|
||||
TableColumn<Asiakas, String> tcErityisruokavalio = new TableColumn<>("Ruokarajoitteet");
|
||||
// tcErityisruokavalio.setMinWidth(150);
|
||||
tcErityisruokavalio.setCellValueFactory(new PropertyValueFactory<>("erityisruokavalio"));
|
||||
TableColumn<Asiakas, String> tcAvainTieto = new TableColumn<>("Avaintieto");
|
||||
// tcAvainTieto.setMinWidth(150);
|
||||
tcAvainTieto.setCellValueFactory(new PropertyValueFactory<>("avainTieto"));
|
||||
TableColumn<Asiakas, String> tcLisätiedot = new TableColumn<>("Lisätieto kuljetukselle");
|
||||
// tcLisätiedot.setMinWidth(250);
|
||||
tcLisätiedot.setCellValueFactory(new PropertyValueFactory<>("lisätiedot"));
|
||||
TableColumn<Asiakas, String> tcYhteyshenkilönNimi = new TableColumn<>("Yhteyshenkilö");
|
||||
// tcYhteyshenkilönNimi.setMinWidth(250);
|
||||
tcYhteyshenkilönNimi.setCellValueFactory(new PropertyValueFactory<>("yhteyshenkilönNimi"));
|
||||
TableColumn<Asiakas, String> tcLaskutusOsoite = new TableColumn<>("Laskutusosoite");
|
||||
// tcLaskutusOsoite.setMinWidth(250);
|
||||
tcLaskutusOsoite.setCellValueFactory(new PropertyValueFactory<>("laskutusOsoite"));
|
||||
TableColumn<Asiakas, String> tcYhteyshenkilönPuhelinnumero = new TableColumn<>("Yhteyshenkilön puhelinnumero");
|
||||
// tcYhteyshenkilönPuhelinnumero.setMinWidth(250);
|
||||
tcYhteyshenkilönPuhelinnumero.setCellValueFactory(new PropertyValueFactory<>("yhteyshenkilönPuhelinnumero"));
|
||||
TableColumn<Asiakas, String> tcYhteyshenkilönSähköposti = new TableColumn<>("Yhteyshenkilön sähköposti");
|
||||
// tcYhteyshenkilönSähköposti.setMinWidth(250);
|
||||
tcYhteyshenkilönSähköposti.setCellValueFactory(new PropertyValueFactory<>("yhteyshenkilönSähköposti"));
|
||||
|
||||
tvAsiakkaat.getColumns().addAll(tcId, tcNimi, tcOsoite, tcKuljetuspäivät, tcKuljetusmäärät, tcErityisruokavalio, tcAvainTieto, tcLisätiedot, tcYhteyshenkilönNimi, tcLaskutusOsoite, tcYhteyshenkilönPuhelinnumero, tcYhteyshenkilönSähköposti);
|
||||
|
||||
for (TableColumn<Asiakas, ?> column : tvAsiakkaat.getColumns()) {
|
||||
column.setEditable(false);
|
||||
column.setReorderable(false);
|
||||
column.setResizable(true);
|
||||
column.setStyle("-fx-alignment: CENTER; -fx-font-size: 16px;");
|
||||
|
||||
column.getColumns().forEach(this::määritäColumn);
|
||||
määritäColumn(column);
|
||||
}
|
||||
|
||||
tvAsiakkaat.setItems(FXCollections.observableArrayList(Objects.requireNonNull(Asiakas.haeKaikki())));
|
||||
//tvAsiakkaat.setPrefSize(1920, 1080); //Tämä estää oudon bugin? (asiakkaiden ollessa 31 TV sekoaa)
|
||||
}
|
||||
|
||||
private BorderPane getYläpalkki() {
|
||||
BorderPane yläpalkki = new BorderPane();
|
||||
Label otsikko = new FontLabel(TEKSTI_FONT, "Asiakashallinta");
|
||||
yläpalkki.setLeft(otsikko);
|
||||
|
||||
HBox yläpalkinNapit = new HBox();
|
||||
yläpalkinNapit.setSpacing(SPACING);
|
||||
yläpalkinNapit.setPadding(INSETS);
|
||||
yläpalkki.setRight(yläpalkinNapit);
|
||||
|
||||
Button avaaVersioloki = new Button("VERSIOLOKI");
|
||||
avaaVersioloki.setFont(BUTTON_FONT);
|
||||
avaaVersioloki.setOnAction(_ -> {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://git.lpam.fi/laurimaaninka/Ruokamanageri/src/branch/master/CHANGELOG.md"));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
});
|
||||
yläpalkinNapit.getChildren().add(avaaVersioloki);
|
||||
|
||||
Button poistaValittu = new Button("Poista");
|
||||
poistaValittu.setOnAction(_ -> poistaValittu());
|
||||
poistaValittu.setFont(BUTTON_FONT);
|
||||
yläpalkinNapit.getChildren().add(poistaValittu);
|
||||
|
||||
Button muokkaaAsiakasta = new Button("Muokkaa");
|
||||
muokkaaAsiakasta.setOnAction(_ -> muokkaaValittua());
|
||||
muokkaaAsiakasta.setFont(BUTTON_FONT);
|
||||
yläpalkinNapit.getChildren().add(muokkaaAsiakasta);
|
||||
|
||||
Button uusiAsiakas = new Button("Uusi asiakas");
|
||||
uusiAsiakas.setOnAction(_ -> uusiAsiakas());
|
||||
uusiAsiakas.setFont(BUTTON_FONT);
|
||||
yläpalkinNapit.getChildren().add(uusiAsiakas);
|
||||
|
||||
return yläpalkki;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void uusiAsiakas() {
|
||||
Asiakas luotavaAsiakas = new Asiakas();
|
||||
AsiakasIkkuna asiakasIkkuna = new AsiakasIkkuna(luotavaAsiakas);
|
||||
@@ -189,4 +186,15 @@ public class Asiakashallinta extends TabPohja {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void määritäColumn(TableColumn<Asiakas, ?> column) {
|
||||
column.setEditable(false);
|
||||
column.setReorderable(false);
|
||||
column.setResizable(true);
|
||||
column.setStyle(
|
||||
"-fx-alignment: CENTER;" +
|
||||
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
|
||||
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti")
|
||||
);
|
||||
}
|
||||
}
|
||||
+22
-18
@@ -1,18 +1,18 @@
|
||||
package fi.lpam.ruokamanageri.gui;
|
||||
package fi.lpam.gui;
|
||||
|
||||
import com.dlsc.gemsfx.MultiColumnListView;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Kierros;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.AsiakasListCell;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.TabPohja;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
import fi.lpam.dataluokat.Kierros;
|
||||
import fi.lpam.gui.elementit.AsiakasMCLVListCell;
|
||||
import fi.lpam.gui.elementit.FontLabel;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
|
||||
@@ -23,15 +23,13 @@ import java.util.Objects;
|
||||
public class Kierroshallinta extends TabPohja {
|
||||
private final MultiColumnListView<Asiakas> mclv = new MultiColumnListView<>();
|
||||
private final ArrayList<Kierros> kierrokset = Kierros.haeKaikki();
|
||||
private final ArrayList<Asiakas> kaikkiAsiakkaat = Asiakas.haeKaikki();
|
||||
private ArrayList<Asiakas> kaikkiAsiakkaat = Asiakas.haeKaikki();
|
||||
|
||||
public Kierroshallinta() {
|
||||
BorderPane root = new BorderPane();
|
||||
this.getChildren().add(root);
|
||||
root.setPadding(oletusInsets);
|
||||
super("Kierroshallinta");
|
||||
root.setCenter(mclv);
|
||||
|
||||
mclv.setCellFactory(_ -> new AsiakasListCell(mclv));
|
||||
mclv.setCellFactory(_ -> new AsiakasMCLVListCell(mclv));
|
||||
mclv.setPlaceholderFrom(new Asiakas(""));
|
||||
mclv.setPlaceholderTo(new Asiakas(""));
|
||||
rakennaSarakkeet();
|
||||
@@ -39,8 +37,7 @@ public class Kierroshallinta extends TabPohja {
|
||||
BorderPane yläpalkki = new BorderPane();
|
||||
root.setTop(yläpalkki);
|
||||
|
||||
Label infoTeksti = new Label("Siirrä asiakkaat haluamallesi kierrokselle. Kierroksia voit lisätä painamalla lisää uusi kierros painiketta.\nKierrosnumerot päivittyvät, sekä tyhjät poistuvat kierroksia tallentaessa.");
|
||||
infoTeksti.setFont(tekstiFont);
|
||||
Label infoTeksti = new FontLabel(TEKSTI_FONT, "Siirrä asiakkaat haluamallesi kierrokselle. Kierroksia voit lisätä painamalla lisää uusi kierros painiketta.\nKierrosnumerot päivittyvät, sekä tyhjät poistuvat kierroksia tallentaessa.");
|
||||
yläpalkki.setLeft(infoTeksti);
|
||||
|
||||
HBox yläpalkinNapit = new HBox();
|
||||
@@ -52,11 +49,11 @@ public class Kierroshallinta extends TabPohja {
|
||||
int uudenKierroksenNumero = mclv.getColumns().size();
|
||||
lisaaKierros(new Kierros(uudenKierroksenNumero, FXCollections.observableArrayList(new ArrayList<>())));
|
||||
});
|
||||
lisääKierros.setFont(TabPohja.buttonFont);
|
||||
lisääKierros.setFont(BUTTON_FONT);
|
||||
yläpalkinNapit.getChildren().add(lisääKierros);
|
||||
|
||||
Button tallenna = new Button("Tallenna kierrokset");
|
||||
tallenna.setFont(TabPohja.buttonFont);
|
||||
tallenna.setFont(BUTTON_FONT);
|
||||
tallenna.setOnAction(_ ->tallennaKierrokset());
|
||||
yläpalkinNapit.getChildren().add(tallenna);
|
||||
|
||||
@@ -67,6 +64,7 @@ public class Kierroshallinta extends TabPohja {
|
||||
|
||||
private void rakennaSarakkeet() {
|
||||
mclv.getColumns().clear();
|
||||
kaikkiAsiakkaat = Asiakas.haeKaikki();
|
||||
ObservableList<Asiakas> eiKierroksella = FXCollections.observableArrayList(new ArrayList<>());
|
||||
HashSet<Integer> kierroksellaOlevatAsiakasIDt = new HashSet<>();
|
||||
|
||||
@@ -85,15 +83,16 @@ public class Kierroshallinta extends TabPohja {
|
||||
}
|
||||
}
|
||||
MultiColumnListView.ListViewColumn<Asiakas> colEiKierroksella = new MultiColumnListView.ListViewColumn<>();
|
||||
colEiKierroksella.setHeader(new Label("Ei vielä kierroksella"));
|
||||
Label labelEiKierroksella = new FontLabel(TEKSTI_FONT, "Ei vielä kierroksella");
|
||||
colEiKierroksella.setHeader(labelEiKierroksella);
|
||||
colEiKierroksella.setItems(FXCollections.observableArrayList(eiKierroksella));
|
||||
mclv.getColumns().add(colEiKierroksella);
|
||||
}
|
||||
|
||||
private void lisaaKierros(Kierros kierros) {
|
||||
if (kierros.getId() == -1) kierrokset.add(kierros);
|
||||
if (!kierrokset.contains(kierros)) kierrokset.add(kierros);
|
||||
MultiColumnListView.ListViewColumn<Asiakas> uusiSarake = new MultiColumnListView.ListViewColumn<>();
|
||||
uusiSarake.setHeader(new Label("Kierros " + kierros.getKierrosNumero()));
|
||||
uusiSarake.setHeader(new FontLabel(TEKSTI_FONT, "Kierros " + kierros.getKierrosNumero()));
|
||||
uusiSarake.setItems(kierros.getAsiakkaat());
|
||||
mclv.getColumns().add(kierros.getKierrosNumero()-1, uusiSarake);
|
||||
}
|
||||
@@ -126,4 +125,9 @@ public class Kierroshallinta extends TabPohja {
|
||||
info.setContentText(null);
|
||||
info.showAndWait();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void päivitä() {
|
||||
rakennaSarakkeet();
|
||||
}
|
||||
}
|
||||
+36
-30
@@ -1,13 +1,15 @@
|
||||
package fi.lpam.ruokamanageri.gui;
|
||||
package fi.lpam.gui;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Kierros;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Kuljetus;
|
||||
import fi.lpam.ruokamanageri.gui.tableCell.IntegerFieldTableCellFactory;
|
||||
import fi.lpam.ruokamanageri.gui.tableCell.KuljetaTableCell;
|
||||
import fi.lpam.ruokamanageri.tulostajat.KuljetusListaTulostaja;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.MaaraTableColumn;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.TabPohja;
|
||||
import fi.lpam.Main;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
import fi.lpam.dataluokat.Kierros;
|
||||
import fi.lpam.dataluokat.Kuljetus;
|
||||
import fi.lpam.gui.elementit.FontLabel;
|
||||
import fi.lpam.gui.tableCell.IntegerFieldTableCellFactory;
|
||||
import fi.lpam.gui.tableCell.KuljetaTableCell;
|
||||
import fi.lpam.tulostajat.KuljetusListaTulostaja;
|
||||
import fi.lpam.gui.elementit.MaaraTableColumn;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.FXCollections;
|
||||
@@ -36,6 +38,8 @@ public class KuljetusListat extends TabPohja {
|
||||
private final HashMap<Integer, Asiakas> asiakkaat = new HashMap<>();
|
||||
|
||||
public KuljetusListat() {
|
||||
super("Kuljetuslistat");
|
||||
|
||||
ObservableList<Integer> määräVaihtoehdot = FXCollections.observableArrayList();
|
||||
for (int i = 0; i <= 10; i++) {
|
||||
määräVaihtoehdot.add(i);}
|
||||
@@ -44,51 +48,45 @@ public class KuljetusListat extends TabPohja {
|
||||
asiakkaat.put(asiakas.getId(), asiakas);
|
||||
}
|
||||
|
||||
BorderPane root = new BorderPane();
|
||||
root.setPadding(oletusInsets);
|
||||
this.getChildren().add(root);
|
||||
|
||||
BorderPane yläpalkki = new BorderPane();
|
||||
Label infoTeksti = new Label("Kuljetuslistojen luonti");
|
||||
infoTeksti.setFont(tekstiFont);
|
||||
Label infoTeksti = new FontLabel(TEKSTI_FONT, "Kuljetuslistojen luonti");
|
||||
yläpalkki.setLeft(infoTeksti);
|
||||
|
||||
HBox kierroksenValintaLaatikko = new HBox();
|
||||
kierroksenValintaLaatikko.setSpacing(5);
|
||||
kierroksenValintaLaatikko.setSpacing(5);
|
||||
kierroksenValintaLaatikko.setSpacing(SPACING);
|
||||
kierroksenValintaLaatikko.setAlignment(Pos.CENTER);
|
||||
Button valitse = new Button("Valitse");
|
||||
valitse.setFont(buttonFont);
|
||||
valitse.setFont(BUTTON_FONT);
|
||||
valitse.setOnAction(_ -> päivitäListanäkymä());
|
||||
tallennusStatus = new Label("Tallennettu: Kyllä");
|
||||
tallennusStatus.setFont(tekstiFont);
|
||||
tallennusStatus = new FontLabel(TEKSTI_FONT, "Tallennettu: Kyllä");
|
||||
tallennusStatus.setFont(TEKSTI_FONT);
|
||||
datePicker.valueProperty().addListener(_ -> päivitäListanäkymä());
|
||||
kierrosValinta.valueProperty().addListener(_ -> päivitäListanäkymä());
|
||||
kierroksenValintaLaatikko.getChildren().addAll(
|
||||
new Label("Valitse päivämäärä:"),
|
||||
new FontLabel(TEKSTI_FONT, "Päivämäärä:"),
|
||||
datePicker,
|
||||
new Label("Valitse kierros:"),
|
||||
new FontLabel(TEKSTI_FONT, "Kierros:"),
|
||||
kierrosValinta, tallennusStatus);
|
||||
yläpalkki.setCenter(kierroksenValintaLaatikko);
|
||||
|
||||
HBox napit = new HBox();
|
||||
napit.setSpacing(5);
|
||||
napit.setSpacing(SPACING);
|
||||
Button poista = new Button("Poista kuljetusrivi");
|
||||
poista.setOnAction(_ -> poistaRivi());
|
||||
poista.setFont(buttonFont);
|
||||
poista.setFont(BUTTON_FONT);
|
||||
Button tallenna = new Button("Tallenna");
|
||||
tallenna.setFont(buttonFont);
|
||||
tallenna.setFont(BUTTON_FONT);
|
||||
tallenna.setOnAction(_ -> tallennaKierros());
|
||||
btnTulosta = new Button("Tulosta lista");
|
||||
btnTulosta.setDisable(true);
|
||||
btnTulosta.setFont(buttonFont);
|
||||
btnTulosta.setFont(BUTTON_FONT);
|
||||
btnTulosta.setOnAction(_ -> tulostaLista());
|
||||
napit.getChildren().addAll(poista, tallenna, btnTulosta);
|
||||
yläpalkki.setRight(napit);
|
||||
root.setTop(yläpalkki);
|
||||
|
||||
tableView.setEditable(true);
|
||||
tableView.setPlaceholder(new Label("Valitse kierros aloittaaksesi"));
|
||||
tableView.setPlaceholder(new FontLabel(BUTTON_FONT, "Valitse kierros aloittaaksesi"));
|
||||
root.setCenter(tableView);
|
||||
|
||||
TableColumn<Kuljetus, Boolean> tcNappi = new TableColumn<>("Kuljeta");
|
||||
@@ -97,7 +95,7 @@ public class KuljetusListat extends TabPohja {
|
||||
tcNappi.setCellValueFactory(features -> new SimpleBooleanProperty(features.getValue() != null));
|
||||
|
||||
TableColumn<Kuljetus, String> tcNimi = new TableColumn<>("Nimi");
|
||||
tcNimi.setMinWidth(150);
|
||||
tcNimi.setMinWidth(200);
|
||||
tcNimi.setCellFactory(TextFieldTableCell.forTableColumn());
|
||||
tcNimi.setCellValueFactory(new PropertyValueFactory<>("nimi"));
|
||||
tcNimi.setOnEditCommit((TableColumn.CellEditEvent<Kuljetus, String> event) -> {event.getTableView().getItems().get(event.getTablePosition().getRow()).setNimi(event.getNewValue()); tallennusStatus.setText("Tallennettu: Ei");});
|
||||
@@ -147,10 +145,12 @@ public class KuljetusListat extends TabPohja {
|
||||
sarake.setSortable(false);
|
||||
sarake.setEditable(true);
|
||||
sarake.setResizable(true);
|
||||
sarake.setStyle("-fx-alignment: CENTER; -fx-font-size: 16px;");
|
||||
sarake.setStyle(
|
||||
"-fx-alignment: CENTER;" +
|
||||
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
|
||||
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti"));
|
||||
}
|
||||
tcNimi.setEditable(false);
|
||||
tcNimi.setResizable(false);
|
||||
}
|
||||
|
||||
private void päivitäListanäkymä() {
|
||||
@@ -217,4 +217,10 @@ public class KuljetusListat extends TabPohja {
|
||||
private void tulostaLista() {
|
||||
new KuljetusListaTulostaja().luoKuljetusLista(tableView.getItems(), kierrosValinta.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void päivitä() {
|
||||
if (kierrosValinta.getValue() == null) return;
|
||||
päivitäListanäkymä();
|
||||
}
|
||||
}
|
||||
+23
-17
@@ -1,9 +1,11 @@
|
||||
package fi.lpam.ruokamanageri.gui;
|
||||
package fi.lpam.gui;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.RaporttiRivi;
|
||||
import fi.lpam.ruokamanageri.tulostajat.KuljetusRaporttiTulostaja;
|
||||
import fi.lpam.ruokamanageri.gui.tableCell.PaivamaaraTableCell;
|
||||
import fi.lpam.ruokamanageri.gui.elementit.TabPohja;
|
||||
import fi.lpam.Main;
|
||||
import fi.lpam.dataluokat.RaporttiRivi;
|
||||
import fi.lpam.gui.elementit.FontLabel;
|
||||
import fi.lpam.tulostajat.KuljetusRaporttiTulostaja;
|
||||
import fi.lpam.gui.tableCell.PaivamaaraTableCell;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
@@ -34,34 +36,32 @@ public class KuljetusRaportit extends TabPohja {
|
||||
}
|
||||
|
||||
public KuljetusRaportit() {
|
||||
BorderPane root = new BorderPane();
|
||||
root.setPadding(oletusInsets);
|
||||
this.getChildren().add(root);
|
||||
super("Raportit");
|
||||
|
||||
BorderPane yläpalkki = new BorderPane();
|
||||
root.setTop(yläpalkki);
|
||||
|
||||
Label infoTeksti = new Label("Kuljetusraportit. \nTarkka-valinnalla koostetun raportin tulostaminen paperille ei suositeltua.");
|
||||
infoTeksti.setFont(tekstiFont);
|
||||
Label infoTeksti = new FontLabel(TEKSTI_FONT, "Kuljetusraportit. \nTarkka-valinnalla koostetun raportin \ntulostaminen paperille ei suositeltua.");
|
||||
yläpalkki.setLeft(infoTeksti);
|
||||
|
||||
HBox yläpalkinNapit = new HBox();
|
||||
yläpalkinNapit.setAlignment(Pos.CENTER);
|
||||
yläpalkinNapit.setSpacing(5);
|
||||
yläpalkinNapit.setSpacing(SPACING);
|
||||
yläpalkki.setRight(yläpalkinNapit);
|
||||
|
||||
tarkka = new CheckBox("Tarkka");
|
||||
tarkka.setFont(TEKSTI_FONT);
|
||||
alkuPvm = new DatePicker(LocalDate.now().minusDays(LocalDate.now().getDayOfMonth() - 1));
|
||||
loppuPvm = new DatePicker(LocalDate.now());
|
||||
Button haeKuljetukset = new Button("Hae");
|
||||
haeKuljetukset.setFont(buttonFont);
|
||||
haeKuljetukset.setFont(BUTTON_FONT);
|
||||
haeKuljetukset.setOnAction(_ ->haeRaportti());
|
||||
Button tulostaRaportti = new Button("Tulosta raportti");
|
||||
tulostaRaportti.setFont(buttonFont);
|
||||
tulostaRaportti.setFont(BUTTON_FONT);
|
||||
tulostaRaportti.setOnAction(_ ->tulostaRaportti());
|
||||
yläpalkinNapit.getChildren().addAll(tarkka,
|
||||
new Label("Hae kuljetukset välillä:"),
|
||||
alkuPvm, new Label("-"), loppuPvm,
|
||||
//new FontLabel(tekstiFont,"Hae kuljetukset välillä:"),
|
||||
alkuPvm, new FontLabel(TEKSTI_FONT,"-"), loppuPvm,
|
||||
haeKuljetukset, tulostaRaportti);
|
||||
|
||||
root.setCenter(tableView);
|
||||
@@ -109,12 +109,18 @@ public class KuljetusRaportit extends TabPohja {
|
||||
|
||||
tableView.getColumns().addAll(tcNimi, tcPvm, tcSalaatit, tcPääruoat, tcJälkiruoat, tcLisätiedot,
|
||||
tcYhteyshenkilönNimi, tcLaskutusOsoite, tcYhteyshenkilönPuhelinnumero, tcYhteyshenkilönSähköposti);
|
||||
tableView.setPlaceholder(new Label("Hae raportti"));
|
||||
tableView.setPlaceholder(new FontLabel(BUTTON_FONT, "Hae raportti"));
|
||||
for (TableColumn<RaporttiRivi, ?> sarake : tableView.getColumns()) {
|
||||
sarake.setSortable(false);
|
||||
sarake.setEditable(false);
|
||||
sarake.setResizable(true);
|
||||
sarake.setStyle("-fx-alignment: CENTER; -fx-font-size: 16px;");
|
||||
sarake.setStyle(
|
||||
"-fx-alignment: CENTER;" +
|
||||
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
|
||||
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void päivitä() {}
|
||||
}
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
package fi.lpam.ruokamanageri.gui.elementit;
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import com.dlsc.gemsfx.MultiColumnListView;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.geometry.Pos;
|
||||
@@ -12,13 +12,13 @@ import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
|
||||
public class AsiakasListCell extends MultiColumnListView.ColumnListCell<Asiakas> {
|
||||
public class AsiakasMCLVListCell extends MultiColumnListView.ColumnListCell<Asiakas> {
|
||||
private final StackPane wrapper;
|
||||
|
||||
public AsiakasListCell(MultiColumnListView<Asiakas> multiColumnListView) {
|
||||
public AsiakasMCLVListCell(MultiColumnListView<Asiakas> multiColumnListView) {
|
||||
super(multiColumnListView);
|
||||
this.setMinHeight(60);
|
||||
this.setMaxHeight(60);
|
||||
this.setMinHeight(TabPohja.TEKSTI_FONT.getSize()*4);
|
||||
this.setMaxHeight(TabPohja.TEKSTI_FONT.getSize()*4);
|
||||
|
||||
VBox content = new VBox();
|
||||
content.visibleProperty().bind(placeholder.not().and(emptyProperty().not()));
|
||||
@@ -29,7 +29,7 @@ public class AsiakasListCell extends MultiColumnListView.ColumnListCell<Asiakas>
|
||||
contentPlaceholder.managedProperty().bind(placeholder);
|
||||
|
||||
Label label = new Label();
|
||||
label.setFont(TabPohja.tekstiFont);
|
||||
label.setFont(TabPohja.TEKSTI_FONT);
|
||||
label.textProperty().bind(textProperty());
|
||||
|
||||
wrapper = new StackPane(content, contentPlaceholder, label);
|
||||
@@ -0,0 +1,11 @@
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.text.Font;
|
||||
|
||||
public class FontLabel extends Label {
|
||||
public FontLabel(Font font, String text) {
|
||||
super(text);
|
||||
this.setFont(font);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fi.lpam.ruokamanageri.gui.elementit;
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import javafx.scene.control.Spinner;
|
||||
import javafx.scene.control.SpinnerValueFactory;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fi.lpam.ruokamanageri.gui.elementit;
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import javafx.scene.control.TableColumn;
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import fi.lpam.Main;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
import one.jpro.platform.mdfx.MarkdownView;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MuutosIlmoitus extends Stage {
|
||||
public MuutosIlmoitus() {
|
||||
super();
|
||||
VBox root = new VBox();
|
||||
root.setBorder(TabPohja.BORDER);
|
||||
root.setPadding(TabPohja.INSETS);
|
||||
root.setAlignment(Pos.CENTER);
|
||||
root.setSpacing(10);
|
||||
|
||||
String md;
|
||||
try (InputStreamReader isr = new InputStreamReader(Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream("CHANGELOG.md")))) {
|
||||
md = isr.readAllAsString();
|
||||
int toinenMerkintä = md.indexOf("# ", 1);
|
||||
int kolmasMerkintä = md.indexOf("# ", toinenMerkintä + 1);
|
||||
int endIndex = md.indexOf("# ", kolmasMerkintä + 1);
|
||||
md = md.substring(0, endIndex);
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
md = "# Virhe versiolokin haussa";
|
||||
}
|
||||
|
||||
MarkdownView markdownView = new MarkdownView(md);
|
||||
root.getChildren().add(markdownView);
|
||||
|
||||
Button ok = new Button("OK");
|
||||
ok.setFont(TabPohja.BUTTON_FONT);
|
||||
ok.setOnAction(e -> this.close());
|
||||
root.getChildren().add(ok);
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
this.setScene(scene);
|
||||
this.setTitle("Uusi versio, katso muutokset alta!");
|
||||
this.setResizable(false);
|
||||
this.show();
|
||||
|
||||
Main.properties.setProperty("viimeisinVersio", Main.properties.getProperty("version"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package fi.lpam.gui.elementit;
|
||||
|
||||
import fi.lpam.Main;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Käyttöliittymän välilehden pohja
|
||||
*/
|
||||
public class TabPohja extends Tab {
|
||||
public static Insets INSETS;
|
||||
public static Border BORDER = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, new CornerRadii(5), BorderWidths.DEFAULT));
|
||||
public static String STYLE;
|
||||
public static Font BUTTON_FONT;
|
||||
public static Font TEKSTI_FONT;
|
||||
public static double SPACING;
|
||||
|
||||
protected BorderPane root = new BorderPane();
|
||||
|
||||
public TabPohja(String title) {
|
||||
super(title);
|
||||
Properties prop = Main.properties;
|
||||
INSETS = new Insets(Double.parseDouble(prop.getProperty("insets")));
|
||||
SPACING = Double.parseDouble(prop.getProperty("insets"));
|
||||
STYLE = "-fx-background-color: " + prop.getProperty("taustaVari");
|
||||
BUTTON_FONT = Font.font(prop.getProperty("buttonFontti"), FontWeight.BOLD, Double.parseDouble(prop.getProperty("buttonFonttiKoko")));
|
||||
TEKSTI_FONT = Font.font(prop.getProperty("tekstiFontti"), FontWeight.NORMAL, Double.parseDouble(prop.getProperty("tekstiFonttiKoko")));
|
||||
|
||||
this.setStyle(
|
||||
"-fx-font-size: " + Main.properties.getProperty("buttonFonttiKoko") + "px;" +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-font-family: " + Main.properties.getProperty("buttonFontti") + ";"
|
||||
);
|
||||
this.setClosable(false);
|
||||
this.setOnSelectionChanged(e -> {if (this.isSelected()) päivitä();});
|
||||
|
||||
root.setStyle(STYLE);
|
||||
root.setPadding(INSETS);
|
||||
root.setBorder(BORDER);
|
||||
this.setContent(root);
|
||||
}
|
||||
|
||||
/**
|
||||
* Metodi, jota kutsutaan kun tähän välilehteen palataan
|
||||
* Luokan toteuttaja määrittää, mitä tarvitsee päivittää välilehteen palattaessa
|
||||
*/
|
||||
public void päivitä() {}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fi.lpam.ruokamanageri.gui.tableCell;
|
||||
package fi.lpam.gui.tableCell;
|
||||
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
+7
-5
@@ -1,8 +1,9 @@
|
||||
package fi.lpam.ruokamanageri.gui.tableCell;
|
||||
package fi.lpam.gui.tableCell;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Asiakas;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Kuljetus;
|
||||
import fi.lpam.ruokamanageri.gui.KuljetusListat;
|
||||
import fi.lpam.dataluokat.Asiakas;
|
||||
import fi.lpam.dataluokat.Kuljetus;
|
||||
import fi.lpam.gui.KuljetusListat;
|
||||
import fi.lpam.gui.elementit.TabPohja;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
@@ -16,7 +17,8 @@ public class KuljetaTableCell extends TableCell<Kuljetus, Boolean> {
|
||||
|
||||
public KuljetaTableCell(HashMap<Integer, Asiakas> asiakkaat) {
|
||||
paddedNappi.setPadding(new Insets(3));
|
||||
Button nappi = new Button("Muuta");
|
||||
Button nappi = new Button("Kuljeta?");
|
||||
nappi.setFont(TabPohja.TEKSTI_FONT);
|
||||
paddedNappi.getChildren().add(nappi);
|
||||
nappi.setOnMouseClicked(_ -> {
|
||||
getTableView().getSelectionModel().select(getIndex());
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.gui.tableCell;
|
||||
package fi.lpam.gui.tableCell;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.RaporttiRivi;
|
||||
import fi.lpam.dataluokat.RaporttiRivi;
|
||||
import javafx.scene.control.TableCell;
|
||||
|
||||
import java.time.LocalDate;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fi.lpam.ruokamanageri.gui.virheDialogit;
|
||||
package fi.lpam.gui.virheDialogit;
|
||||
|
||||
public class SiirtoVirhe extends TietokantaVirhe{
|
||||
public SiirtoVirhe(Exception e){
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.gui.virheDialogit;
|
||||
package fi.lpam.gui.virheDialogit;
|
||||
|
||||
import fi.lpam.ruokamanageri.Main;
|
||||
import fi.lpam.Main;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
@@ -1,67 +0,0 @@
|
||||
package fi.lpam.ruokamanageri;
|
||||
import fi.lpam.ruokamanageri.dataluokat.Tietokanta;
|
||||
import fi.lpam.ruokamanageri.gui.Asiakashallinta;
|
||||
import fi.lpam.ruokamanageri.gui.Kierroshallinta;
|
||||
import fi.lpam.ruokamanageri.gui.KuljetusRaportit;
|
||||
import fi.lpam.ruokamanageri.gui.KuljetusListat;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Side;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@SuppressWarnings("InstantiationOfUtilityClass")
|
||||
public class App extends Application {
|
||||
static void main() {
|
||||
launch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
new Tietokanta(Main.dev);
|
||||
|
||||
TabPane root = new TabPane();
|
||||
root.setSide(Side.LEFT);
|
||||
root.setTabMinWidth(50);
|
||||
root.setTabMinHeight(35);
|
||||
root.setTabMaxHeight(50);
|
||||
|
||||
Tab asiakasHallinta, kierrostenHallinta, kuljetusListat, kuljetetut;
|
||||
asiakasHallinta = new Tab("Asiakashallinta", new Asiakashallinta());
|
||||
kierrostenHallinta = new Tab("Kierrostenhallinta");
|
||||
kuljetusListat = new Tab("Kuljetuslistat");
|
||||
kuljetetut = new Tab("Kuljetetut");
|
||||
root.getTabs().addAll(asiakasHallinta, kierrostenHallinta, kuljetusListat, kuljetetut);
|
||||
|
||||
root.getSelectionModel().selectedItemProperty().addListener((_, _, newValue) -> {
|
||||
switch (newValue.getText()) {
|
||||
case "Asiakashallinta": newValue.setContent(new Asiakashallinta()); break;
|
||||
case "Kierrostenhallinta": newValue.setContent(new Kierroshallinta()); break;
|
||||
case "Kuljetuslistat": newValue.setContent(new KuljetusListat()); break;
|
||||
case "Kuljetetut": newValue.setContent(new KuljetusRaportit()); break;
|
||||
}
|
||||
});
|
||||
|
||||
for (Tab tab : root.getTabs()) {
|
||||
tab.setClosable(false);
|
||||
tab.setStyle("-fx-font-size: 18px; -fx-font-weight: bold; -fx-font-family: Open Sans");
|
||||
}
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
primaryStage.setScene(scene);
|
||||
|
||||
StringBuilder title = new StringBuilder();
|
||||
title.append("Ruokamanageri");
|
||||
title.append(" v").append(Main.properties.getProperty("version"));
|
||||
if (Main.dev) title.append(" KEHITYS");
|
||||
primaryStage.setTitle(title.toString());
|
||||
|
||||
primaryStage.setMaximized(true);
|
||||
primaryStage.show();
|
||||
primaryStage.getIcons().add(new Image(Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream("kuljetusruokalaatikko.jpg"))));
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package fi.lpam.ruokamanageri;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Main {
|
||||
public static boolean dev;
|
||||
public static Properties properties;
|
||||
|
||||
static void main(String[] args) {
|
||||
//noinspection RedundantIfStatement
|
||||
if (args.length > 0) {
|
||||
dev = true;
|
||||
} else {
|
||||
dev = false;
|
||||
}
|
||||
|
||||
try {
|
||||
properties = new Properties();
|
||||
properties.load(Main.class.getClassLoader().getResourceAsStream("app.properties"));
|
||||
}
|
||||
catch (IOException e) {
|
||||
//noinspection CallToPrintStackTrace
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
App.main();
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package fi.lpam.ruokamanageri.gui.elementit;
|
||||
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
|
||||
/**
|
||||
* Käyttöliittymän pohja
|
||||
*/
|
||||
public class TabPohja extends StackPane {
|
||||
public static final Insets oletusInsets = new Insets(5);
|
||||
public static final String oletusStyle = "-fx-background-color: lightgray;";
|
||||
public static final Font buttonFont = Font.font("Open Sans", FontWeight.BOLD, 16);
|
||||
public static final Font tekstiFont = Font.font("Open Sans", FontWeight.NORMAL, 16);
|
||||
public static final Border oletusBorder = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, new CornerRadii(5), BorderWidths.DEFAULT));
|
||||
|
||||
public TabPohja() {
|
||||
this.setStyle(oletusStyle);
|
||||
this.setPadding(oletusInsets);
|
||||
this.setBorder(oletusBorder);
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.tulostajat;
|
||||
package fi.lpam.tulostajat;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.Kuljetus;
|
||||
import fi.lpam.dataluokat.Kuljetus;
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -44,7 +44,8 @@ public class KuljetusListaTulostaja extends Tulostaja{
|
||||
siirräOsoitinta(NIMEN_LEVEYS);
|
||||
sisältö.showText(kuljetus.getLisätieto());
|
||||
uusiRivi(RIVI_KORKEUS*0.1F);
|
||||
sisältö.showText("___________________________________________________________________"); //67 alaviivaa (noin sivun leveys)
|
||||
//67 alaviivaa fonttikoolla 13 (noin sivun leveys)
|
||||
sisältö.showText("_".repeat((int) (67*13/FONTTI_KOKO)));
|
||||
}
|
||||
|
||||
tulosta();
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fi.lpam.ruokamanageri.tulostajat;
|
||||
package fi.lpam.tulostajat;
|
||||
|
||||
import fi.lpam.ruokamanageri.dataluokat.RaporttiRivi;
|
||||
import fi.lpam.dataluokat.RaporttiRivi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package fi.lpam.ruokamanageri.tulostajat;
|
||||
package fi.lpam.tulostajat;
|
||||
|
||||
import fi.lpam.ruokamanageri.gui.virheDialogit.SiirtoVirhe;
|
||||
import fi.lpam.Main;
|
||||
import fi.lpam.gui.virheDialogit.SiirtoVirhe;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.pdmodel.PDPage;
|
||||
import org.apache.pdfbox.pdmodel.PDPageContentStream;
|
||||
@@ -17,7 +18,7 @@ import java.io.IOException;
|
||||
public abstract class Tulostaja {
|
||||
final PDRectangle SIVUKOKO = PDRectangle.A4;
|
||||
final PDFont FONTTI = new PDType1Font(Standard14Fonts.FontName.HELVETICA);
|
||||
final float FONTTI_KOKO = 13;
|
||||
final float FONTTI_KOKO = Float.parseFloat(Main.properties.getProperty("tulostusFonttiKoko"));
|
||||
final float MARGINAALI = 50;
|
||||
final float RIVI_KORKEUS = FONTTI_KOKO * 1.2F;
|
||||
|
||||
@@ -8,7 +8,8 @@ module fi.lpam.ruokamanageri {
|
||||
requires java.desktop;
|
||||
requires org.apache.pdfbox;
|
||||
requires org.apache.commons.lang3;
|
||||
requires one.jpro.platform.mdfx;
|
||||
|
||||
opens fi.lpam.ruokamanageri.dataluokat to javafx.base;
|
||||
exports fi.lpam.ruokamanageri;
|
||||
opens fi.lpam.dataluokat to javafx.base;
|
||||
exports fi.lpam;
|
||||
}
|
||||
@@ -1,3 +1,14 @@
|
||||
# 3.2.0
|
||||
- Lisätty Asetukset -välilehti
|
||||
- Asiakkaan voi poistaa ilman, että se rikkoo kierroksia
|
||||
- Ohjelma ei enään kaadu, mikäli on tallentamaton kierros kierroshallinnassa
|
||||
- Yhtenäistetty ulkoasua välilehtien välillä
|
||||
|
||||
# 3.1.0
|
||||
- Muutosloki näkyy käynnistäessä uutta versiota ensimmäistä kertaa
|
||||
- Ohjelman taustariippuvuuksia päivitetty
|
||||
- Yleistä huoltoa
|
||||
|
||||
# 3.0.1
|
||||
- Kierroshallinnan muokkaus tukemaan paremmin useampaa kierrosta
|
||||
- Kosmeettisia viilauksia muuallekin
|
||||
@@ -1,2 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: fi.lpam.ruokamanageri.Main
|
||||
@@ -1 +0,0 @@
|
||||
version=${project.version}
|
||||
@@ -0,0 +1,13 @@
|
||||
version=${project.version}
|
||||
|
||||
buttonFonttiKoko=16
|
||||
buttonFontti=Arial
|
||||
|
||||
tekstiFonttiKoko=16
|
||||
tekstiFontti=Arial
|
||||
|
||||
tulostusFonttiKoko=13
|
||||
|
||||
taustaVari=lightgray
|
||||
|
||||
insets=5
|
||||
Reference in New Issue
Block a user