1 4 package gnu.jemacs.swing; 5 import gnu.jemacs.buffer.*; 6 import gnu.lists.LList; 7 8 import java.awt.Color ; 9 import javax.swing.text.*; 10 11 public class SwingToolkit extends EToolkit 12 { 13 public EFrame newFrame(Buffer buffer) 14 { 15 return new SwingFrame(buffer); 16 } 17 18 public Buffer newBuffer (String name) 19 { 20 return new SwingBuffer(name); 21 } 22 23 public Object getFace(String name, boolean create) 24 { 25 Style style = SwingBuffer.styles.getStyle(name); 26 if (style == null && create) 27 style = SwingBuffer.styles.addStyle(name, null); 28 return style; 29 } 30 31 public void setUnderline(Object face, boolean underline) 32 { 33 StyleConstants.setUnderline((Style) face, underline); 34 } 35 36 public void setBold(Object face, boolean bold) 37 { 38 StyleConstants.setBold((Style) face, bold); 39 } 40 41 42 public void setForeground (Object face, Color foreground) 43 { 44 StyleConstants.setForeground((Style) face, foreground); 45 } 46 47 public void setBackground (Object face, Color background) 48 { 49 StyleConstants.setBackground((Style) face, background); 50 } 51 52 55 public EMenu getMenu(LList menubar) 56 { 57 return new SwingMenu(menubar); 58 } 59 60 63 public Object getIgnoreAction() 64 { 65 return IgnoreAction.getInstance(); 66 } 67 68 } 69 | Popular Tags |