ProjektGraph/OurApplication/OurTextArea.java

46 lines
1.1 KiB
Java

package OurApplication;
import logging.LogElement;
import logging.LogElementList;
import visualisation.TextArea;
/**
* This class extends visualisation.TextArea and provides an example of its usage.
* It overrides constructors and the print() method.
*
* @see TextArea
*/
public class OurTextArea extends TextArea {
private static final long serialVersionUID = 1L;
/**
* Default constructor for creating an instance of OurTextArea.
* Initializes with default settings.
*/
public OurTextArea() {
super();
}
/**
* 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.
*/
public OurTextArea(LogElementList<OurLogElement> logList) {
super(logList);
}
/**
* Outputs the description of a log element to the text area.
*
* @return true if the operation is successful, false otherwise.
*/
public boolean print() {
LogElement logElement = (LogElement) logList.get();
setText(logElement.getDescription());
return true;
}
}