01: // Copyright (c) 2002 Per M.A. Bothner.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.jemacs.swing;
05:
06: import gnu.jemacs.buffer.*;
07: import gnu.lists.LList;
08:
09: import java.awt.Color;
10: import javax.swing.text.*;
11:
12: public class SwingToolkit extends EToolkit {
13: public EFrame newFrame(Buffer buffer) {
14: return new SwingFrame(buffer);
15: }
16:
17: public Buffer newBuffer(String name) {
18: return new SwingBuffer(name);
19: }
20:
21: public Object getFace(String name, boolean create) {
22: Style style = SwingBuffer.styles.getStyle(name);
23: if (style == null && create)
24: style = SwingBuffer.styles.addStyle(name, null);
25: return style;
26: }
27:
28: public void setUnderline(Object face, boolean underline) {
29: StyleConstants.setUnderline((Style) face, underline);
30: }
31:
32: public void setBold(Object face, boolean bold) {
33: StyleConstants.setBold((Style) face, bold);
34: }
35:
36: public void setForeground(Object face, Color foreground) {
37: StyleConstants.setForeground((Style) face, foreground);
38: }
39:
40: public void setBackground(Object face, Color background) {
41: StyleConstants.setBackground((Style) face, background);
42: }
43:
44: /**
45: * @see gnu.jemacs.buffer.EToolkit#getMenu(gnu.lists.LList)
46: */
47: public EMenu getMenu(LList menubar) {
48: return new SwingMenu(menubar);
49: }
50:
51: /**
52: * @see gnu.jemacs.buffer.EToolkit#getIgnoreAction()
53: */
54: public Object getIgnoreAction() {
55: return IgnoreAction.getInstance();
56: }
57:
58: }
|