Panel just below the editing area that contains status messages.
| 41 | * Panel just below the editing area that contains status messages. |
| 42 | */ |
| 43 | public class EditorStatus extends JPanel { |
| 44 | |
| 45 | private static final int NOTICE = 0; |
| 46 | private static final int ERR = 1; |
| 47 | private static final int EDIT = 2; |
| 48 | private static final int PROGRESS = 5; |
| 49 | private static final String NO_MESSAGE = ""; |
| 50 | |
| 51 | private static final Color[] BGCOLOR; |
| 52 | private static final Color[] FGCOLOR; |
| 53 | |
| 54 | static { |
| 55 | BGCOLOR = new Color[6]; |
| 56 | BGCOLOR[0] = Theme.getColor("status.notice.bgcolor"); |
| 57 | BGCOLOR[1] = Theme.getColor("status.error.bgcolor"); |
| 58 | BGCOLOR[2] = Theme.getColor("status.edit.bgcolor"); |
| 59 | BGCOLOR[3] = null; |
| 60 | BGCOLOR[4] = null; |
| 61 | BGCOLOR[5] = Theme.getColor("status.notice.bgcolor"); |
| 62 | |
| 63 | FGCOLOR = new Color[6]; |
| 64 | FGCOLOR[0] = Theme.getColor("status.notice.fgcolor"); |
| 65 | FGCOLOR[1] = Theme.getColor("status.error.fgcolor"); |
| 66 | FGCOLOR[2] = Theme.getColor("status.edit.fgcolor"); |
| 67 | FGCOLOR[3] = null; |
| 68 | FGCOLOR[4] = null; |
| 69 | FGCOLOR[5] = Theme.getColor("status.notice.fgcolor"); |
| 70 | } |
| 71 | |
| 72 | // value for the size bars, buttons, etc |
| 73 | // TODO: Should be a Theme value? |
| 74 | static final int GRID_SIZE = 33; |
| 75 | |
| 76 | private final Editor editor; |
| 77 | private final Font font; |
| 78 | |
| 79 | private int mode; |
| 80 | private String message; |
| 81 | |
| 82 | private Image offscreen; |
| 83 | private int sizeW; |
| 84 | private int sizeH; |
| 85 | private int imageW; |
| 86 | private int imageH; |
| 87 | |
| 88 | private JButton cancelButton; |
| 89 | private JButton okButton; |
| 90 | private JTextField editField; |
| 91 | private JProgressBar progressBar; |
| 92 | private JButton copyErrorButton; |
| 93 | |
| 94 | private ArrayList<CompilerProgressListener> compilerProgressListeners; |
| 95 | |
| 96 | public EditorStatus(Editor editor) { |
| 97 | this.editor = editor; |
| 98 | this.message = NO_MESSAGE; |
| 99 | this.mode = NOTICE; |
| 100 | this.font = Theme.getFont("status.font"); |