2024-07-02 19:13:30 +00:00
|
|
|
package OurApplication;
|
2024-06-15 19:55:30 +00:00
|
|
|
|
2024-07-07 12:02:19 +00:00
|
|
|
import logging.LogElement;
|
2024-06-15 19:55:30 +00:00
|
|
|
import logging.LogElementList;
|
2024-07-02 19:13:30 +00:00
|
|
|
import visualisation.TextArea;
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
/**
|
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-06-15 19:55:30 +00:00
|
|
|
*/
|
2024-07-08 22:17:31 +00:00
|
|
|
public class OurTextArea extends TextArea {
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
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-06-15 19:55:30 +00:00
|
|
|
*/
|
2024-07-02 19:13:30 +00:00
|
|
|
public OurTextArea() {
|
2024-06-15 19:55:30 +00:00
|
|
|
super();
|
|
|
|
}
|
2024-07-08 22:17:31 +00:00
|
|
|
|
2024-06-15 19:55:30 +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-06-15 19:55:30 +00:00
|
|
|
*/
|
2024-07-08 22:17:31 +00:00
|
|
|
public OurTextArea(LogElementList<OurLogElement> logList) {
|
2024-06-15 19:55:30 +00:00
|
|
|
super(logList);
|
|
|
|
}
|
2024-07-08 22:17:31 +00:00
|
|
|
|
2024-06-15 19:55:30 +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-06-15 19:55:30 +00:00
|
|
|
*/
|
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());
|
2024-06-15 19:55:30 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|