diff options
Diffstat (limited to 'src/MetadataView.java')
-rw-r--r-- | src/MetadataView.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/MetadataView.java b/src/MetadataView.java new file mode 100644 index 0000000..5837aca --- /dev/null +++ b/src/MetadataView.java @@ -0,0 +1,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); + } +} |