summaryrefslogtreecommitdiff
path: root/src/MetadataView.java
blob: 5837acae82fe50b4a18e803c7255a46d6178357e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import javax.swing.JTextArea;
import java.awt.*;

/*
 * @author
 * Kian Agheli
 *
 * References:
 * https://docs.oracle.com/javase/tutorial/uiswing/components/textarea.html
 *
 * Date:
 * 2024-05-25
 *
 * Purpose of class:
 * Provide an area to show metadata.
 */

public class MetadataView extends JTextArea {
	// A MetadataView has-a default text.
	private final String defaultText = "Toggle a font family using a colorful button below.\n" + 
		"Each color corresponds with a line on the graph to the right.\n" + 
		"The graph tracks monthly views.";

	public MetadataView() {
		super(); // Call parent constructor
		setEditable(false); // Disable editing of the widget.
		setFocusable(false); // Disable focusing of the widget.
		setText(defaultText); // Set to the default text.
	}

	/* Reset the MetadataView. Set the text to the default. */
	public void reset() {
		setText(defaultText);
	}
}