Commit e7410325 authored by Joachim Müssig's avatar Joachim Müssig

Add documentation and methods which also can set the color of the current action messages

parent 36161e50
......@@ -7,6 +7,7 @@ package gui;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.paint.Color;
/**
*
......@@ -23,23 +24,75 @@ public class CurrentActionLogger {
endProgress();
}
/**
* start progress indicator and show the given string as current action on the GUI
* @param msg the message you want to show on the GUI as current action
*/
public void startProgress(String msg) {
progressIndicator.setVisible(true);
labelCurrentAction.setText(msg);
labelCurrentAction.setTextFill(Color.BLACK);
}
/**
* start progress indicator and show the given string as current action on the GUI in a specific color
* @param msg the message you want to show on the GUI as current action
* @param c the color for the message
*/
public void startProgress(String msg, Color c) {
progressIndicator.setVisible(true);
labelCurrentAction.setTextFill(c);
labelCurrentAction.setText(msg);
}
/**
* stop progress indicator and clear the current action text on the gui.
*/
public void endProgress() {
labelCurrentAction.setText("");
progressIndicator.setVisible(false);
labelCurrentAction.setTextFill(Color.BLACK);
}
/**
* stop progress indicator and show the given string as current action on the GUI
* @param msg the message you want to show on the GUI as current action
*/
public void endProgressWithMessage(String msg) {
labelCurrentAction.setText(msg);
progressIndicator.setVisible(false);
labelCurrentAction.setTextFill(Color.BLACK);
}
/**
* stop progress indicator and show the given string as current action on the GUI
* @param msg the message you want to show on the GUI as current action
* @param c the color for the message
*/
public void endProgressWithMessage(String msg, Color c) {
labelCurrentAction.setText(msg);
labelCurrentAction.setTextFill(c);
progressIndicator.setVisible(false);
}
/**
* show the given string as current action on the GUI
* @param msg the message you want to show on the GUI as current action
*/
public void showMessage(String msg) {
labelCurrentAction.setText(msg);
labelCurrentAction.setTextFill(Color.BLACK);
}
/**
* show the given string as current action on the GUI
* @param msg the message you want to show on the GUI as current action
* @param c the color for the message
*/
public void showMessage(String msg, Color c) {
labelCurrentAction.setText(msg);
labelCurrentAction.setTextFill(c);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment