added implementation for the grid button, name + color
This commit is contained in:
parent
4b80f983fb
commit
26e474a486
Binary file not shown.
|
@ -358,7 +358,7 @@
|
|||
<Font name="Cantarell Regular" size="26.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" cancelButton="true" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="148.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" cancelButton="true" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="180.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="19.0" />
|
||||
</font>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -84,6 +84,7 @@ public class Main extends Application
|
|||
dbc.dbname = mwc.getDatabaseName(); // handover database name
|
||||
dbc.connectDatabase(); // estabishing DB conection
|
||||
mwc.fillTablePositionen(); // fill TreeTable 'Positionen'
|
||||
mwc.loadGridButtons();
|
||||
} else {
|
||||
// config.xml NOT found, first start of app
|
||||
System.out.println("keine XML gefunden!");
|
||||
|
|
|
@ -358,7 +358,7 @@
|
|||
<Font name="Cantarell Regular" size="26.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" cancelButton="true" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="148.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" cancelButton="true" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="180.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="19.0" />
|
||||
</font>
|
||||
|
|
|
@ -280,6 +280,8 @@ public class MainWindowController
|
|||
|
||||
private String databaseName;
|
||||
|
||||
private boolean lockState = false;
|
||||
|
||||
@FXML
|
||||
TreeItem<tableData> rootCurrentJob = new TreeItem<>(
|
||||
new tableData(0, "0", "0"));
|
||||
|
@ -301,7 +303,7 @@ public class MainWindowController
|
|||
Dialog<Pair<String, String>> dialog = new Dialog<>();
|
||||
dialog.setTitle("Über jFxKasse");
|
||||
dialog.setHeaderText(
|
||||
"Informationen und Lizenzen - Version 0.8 - UI Techdemo");
|
||||
"Informationen und Lizenzen - Version 0.9 - Techdemo");
|
||||
|
||||
dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
|
||||
|
||||
|
@ -360,6 +362,7 @@ public class MainWindowController
|
|||
dbc.setColor(idPositionen, getColorCodes(selectedColorName));
|
||||
|
||||
fillTablePositionen(); // fill TreeTable 'Positionen'
|
||||
loadGridButtons();
|
||||
|
||||
}
|
||||
|
||||
|
@ -395,7 +398,17 @@ public class MainWindowController
|
|||
@FXML
|
||||
public void btnLockAction(ActionEvent event)
|
||||
{
|
||||
System.out.println("Button!");
|
||||
lockState = !lockState;
|
||||
|
||||
blockUI(lockState);
|
||||
|
||||
|
||||
if(lockState) {
|
||||
btnLock.setText("Kasse entsperren");
|
||||
}else {
|
||||
btnLock.setText("Kasse sperren");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
@ -583,9 +596,10 @@ public class MainWindowController
|
|||
System.out.println("initUI");
|
||||
tftNewDBName.setText(getDatabaseName());
|
||||
initPositionen();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initPositionen()
|
||||
{
|
||||
entryTreeTable.setRoot(rootPositionen);
|
||||
|
@ -666,16 +680,12 @@ public class MainWindowController
|
|||
|
||||
}
|
||||
|
||||
|
||||
public void setMain(Main main, DBController dbc)
|
||||
{
|
||||
this.main = main;
|
||||
this.dbc = dbc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getSystemDatum()
|
||||
{
|
||||
java.util.Date now = new java.util.Date();
|
||||
|
@ -685,7 +695,6 @@ public class MainWindowController
|
|||
return heutigesDatum;
|
||||
}
|
||||
|
||||
|
||||
public void saveSettings(String databasename) throws Exception
|
||||
{ // Save settings to config.xml
|
||||
OutputStream outputStream;
|
||||
|
@ -698,7 +707,6 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean loadSettings() throws Exception
|
||||
{ // reads the settings from config.xml
|
||||
InputStream inputStream;
|
||||
|
@ -714,21 +722,16 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getDatabaseName()
|
||||
{
|
||||
return databaseName;
|
||||
}
|
||||
|
||||
|
||||
public void setDatabaseName(String NewDatabaseName)
|
||||
{
|
||||
databaseName = NewDatabaseName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setDBLabel() throws Exception
|
||||
{
|
||||
if (loadSettings() == true) {
|
||||
|
@ -749,7 +752,6 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private String getColorCodes(String pColorName)
|
||||
{
|
||||
switch (pColorName) {
|
||||
|
@ -775,8 +777,6 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String getColorNames(String pColorCode)
|
||||
{
|
||||
switch (pColorCode) {
|
||||
|
@ -802,7 +802,6 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private Integer getColorID(String pColorCode)
|
||||
{
|
||||
switch (pColorCode) {
|
||||
|
@ -828,7 +827,6 @@ public class MainWindowController
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void blockUI(boolean pState)
|
||||
{
|
||||
btnCalcStats.setDisable(pState);
|
||||
|
@ -838,31 +836,10 @@ public class MainWindowController
|
|||
btnReprintJob.setDisable(pState);
|
||||
btnSaveEntry.setDisable(pState);
|
||||
btnCancelJob.setDisable(pState);
|
||||
gridButton01.setDisable(pState);
|
||||
gridButton02.setDisable(pState);
|
||||
gridButton03.setDisable(pState);
|
||||
gridButton04.setDisable(pState);
|
||||
gridButton05.setDisable(pState);
|
||||
gridButton06.setDisable(pState);
|
||||
gridButton07.setDisable(pState);
|
||||
gridButton08.setDisable(pState);
|
||||
gridButton09.setDisable(pState);
|
||||
gridButton10.setDisable(pState);
|
||||
gridButton11.setDisable(pState);
|
||||
gridButton12.setDisable(pState);
|
||||
gridButton13.setDisable(pState);
|
||||
gridButton14.setDisable(pState);
|
||||
gridButton15.setDisable(pState);
|
||||
gridButton16.setDisable(pState);
|
||||
gridButton17.setDisable(pState);
|
||||
gridButton18.setDisable(pState);
|
||||
gridButton19.setDisable(pState);
|
||||
gridButton20.setDisable(pState);
|
||||
gridButton21.setDisable(pState);
|
||||
gridButton22.setDisable(pState);
|
||||
gridButton23.setDisable(pState);
|
||||
gridButton24.setDisable(pState);
|
||||
gridButton25.setDisable(pState);
|
||||
|
||||
for(int i = 0; i < 25; i++) {
|
||||
getButtonByID(i).setDisable(pState);
|
||||
}
|
||||
|
||||
tftNewPosition.setDisable(pState);
|
||||
tftNewValue.setDisable(pState);
|
||||
|
@ -878,4 +855,86 @@ public class MainWindowController
|
|||
titlePaneStats.setVisible(!pState);
|
||||
}
|
||||
|
||||
public void loadGridButtons()
|
||||
{
|
||||
|
||||
for (int i = 0; i < 25; i++) {
|
||||
|
||||
getButtonByID(i).setText(dbc.getName(i+1));
|
||||
getButtonByID(i).setStyle("-fx-background-color: "+ dbc.getColor(i+1) +";");
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < 25; i++) {
|
||||
|
||||
if(dbc.getName(i+1).equals("Noch frei")) {
|
||||
getButtonByID(i).setVisible(false);
|
||||
}else {
|
||||
getButtonByID(i).setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Button getButtonByID(int pID) {
|
||||
switch (pID) {
|
||||
case 0:
|
||||
return gridButton01;
|
||||
case 1:
|
||||
return gridButton02;
|
||||
case 2:
|
||||
return gridButton03;
|
||||
case 3:
|
||||
return gridButton04;
|
||||
case 4:
|
||||
return gridButton05;
|
||||
case 5:
|
||||
return gridButton06;
|
||||
case 6:
|
||||
return gridButton07;
|
||||
case 7:
|
||||
return gridButton08;
|
||||
case 8:
|
||||
return gridButton09;
|
||||
case 9:
|
||||
return gridButton10;
|
||||
case 10:
|
||||
return gridButton11;
|
||||
case 11:
|
||||
return gridButton12;
|
||||
case 12:
|
||||
return gridButton13;
|
||||
case 13:
|
||||
return gridButton14;
|
||||
case 14:
|
||||
return gridButton15;
|
||||
case 15:
|
||||
return gridButton16;
|
||||
case 16:
|
||||
return gridButton17;
|
||||
case 17:
|
||||
return gridButton18;
|
||||
case 18:
|
||||
return gridButton19;
|
||||
case 19:
|
||||
return gridButton20;
|
||||
case 20:
|
||||
return gridButton21;
|
||||
case 21:
|
||||
return gridButton22;
|
||||
case 22:
|
||||
return gridButton23;
|
||||
case 23:
|
||||
return gridButton24;
|
||||
case 24:
|
||||
return gridButton25;
|
||||
default:
|
||||
return gridButton01;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue