/[classpath]/classpath/javax/swing/plaf/basic/BasicTextPaneUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicTextPaneUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by trebligd, Wed Sep 14 07:58:07 2005 UTC revision 1.6 by rabbit78, Tue Sep 20 09:51:52 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.swing.plaf.basic;  package javax.swing.plaf.basic;
40    
41    import java.awt.Color;
42    
43  import javax.swing.JComponent;  import javax.swing.JComponent;
44    import javax.swing.JTextPane;
45    import javax.swing.plaf.ColorUIResource;
46  import javax.swing.UIDefaults;  import javax.swing.UIDefaults;
47  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
48  import javax.swing.text.Element;  import javax.swing.text.Element;
49  import javax.swing.text.PlainView;  import javax.swing.text.PlainView;
50    import javax.swing.text.Style;
51    import javax.swing.text.StyleConstants;
52    import javax.swing.text.StyleContext;
53  import javax.swing.text.View;  import javax.swing.text.View;
54    
55  public class BasicTextPaneUI extends BasicEditorPaneUI  public class BasicTextPaneUI extends BasicEditorPaneUI
# Line 71  public class BasicTextPaneUI extends Bas Line 78  public class BasicTextPaneUI extends Bas
78    {    {
79      return "TextPane";      return "TextPane";
80    }    }
81    
82      /**
83       * Installs this UI on the specified <code>JTextPane</code>. This calls the
84       * super implementation and then adds a default style to the text pane.
85       *
86       * @param c the text pane to install the UI to
87       */
88      public void installUI(JComponent c)
89      {
90        super.installUI(c);
91        JTextPane tp = (JTextPane) c;
92        Style defaultStyle = tp.getStyle(StyleContext.DEFAULT_STYLE);
93        defaultStyle.addAttribute(StyleConstants.Foreground,
94                                  new ColorUIResource(Color.BLACK));
95        defaultStyle.addAttribute(StyleConstants.FontFamily, "Serif");
96        defaultStyle.addAttribute(StyleConstants.Italic, Boolean.FALSE);
97        defaultStyle.addAttribute(StyleConstants.Bold, Boolean.FALSE);
98        defaultStyle.addAttribute(StyleConstants.FontSize, new Integer(12));
99      }
100  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26