server
Clone or download
Modified Files
package com.stream_pi.server.window.dashboard;
package com.stream_pi.server.window.dashboard;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.action.ActionType;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.action_api.externalplugin.ExternalPlugin;
import com.stream_pi.server.action.ExternalPlugins;
import com.stream_pi.server.action.ExternalPlugins;
import com.stream_pi.server.controller.ActionDataFormats;
import com.stream_pi.server.controller.ActionDataFormats;
import com.stream_pi.util.uihelper.SpaceFiller;
import com.stream_pi.util.uihelper.SpaceFiller;
import javafx.application.HostServices;
import javafx.application.HostServices;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.Pos;
import javafx.scene.CacheHint;
import javafx.scene.CacheHint;
import javafx.scene.Node;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.image.ImageView;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.Dragboard;
import javafx.scene.input.Dragboard;
import javafx.scene.input.TransferMode;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.*;
import javafx.scene.layout.*;
import org.kordamp.ikonli.javafx.FontIcon;
import org.kordamp.ikonli.javafx.FontIcon;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
public class PluginsPane extends VBox {
public class PluginsPane extends VBox {
private Button settingsButton;
private Button settingsButton;
public PluginsPane(HostServices hostServices)
public PluginsPane(HostServices hostServices)
{
{
setMinWidth(250);
setMinWidth(250);
setMaxWidth(350);
setMaxWidth(350);
getStyleClass().add("plugins_pane");
getStyleClass().add("plugins_pane");
setPadding(new Insets(10));
setPadding(new Insets(10));
this.hostServices = hostServices;
this.hostServices = hostServices;
initUI();
initUI();
}
}
private Accordion pluginsAccordion;
private Accordion pluginsAccordion;
public void initUI()
public void initUI()
{
{
pluginsAccordion = new Accordion();
pluginsAccordion = new Accordion();
pluginsAccordion.getStyleClass().add("plugins_pane_accordion");
pluginsAccordion.getStyleClass().add("plugins_pane_accordion");
pluginsAccordion.setCache(true);
pluginsAccordion.setCache(true);
settingsButton = new Button();
settingsButton = new Button();
settingsButton.getStyleClass().add("plugins_pane_settings_button");
settingsButton.getStyleClass().add("plugins_pane_settings_button");
FontIcon cog = new FontIcon("fas-cog");
FontIcon cog = new FontIcon("fas-cog");
settingsButton.setGraphic(cog);
settingsButton.setGraphic(cog);
HBox settingsHBox = new HBox(settingsButton);
HBox settingsHBox = new HBox(settingsButton);
settingsHBox.getStyleClass().add("plugins_pane_settings_button_parent");
settingsHBox.getStyleClass().add("plugins_pane_settings_button_parent");
settingsHBox.setAlignment(Pos.CENTER_RIGHT);
settingsHBox.setAlignment(Pos.CENTER_RIGHT);
Label pluginsLabel = new Label("Plugins");
Label pluginsLabel = new Label("Plugins");
pluginsLabel.getStyleClass().add("plugins_pane_top_label");
pluginsLabel.getStyleClass().add("plugins_pane_top_label");
getChildren().addAll(pluginsLabel, pluginsAccordion, SpaceFiller.vertical(), settingsHBox);
getChildren().addAll(pluginsLabel, pluginsAccordion, SpaceFiller.vertical(), settingsHBox);
}
}
public Button getSettingsButton()
public Button getSettingsButton()
{
{
return settingsButton;
return settingsButton;
}
}
public void clearData()
public void clearData()
{
{
pluginsAccordion.getPanes().clear();
pluginsAccordion.getPanes().clear();
}
}
public void loadData()
public void loadData()
{
{
HashMap<String, ArrayList<ExternalPlugin>> sortedPlugins = ExternalPlugins.getInstance().getSortedPlugins();
HashMap<String, ArrayList<ExternalPlugin>> sortedPlugins = ExternalPlugins.getInstance().getSortedPlugins();
for(String eachCategory : sortedPlugins.keySet())
for(String eachCategory : sortedPlugins.keySet())
{
{
VBox vBox = new VBox();
VBox vBox = new VBox();
vBox.getStyleClass().add("plugins_pane_each_plugin_box_parent");
vBox.getStyleClass().add("plugins_pane_each_plugin_box_parent");
TitledPane pane = new TitledPane(eachCategory, vBox);
TitledPane pane = new TitledPane(eachCategory, vBox);
pane.getStyleClass().add("plugins_pane_each_plugin_category_titled_pane");
pane.getStyleClass().add("plugins_pane_each_plugin_category_titled_pane");
for(ExternalPlugin eachAction : sortedPlugins.get(eachCategory))
for(ExternalPlugin eachAction : sortedPlugins.get(eachCategory))
{
{
if(!eachAction.isVisibleInPluginsPane())
if(!eachAction.isVisibleInPluginsPane())
continue;
continue;
Button eachNormalActionPluginButton = new Button();
Button eachNormalActionPluginButton = new Button();
eachNormalActionPluginButton.getStyleClass().add("plugins_pane_each_plugin_button");
eachNormalActionPluginButton.getStyleClass().add("plugins_pane_each_plugin_button");
HBox.setHgrow(eachNormalActionPluginButton, Priority.ALWAYS);
HBox.setHgrow(eachNormalActionPluginButton, Priority.ALWAYS);
eachNormalActionPluginButton.setMaxWidth(Double.MAX_VALUE);
eachNormalActionPluginButton.setMaxWidth(Double.MAX_VALUE);
eachNormalActionPluginButton.setAlignment(Pos.CENTER_LEFT);
eachNormalActionPluginButton.setAlignment(Pos.CENTER_LEFT);
Node graphic = eachAction.getServerButtonGraphic();
Node graphic = eachAction.getServerButtonGraphic();
if(graphic == null)
if(graphic == null)
{
{
FontIcon cogs = new FontIcon("fas-cogs");
if(eachAction.getActionType() == ActionType.TOGGLE)
cogs.getStyleClass().add("plugins_pane_each_plugin_button_icon");
{
eachNormalActionPluginButton.setGraphic(cogs);
FontIcon toggleIcon = new FontIcon("fas-toggle-on");
toggleIcon.getStyleClass().add("plugins_pane_each_plugin_button_icon_toggle");
eachNormalActionPluginButton.setGraphic(toggleIcon);
}
else
{
FontIcon cogs = new FontIcon("fas-cogs");
cogs.getStyleClass().add("plugins_pane_each_plugin_button_icon_normal");
eachNormalActionPluginButton.setGraphic(cogs);
}
}
}
else
else
{
{
if(graphic instanceof FontIcon)
if(graphic instanceof FontIcon)
{
{
FontIcon fi = (FontIcon) graphic;
FontIcon fi = (FontIcon) graphic;
fi.getStyleClass().add("plugins_pane_each_plugin_button_icon");
fi.getStyleClass().add("plugins_pane_each_plugin_button_icon");
eachNormalActionPluginButton.setGraphic(fi);
eachNormalActionPluginButton.setGraphic(fi);
}
}
else if(graphic instanceof ImageView)
else if(graphic instanceof ImageView)
{
{
ImageView iv = (ImageView) graphic;
ImageView iv = (ImageView) graphic;
iv.getStyleClass().add("plugins_pane_each_plugin_button_imageview");
iv.getStyleClass().add("plugins_pane_each_plugin_button_imageview");
iv.setPreserveRatio(false);
iv.setPreserveRatio(false);
eachNormalActionPluginButton.setGraphic(iv);
eachNormalActionPluginButton.setGraphic(iv);
}
}
}
}
eachNormalActionPluginButton.setText(eachAction.getName());
eachNormalActionPluginButton.setText(eachAction.getName());
eachNormalActionPluginButton.setOnDragDetected(mouseEvent -> {
eachNormalActionPluginButton.setOnDragDetected(mouseEvent -> {
Dragboard db = eachNormalActionPluginButton.startDragAndDrop(TransferMode.ANY);
Dragboard db = eachNormalActionPluginButton.startDragAndDrop(TransferMode.ANY);
ClipboardContent content = new ClipboardContent();
ClipboardContent content = new ClipboardContent();
content.put(ActionDataFormats.ACTION_TYPE, eachAction.getActionType());
content.put(ActionDataFormats.ACTION_TYPE, eachAction.getActionType());
content.put(ActionDataFormats.MODULE_NAME, eachAction.getModuleName());
content.put(ActionDataFormats.MODULE_NAME, eachAction.getModuleName());
content.put(ActionDataFormats.IS_NEW, true);
content.put(ActionDataFormats.IS_NEW, true);
db.setContent(content);
db.setContent(content);
mouseEvent.consume();
mouseEvent.consume();
});
});
HBox hBox = new HBox(eachNormalActionPluginButton);
HBox hBox = new HBox(eachNormalActionPluginButton);
hBox.getStyleClass().add("plugins_pane_each_plugin_box");
hBox.getStyleClass().add("plugins_pane_each_plugin_box");
hBox.setAlignment(Pos.TOP_LEFT);
hBox.setAlignment(Pos.TOP_LEFT);
HBox.setHgrow(eachNormalActionPluginButton, Priority.ALWAYS);
HBox.setHgrow(eachNormalActionPluginButton, Priority.ALWAYS);
if(eachAction.getHelpLink() != null) {
if(eachAction.getHelpLink() != null) {
Button helpButton = new Button();
Button helpButton = new Button();
helpButton.getStyleClass().add("plugins_pane_each_plugin_button_help_icon");
helpButton.getStyleClass().add("plugins_pane_each_plugin_button_help_icon");
FontIcon questionIcon = new FontIcon("fas-question");
FontIcon questionIcon = new FontIcon("fas-question");
questionIcon.getStyleClass().add("plugins_pane_each_plugin_button_help_button_icon");
questionIcon.getStyleClass().add("plugins_pane_each_plugin_button_help_button_icon");
helpButton.setGraphic(questionIcon);
helpButton.setGraphic(questionIcon);
helpButton.setOnAction(event -> hostServices.showDocument(eachAction.getHelpLink()));
helpButton.setOnAction(event -> hostServices.showDocument(eachAction.getHelpLink()));
hBox.getChildren().add(helpButton);
hBox.getChildren().add(helpButton);
}
}
vBox.getChildren().add(hBox);
vBox.getChildren().add(hBox);
}
}
if(vBox.getChildren().size() > 0)
if(vBox.getChildren().size() > 0)
pluginsAccordion.getPanes().add(pane);
pluginsAccordion.getPanes().add(pane);
}
}
}
}
private HostServices hostServices;
private HostServices hostServices;
public void loadOtherActions()
public void loadOtherActions()
{
{
VBox vBox = new VBox();
VBox vBox = new VBox();
vBox.getStyleClass().add("plugins_pane_each_plugin_box_parent");
vBox.getStyleClass().add("plugins_pane_each_plugin_box_parent");
Button folderActionButton = new Button("Folder");
Button folderActionButton = new Button("Folder");
folderActionButton.getStyleClass().add("plugins_pane_each_plugin_button");
folderActionButton.getStyleClass().add("plugins_pane_each_plugin_button");
folderActionButton.setMaxWidth(Double.MAX_VALUE);
folderActionButton.setMaxWidth(Double.MAX_VALUE);
folderActionButton.setAlignment(Pos.CENTER_LEFT);
folderActionButton.setAlignment(Pos.CENTER_LEFT);
FontIcon folder = new FontIcon("fas-folder");
FontIcon folder = new FontIcon("fas-folder");
folderActionButton.setGraphic(folder);
folderActionButton.setGraphic(folder);
folderActionButton.setOnDragDetected(mouseEvent -> {
folderActionButton.setOnDragDetected(mouseEvent -> {
Dragboard db = folderActionButton.startDragAndDrop(TransferMode.ANY);
Dragboard db = folderActionButton.startDragAndDrop(TransferMode.ANY);
ClipboardContent content = new ClipboardContent();
ClipboardContent content = new ClipboardContent();
content.put(ActionDataFormats.ACTION_TYPE, ActionType.FOLDER);
content.put(ActionDataFormats.ACTION_TYPE, ActionType.FOLDER);
db.setContent(content);
db.setContent(content);
mouseEvent.consume();
mouseEvent.consume();
});
});
Button combineActionButton = new Button("Combine");
Button combineActionButton = new Button("Combine");
combineActionButton.getStyleClass().add("plugins_pane_each_plugin_button");
combineActionButton.getStyleClass().add("plugins_pane_each_plugin_button");
combineActionButton.setMaxWidth(Double.MAX_VALUE);
combineActionButton.setMaxWidth(Double.MAX_VALUE);
combineActionButton.setAlignment(Pos.CENTER_LEFT);
combineActionButton.setAlignment(Pos.CENTER_LEFT);
FontIcon list = new FontIcon("fas-list");
FontIcon list = new FontIcon("fas-list");
combineActionButton.setGraphic(list);
combineActionButton.setGraphic(list);
combineActionButton.setOnDragDetected(mouseEvent -> {
combineActionButton.setOnDragDetected(mouseEvent -> {
Dragboard db = combineActionButton.startDragAndDrop(TransferMode.ANY);
Dragboard db = combineActionButton.startDragAndDrop(TransferMode.ANY);
ClipboardContent content = new ClipboardContent();
ClipboardContent content = new ClipboardContent();
content.put(ActionDataFormats.ACTION_TYPE, ActionType.COMBINE);
content.put(ActionDataFormats.ACTION_TYPE, ActionType.COMBINE);
db.setContent(content);
db.setContent(content);
mouseEvent.consume();
mouseEvent.consume();
});
});
HBox.setHgrow(folderActionButton, Priority.ALWAYS);
HBox.setHgrow(folderActionButton, Priority.ALWAYS);
HBox h1 = new HBox(folderActionButton);
HBox h1 = new HBox(folderActionButton);
h1.getStyleClass().add("plugins_pane_each_plugin_box");
h1.getStyleClass().add("plugins_pane_each_plugin_box");
HBox.setHgrow(combineActionButton, Priority.ALWAYS);
HBox.setHgrow(combineActionButton, Priority.ALWAYS);
HBox h2 = new HBox(combineActionButton);
HBox h2 = new HBox(combineActionButton);
h2.getStyleClass().add("plugins_pane_each_plugin_box");
h2.getStyleClass().add("plugins_pane_each_plugin_box");
vBox.getChildren().addAll(h1, h2);
vBox.getChildren().addAll(h1, h2);
TitledPane pane = new TitledPane("Stream-Pi", vBox);
TitledPane pane = new TitledPane("Stream-Pi", vBox);
pane.getStyleClass().add("plugins_pane_each_plugin_category_titled_pane");
pane.getStyleClass().add("plugins_pane_each_plugin_category_titled_pane");
pluginsAccordion.getPanes().add(pane);
pluginsAccordion.getPanes().add(pane);
pluginsAccordion.setCache(true);
pluginsAccordion.setCache(true);
pluginsAccordion.setCacheHint(CacheHint.SPEED);
pluginsAccordion.setCacheHint(CacheHint.SPEED);
}
}
}
}
This list is somewhat outdated. Some classes are missing/no longer work. This will be updated soon
dashboard
dashboard
Action Details Pane - action_details_pane
Action Details Pane - action_details_pane
Heading HBox - action_details_pane_heading_box
Heading HBox - action_details_pane_heading_box
Heading Label - action_details_pane_heading_label
Heading Label - action_details_pane_heading_label
Scroll Pane - action_details_pane_scroll_pane
Scroll Pane - action_details_pane_scroll_pane
VBox (Content Pane) - action_details_pane_vbox
VBox (Content Pane) - action_details_pane_vbox
Bottom Button Bar - action_details_pane_button_bar
Bottom Button Bar - action_details_pane_button_bar
Delete Button - action_details_pane_delete_button
Delete Button - action_details_pane_delete_button
Icon - action_details_pane_delete_button_icon
Icon - action_details_pane_delete_button_icon
Action Grid Pane (Scroll Pane) - action_grid_pane_parent
Action Grid Pane (Scroll Pane) - action_grid_pane_parent
Main Grid Pane - action_grid_pane
Main Grid Pane - action_grid_pane
Action Box - action_box
Action Box - action_box
if folder back button :
if folder back button :
Icon : folder_action_back_button_icon
Icon : folder_action_back_button_icon
Is Icon Present ?
Is Icon Present ?
yes : action_box_icon_present
yes : action_box_icon_present
no : action_box_icon_not_present
no : action_box_icon_not_present
Is Action Valid (is plugin by module name found) ?
Is Action Valid (is plugin by module name found) ?
yes : action_box_valid
yes : action_box_valid
no : action_box_invalid
no : action_box_invalid
Display Text Label - action_box_display_text_label
Display Text Label - action_box_display_text_label
Client & Profile Selector Pane - client_and_profile_selector_pane
Client & Profile Selector Pane - client_and_profile_selector_pane
Stack VBox - client_and_profile_selector_pane_stack
Stack VBox - client_and_profile_selector_pane_stack
"No Clients Connected" Label - client_and_profile_selector_pane_no_clients_connected_label
"No Clients Connected" Label - client_and_profile_selector_pane_no_clients_connected_label
Client Combo Box - client_and_profile_selector_pane_client_selector_combo_box
Client Combo Box - client_and_profile_selector_pane_client_selector_combo_box
Profile Combo Box - client_and_profile_selector_pane_profile_selector_combo_box
Profile Combo Box - client_and_profile_selector_pane_profile_selector_combo_box
Plugins Pane - plugins_pane
Plugins Pane - plugins_pane
"Plugins" Label - plugins_pane_top_label
"Plugins" Label - plugins_pane_top_label
Accordion - plugins_pane_accordion
Accordion - plugins_pane_accordion
Category - plugins_pane_each_plugin_category_titled_pane
Category - plugins_pane_each_plugin_category_titled_pane
VBox - plugins_pane_each_plugin_box_parent
VBox - plugins_pane_each_plugin_box_parent
HBox - plugins_pane_each_plugin_box
HBox - plugins_pane_each_plugin_box
Each Plugin Button - plugins_pane_each_plugin_button
Each Plugin Button - plugins_pane_each_plugin_button
Icon - plugins_pane_each_plugin_button_icon
Icon - plugins_pane_each_plugin_button_icon
OR
OR
ImageView (NOT RECOMMENDED FOR USE) - plugins_pane_each_plugin_button_imageview]
ImageView (NOT RECOMMENDED FOR USE) - plugins_pane_each_plugin_button_imageview]
Help Button - plugins_pane_each_plugin_button_help_icon
Help Button - plugins_pane_each_plugin_button_help_icon
Icon - plugins_pane_each_plugin_button_help_button_icon
Icon - plugins_pane_each_plugin_button_help_button_icon
HBox - plugins_pane_settings_button
HBox - plugins_pane_settings_button
Settings Button - plugins_pane_settings_button
Settings Button - plugins_pane_settings_button
settings
settings
General - general_settings
General - general_settings
Plugins - plugins_settings
Plugins - plugins_settings
Scroll Pane (CENTER) - plugins_settings_scroll_pane
Scroll Pane (CENTER) - plugins_settings_scroll_pane
VBox - plugins_settings_vbox
VBox - plugins_settings_vbox
"No Plugins Present Label" - plugins_pane_no_plugins_installed_label
"No Plugins Present Label" - plugins_pane_no_plugins_installed_label
Each Plugin Box - plugins_settings_each_plugin_box
Each Plugin Box - plugins_settings_each_plugin_box
Header HBox - plugins_settings_each_plugin_header
Header HBox - plugins_settings_each_plugin_header
Heading Label - plugins_settings_each_plugin_heading_label
Heading Label - plugins_settings_each_plugin_heading_label
Help Button - plugins_settings_each_plugin_help_button
Help Button - plugins_settings_each_plugin_help_button
Help Icon - plugins_settings_each_plugin_help_icon
Help Icon - plugins_settings_each_plugin_help_icon
Author Label - plugins_settings_each_plugin_author_label
Author Label - plugins_settings_each_plugin_author_label
Module Label - plugins_settings_each_plugin_module_label
Module Label - plugins_settings_each_plugin_module_label
Version Label - plugins_settings_each_plugin_version_label
Version Label - plugins_settings_each_plugin_version_label
Server Properties Box - plugins_settings_each_plugin_server_properties_box
Server Properties Box - plugins_settings_each_plugin_server_properties_box
buttonBarHBox - plugins_settings_each_plugin_button_bar
buttonBarHBox - plugins_settings_each_plugin_button_bar
Themes - themes_settings
Themes - themes_settings
Scroll Pane (CENTER) - themes_settings_scroll_pane
Scroll Pane (CENTER) - themes_settings_scroll_pane
VBox - themes_settings_vbox
VBox - themes_settings_vbox
Each Theme Box - theme_settings_each_theme_box
Each Theme Box - theme_settings_each_theme_box
Heading HBox - themes_settings_each_theme_header
Heading HBox - themes_settings_each_theme_header
Heading Label - themes_settings_each_theme_heading
Heading Label - themes_settings_each_theme_heading
Help Button - themes_settings_each_theme_help_button
Help Button - themes_settings_each_theme_help_button
Help Icon - themes_settings_each_theme_help_icon
Help Icon - themes_settings_each_theme_help_icon
Author Label - themes_settings_each_theme_author_label
Author Label - themes_settings_each_theme_author_label
Full Name Label - themes_settings_each_theme_full_name_label
Full Name Label - themes_settings_each_theme_full_name_label
Version Label - themes_settings_each_theme_version_label
Version Label - themes_settings_each_theme_version_label
Toggle Button HBox - themes_settings_each_theme_toggle_button_parent
Toggle Button HBox - themes_settings_each_theme_toggle_button_parent
Toggle Button - themes_settings_each_theme_toggle_button
Toggle Button - themes_settings_each_theme_toggle_button
Client - clients_settings
Client - clients_settings
Scroll Pane (CENTER) - clients_settings_scroll_pane
Scroll Pane (CENTER) - clients_settings_scroll_pane
VBox - clients_settings_vbox
VBox - clients_settings_vbox
Each Client Box - clients_settings_each_client_box
Each Client Box - clients_settings_each_client_box
Nick Name Label - client_settings_each_client_nick_name_label
Nick Name Label - client_settings_each_client_nick_name_label
Socket Connection Label - client_settings_each_client_socket_connection_label
Socket Connection Label - client_settings_each_client_socket_connection_label
Platform Label - client_settings_each_client_platform_label
Platform Label - client_settings_each_client_platform_label
Version Label - client_settings_each_client_version_label
Version Label - client_settings_each_client_version_label
Profiles Accordion - client_settings_each_client_profiles_accordion
Profiles Accordion - client_settings_each_client_profiles_accordion
Each Titled Pane - client_settings_each_client_accordion_each_titled_pane
Each Titled Pane - client_settings_each_client_accordion_each_titled_pane
Content VBox - client_settings_each_client_accordion_each_profile_box
Content VBox - client_settings_each_client_accordion_each_profile_box
About - about
About - about
Tab Pane - settings_about_tab_internal
Tab Pane - settings_about_tab_internal
License Tab (Text Area) - about_license_text_area
License Tab (Text Area) - about_license_text_area
Contributors Tab (VBox) - about_license_contributors_vbox
Contributors Tab (VBox) - about_license_contributors_vbox
Table View - about_license_contributors_table_view
Table View - about_license_contributors_table_view
Disclaimer Label - about_license_contributors_disclaimer_label
Disclaimer Label - about_license_contributors_disclaimer_label
Contact Tab (Scroll Pane) - about_contact_tab_scroll_pane
Contact Tab (Scroll Pane) - about_contact_tab_scroll_pane
DONATE Hyperlink - about_donate_hyperlink
DONATE Hyperlink - about_donate_hyperlink
Version Label - about_version_label
Version Label - about_version_label
Comm Standard Label - about_comm_standard_label
Comm Standard Label - about_comm_standard_label
Min Theme API Label - about_min_theme_api_label
Min Theme API Label - about_min_theme_api_label
Min Action API Label - about_min_action_api_label
Min Action API Label - about_min_action_api_label
Current Action API Label - about_current_action_api_label
Current Action API Label - about_current_action_api_label