server
Clone or download
Modified Files
M
src/main/java/com/stream_pi/server/window/dashboard/actiondetailpane/ActionDetailsPane.java
+69
−28
package com.stream_pi.server.window.dashboard.actiondetailpane;
package com.stream_pi.server.window.dashboard.actiondetailpane;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.action.DisplayTextAlignment;
import com.stream_pi.action_api.action.DisplayTextAlignment;
import com.stream_pi.action_api.action.Location;
import com.stream_pi.action_api.action.Location;
import com.stream_pi.action_api.actionproperty.ClientProperties;
import com.stream_pi.action_api.actionproperty.ClientProperties;
import com.stream_pi.action_api.actionproperty.property.ControlType;
import com.stream_pi.action_api.actionproperty.property.ControlType;
import com.stream_pi.action_api.actionproperty.property.FileExtensionFilter;
import com.stream_pi.action_api.actionproperty.property.FileExtensionFilter;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.action_api.otheractions.CombineAction;
import com.stream_pi.action_api.otheractions.CombineAction;
import com.stream_pi.action_api.otheractions.FolderAction;
import com.stream_pi.action_api.otheractions.FolderAction;
import com.stream_pi.server.uipropertybox.UIPropertyBox;
import com.stream_pi.server.uipropertybox.UIPropertyBox;
import com.stream_pi.server.client.Client;
import com.stream_pi.server.client.Client;
import com.stream_pi.server.client.ClientProfile;
import com.stream_pi.server.client.ClientProfile;
import com.stream_pi.server.connection.ClientConnection;
import com.stream_pi.server.connection.ClientConnection;
import com.stream_pi.server.connection.ClientConnections;
import com.stream_pi.server.connection.ClientConnections;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.server.controller.ActionDataFormats;
import com.stream_pi.server.controller.ActionDataFormats;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionGridPaneListener;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionGridPaneListener;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.SevereException;
import com.stream_pi.util.exception.SevereException;
import com.stream_pi.util.uihelper.HBoxInputBox;
import com.stream_pi.util.uihelper.HBoxInputBox;
import com.stream_pi.util.uihelper.HBoxInputBoxWithFileChooser;
import com.stream_pi.util.uihelper.HBoxInputBoxWithFileChooser;
import com.stream_pi.util.uihelper.SpaceFiller;
import com.stream_pi.util.uihelper.SpaceFiller;
import javafx.application.HostServices;
import javafx.application.HostServices;
import javafx.collections.FXCollections;
import javafx.collections.FXCollections;
import javafx.concurrent.Task;
import javafx.concurrent.Task;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.control.*;
import javafx.scene.input.Dragboard;
import javafx.scene.input.Dragboard;
import javafx.scene.input.TransferMode;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser;
import javafx.stage.Window;
import javafx.stage.Window;
import javafx.util.Callback;
import javafx.util.Callback;
import org.kordamp.ikonli.javafx.FontIcon;
import org.kordamp.ikonli.javafx.FontIcon;
import java.io.File;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.logging.Logger;
public class ActionDetailsPane extends VBox implements ActionDetailsPaneListener
public class ActionDetailsPane extends VBox implements ActionDetailsPaneListener
{
{
private ScrollPane scrollPane;
private ScrollPane scrollPane;
private VBox vbox;
private VBox vbox;
private VBox clientPropertiesVBox;
private VBox clientPropertiesVBox;
private Button saveButton;
private Button saveButton;
private Button deleteButton;
private Button deleteButton;
private Button openFolderButton;
private Button openFolderButton;
private Button resetToDefaultsFolderButton;
private HBox buttonBar;
private HBox buttonBar;
private VBox pluginExtraButtonBar;
private VBox pluginExtraButtonBar;
private Label actionHeadingLabel;
private Label actionHeadingLabel;
private Logger logger;
private Logger logger;
private Button returnButtonForCombineActionChild;
private Button returnButtonForCombineActionChild;
private ExceptionAndAlertHandler exceptionAndAlertHandler;
private ExceptionAndAlertHandler exceptionAndAlertHandler;
private HostServices hostServices;
private HostServices hostServices;
private ActionGridPaneListener actionGridPaneListener;
private ActionGridPaneListener actionGridPaneListener;
public ActionDetailsPane(ExceptionAndAlertHandler exceptionAndAlertHandler, HostServices hostServices,
public ActionDetailsPane(ExceptionAndAlertHandler exceptionAndAlertHandler, HostServices hostServices,
ActionGridPaneListener actionGridPaneListener)
ActionGridPaneListener actionGridPaneListener)
{
{
this.hostServices = hostServices;
this.hostServices = hostServices;
this.exceptionAndAlertHandler = exceptionAndAlertHandler;
this.exceptionAndAlertHandler = exceptionAndAlertHandler;
this.actionGridPaneListener = actionGridPaneListener;
this.actionGridPaneListener = actionGridPaneListener;
logger = Logger.getLogger(ActionDetailsPane.class.getName());
logger = Logger.getLogger(ActionDetailsPane.class.getName());
setSpacing(10.0);
setSpacing(10.0);
clientPropertiesVBox = new VBox();
clientPropertiesVBox = new VBox();
clientPropertiesVBox.setSpacing(10.0);
clientPropertiesVBox.setSpacing(10.0);
vbox = new VBox();
vbox = new VBox();
vbox.setPadding(new Insets(0, 25, 0, 5));
vbox.setPadding(new Insets(0, 25, 0, 5));
vbox.getStyleClass().add("action_details_pane_vbox");
vbox.getStyleClass().add("action_details_pane_vbox");
vbox.setSpacing(10.0);
vbox.setSpacing(10.0);
pluginExtraButtonBar = new VBox();
pluginExtraButtonBar = new VBox();
pluginExtraButtonBar.setSpacing(10.0);
pluginExtraButtonBar.setSpacing(10.0);
getStyleClass().add("action_details_pane");
getStyleClass().add("action_details_pane");
scrollPane = new ScrollPane();
scrollPane = new ScrollPane();
VBox.setMargin(scrollPane, new Insets(0, 0, 0, 10));
VBox.setMargin(scrollPane, new Insets(0, 0, 0, 10));
scrollPane.getStyleClass().add("action_details_pane_scroll_pane");
scrollPane.getStyleClass().add("action_details_pane_scroll_pane");
setMinHeight(210);
setMinHeight(210);
scrollPane.setContent(vbox);
scrollPane.setContent(vbox);
vbox.prefWidthProperty().bind(scrollPane.widthProperty());
vbox.prefWidthProperty().bind(scrollPane.widthProperty());
scrollPane.prefWidthProperty().bind(widthProperty());
scrollPane.prefWidthProperty().bind(widthProperty());
VBox.setVgrow(scrollPane, Priority.ALWAYS);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
openFolderButton = new Button("Open Folder");
openFolderButton = new Button("Open Folder");
FontIcon folderOpenIcon = new FontIcon("far-folder-open");
FontIcon folderOpenIcon = new FontIcon("far-folder-open");
openFolderButton.setGraphic(folderOpenIcon);
openFolderButton.setGraphic(folderOpenIcon);
openFolderButton.setOnAction(event -> onOpenFolderButtonClicked());
openFolderButton.setOnAction(event -> onOpenFolderButtonClicked());
saveButton = new Button("Apply Changes");
saveButton = new Button("Apply Changes");
FontIcon syncIcon = new FontIcon("fas-sync-alt");
saveButton.getStyleClass().add("action_details_pane_save_button");
FontIcon syncIcon = new FontIcon("far-save");
syncIcon.getStyleClass().add("action_details_save_delete_button_icon");
saveButton.setGraphic(syncIcon);
saveButton.setGraphic(syncIcon);
saveButton.setOnAction(event -> onSaveButtonClicked());
saveButton.setOnAction(event -> onSaveButtonClicked());
deleteButton = new Button("Delete action");
deleteButton = new Button("Delete action");
deleteButton.getStyleClass().add("action_details_pane_delete_button");
deleteButton.getStyleClass().add("action_details_pane_delete_button");
FontIcon deleteIcon = new FontIcon("fas-trash");
FontIcon deleteIcon = new FontIcon("fas-trash");
deleteIcon.getStyleClass().add("action_details_pane_delete_button_icon");
deleteIcon.getStyleClass().add("action_details_pane_delete_button_icon");
deleteButton.setGraphic(deleteIcon);
deleteButton.setGraphic(deleteIcon);
deleteButton.setOnAction(event -> onDeleteButtonClicked());
deleteButton.setOnAction(event -> onDeleteButtonClicked());
resetToDefaultsFolderButton = new Button("Reset");
resetToDefaultsFolderButton.getStyleClass().add("action_details_pane_reset_button");
FontIcon resetToDefaultsIcon = new FontIcon("fas-sync-alt");
resetToDefaultsIcon.getStyleClass().add("action_details_pane_reset_button_icon");
resetToDefaultsFolderButton.setGraphic(resetToDefaultsIcon);
resetToDefaultsFolderButton.setOnAction(event -> onResetToDefaultsButtonClicked());
returnButtonForCombineActionChild = new Button("Return");
returnButtonForCombineActionChild = new Button("Return");
returnButtonForCombineActionChild.setGraphic(new FontIcon("fas-caret-left"));
returnButtonForCombineActionChild.setGraphic(new FontIcon("fas-caret-left"));
returnButtonForCombineActionChild.managedProperty().bind(returnButtonForCombineActionChild.visibleProperty());
returnButtonForCombineActionChild.managedProperty().bind(returnButtonForCombineActionChild.visibleProperty());
returnButtonForCombineActionChild.setOnAction(event -> {
returnButtonForCombineActionChild.setOnAction(event -> {
try {
try {
logger.info("@@## : " + getAction().getParent());
logger.info("@@## : " + getAction().getParent());
onActionClicked(getClientProfile().getActionByID(getAction().getParent()), getActionBox());
onActionClicked(getClientProfile().getActionByID(getAction().getParent()), getActionBox());
} catch (MinorException e) {
} catch (MinorException e) {
e.printStackTrace();
e.printStackTrace();
}
}
});
});
buttonBar = new HBox(openFolderButton, returnButtonForCombineActionChild, saveButton, deleteButton);
buttonBar = new HBox(openFolderButton, resetToDefaultsFolderButton, returnButtonForCombineActionChild, saveButton, deleteButton);
buttonBar.getStyleClass().add("action_details_pane_button_bar");
buttonBar.getStyleClass().add("action_details_pane_button_bar");
buttonBar.setPadding(new Insets(10, 10, 10, 0));
buttonBar.setPadding(new Insets(10, 10, 10, 0));
buttonBar.setAlignment(Pos.CENTER_RIGHT);
buttonBar.setAlignment(Pos.CENTER_RIGHT);
buttonBar.setVisible(false);
buttonBar.setVisible(false);
buttonBar.setSpacing(10.0);
buttonBar.setSpacing(10.0);
actionHeadingLabel = new Label();
actionHeadingLabel = new Label();
actionHeadingLabel.getStyleClass().add("action_details_pane_heading_label");
actionHeadingLabel.getStyleClass().add("action_details_pane_heading_label");
HBox headingHBox = new HBox(actionHeadingLabel);
HBox headingHBox = new HBox(actionHeadingLabel);
headingHBox.getStyleClass().add("action_details_pane_heading_box");
headingHBox.getStyleClass().add("action_details_pane_heading_box");
headingHBox.setPadding(new Insets(5, 10, 0, 10));
headingHBox.setPadding(new Insets(5, 10, 0, 10));
getChildren().addAll(headingHBox, scrollPane, buttonBar);
getChildren().addAll(headingHBox, scrollPane, buttonBar);
displayTextAlignmentComboBox = new ComboBox<>(FXCollections.observableArrayList(DisplayTextAlignment.TOP,
displayTextAlignmentComboBox = new ComboBox<>(FXCollections.observableArrayList(DisplayTextAlignment.TOP,
DisplayTextAlignment.CENTER, DisplayTextAlignment.BOTTOM));
DisplayTextAlignment.CENTER, DisplayTextAlignment.BOTTOM));
displayTextAlignmentComboBox.managedProperty().bind(displayTextAlignmentComboBox.visibleProperty());
displayTextAlignmentComboBox.managedProperty().bind(displayTextAlignmentComboBox.visibleProperty());
Callback<ListView<DisplayTextAlignment>, ListCell<DisplayTextAlignment>> displayTextAlignmentComboBoxFactory = new Callback<>() {
Callback<ListView<DisplayTextAlignment>, ListCell<DisplayTextAlignment>> displayTextAlignmentComboBoxFactory = new Callback<>() {
@Override
@Override
public ListCell<DisplayTextAlignment> call(ListView<DisplayTextAlignment> displayTextAlignment) {
public ListCell<DisplayTextAlignment> call(ListView<DisplayTextAlignment> displayTextAlignment) {
return new ListCell<>() {
return new ListCell<>() {
@Override
@Override
protected void updateItem(DisplayTextAlignment displayTextAlignment, boolean b) {
protected void updateItem(DisplayTextAlignment displayTextAlignment, boolean b) {
super.updateItem(displayTextAlignment, b);
super.updateItem(displayTextAlignment, b);
if (displayTextAlignment != null) {
if (displayTextAlignment != null) {
setText(displayTextAlignment.getUIName());
setText(displayTextAlignment.getUIName());
}
}
}
}
};
};
}
}
};
};
displayTextAlignmentComboBox.setCellFactory(displayTextAlignmentComboBoxFactory);
displayTextAlignmentComboBox.setCellFactory(displayTextAlignmentComboBoxFactory);
displayTextAlignmentComboBox.setButtonCell(displayTextAlignmentComboBoxFactory.call(null));
displayTextAlignmentComboBox.setButtonCell(displayTextAlignmentComboBoxFactory.call(null));
actionClientProperties = new ArrayList<>();
actionClientProperties = new ArrayList<>();
displayNameTextField = new TextField();
displayNameTextField = new TextField();
displayNameTextField.managedProperty().bind(displayNameTextField.visibleProperty());
displayNameTextField.managedProperty().bind(displayNameTextField.visibleProperty());
defaultIconFileTextField = new TextField();
defaultIconFileTextField = new TextField();
defaultIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
defaultIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
try {
try {
if (!s.equals(t1) && t1.length() > 0) {
if (!s.equals(t1) && t1.length() > 0) {
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
hideDefaultIconCheckBox.setDisable(false);
hideDefaultIconCheckBox.setDisable(false);
hideDefaultIconCheckBox.setSelected(false);
hideDefaultIconCheckBox.setSelected(false);
clearIconButton.setDisable(false);
clearIconButton.setDisable(false);
getAction().addIcon("default", iconFileByteArray);
getAction().addIcon("default", iconFileByteArray);
getAction().setCurrentIconState("default");
setSendIcon(true);
setSendIcon(true);
}
}
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
}
}
});
});
toggleOffIconFileTextField = new TextField();
toggleOffIconFileTextField = new TextField();
toggleOffIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
toggleOffIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
try {
try {
if (!s.equals(t1) && t1.length() > 0) {
if (!s.equals(t1) && t1.length() > 0) {
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
hideToggleOffIconCheckBox.setDisable(false);
hideToggleOffIconCheckBox.setDisable(false);
hideToggleOffIconCheckBox.setSelected(false);
hideToggleOffIconCheckBox.setSelected(false);
clearIconButton.setDisable(false);
clearIconButton.setDisable(false);
getAction().addIcon("toggle_off", iconFileByteArray);
getAction().addIcon("toggle_off", iconFileByteArray);
setSendIcon(true);
setSendIcon(true);
}
}
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
}
}
});
});
toggleOnIconFileTextField = new TextField();
toggleOnIconFileTextField = new TextField();
toggleOnIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
toggleOnIconFileTextField.textProperty().addListener((observableValue, s, t1) -> {
try {
try {
if (!s.equals(t1) && t1.length() > 0) {
if (!s.equals(t1) && t1.length() > 0) {
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
byte[] iconFileByteArray = Files.readAllBytes(new File(t1).toPath());
hideToggleOnIconCheckBox.setDisable(false);
hideToggleOnIconCheckBox.setDisable(false);
hideToggleOnIconCheckBox.setSelected(false);
hideToggleOnIconCheckBox.setSelected(false);
clearIconButton.setDisable(false);
clearIconButton.setDisable(false);
getAction().addIcon("toggle_on", iconFileByteArray);
getAction().addIcon("toggle_on", iconFileByteArray);
setSendIcon(true);
setSendIcon(true);
}
}
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
exceptionAndAlertHandler.handleMinorException(new MinorException(e.getMessage()));
}
}
});
});
clearIconButton = new Button("Clear Icon");
clearIconButton = new Button("Clear Icon");
clearIconButton.managedProperty().bind(clearIconButton.visibleProperty());
clearIconButton.managedProperty().bind(clearIconButton.visibleProperty());
clearIconButton.setOnAction(event -> {
clearIconButton.setOnAction(event -> {
hideDefaultIconCheckBox.setDisable(true);
hideDefaultIconCheckBox.setDisable(true);
hideDefaultIconCheckBox.setSelected(false);
hideDefaultIconCheckBox.setSelected(false);
hideToggleOffIconCheckBox.setDisable(true);
hideToggleOffIconCheckBox.setDisable(true);
hideToggleOffIconCheckBox.setSelected(false);
hideToggleOffIconCheckBox.setSelected(false);
hideToggleOnIconCheckBox.setDisable(true);
hideToggleOnIconCheckBox.setDisable(true);
hideToggleOnIconCheckBox.setSelected(false);
hideToggleOnIconCheckBox.setSelected(false);
clearIconButton.setDisable(true);
clearIconButton.setDisable(true);
setSendIcon(false);
setSendIcon(false);
defaultIconFileTextField.clear();
defaultIconFileTextField.clear();
toggleOffIconFileTextField.clear();
toggleOffIconFileTextField.clear();
toggleOnIconFileTextField.clear();
toggleOnIconFileTextField.clear();
});
});
hideDisplayTextCheckBox = new CheckBox("Hide");
hideDisplayTextCheckBox = new CheckBox("Hide");
hideDisplayTextCheckBox.managedProperty().bind(hideDisplayTextCheckBox.visibleProperty());
hideDisplayTextCheckBox.managedProperty().bind(hideDisplayTextCheckBox.visibleProperty());
hideDefaultIconCheckBox = new CheckBox("Hide");
hideDefaultIconCheckBox = new CheckBox("Hide");
hideToggleOnIconCheckBox = new CheckBox("Hide");
hideToggleOnIconCheckBox = new CheckBox("Hide");
hideToggleOffIconCheckBox = new CheckBox("Hide");
hideToggleOffIconCheckBox = new CheckBox("Hide");
actionBackgroundColourPicker = new ColorPicker();
actionBackgroundColourPicker = new ColorPicker();
actionBackgroundColourPicker.managedProperty().bind(actionBackgroundColourPicker.visibleProperty());
actionBackgroundColourPicker.managedProperty().bind(actionBackgroundColourPicker.visibleProperty());
displayTextColourPicker = new ColorPicker();
displayTextColourPicker = new ColorPicker();
displayTextColourPicker.managedProperty().bind(displayTextColourPicker.visibleProperty());
displayTextColourPicker.managedProperty().bind(displayTextColourPicker.visibleProperty());
actionBackgroundColourTransparentCheckBox = new CheckBox("Default");
actionBackgroundColourTransparentCheckBox = new CheckBox("Default");
actionBackgroundColourPicker.disableProperty()
actionBackgroundColourPicker.disableProperty()
.bind(actionBackgroundColourTransparentCheckBox.selectedProperty());
.bind(actionBackgroundColourTransparentCheckBox.selectedProperty());
HBox.setMargin(actionBackgroundColourTransparentCheckBox, new Insets(0, 0, 0, 10));
HBox.setMargin(actionBackgroundColourTransparentCheckBox, new Insets(0, 0, 0, 10));
displayTextColourDefaultCheckBox = new CheckBox("Default");
displayTextColourDefaultCheckBox = new CheckBox("Default");
displayTextColourPicker.disableProperty()
displayTextColourPicker.disableProperty()
.bind(displayTextColourDefaultCheckBox.selectedProperty());
.bind(displayTextColourDefaultCheckBox.selectedProperty());
HBox.setMargin(displayTextColourDefaultCheckBox, new Insets(0, 0, 0, 10));
HBox.setMargin(displayTextColourDefaultCheckBox, new Insets(0, 0, 0, 10));
HBox displayTextColourHBox = new HBox(new Label("Display Text Colour"), SpaceFiller.horizontal(), displayTextColourPicker,
HBox displayTextColourHBox = new HBox(new Label("Display Text Colour"), SpaceFiller.horizontal(), displayTextColourPicker,
displayTextColourDefaultCheckBox);
displayTextColourDefaultCheckBox);
displayTextColourHBox.setAlignment(Pos.CENTER);
displayTextColourHBox.setAlignment(Pos.CENTER);
displayTextColourHBox.setSpacing(5.0);
displayTextColourHBox.setSpacing(5.0);
HBox bgColourHBox = new HBox(new Label("Background Colour"), SpaceFiller.horizontal(), actionBackgroundColourPicker,
HBox bgColourHBox = new HBox(new Label("Background Colour"), SpaceFiller.horizontal(), actionBackgroundColourPicker,
actionBackgroundColourTransparentCheckBox);
actionBackgroundColourTransparentCheckBox);
bgColourHBox.setAlignment(Pos.CENTER);
bgColourHBox.setAlignment(Pos.CENTER);
bgColourHBox.setSpacing(5.0);
bgColourHBox.setSpacing(5.0);
HBox clearIconHBox = new HBox(clearIconButton);
HBox clearIconHBox = new HBox(clearIconButton);
clearIconHBox.setAlignment(Pos.CENTER_RIGHT);
clearIconHBox.setAlignment(Pos.CENTER_RIGHT);
displayTextFieldHBox = new HBoxInputBox("Display Name", displayNameTextField, hideDisplayTextCheckBox);
displayTextFieldHBox = new HBoxInputBox("Display Name", displayNameTextField, hideDisplayTextCheckBox);
HBox alignmentHBox = new HBox(new Label("Alignment"), SpaceFiller.horizontal(),
HBox alignmentHBox = new HBox(new Label("Alignment"), SpaceFiller.horizontal(),
displayTextAlignmentComboBox);
displayTextAlignmentComboBox);
normalToggleActionCommonPropsVBox = new VBox(
normalToggleActionCommonPropsVBox = new VBox(
displayTextColourHBox,
displayTextColourHBox,
alignmentHBox,
alignmentHBox,
bgColourHBox,
bgColourHBox,
clearIconHBox
clearIconHBox
);
);
normalToggleActionCommonPropsVBox.managedProperty().bind(normalToggleActionCommonPropsVBox.visibleProperty());
normalToggleActionCommonPropsVBox.managedProperty().bind(normalToggleActionCommonPropsVBox.visibleProperty());
normalToggleActionCommonPropsVBox.setSpacing(10.0);
normalToggleActionCommonPropsVBox.setSpacing(10.0);
normalActionsPropsVBox = new VBox(
normalActionsPropsVBox = new VBox(
new HBoxInputBoxWithFileChooser("Icon", defaultIconFileTextField, hideDefaultIconCheckBox,
new HBoxInputBoxWithFileChooser("Icon", defaultIconFileTextField, hideDefaultIconCheckBox,
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif"))
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif"))
);
);
normalActionsPropsVBox.managedProperty().bind(normalActionsPropsVBox.visibleProperty());
normalActionsPropsVBox.managedProperty().bind(normalActionsPropsVBox.visibleProperty());
normalActionsPropsVBox.setSpacing(10.0);
normalActionsPropsVBox.setSpacing(10.0);
toggleActionsPropsVBox = new VBox(
toggleActionsPropsVBox = new VBox(
new HBoxInputBoxWithFileChooser("Toggle Off Icon", toggleOffIconFileTextField, hideToggleOffIconCheckBox,
new HBoxInputBoxWithFileChooser("Toggle Off Icon", toggleOffIconFileTextField, hideToggleOffIconCheckBox,
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif")),
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif")),
new HBoxInputBoxWithFileChooser("Toggle On Icon", toggleOnIconFileTextField, hideToggleOnIconCheckBox,
new HBoxInputBoxWithFileChooser("Toggle On Icon", toggleOnIconFileTextField, hideToggleOnIconCheckBox,
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif"))
new FileChooser.ExtensionFilter("Images", "*.jpeg", "*.jpg", "*.png", "*.gif"))
);
);
toggleActionsPropsVBox.managedProperty().bind(toggleActionsPropsVBox.visibleProperty());
toggleActionsPropsVBox.managedProperty().bind(toggleActionsPropsVBox.visibleProperty());
toggleActionsPropsVBox.setSpacing(10.0);
toggleActionsPropsVBox.setSpacing(10.0);
vbox.getChildren().addAll(displayTextFieldHBox,normalToggleActionCommonPropsVBox,
vbox.getChildren().addAll(displayTextFieldHBox,normalToggleActionCommonPropsVBox,
normalActionsPropsVBox, toggleActionsPropsVBox, clientPropertiesVBox,
normalActionsPropsVBox, toggleActionsPropsVBox, clientPropertiesVBox,
pluginExtraButtonBar);
pluginExtraButtonBar);
vbox.setVisible(false);
vbox.setVisible(false);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
setOnDragOver(dragEvent -> {
setOnDragOver(dragEvent -> {
if (dragEvent.getDragboard().hasContent(ActionDataFormats.ACTION_TYPE) && action != null) {
if (dragEvent.getDragboard().hasContent(ActionDataFormats.ACTION_TYPE) && action != null) {
if (getAction().getActionType() == ActionType.COMBINE) {
if (getAction().getActionType() == ActionType.COMBINE) {
dragEvent.acceptTransferModes(TransferMode.ANY);
dragEvent.acceptTransferModes(TransferMode.ANY);
dragEvent.consume();
dragEvent.consume();
}
}
}
}
});
});
setOnDragDropped(dragEvent -> {
setOnDragDropped(dragEvent -> {
try {
try {
Dragboard db = dragEvent.getDragboard();
Dragboard db = dragEvent.getDragboard();
ActionType actionType = (ActionType) db.getContent(ActionDataFormats.ACTION_TYPE);
ActionType actionType = (ActionType) db.getContent(ActionDataFormats.ACTION_TYPE);
if(actionType == ActionType.NORMAL || actionType == ActionType.TOGGLE)
if(actionType == ActionType.NORMAL || actionType == ActionType.TOGGLE)
{
{
ExternalPlugin newAction = actionGridPaneListener.createNewActionFromExternalPlugin(
ExternalPlugin newAction = actionGridPaneListener.createNewActionFromExternalPlugin(
(String) db.getContent(ActionDataFormats.MODULE_NAME)
(String) db.getContent(ActionDataFormats.MODULE_NAME)
);
);
boolean isNew = (boolean) db.getContent(ActionDataFormats.IS_NEW);
boolean isNew = (boolean) db.getContent(ActionDataFormats.IS_NEW);
if(isNew)
if(isNew)
{
{
newAction.setDisplayText("Untitled Action");
newAction.setDisplayText("Untitled Action");
newAction.setShowDisplayText(true);
newAction.setShowDisplayText(true);
newAction.setDisplayTextAlignment(DisplayTextAlignment.CENTER);
newAction.setDisplayTextAlignment(DisplayTextAlignment.CENTER);
if(actionType == ActionType.TOGGLE)
if(actionType == ActionType.TOGGLE)
newAction.setCurrentIconState("false__false");
newAction.setCurrentIconState("false__false");
}
}
else
else
{
{
newAction.setClientProperties((ClientProperties) db.getContent(ActionDataFormats.CLIENT_PROPERTIES));
newAction.setClientProperties((ClientProperties) db.getContent(ActionDataFormats.CLIENT_PROPERTIES));
newAction.setIcons((HashMap<String, byte[]>) db.getContent(ActionDataFormats.ICONS));
newAction.setIcons((HashMap<String, byte[]>) db.getContent(ActionDataFormats.ICONS));
newAction.setCurrentIconState((String) db.getContent(ActionDataFormats.CURRENT_ICON_STATE));
newAction.setCurrentIconState((String) db.getContent(ActionDataFormats.CURRENT_ICON_STATE));
newAction.setBgColourHex((String) db.getContent(ActionDataFormats.BACKGROUND_COLOUR));
newAction.setBgColourHex((String) db.getContent(ActionDataFormats.BACKGROUND_COLOUR));
newAction.setDisplayTextFontColourHex((String) db.getContent(ActionDataFormats.DISPLAY_TEXT_FONT_COLOUR));
newAction.setDisplayTextFontColourHex((String) db.getContent(ActionDataFormats.DISPLAY_TEXT_FONT_COLOUR));
newAction.setDisplayText((String) db.getContent(ActionDataFormats.DISPLAY_TEXT));
newAction.setDisplayText((String) db.getContent(ActionDataFormats.DISPLAY_TEXT));
newAction.setDisplayTextAlignment((DisplayTextAlignment) db.getContent(ActionDataFormats.DISPLAY_TEXT_ALIGNMENT));
newAction.setDisplayTextAlignment((DisplayTextAlignment) db.getContent(ActionDataFormats.DISPLAY_TEXT_ALIGNMENT));
newAction.setShowDisplayText((boolean) db.getContent(ActionDataFormats.DISPLAY_TEXT_SHOW));
newAction.setShowDisplayText((boolean) db.getContent(ActionDataFormats.DISPLAY_TEXT_SHOW));
}
}
newAction.setLocation(new Location(-1, -1));
newAction.setLocation(new Location(-1, -1));
newAction.setParent(getAction().getID());
newAction.setParent(getAction().getID());
newAction.setProfileID(actionGridPaneListener.getCurrentProfile().getID());
newAction.setProfileID(actionGridPaneListener.getCurrentProfile().getID());
newAction.setSocketAddressForClient(actionGridPaneListener.getClientConnection().getRemoteSocketAddress());
newAction.setSocketAddressForClient(actionGridPaneListener.getClientConnection().getRemoteSocketAddress());
try
try
{
{
newAction.onActionCreate();
newAction.onActionCreate();
}
}
catch (Exception e)
catch (Exception e)
{
{
exceptionAndAlertHandler.handleMinorException(new MinorException("Error","onCreate() failed for "+getAction().getModuleName()+"\n\n"+e.getMessage()));
exceptionAndAlertHandler.handleMinorException(new MinorException("Error","onCreate() failed for "+getAction().getModuleName()+"\n\n"+e.getMessage()));
}
}
combineActionPropertiesPane.getCombineAction().addChild(newAction.getID());
combineActionPropertiesPane.getCombineAction().addChild(newAction.getID());
addActionToCurrentClientProfile(newAction);
addActionToCurrentClientProfile(newAction);
ClientConnection connection = ClientConnections.getInstance()
ClientConnection connection = ClientConnections.getInstance()
.getClientConnectionBySocketAddress(getClient().getRemoteSocketAddress());
.getClientConnectionBySocketAddress(getClient().getRemoteSocketAddress());
connection.saveActionDetails(getClientProfile().getID(), newAction);
connection.saveActionDetails(getClientProfile().getID(), newAction);
combineActionPropertiesPane.renderProps();
combineActionPropertiesPane.renderProps();
saveAction(true, false);
saveAction(true, false);
}
}
} catch (MinorException e) {
} catch (MinorException e) {
exceptionAndAlertHandler.handleMinorException(e);
exceptionAndAlertHandler.handleMinorException(e);
e.printStackTrace();
e.printStackTrace();
} catch (SevereException e) {
} catch (SevereException e) {
exceptionAndAlertHandler.handleSevereException(e);
exceptionAndAlertHandler.handleSevereException(e);
e.printStackTrace();
e.printStackTrace();
} catch (CloneNotSupportedException e) {
} catch (CloneNotSupportedException e) {
e.printStackTrace();
e.printStackTrace();
} catch (Exception e)
} catch (Exception e)
{
{
e.printStackTrace();
e.printStackTrace();
}
}
});
});
}
}
private void onResetToDefaultsButtonClicked()
{
getAction().getClientProperties().resetToDefaults();
try
{
onActionClicked(getAction(), getActionBox());
saveAction(true, true);
}
catch (MinorException e)
{
exceptionAndAlertHandler.handleMinorException(e);
}
}
private VBox normalActionsPropsVBox;
private VBox normalActionsPropsVBox;
private VBox normalToggleActionCommonPropsVBox;
private VBox normalToggleActionCommonPropsVBox;
private VBox toggleActionsPropsVBox;
private VBox toggleActionsPropsVBox;
private HBox displayTextFieldHBox;
private HBox displayTextFieldHBox;
private ClientConnection clientConnection;
private ClientConnection clientConnection;
private ClientProfile clientProfile;
private ClientProfile clientProfile;
public void setClientConnection(ClientConnection clientConnection) {
public void setClientConnection(ClientConnection clientConnection) {
this.clientConnection = clientConnection;
this.clientConnection = clientConnection;
}
}
public ClientConnection getClientConnection() {
public ClientConnection getClientConnection() {
return clientConnection;
return clientConnection;
}
}
public Client getClient()
public Client getClient()
{
{
return getClientConnection().getClient();
return getClientConnection().getClient();
}
}
public void setClientProfile(ClientProfile clientProfile) {
public void setClientProfile(ClientProfile clientProfile) {
this.clientProfile = clientProfile;
this.clientProfile = clientProfile;
}
}
public ClientProfile getClientProfile() {
public ClientProfile getClientProfile() {
return clientProfile;
return clientProfile;
}
}
public void setActionHeadingLabelText(String text) {
public void setActionHeadingLabelText(String text) {
actionHeadingLabel.setText(text);
actionHeadingLabel.setText(text);
}
}
private Action action;
private Action action;
public synchronized Action getAction() {
public synchronized Action getAction() {
return action;
return action;
}
}
private ActionBox actionBox;
private ActionBox actionBox;
public ActionBox getActionBox() {
public ActionBox getActionBox() {
return actionBox;
return actionBox;
}
}
@Override
@Override
public void onActionClicked(Action action, ActionBox actionBox) throws MinorException
public void onActionClicked(Action action, ActionBox actionBox) throws MinorException
{
{
clear();
clear();
setAction(action);
setAction(action);
this.actionBox = actionBox;
this.actionBox = actionBox;
System.out.println(getAction().getProfileID()+"KOBAAA");
System.out.println(getAction().getProfileID()+"KOBAAA");
renderActionProperties();
renderActionProperties();
}
}
public void refresh() throws MinorException
public void refresh()
{
{
clear(false);
clear(false);
renderActionProperties();
try
{
renderActionProperties();
}
catch (MinorException e)
{
exceptionAndAlertHandler.handleMinorException(e);
}
}
}
private TextField displayNameTextField;
private TextField displayNameTextField;
private CheckBox hideDisplayTextCheckBox;
private CheckBox hideDisplayTextCheckBox;
private CheckBox hideDefaultIconCheckBox;
private CheckBox hideDefaultIconCheckBox;
private TextField defaultIconFileTextField;
private TextField defaultIconFileTextField;
private CheckBox hideToggleOnIconCheckBox;
private CheckBox hideToggleOnIconCheckBox;
private TextField toggleOnIconFileTextField;
private TextField toggleOnIconFileTextField;
private CheckBox hideToggleOffIconCheckBox;
private CheckBox hideToggleOffIconCheckBox;
private TextField toggleOffIconFileTextField;
private TextField toggleOffIconFileTextField;
private Button clearIconButton;
private Button clearIconButton;
private ColorPicker actionBackgroundColourPicker;
private ColorPicker actionBackgroundColourPicker;
private ColorPicker displayTextColourPicker;
private ColorPicker displayTextColourPicker;
private CheckBox actionBackgroundColourTransparentCheckBox;
private CheckBox actionBackgroundColourTransparentCheckBox;
private CheckBox displayTextColourDefaultCheckBox;
private CheckBox displayTextColourDefaultCheckBox;
private ComboBox<DisplayTextAlignment> displayTextAlignmentComboBox;
private ComboBox<DisplayTextAlignment> displayTextAlignmentComboBox;
public void clear(boolean actionNull)
public void clear(boolean actionNull)
{
{
sendIcon = false;
sendIcon = false;
actionClientProperties.clear();
actionClientProperties.clear();
displayNameTextField.clear();
displayNameTextField.clear();
defaultIconFileTextField.clear();
defaultIconFileTextField.clear();
toggleOffIconFileTextField.clear();
toggleOffIconFileTextField.clear();
toggleOnIconFileTextField.clear();
toggleOnIconFileTextField.clear();
clientPropertiesVBox.getChildren().clear();
clientPropertiesVBox.getChildren().clear();
pluginExtraButtonBar.getChildren().clear();
pluginExtraButtonBar.getChildren().clear();
vbox.setVisible(false);
vbox.setVisible(false);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
buttonBar.setVisible(false);
buttonBar.setVisible(false);
setActionHeadingLabelText("");
setActionHeadingLabelText("");
actionBackgroundColourPicker.setValue(Color.WHITE);
actionBackgroundColourPicker.setValue(Color.WHITE);
displayTextColourPicker.setValue(Color.WHITE);
displayTextColourPicker.setValue(Color.WHITE);
if(actionNull)
if(actionNull)
{
{
action = null;
action = null;
actionBox = null;
actionBox = null;
}
}
}
}
@Override
@Override
public void clear()
public void clear()
{
{
clear(true);
clear(true);
}
}
boolean isCombineChild = false;
boolean isCombineChild = false;
public boolean isCombineChild() {
public boolean isCombineChild() {
return isCombineChild;
return isCombineChild;
}
}
public void renderActionProperties() throws MinorException
public void renderActionProperties() throws MinorException
{
{
//Combine Child action
//Combine Child action
isCombineChild = getAction().getLocation().getCol() == -1;
isCombineChild = getAction().getLocation().getCol() == -1;
System.out.println(isCombineChild);
System.out.println(isCombineChild);
System.out.println("DISPLAY : "+getAction().getDisplayText());
System.out.println("DISPLAY : "+getAction().getDisplayText());
displayNameTextField.setText(getAction().getDisplayText());
displayNameTextField.setText(getAction().getDisplayText());
if(isCombineChild)
if(isCombineChild)
{
{
setReturnButtonForCombineActionChildVisible(true);
setReturnButtonForCombineActionChildVisible(true);
normalActionsPropsVBox.setVisible(false);
normalActionsPropsVBox.setVisible(false);
normalToggleActionCommonPropsVBox.setVisible(false);
normalToggleActionCommonPropsVBox.setVisible(false);
hideDisplayTextCheckBox.setSelected(false);
hideDisplayTextCheckBox.setSelected(false);
hideDisplayTextCheckBox.setVisible(false);
hideDisplayTextCheckBox.setVisible(false);
}
}
else
else
{
{
normalToggleActionCommonPropsVBox.setVisible(true);
normalToggleActionCommonPropsVBox.setVisible(true);
if(getAction().getActionType() == ActionType.NORMAL)
if(getAction().getActionType() == ActionType.TOGGLE)
{
normalActionsPropsVBox.setVisible(true);
toggleActionsPropsVBox.setVisible(false);
boolean doesDefaultExist = getAction().getIcons().containsKey("default");
boolean isDefaultHidden = !getAction().getCurrentIconState().equals("default");
if(!doesDefaultExist)
isDefaultHidden = false;
hideDefaultIconCheckBox.setDisable(!doesDefaultExist);
hideDefaultIconCheckBox.setSelected(isDefaultHidden);
}
else
{
{
normalActionsPropsVBox.setVisible(false);
normalActionsPropsVBox.setVisible(false);
toggleActionsPropsVBox.setVisible(true);
toggleActionsPropsVBox.setVisible(true);
boolean doesToggleOnExist = getAction().getIcons().containsKey("toggle_on");
boolean doesToggleOnExist = getAction().getIcons().containsKey("toggle_on");
boolean isToggleOnHidden = getAction().getCurrentIconState().contains("toggle_on");
boolean isToggleOnHidden = getAction().getCurrentIconState().contains("toggle_on");
if(!doesToggleOnExist)
if(!doesToggleOnExist)
isToggleOnHidden = false;
isToggleOnHidden = false;
hideToggleOnIconCheckBox.setDisable(!doesToggleOnExist);
hideToggleOnIconCheckBox.setDisable(!doesToggleOnExist);
hideToggleOnIconCheckBox.setSelected(isToggleOnHidden);
hideToggleOnIconCheckBox.setSelected(isToggleOnHidden);
boolean doesToggleOffExist = getAction().getIcons().containsKey("toggle_off");
boolean doesToggleOffExist = getAction().getIcons().containsKey("toggle_off");
boolean isToggleOffHidden = getAction().getCurrentIconState().contains("toggle_off");
boolean isToggleOffHidden = getAction().getCurrentIconState().contains("toggle_off");
if(!doesToggleOffExist)
if(!doesToggleOffExist)
isToggleOffHidden = false;
isToggleOffHidden = false;
hideToggleOffIconCheckBox.setDisable(!doesToggleOffExist);
hideToggleOffIconCheckBox.setDisable(!doesToggleOffExist);
hideToggleOffIconCheckBox.setSelected(isToggleOffHidden);
hideToggleOffIconCheckBox.setSelected(isToggleOffHidden);
}
}
else
{
normalActionsPropsVBox.setVisible(true);
toggleActionsPropsVBox.setVisible(false);
boolean doesDefaultExist = getAction().getIcons().containsKey("default");
boolean isDefaultHidden = !getAction().getCurrentIconState().equals("default");
if(!doesDefaultExist)
isDefaultHidden = false;
hideDefaultIconCheckBox.setDisable(!doesDefaultExist);
hideDefaultIconCheckBox.setSelected(isDefaultHidden);
}
setReturnButtonForCombineActionChildVisible(false);
setReturnButtonForCombineActionChildVisible(false);
hideDisplayTextCheckBox.setVisible(true);
hideDisplayTextCheckBox.setVisible(true);
setFolderButtonVisible(getAction().getActionType().equals(ActionType.FOLDER));
setFolderButtonVisible(getAction().getActionType().equals(ActionType.FOLDER));
setResetToDefaultsFolderButtonVisible(!getAction().getActionType().equals(ActionType.FOLDER));
displayTextAlignmentComboBox.getSelectionModel().select(getAction().getDisplayTextAlignment());
displayTextAlignmentComboBox.getSelectionModel().select(getAction().getDisplayTextAlignment());
if(!getAction().getBgColourHex().isEmpty())
if(!getAction().getBgColourHex().isEmpty())
actionBackgroundColourPicker.setValue(Color.valueOf(getAction().getBgColourHex()));
actionBackgroundColourPicker.setValue(Color.valueOf(getAction().getBgColourHex()));
else
else
actionBackgroundColourTransparentCheckBox.setSelected(true);
actionBackgroundColourTransparentCheckBox.setSelected(true);
if(!getAction().getDisplayTextFontColourHex().isEmpty())
if(!getAction().getDisplayTextFontColourHex().isEmpty())
displayTextColourPicker.setValue(Color.valueOf(getAction().getDisplayTextFontColourHex()));
displayTextColourPicker.setValue(Color.valueOf(getAction().getDisplayTextFontColourHex()));
else
else
displayTextColourDefaultCheckBox.setSelected(true);
displayTextColourDefaultCheckBox.setSelected(true);
hideDisplayTextCheckBox.setSelected(!getAction().isShowDisplayText());
hideDisplayTextCheckBox.setSelected(!getAction().isShowDisplayText());
clearIconButton.setDisable(!getAction().isHasIcon());
clearIconButton.setDisable(!getAction().isHasIcon());
}
}
buttonBar.setVisible(true);
buttonBar.setVisible(true);
vbox.setVisible(true);
vbox.setVisible(true);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
if(getAction().getActionType() == ActionType.NORMAL || getAction().getActionType() == ActionType.TOGGLE)
if(getAction().getActionType() == ActionType.NORMAL || getAction().getActionType() == ActionType.TOGGLE)
{
{
if(getAction().isInvalid())
if(getAction().isInvalid())
setActionHeadingLabelText("Invalid action ("+getAction().getModuleName()+")");
setActionHeadingLabelText("Invalid action ("+getAction().getModuleName()+")");
else
else
setActionHeadingLabelText(getAction().getName());
setActionHeadingLabelText(getAction().getName());
}
}
else if(getAction().getActionType() == ActionType.COMBINE)
else if(getAction().getActionType() == ActionType.COMBINE)
setActionHeadingLabelText("Combine action");
setActionHeadingLabelText("Combine action");
else if(getAction().getActionType() == ActionType.FOLDER)
else if(getAction().getActionType() == ActionType.FOLDER)
setActionHeadingLabelText("Folder action");
setActionHeadingLabelText("Folder action");
if(!getAction().isInvalid())
if(!getAction().isInvalid())
{
{
if(getAction().getActionType() == ActionType.NORMAL || getAction().getActionType() == ActionType.TOGGLE)
if(getAction().getActionType() == ActionType.NORMAL || getAction().getActionType() == ActionType.TOGGLE)
{
renderClientProperties();
renderClientProperties();
renderPluginExtraButtonBar();
}
else if(getAction().getActionType() == ActionType.COMBINE)
else if(getAction().getActionType() == ActionType.COMBINE)
renderCombineActionProperties();
renderCombineActionProperties();
renderPluginExtraButtonBar();
}
}
}
}
private void renderPluginExtraButtonBar()
private void renderPluginExtraButtonBar()
{
{
ExternalPlugin externalPlugin = (ExternalPlugin) getAction();
ExternalPlugin externalPlugin = (ExternalPlugin) getAction();
externalPlugin.initClientActionSettingsButtonBar();
externalPlugin.initClientActionSettingsButtonBar();
if(externalPlugin.getClientActionSettingsButtonBar() != null)
if(externalPlugin.getClientActionSettingsButtonBar() != null)
{
{
HBox tba = new HBox(SpaceFiller.horizontal(), externalPlugin.getClientActionSettingsButtonBar());
HBox tba = new HBox(SpaceFiller.horizontal(), externalPlugin.getClientActionSettingsButtonBar());
pluginExtraButtonBar.getChildren().add(tba);
pluginExtraButtonBar.getChildren().add(tba);
}
}
}
}
private CombineActionPropertiesPane combineActionPropertiesPane;
private CombineActionPropertiesPane combineActionPropertiesPane;
public CombineActionPropertiesPane getCombineActionPropertiesPane() {
public CombineActionPropertiesPane getCombineActionPropertiesPane() {
return combineActionPropertiesPane;
return combineActionPropertiesPane;
}
}
public void setReturnButtonForCombineActionChildVisible(boolean visible)
public void setReturnButtonForCombineActionChildVisible(boolean visible)
{
{
returnButtonForCombineActionChild.setVisible(visible);
returnButtonForCombineActionChild.setVisible(visible);
}
}
public void renderCombineActionProperties()
public void renderCombineActionProperties()
{
{
try
try
{
{
combineActionPropertiesPane = new CombineActionPropertiesPane(getActionAsCombineAction(action),
combineActionPropertiesPane = new CombineActionPropertiesPane(getActionAsCombineAction(action),
getClientProfile(),
getClientProfile(),
this
this
);
);
clientPropertiesVBox.getChildren().add(combineActionPropertiesPane);
clientPropertiesVBox.getChildren().add(combineActionPropertiesPane);
}
}
catch (MinorException e)
catch (MinorException e)
{
{
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleMinorException(e);
exceptionAndAlertHandler.handleMinorException(e);
}
}
}
}
@Override
@Override
public synchronized void setAction(Action action) {
public synchronized void setAction(Action action) {
this.action = action;
this.action = action;
}
}
public FolderAction getActionAsFolderAction(Action action)
public FolderAction getActionAsFolderAction(Action action)
{
{
FolderAction folderAction = new FolderAction();
FolderAction folderAction = new FolderAction();
folderAction.setDisplayText(getAction().getDisplayText());
folderAction.setDisplayText(getAction().getDisplayText());
folderAction.setName(getAction().getName());
folderAction.setName(getAction().getName());
folderAction.setID(getAction().getID());
folderAction.setID(getAction().getID());
folderAction.setLocation(getAction().getLocation());
folderAction.setLocation(getAction().getLocation());
folderAction.setBgColourHex(getAction().getBgColourHex());
folderAction.setBgColourHex(getAction().getBgColourHex());
folderAction.setParent(getAction().getParent());
folderAction.setParent(getAction().getParent());
folderAction.getClientProperties().set(getAction().getClientProperties());
folderAction.getClientProperties().set(getAction().getClientProperties());
folderAction.setDisplayTextAlignment(getAction().getDisplayTextAlignment());
folderAction.setDisplayTextAlignment(getAction().getDisplayTextAlignment());
folderAction.setIcons(getAction().getIcons());
folderAction.setIcons(getAction().getIcons());
folderAction.setCurrentIconState(getAction().getCurrentIconState());
folderAction.setCurrentIconState(getAction().getCurrentIconState());
folderAction.setDisplayTextFontColourHex(getAction().getDisplayTextFontColourHex());
folderAction.setDisplayTextFontColourHex(getAction().getDisplayTextFontColourHex());
return folderAction;
return folderAction;
}
}
public CombineAction getActionAsCombineAction(Action action)
public CombineAction getActionAsCombineAction(Action action)
{
{
CombineAction combineAction = new CombineAction();
CombineAction combineAction = new CombineAction();
combineAction.setDisplayText(getAction().getDisplayText());
combineAction.setDisplayText(getAction().getDisplayText());
combineAction.setName(getAction().getName());
combineAction.setName(getAction().getName());
combineAction.setID(getAction().getID());
combineAction.setID(getAction().getID());
combineAction.setLocation(getAction().getLocation());
combineAction.setLocation(getAction().getLocation());
combineAction.setBgColourHex(getAction().getBgColourHex());
combineAction.setBgColourHex(getAction().getBgColourHex());
combineAction.setParent(getAction().getParent());
combineAction.setParent(getAction().getParent());
combineAction.getClientProperties().set(getAction().getClientProperties());
combineAction.getClientProperties().set(getAction().getClientProperties());
combineAction.setDisplayTextAlignment(getAction().getDisplayTextAlignment());
combineAction.setDisplayTextAlignment(getAction().getDisplayTextAlignment());
combineAction.setIcons(getAction().getIcons());
combineAction.setIcons(getAction().getIcons());
combineAction.setCurrentIconState(getAction().getCurrentIconState());
combineAction.setCurrentIconState(getAction().getCurrentIconState());
combineAction.setDisplayTextFontColourHex(getAction().getDisplayTextFontColourHex());
combineAction.setDisplayTextFontColourHex(getAction().getDisplayTextFontColourHex());
return combineAction;
return combineAction;
}
}
@Override
@Override
public void onOpenFolderButtonClicked()
public void onOpenFolderButtonClicked()
{
{
FolderAction folderAction = getActionAsFolderAction(action);
FolderAction folderAction = getActionAsFolderAction(action);
actionBox.getActionGridPaneListener().renderFolder(folderAction);
actionBox.getActionGridPaneListener().renderFolder(folderAction);
clear();
clear();
}
}
@Override
@Override
public Window getCurrentWindow() {
public Window getCurrentWindow() {
return getScene().getWindow();
return getScene().getWindow();
}
}
private ArrayList<UIPropertyBox> actionClientProperties;
private ArrayList<UIPropertyBox> actionClientProperties;
private TextField delayBeforeRunningTextField;
private TextField delayBeforeRunningTextField;
public void renderClientProperties() throws MinorException
public void renderClientProperties() throws MinorException
{
{
delayBeforeRunningTextField = new TextField();
delayBeforeRunningTextField = new TextField();
delayBeforeRunningTextField.setText(getAction().getDelayBeforeExecuting()+"");
delayBeforeRunningTextField.setText(getAction().getDelayBeforeExecuting()+"");
clientPropertiesVBox.getChildren().add(
clientPropertiesVBox.getChildren().add(
new HBoxInputBox("Delay before running (milli-seconds)", delayBeforeRunningTextField, 100)
new HBoxInputBox("Delay before running (milli-seconds)", delayBeforeRunningTextField, 100)
);
);
for(int i =0;i< getAction().getClientProperties().getSize(); i++)
for(int i =0;i< getAction().getClientProperties().getSize(); i++)
{
{
Property eachProperty = getAction().getClientProperties().get().get(i);
Property eachProperty = getAction().getClientProperties().get().get(i);
if(!eachProperty.isVisible())
if(!eachProperty.isVisible())
continue;
continue;
Label label = new Label(eachProperty.getDisplayName());
Label label = new Label(eachProperty.getDisplayName());
HBox hBox = new HBox(label);
HBox hBox = new HBox(label);
hBox.setSpacing(5.0);
hBox.setSpacing(5.0);
hBox.setAlignment(Pos.CENTER_LEFT);
hBox.setAlignment(Pos.CENTER_LEFT);
Node controlNode = null;
Node controlNode = null;
if(eachProperty.getHelpLink() != null)
if(eachProperty.getHelpLink() != null)
{
{
Button helpButton = new Button();
Button helpButton = new Button();
FontIcon questionIcon = new FontIcon("fas-question");
FontIcon questionIcon = new FontIcon("fas-question");
helpButton.setGraphic(questionIcon);
helpButton.setGraphic(questionIcon);
helpButton.setOnAction(event -> {
helpButton.setOnAction(event -> {
hostServices.showDocument(eachProperty.getHelpLink());
hostServices.showDocument(eachProperty.getHelpLink());
});
});
hBox.getChildren().add(helpButton);
hBox.getChildren().add(helpButton);
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
hBox.getChildren().add(SpaceFiller.horizontal());
hBox.getChildren().add(SpaceFiller.horizontal());
if(eachProperty.getControlType() == ControlType.COMBO_BOX)
if(eachProperty.getControlType() == ControlType.COMBO_BOX)
{
{
ComboBox<String> comboBox = new ComboBox<>();
ComboBox<String> comboBox = new ComboBox<>();
comboBox.getItems().addAll(eachProperty.getListValue());
comboBox.getItems().addAll(eachProperty.getListValue());
comboBox.getSelectionModel().select(eachProperty.getSelectedIndex());
comboBox.getSelectionModel().select(eachProperty.getSelectedIndex());
controlNode = comboBox;
controlNode = comboBox;
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
else if(eachProperty.getControlType() == ControlType.FILE_PATH)
else if(eachProperty.getControlType() == ControlType.FILE_PATH)
{
{
TextField textField = new TextField(eachProperty.getRawValue());
TextField textField = new TextField(eachProperty.getRawValue());
FileExtensionFilter[] fileExtensionFilters = eachProperty.getExtensionFilters();
FileExtensionFilter[] fileExtensionFilters = eachProperty.getExtensionFilters();
FileChooser.ExtensionFilter[] extensionFilters = new FileChooser.ExtensionFilter[fileExtensionFilters.length];
FileChooser.ExtensionFilter[] extensionFilters = new FileChooser.ExtensionFilter[fileExtensionFilters.length];
for(int x = 0;x<fileExtensionFilters.length;x++)
for(int x = 0;x<fileExtensionFilters.length;x++)
{
{
extensionFilters[x] = new FileChooser.ExtensionFilter(
extensionFilters[x] = new FileChooser.ExtensionFilter(
fileExtensionFilters[x].getDescription(),
fileExtensionFilters[x].getDescription(),
fileExtensionFilters[x].getExtensions()
fileExtensionFilters[x].getExtensions()
);
);
}
}
hBox = new HBoxInputBoxWithFileChooser(eachProperty.getDisplayName(), textField, null,
hBox = new HBoxInputBoxWithFileChooser(eachProperty.getDisplayName(), textField, null,
extensionFilters);
extensionFilters);
controlNode = textField;
controlNode = textField;
}
}
else if(eachProperty.getControlType() == ControlType.TEXT_FIELD)
else if(eachProperty.getControlType() == ControlType.TEXT_FIELD)
{
{
controlNode= new TextField(eachProperty.getRawValue());
controlNode= new TextField(eachProperty.getRawValue());
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
else if(eachProperty.getControlType() == ControlType.TEXT_FIELD_MASKED)
else if(eachProperty.getControlType() == ControlType.TEXT_FIELD_MASKED)
{
{
PasswordField textField = new PasswordField();
PasswordField textField = new PasswordField();
textField.setText(eachProperty.getRawValue());
textField.setText(eachProperty.getRawValue());
controlNode= textField;
controlNode= textField;
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
else if(eachProperty.getControlType() == ControlType.TOGGLE)
else if(eachProperty.getControlType() == ControlType.TOGGLE)
{
{
ToggleButton toggleButton = new ToggleButton();
ToggleButton toggleButton = new ToggleButton();
toggleButton.setSelected(eachProperty.getBoolValue());
toggleButton.setSelected(eachProperty.getBoolValue());
if(eachProperty.getBoolValue())
if(eachProperty.getBoolValue())
toggleButton.setText("ON");
toggleButton.setText("ON");
else
else
toggleButton.setText("OFF");
toggleButton.setText("OFF");
toggleButton.selectedProperty().addListener((observableValue, aBoolean, t1) -> {
toggleButton.selectedProperty().addListener((observableValue, aBoolean, t1) -> {
if(t1)
if(t1)
toggleButton.setText("ON");
toggleButton.setText("ON");
else
else
toggleButton.setText("OFF");
toggleButton.setText("OFF");
});
});
controlNode = toggleButton;
controlNode = toggleButton;
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
else if(eachProperty.getControlType() == ControlType.SLIDER_DOUBLE)
else if(eachProperty.getControlType() == ControlType.SLIDER_DOUBLE)
{
{
Slider slider = new Slider();
Slider slider = new Slider();
slider.setValue(eachProperty.getDoubleValue());
slider.setValue(eachProperty.getDoubleValue());
slider.setMax(eachProperty.getMaxDoubleValue());
slider.setMax(eachProperty.getMaxDoubleValue());
slider.setMin(eachProperty.getMinDoubleValue());
slider.setMin(eachProperty.getMinDoubleValue());
controlNode = slider;
controlNode = slider;
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
else if(eachProperty.getControlType() == ControlType.SLIDER_INTEGER)
else if(eachProperty.getControlType() == ControlType.SLIDER_INTEGER)
{
{
Slider slider = new Slider();
Slider slider = new Slider();
slider.setValue(eachProperty.getIntValue());
slider.setValue(eachProperty.getIntValue());
slider.setMax(eachProperty.getMaxIntValue());
slider.setMax(eachProperty.getMaxIntValue());
slider.setMin(eachProperty.getMinIntValue());
slider.setMin(eachProperty.getMinIntValue());
slider.setBlockIncrement(1.0);
slider.setBlockIncrement(1.0);
slider.setSnapToTicks(true);
slider.setSnapToTicks(true);
controlNode = slider;
controlNode = slider;
hBox.getChildren().add(controlNode);
hBox.getChildren().add(controlNode);
}
}
UIPropertyBox clientProperty = new UIPropertyBox(i, eachProperty.getDisplayName(), controlNode,
UIPropertyBox clientProperty = new UIPropertyBox(i, eachProperty.getDisplayName(), controlNode,
eachProperty.getControlType(), eachProperty.getType(), eachProperty.isCanBeBlank());
eachProperty.getControlType(), eachProperty.getType(), eachProperty.isCanBeBlank());
actionClientProperties.add(clientProperty);
actionClientProperties.add(clientProperty);
clientPropertiesVBox.getChildren().add(hBox);
clientPropertiesVBox.getChildren().add(hBox);
}
}
}
}
public void onSaveButtonClicked()
public void onSaveButtonClicked()
{
{
try {
try {
// saveButton.setDisable(true);
// saveButton.setDisable(true);
// deleteButton.setDisable(true);
// deleteButton.setDisable(true);
validateForm();
validateForm();
saveAction(true, true);
saveAction(true, true);
}
}
catch (MinorException e)
catch (MinorException e)
{
{
exceptionAndAlertHandler.handleMinorException(e);
exceptionAndAlertHandler.handleMinorException(e);
}
}
}
}
private boolean sendIcon = false;
private boolean sendIcon = false;
@Override
@Override
public void setSendIcon(boolean sendIcon)
public void setSendIcon(boolean sendIcon)
{
{
this.sendIcon = sendIcon;
this.sendIcon = sendIcon;
}
}
public void addActionToCurrentClientProfile(Action newAction) throws CloneNotSupportedException {
public void addActionToCurrentClientProfile(Action newAction) throws CloneNotSupportedException {
getClientProfile().addAction(newAction);
getClientProfile().addAction(newAction);
}
}
@Override
@Override
public void saveAction(Action action, boolean runAsync, boolean runOnActionSavedFromServer)
public void saveAction(Action action, boolean runAsync, boolean runOnActionSavedFromServer)
{
{
logger.info("gOAT@ :"+action.getProfileID());
String delayBeforeRunning = "0";
if(action.getActionType() != ActionType.FOLDER && action.getActionType() !=ActionType.COMBINE)
delayBeforeRunning =delayBeforeRunningTextField.getText();
new OnSaveActionTask(
new OnSaveActionTask(
ClientConnections.getInstance().getClientConnectionBySocketAddress(
ClientConnections.getInstance().getClientConnectionBySocketAddress(
getClient().getRemoteSocketAddress()
getClient().getRemoteSocketAddress()
),
),
action,
action, delayBeforeRunning,
delayBeforeRunningTextField.getText(),
displayNameTextField.getText(),
displayNameTextField.getText(),
isCombineChild(),
isCombineChild(),
!hideDisplayTextCheckBox.isSelected(),
!hideDisplayTextCheckBox.isSelected(),
displayTextColourDefaultCheckBox.isSelected(),
displayTextColourDefaultCheckBox.isSelected(),
"#" + displayTextColourPicker.getValue().toString().substring(2),
"#" + displayTextColourPicker.getValue().toString().substring(2),
clearIconButton.isDisable(),
clearIconButton.isDisable(),
hideDefaultIconCheckBox.isSelected(),
hideDefaultIconCheckBox.isSelected(),
hideToggleOffIconCheckBox.isSelected(),
hideToggleOffIconCheckBox.isSelected(),
hideToggleOnIconCheckBox.isSelected(),
hideToggleOnIconCheckBox.isSelected(),
displayTextAlignmentComboBox.getSelectionModel().getSelectedItem(),
displayTextAlignmentComboBox.getSelectionModel().getSelectedItem(),
actionBackgroundColourTransparentCheckBox.isSelected(),
actionBackgroundColourTransparentCheckBox.isSelected(),
"#" + actionBackgroundColourPicker.getValue().toString().substring(2),
"#" + actionBackgroundColourPicker.getValue().toString().substring(2),
getCombineActionPropertiesPane(),
getCombineActionPropertiesPane(),
clientProfile, sendIcon, actionBox, actionClientProperties, exceptionAndAlertHandler,
clientProfile, sendIcon, actionBox, actionClientProperties, exceptionAndAlertHandler,
saveButton, deleteButton, runOnActionSavedFromServer, runAsync
saveButton, deleteButton, runOnActionSavedFromServer, runAsync, this
);
);
}
}
@Override
@Override
public void saveAction(boolean runAsync, boolean runOnActionSavedFromServer)
public void saveAction(boolean runAsync, boolean runOnActionSavedFromServer)
{
{
logger.info("ENGREJDERMAARBOOR:"+getAction().getProfileID());
logger.info("ENGREJDERMAARBOOR:"+getAction().getDisplayText());
saveAction(getAction(), runAsync, runOnActionSavedFromServer);
saveAction(getAction(), runAsync, runOnActionSavedFromServer);
}
}
public void setFolderButtonVisible(boolean visible)
public void setFolderButtonVisible(boolean visible)
{
{
openFolderButton.setVisible(visible);
openFolderButton.setVisible(visible);
}
}
public void setResetToDefaultsFolderButtonVisible(boolean visible)
{
resetToDefaultsFolderButton.setVisible(visible);
}
public void validateForm() throws MinorException
public void validateForm() throws MinorException
{
{
String displayNameStr = displayNameTextField.getText();
String displayNameStr = displayNameTextField.getText();
StringBuilder finalErrors = new StringBuilder();
StringBuilder finalErrors = new StringBuilder();
if(displayNameStr.isBlank())
if(displayNameStr.isBlank())
{
{
finalErrors.append(" * Display Name cannot be blank\n");
finalErrors.append(" * Display Name cannot be blank\n");
}
}
if(!isCombineChild())
if(!isCombineChild())
{
{
if(getAction().getActionType() == ActionType.NORMAL)
if(getAction().getActionType() == ActionType.NORMAL)
{
{
if(getAction().isHasIcon())
if(getAction().isHasIcon())
{
{
if(hideDisplayTextCheckBox.isSelected() && hideDefaultIconCheckBox.isSelected())
if(hideDisplayTextCheckBox.isSelected() && hideDefaultIconCheckBox.isSelected())
{
{
finalErrors.append(" * Both Icon and display text check box cannot be hidden.\n");
finalErrors.append(" * Both Icon and display text check box cannot be hidden.\n");
}
}
}
}
else
else
{
{
if(hideDisplayTextCheckBox.isSelected())
if(hideDisplayTextCheckBox.isSelected())
finalErrors.append(" * Display Text cannot be hidden, since there is also no icon.\n");
finalErrors.append(" * Display Text cannot be hidden, since there is also no icon.\n");
}
}
}
}
}
}
if(getAction().getActionType() == ActionType.NORMAL)
if(getAction().getActionType() == ActionType.NORMAL)
{
{
try
try
{
{
int n = Integer.parseInt(delayBeforeRunningTextField.getText());
int n = Integer.parseInt(delayBeforeRunningTextField.getText());
if (n<0)
if (n<0)
{
{
finalErrors.append(" * Sleep should be greater than 0.\n");
finalErrors.append(" * Sleep should be greater than 0.\n");
}
}
}
}
catch (Exception e)
catch (Exception e)
{
{
finalErrors.append(" * Sleep should be a number.\n");
finalErrors.append(" * Sleep should be a number.\n");
}
}
}
}
for (UIPropertyBox clientProperty : actionClientProperties) {
for (UIPropertyBox clientProperty : actionClientProperties) {
Node controlNode = clientProperty.getControlNode();
Node controlNode = clientProperty.getControlNode();
if (clientProperty.getControlType() == ControlType.TEXT_FIELD ||
if (clientProperty.getControlType() == ControlType.TEXT_FIELD ||
clientProperty.getControlType() == ControlType.FILE_PATH)
clientProperty.getControlType() == ControlType.FILE_PATH)
{
{
String value = ((TextField) controlNode).getText();
String value = ((TextField) controlNode).getText();
if(clientProperty.getType() == Type.INTEGER)
if(clientProperty.getType() == Type.INTEGER)
{
{
try
try
{
{
Integer.parseInt(value);
Integer.parseInt(value);
}
}
catch (NumberFormatException e)
catch (NumberFormatException e)
{
{
finalErrors.append(" -> ").append(clientProperty.getDisplayName()).append(" must be integer.\n");
finalErrors.append(" -> ").append(clientProperty.getDisplayName()).append(" must be integer.\n");
}
}
}
}
else
else
{
{
if(value.isBlank() && !clientProperty.isCanBeBlank())
if(value.isBlank() && !clientProperty.isCanBeBlank())
finalErrors.append(" -> ").append(clientProperty.getDisplayName()).append(" cannot be blank.\n");
finalErrors.append(" -> ").append(clientProperty.getDisplayName()).append(" cannot be blank.\n");
}
}
}
}
}
}
if(!finalErrors.toString().isEmpty())
if(!finalErrors.toString().isEmpty())
{
{
throw new MinorException("You made mistakes",
throw new MinorException("You made mistakes",
finalErrors.toString());
finalErrors.toString());
}
}
}
}
public void onDeleteButtonClicked()
public void onDeleteButtonClicked()
{
{
new OnDeleteActionTask(
new OnDeleteActionTask(
ClientConnections.getInstance().getClientConnectionBySocketAddress(
ClientConnections.getInstance().getClientConnectionBySocketAddress(
getClient().getRemoteSocketAddress()
getClient().getRemoteSocketAddress()
),
),
action,
action,
isCombineChild(),
isCombineChild(),
getCombineActionPropertiesPane(),
getCombineActionPropertiesPane(),
clientProfile, actionBox, this, exceptionAndAlertHandler,
clientProfile, actionBox, this, exceptionAndAlertHandler,
!isCombineChild
!isCombineChild
);
);
}
}
}
}
M
src/main/java/com/stream_pi/server/window/dashboard/actiondetailpane/ActionDetailsPaneListener.java
+1
−1
package com.stream_pi.server.window.dashboard.actiondetailpane;
package com.stream_pi.server.window.dashboard.actiondetailpane;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionGridPaneListener;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionGridPaneListener;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.MinorException;
import javafx.stage.Window;
import javafx.stage.Window;
public interface ActionDetailsPaneListener {
public interface ActionDetailsPaneListener {
void onActionClicked(Action action, ActionBox actionBox) throws MinorException;
void onActionClicked(Action action, ActionBox actionBox) throws MinorException;
void saveAction(boolean runAsync, boolean runOnActionSavedFromServer);
void saveAction(boolean runAsync, boolean runOnActionSavedFromServer);
void saveAction(Action action, boolean runAsync, boolean runOnActionSavedFromServer);
void saveAction(Action action, boolean runAsync, boolean runOnActionSavedFromServer);
void clear();
void clear();
void setSendIcon(boolean sendIcon);
void setSendIcon(boolean sendIcon);
void setAction(Action action);
void setAction(Action action);
void onOpenFolderButtonClicked();
void onOpenFolderButtonClicked();
Window getCurrentWindow();
Window getCurrentWindow();
void refresh();
}
}
package com.stream_pi.server.window.dashboard.actiondetailpane;
package com.stream_pi.server.window.dashboard.actiondetailpane;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
import java.util.logging.Logger;
import java.util.logging.Logger;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.action_api.action.Action;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.action.DisplayTextAlignment;
import com.stream_pi.action_api.action.DisplayTextAlignment;
import com.stream_pi.action_api.actionproperty.ClientProperties;
import com.stream_pi.action_api.actionproperty.ClientProperties;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.server.client.ClientProfile;
import com.stream_pi.server.client.ClientProfile;
import com.stream_pi.server.connection.ClientConnection;
import com.stream_pi.server.connection.ClientConnection;
import com.stream_pi.server.uipropertybox.UIPropertyBox;
import com.stream_pi.server.uipropertybox.UIPropertyBox;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.server.window.dashboard.actiongridpane.ActionBox;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.SevereException;
import com.stream_pi.util.exception.SevereException;
import javafx.application.Platform;
import javafx.application.Platform;
import javafx.concurrent.Task;
import javafx.concurrent.Task;
import javafx.scene.control.Button;
import javafx.scene.control.Button;
public class OnSaveActionTask extends Task<Void>
public class OnSaveActionTask extends Task<Void>
{
{
private Logger logger;
private Logger logger;
public OnSaveActionTask(ClientConnection connection, Action action, String delayBeforeRunningString, String displayNameText, boolean isCombineChild,
public OnSaveActionTask(ClientConnection connection, Action action, String delayBeforeRunningString, String displayNameText, boolean isCombineChild,
boolean isShowDisplayText, boolean isDefaultDisplayTextColour, String displayTextFontColour, boolean isClearIcon,
boolean isShowDisplayText, boolean isDefaultDisplayTextColour, String displayTextFontColour, boolean isClearIcon,
boolean isHideDefaultIcon, boolean isHideToggleOffIcon, boolean isHideToggleOnIcon, DisplayTextAlignment displayTextAlignment, boolean isTransparentBackground, String backgroundColour,
boolean isHideDefaultIcon, boolean isHideToggleOffIcon, boolean isHideToggleOnIcon, DisplayTextAlignment displayTextAlignment, boolean isTransparentBackground, String backgroundColour,
CombineActionPropertiesPane combineActionPropertiesPane, ClientProfile clientProfile, boolean sendIcon, ActionBox actionBox,
CombineActionPropertiesPane combineActionPropertiesPane, ClientProfile clientProfile, boolean sendIcon, ActionBox actionBox,
ArrayList<UIPropertyBox> actionClientProperties, ExceptionAndAlertHandler exceptionAndAlertHandler, Button saveButton, Button deleteButton,
ArrayList<UIPropertyBox> actionClientProperties, ExceptionAndAlertHandler exceptionAndAlertHandler, Button saveButton, Button deleteButton,
boolean runOnActionSavedFromServer, boolean runAsync)
boolean runOnActionSavedFromServer, boolean runAsync, ActionDetailsPaneListener actionDetailsPaneListener)
{
{
this.saveButton = saveButton;
this.saveButton = saveButton;
this.deleteButton = deleteButton;
this.deleteButton = deleteButton;
this.delayBeforeRunningString = delayBeforeRunningString;
this.delayBeforeRunningString = delayBeforeRunningString;
this.connection = connection;
this.connection = connection;
this.action = action;
this.action = action;
this.displayNameText = displayNameText;
this.displayNameText = displayNameText;
this.isCombineChild = isCombineChild;
this.isCombineChild = isCombineChild;
this.isShowDisplayText = isShowDisplayText;
this.isShowDisplayText = isShowDisplayText;
this.isDefaultDisplayTextColour = isDefaultDisplayTextColour;
this.isDefaultDisplayTextColour = isDefaultDisplayTextColour;
this.displayTextFontColour = displayTextFontColour;
this.displayTextFontColour = displayTextFontColour;
this.isClearIcon = isClearIcon;
this.isClearIcon = isClearIcon;
this.isHideDefaultIcon = isHideDefaultIcon;
this.isHideDefaultIcon = isHideDefaultIcon;
this.isHideToggleOffIcon = isHideToggleOffIcon;
this.isHideToggleOffIcon = isHideToggleOffIcon;
this.isHideToggleOnIcon = isHideToggleOnIcon;
this.isHideToggleOnIcon = isHideToggleOnIcon;
this.displayTextAlignment = displayTextAlignment;
this.displayTextAlignment = displayTextAlignment;
this.isTransparentBackground = isTransparentBackground;
this.isTransparentBackground = isTransparentBackground;
this.combineActionPropertiesPane = combineActionPropertiesPane;
this.combineActionPropertiesPane = combineActionPropertiesPane;
this.clientProfile = clientProfile;
this.clientProfile = clientProfile;
this.sendIcon = sendIcon;
this.sendIcon = sendIcon;
this.actionBox = actionBox;
this.actionBox = actionBox;
this.exceptionAndAlertHandler = exceptionAndAlertHandler;
this.exceptionAndAlertHandler = exceptionAndAlertHandler;
this.backgroundColour = backgroundColour;
this.backgroundColour = backgroundColour;
this.actionClientProperties = actionClientProperties;
this.actionClientProperties = actionClientProperties;
this.runOnActionSavedFromServer = runOnActionSavedFromServer;
this.runOnActionSavedFromServer = runOnActionSavedFromServer;
this.actionDetailsPaneListener = actionDetailsPaneListener;
logger = Logger.getLogger(getClass().getName());
logger = Logger.getLogger(getClass().getName());
if(runAsync)
if(runAsync)
new Thread(this).start();
new Thread(this).start();
else
else
runTask();
runTask();
}
}
private boolean runOnActionSavedFromServer;
private boolean runOnActionSavedFromServer;
private ActionDetailsPaneListener actionDetailsPaneListener;
private Button saveButton;
private Button saveButton;
private Button deleteButton;
private Button deleteButton;
private String delayBeforeRunningString;
private String delayBeforeRunningString;
private boolean isShowDisplayText;
private boolean isShowDisplayText;
private boolean isCombineChild;
private boolean isCombineChild;
private String displayNameText;
private String displayNameText;
private boolean isDefaultDisplayTextColour;
private boolean isDefaultDisplayTextColour;
private ArrayList<UIPropertyBox> actionClientProperties;
private ArrayList<UIPropertyBox> actionClientProperties;
private String displayTextFontColour;
private String displayTextFontColour;
private boolean isClearIcon;
private boolean isClearIcon;
private boolean isHideDefaultIcon;
private boolean isHideDefaultIcon;
private boolean isHideToggleOffIcon;
private boolean isHideToggleOffIcon;
private boolean isHideToggleOnIcon;
private boolean isHideToggleOnIcon;
private DisplayTextAlignment displayTextAlignment;
private DisplayTextAlignment displayTextAlignment;
private boolean isTransparentBackground;
private boolean isTransparentBackground;
private String backgroundColour;
private String backgroundColour;
private CombineActionPropertiesPane combineActionPropertiesPane;
private CombineActionPropertiesPane combineActionPropertiesPane;
private ClientProfile clientProfile;
private ClientProfile clientProfile;
private boolean sendIcon;
private boolean sendIcon;
private ActionBox actionBox;
private ActionBox actionBox;
private ExceptionAndAlertHandler exceptionAndAlertHandler;
private ExceptionAndAlertHandler exceptionAndAlertHandler;
private Action action;
private Action action;
private ClientConnection connection;
private ClientConnection connection;
private void setSaveDeleteButtonState(boolean state)
private void setSaveDeleteButtonState(boolean state)
{
{
Platform.runLater(()->{
Platform.runLater(()->{
saveButton.setDisable(state);
saveButton.setDisable(state);
deleteButton.setDisable(state);
deleteButton.setDisable(state);
});
});
}
}
private void runTask()
private void runTask()
{
{
action.setDisplayText(displayNameText);
action.setDisplayText(displayNameText);
if(!isCombineChild)
if(!isCombineChild)
{
{
setSaveDeleteButtonState(true);
setSaveDeleteButtonState(true);
action.setShowDisplayText(isShowDisplayText);
action.setShowDisplayText(isShowDisplayText);
if(isDefaultDisplayTextColour)
if(isDefaultDisplayTextColour)
action.setDisplayTextFontColourHex("");
action.setDisplayTextFontColourHex("");
else
else
{
{
action.setDisplayTextFontColourHex(displayTextFontColour);
action.setDisplayTextFontColourHex(displayTextFontColour);
//String fontColour = "#" + displayTextColourPicker.getValue().toString().substring(2);
//String fontColour = "#" + displayTextColourPicker.getValue().toString().substring(2);
//action.setDisplayTextFontColourHex(fontColour);
//action.setDisplayTextFontColourHex(fontColour);
}
}
if(isClearIcon)
if(isClearIcon)
{
{
action.setIcons(null);
action.setIcons(null);
action.setCurrentIconState("");
action.setCurrentIconState("");
}
}
if(action.getActionType() == ActionType.NORMAL)
if(action.getActionType() == ActionType.NORMAL)
{
{
if(isHideDefaultIcon)
if(isHideDefaultIcon)
{
{
if(action.getIcon("default") != null)
if(action.getIcon("default") != null)
action.setCurrentIconState("default");
action.setCurrentIconState("default");
}
}
else
else
{
{
action.setCurrentIconState("");
action.setCurrentIconState("");
}
}
}
}
else if (action.getActionType() == ActionType.TOGGLE)
else if (action.getActionType() == ActionType.TOGGLE)
{
{
action.setCurrentIconState(isHideToggleOffIcon+"__"+isHideToggleOnIcon);
action.setCurrentIconState(isHideToggleOffIcon+"__"+isHideToggleOnIcon);
}
}
action.setDisplayTextAlignment(displayTextAlignment);
action.setDisplayTextAlignment(displayTextAlignment);
if(isTransparentBackground)
if(isTransparentBackground)
action.setBgColourHex("");
action.setBgColourHex("");
else
else
{
{
action.setBgColourHex(backgroundColour);
action.setBgColourHex(backgroundColour);
}
}
}
}
System.out.println("parent : "+action.getParent());
System.out.println("parent : "+action.getParent());
if(action.getActionType() == ActionType.COMBINE)
if(action.getActionType() == ActionType.COMBINE)
{
{
List<String> finalChildren = combineActionPropertiesPane.getFinalChildren();
List<String> finalChildren = combineActionPropertiesPane.getFinalChildren();
System.out.println("2334 "+finalChildren.size());
System.out.println("2334 "+finalChildren.size());
ClientProperties clientProperties = new ClientProperties();
ClientProperties clientProperties = new ClientProperties();
for(int i = 0;i<finalChildren.size();i++)
for(int i = 0;i<finalChildren.size();i++)
{
{
Property property = new Property(i+"", Type.STRING);
Property property = new Property(i+"", Type.STRING);
property.setRawValue(finalChildren.get(i));
property.setRawValue(finalChildren.get(i));
clientProperties.addProperty(property);
clientProperties.addProperty(property);
}
}
action.getClientProperties().set(clientProperties);
action.getClientProperties().set(clientProperties);
}
}
else
else
{
{
action.setDelayBeforeExecuting(Integer.parseInt(delayBeforeRunningString));
if(action.getActionType() != ActionType.FOLDER)
action.setDelayBeforeExecuting(Integer.parseInt(delayBeforeRunningString));
//properties
//properties
for (UIPropertyBox clientProperty : actionClientProperties) {
for (UIPropertyBox clientProperty : actionClientProperties) {
action.getClientProperties().get().get(clientProperty.getIndex()).setRawValue(clientProperty.getRawValue());
action.getClientProperties().get().get(clientProperty.getIndex()).setRawValue(clientProperty.getRawValue());
}
}
}
}
try
try
{
{
logger.info("Saving action ... "+action.isHasIcon()+"+"+sendIcon);
logger.info("Saving action ... "+action.isHasIcon()+"+"+sendIcon);
if(runOnActionSavedFromServer)
if(runOnActionSavedFromServer)
{
{
try
try
{
{
if(action instanceof ExternalPlugin)
if(action instanceof ExternalPlugin)
{
{
System.out.println(action.getSocketAddressForClient());
System.out.println(action.getSocketAddressForClient());
((ExternalPlugin) action).onActionSavedFromServer();
((ExternalPlugin) action).onActionSavedFromServer();
}
}
}
}
catch (Exception e)
catch (Exception e)
{
{
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleMinorException(new MinorException("Error","onActionSavedFromServer() failed for "+action.getModuleName()+"\n\n"+e.getMessage()));
exceptionAndAlertHandler.handleMinorException(new MinorException("Error","onActionSavedFromServer() failed for "+action.getModuleName()+"\n\n"+e.getMessage()));
}
}
}
}
connection.saveActionDetails(clientProfile.getID(), action);
connection.saveActionDetails(clientProfile.getID(), action);
if(sendIcon)
if(sendIcon)
{
{
sendAllIcons(clientProfile, action);
sendAllIcons(clientProfile, action);
}
}
if(!isCombineChild)
if(!isCombineChild)
{
{
Platform.runLater(()->{
Platform.runLater(()->{
actionBox.clear();
actionBox.clear();
actionBox.setAction(action);
actionBox.setAction(action);
//actionBox.baseInit();
//actionBox.baseInit();
actionBox.init();
actionBox.init();
});
});
setSaveDeleteButtonState(false);
setSaveDeleteButtonState(false);
}
}
clientProfile.removeActionByID(action.getID());
clientProfile.removeActionByID(action.getID());
clientProfile.addAction(action);
clientProfile.addAction(action);
Platform.runLater(actionDetailsPaneListener::refresh);
}
}
catch (SevereException e)
catch (SevereException e)
{
{
e.printStackTrace();
e.printStackTrace();
exceptionAndAlertHandler.handleSevereException(e);
exceptionAndAlertHandler.handleSevereException(e);
}
}
catch (Exception e)
catch (Exception e)
{
{
e.printStackTrace();
e.printStackTrace();
}
}
}
}
private void sendAllIcons(ClientProfile clientProfile, Action action) throws SevereException
private void sendAllIcons(ClientProfile clientProfile, Action action) throws SevereException
{
{
for(String state : action.getIcons().keySet())
for(String state : action.getIcons().keySet())
{
{
System.out.println("Sending icon " +state+" -> "+action.getID()+ "-> "+clientProfile.getID());
connection.sendIcon(clientProfile.getID(), action.getID(), state, action.getIcon(state));
connection.sendIcon(clientProfile.getID(), action.getID(), state, action.getIcon(state));
}
}
}
}
@Override
@Override
protected Void call() throws Exception
protected Void call() throws Exception
{
{
runTask();
runTask();
return null;
return null;
}
}
}
}
.alert_error_icon
.alert_error_icon
{
{
-fx-icon-color: RED;
-fx-icon-color: RED;
}
}
.alert_information_icon
.alert_information_icon
{
{
-fx-icon-color: BLUE;
-fx-icon-color: BLUE;
}
}
.alert_warning_icon
.alert_warning_icon
{
{
-fx-icon-color: #ffcc00;
-fx-icon-color: #ffcc00;
}
}
.action_details_pane_delete_button_icon
.action_details_pane_delete_button_icon
{
{
-fx-icon-color:red;
-fx-icon-color:red;
}
}
.action_box_toggle_on
.action_box_toggle_on
{
{
-fx-icon-code: fas-toggle-on;
-fx-icon-code: fas-toggle-on;
}
}
.action_box_toggle_off
.action_box_toggle_off
{
{
-fx-icon-code: fas-toggle-off;
-fx-icon-code: fas-toggle-off;
}
.action_details_pane_reset_button_icon
{
-fx-icon-color:orange;
}
}
.root {
.root {
-fx-font-family : 'Roboto';
-fx-font-family : 'Roboto';
}
}
.about_donate_hyperlink
.about_donate_hyperlink
{
{
-fx-font-size : 19;
-fx-font-size : 19;
-fx-font-weight : bold;
-fx-font-weight : bold;
}
}
.plugins_settings_each_plugin_button_bar
.plugins_settings_each_plugin_button_bar
{
{
-fx-alignment:center-right;
-fx-alignment:center-right;
}
}
.about_license_label
.about_license_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.theme_settings_each_theme_box, .plugins_settings_each_plugin_box, .clients_settings_each_client_box
.theme_settings_each_theme_box, .plugins_settings_each_plugin_box, .clients_settings_each_client_box
{
{
-fx-border-width : 0 0 1 0;
-fx-border-width : 0 0 1 0;
-fx-border-color : grey;
-fx-border-color : grey;
}
}
.plugins_settings_each_plugin_heading_label, .themes_settings_each_theme_heading, .client_settings_each_client_nick_name_label
.plugins_settings_each_plugin_heading_label, .themes_settings_each_theme_heading, .client_settings_each_client_nick_name_label
{
{
-fx-font-size : 19;
-fx-font-size : 19;
}
}
.action_box
.action_box
{
{
-fx-border-width: 1px;
-fx-border-width: 1px;
-fx-border-color : grey;
-fx-border-color : grey;
}
}
.action_box_icon_present
.action_box_icon_present
{
{
}
}
.action_box_icon_not_present
.action_box_icon_not_present
{
{
}
}
.action_box_valid
.action_box_valid
{
{
-fx-border-color: grey;
-fx-border-color: grey;
}
}
.action_box_invalid
.action_box_invalid
{
{
-fx-border-color: red;
-fx-border-color: red;
}
}
.action_box_display_text_label
.action_box_display_text_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
-fx-background-color : transparent;
-fx-background-color : transparent;
}
}
.action_details_pane_heading_label
.action_details_pane_heading_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.client_settings_each_client_socket_connection_label
.client_settings_each_client_socket_connection_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.general_settings{
.general_settings{
-fx-alignment : TOP_CENTER;
-fx-alignment : TOP_CENTER;
-fx-padding : 10;
-fx-padding : 10;
}
}
.alert_header
.alert_header
{
{
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_pane
.alert_pane
{
{
-fx-border-width : 5;
-fx-border-width : 5;
-fx-border-radius : 5;
-fx-border-radius : 5;
-fx-background-radius : 5;
-fx-background-radius : 5;
-fx-max-width : 400;
-fx-max-width : 400;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0.0 , 0 );
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0.0 , 0 );
}
}
.alert_header_icon
.alert_header_icon
{
{
-fx-icon-size : 30;
-fx-icon-size : 30;
}
}
.alert_content_pane
.alert_content_pane
{
{
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_pane_parent
.alert_pane_parent
{
{
-fx-background-color : rgba(0,0,0,0.5);
-fx-background-color : rgba(0,0,0,0.5);
}
}
.alert_pane_header_text
.alert_pane_header_text
{
{
-fx-font-size: 18;
-fx-font-size: 18;
}
}
.alert_button_bar
.alert_button_bar
{
{
-fx-alignment: CENTER_RIGHT;
-fx-alignment: CENTER_RIGHT;
-fx-spacing: 5;
-fx-spacing: 5;
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_scroll_pane {
.alert_scroll_pane {
-fx-max-height : 300;
-fx-max-height : 300;
/*-fx-focus-color: #FFFFFF;
/*-fx-focus-color: #FFFFFF;
-fx-faint-focus-color:#FFFFFF;*/
-fx-faint-focus-color:#FFFFFF;*/
}
}
.plugins_pane
.plugins_pane
{
{
-fx-spacing: 5;
-fx-spacing: 5;
}
}
.plugins_pane_each_plugin_button_imageview
.plugins_pane_each_plugin_button_imageview
{
{
-fx-width:20;
-fx-width:20;
-fx-height:20;
-fx-height:20;
}
}
.about_donate_hyperlink
.about_donate_hyperlink
{
{
-fx-padding : 10 0 0 0;
-fx-padding : 10 0 0 0;
-fx-font-size : 25;
-fx-font-size : 25;
}
}
.first_time_use_pane
.first_time_use_pane
{
{
-fx-padding : 5;
-fx-padding : 5;
}
}
.first_time_use_pane_heading_label
.first_time_use_pane_heading_label
{
{
-fx-font-size: 20;
-fx-font-size: 20;
}
}
.first_time_use_pane_stackpane
.first_time_use_pane_stackpane
{
{
}
}
.first_time_use_pane_welcome
.first_time_use_pane_welcome
{
{
}
}
.first_time_use_pane_license
.first_time_use_pane_license
{
{
-fx-spacing : 10;
-fx-spacing : 10;
}
}
.first_time_use_pane_final_config
.first_time_use_pane_final_config
{
{
}
}
.first_time_use_pane_final_config_label
.first_time_use_pane_final_config_label
{
{
-fx-padding: 0 0 30 0;
-fx-padding: 0 0 30 0;
}
}
.first_time_use_welcome_pane_welcome_label
.first_time_use_welcome_pane_welcome_label
{
{
-fx-font-size: 30;
-fx-font-size: 30;
}
}
.first_time_use_welcome_pane_next_to_continue_label
.first_time_use_welcome_pane_next_to_continue_label
{
{
-fx-font-size: 15;
-fx-font-size: 15;
}
}
.scroll-pane
.scroll-pane
{
{
-fx-focus-color:transparent;
-fx-focus-color:transparent;
-fx-faint-focus-color:transparent;
-fx-faint-focus-color:transparent;
}
}
.plugins_settings_scroll_pane, .themes_settings_scroll_pane, .clients_settings_scroll_pane
.plugins_settings_scroll_pane, .themes_settings_scroll_pane, .clients_settings_scroll_pane
{
{
-fx-padding: 10 0 0 0;
-fx-padding: 10 0 0 0;
}
}
.plugins_settings_each_plugin_box, .theme_settings_each_theme_box, .clients_settings_each_client_box
.plugins_settings_each_plugin_box, .theme_settings_each_theme_box, .clients_settings_each_client_box
{
{
-fx-spacing : 5;
-fx-spacing : 5;
-fx-padding : 10 0 10 0;
-fx-padding : 10 0 10 0;
}
}
.plugins_pane_each_plugin_box_parent, .plugins_pane_each_plugin_box
.plugins_pane_each_plugin_box_parent, .plugins_pane_each_plugin_box
{
{
-fx-spacing : 5;
-fx-spacing : 5;
}
}
.about
.about
{
{
-fx-spacing : 5;
-fx-spacing : 5;
}
}
.about_links_box
.about_links_box
{
{
-fx-spacing : 15;
-fx-spacing : 15;
}
}
.action_details_pane_delete_button
.action_details_pane_delete_button
{
{
-fx-text-fill : red;
-fx-text-fill : red;
}
}
.action_details_pane_reset_button
{
-fx-text-fill : orange;
}
.client_and_profile_selector_pane_stack
.client_and_profile_selector_pane_stack
{
{
-fx-spacing: 5;
-fx-spacing: 5;
}
}
.plugins_settings, .themes_settings, .clients_settings
.plugins_settings, .themes_settings, .clients_settings
{
{
-fx-padding: 0 10 0 0;
-fx-padding: 0 10 0 0;
}
}
/*Alert Classes added to default stylesheet to show init error, if occurs */
/*Alert Classes added to default stylesheet to show init error, if occurs */
.action_box_display_text_label
.action_box_display_text_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
-fx-background-color : transparent;
-fx-background-color : transparent;
}
}
.alert_pane
.alert_pane
{
{
-fx-background-color : white;
-fx-background-color : white;
-fx-border-color : white;
-fx-border-color : white;
}
}
.alert_content_pane
.alert_content_pane
{
{
-fx-background-color: white;
-fx-background-color: white;
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_scroll_pane
.alert_scroll_pane
{
{
-fx-background: white;
-fx-background: white;
-fx-border-color:white;
-fx-border-color:white;
}
}
.alert_button_bar
.alert_button_bar
{
{
-fx-background-color:white;
-fx-background-color:white;
}
}
.split-pane-divider {
.split-pane-divider {
-fx-padding: 2;
-fx-padding: 2;
}
}