Source code: com/trapezium/chisel/ChiselPane.java
1 /* ChiselPane
2 *
3 */
4
5 package com.trapezium.chisel;
6
7 import java.awt.*;
8 import java.awt.event.*;
9 import java.util.*;
10
11 //import com.trapezium.factory.*;
12 import com.trapezium.chisel.gui.ComponentFactory;
13 import com.trapezium.chisel.gui.FontPool;
14
15
16 /** A top-level non-generic gui component of Chisel */
17 public class ChiselPane extends GuiAdapter implements ProcessedFileViewer {
18
19 /** create a pane with a generic gui implementation */
20 public ChiselPane() {
21 this(null, false);
22 }
23
24 /** create a generic scrollable pane */
25 public ChiselPane(boolean scrollable) {
26 this(null, scrollable);
27 }
28
29 /** create a pane with a specific gui implementation */
30 public ChiselPane(Component pane) {
31 this(pane, false);
32 }
33
34 /** create a scrollable pane with a specific gui implementation */
35 private ChiselPane(Component pane, boolean scrollable) {
36 if (pane == null) {
37 Container container;
38 if (scrollable) {
39 container = ComponentFactory.createScrollablePane();
40 container.setLayout(null);
41 setComponent(container);
42 } else {
43 container = ComponentFactory.createSimplePane();
44 setContainer(container);
45 }
46 pane = container;
47 } else {
48 setComponent(pane);
49 }
50 pane.setBackground(DEFAULT_PANECOLOR);
51 pane.setFont(FontPool.getFont(0));
52 }
53
54 /** update the display if the object belongs to this viewer or is null */
55 public void fileUpdated(ProcessedFile data) {
56 }
57
58 /** load an object into the viewer */
59 public void fileDone(ProcessedFile data) {
60 }
61
62 /** save the current document. Prompts for filename if the document was not loaded
63 from disk or previously saved. */
64 public void save() {
65 }
66
67 /** remove the current document from the viewer and display an empty document */
68 public void empty() {
69 }
70
71 /** get the ProcessedFile being viewed */
72 public ProcessedFile getProcessedFile() {
73 return null;
74 }
75
76 /** set the ProcessedFile being viewed */
77 public void setProcessedFile(ProcessedFile data) {
78 }
79
80 /** dump the current document to the console */
81 public void dump() {
82 }
83 }
84