ProjektGraph/OurApplication/OurTextArea.java

46 lines
1.1 KiB
Java
Raw Normal View History

2024-07-02 19:13:30 +00:00
package OurApplication;
2024-07-07 12:02:19 +00:00
import logging.LogElement;
import logging.LogElementList;
2024-07-02 19:13:30 +00:00
import visualisation.TextArea;
/**
2024-07-08 22:17:31 +00:00
* This class extends visualisation.TextArea and provides an example of its usage.
* It overrides constructors and the print() method.
*
2024-07-02 19:13:30 +00:00
* @see TextArea
*/
2024-07-08 22:17:31 +00:00
public class OurTextArea extends TextArea {
private static final long serialVersionUID = 1L;
/**
2024-07-08 22:17:31 +00:00
* Default constructor for creating an instance of OurTextArea.
* Initializes with default settings.
*/
2024-07-02 19:13:30 +00:00
public OurTextArea() {
super();
}
2024-07-08 22:17:31 +00:00
/**
2024-07-08 22:17:31 +00:00
* Extended constructor for creating an instance of OurTextArea.
* Sets the initial LogElementList of OurLogElement as the log list.
*
* @param logList the LogElementList containing OurLogElement objects for the text area's log.
*/
2024-07-08 22:17:31 +00:00
public OurTextArea(LogElementList<OurLogElement> logList) {
super(logList);
}
2024-07-08 22:17:31 +00:00
/**
2024-07-08 22:17:31 +00:00
* Outputs the description of a log element to the text area.
*
* @return true if the operation is successful, false otherwise.
*/
2024-07-08 22:17:31 +00:00
public boolean print() {
LogElement logElement = (LogElement) logList.get();
2024-07-07 12:02:19 +00:00
setText(logElement.getDescription());
return true;
}
}