⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basictextui.java

📁 this gcc-g++-3.3.1.tar.gz is a source file of gcc, you can learn more about gcc through this codes f
💻 JAVA
字号:
package javax.swing.plaf.basic;import javax.swing.text.*;import javax.swing.plaf.*;import java.awt.*;import javax.swing.*;public class BasicTextUI extends TextUI{    int gap = 3;    View view = new RootView();    Color textColor, disabledTextColor, normalBackgroundColor;    EditorKit kit = new DefaultEditorKit();        class RootView extends View    {	RootView()	{	    super(null);	}        public void paint(Graphics g, Shape s)	{	    if (view != null)		{		    Rectangle r = s.getBounds();		    view.setSize((int)r.getWidth(),				 (int)r.getHeight());		    view.paint(g, s);		}        }    }    public BasicTextUI()    {    }    public static ComponentUI createUI(final JComponent c)     {	return new BasicTextUI();    }        public void installUI(final JComponent c)     {	super.installUI(c);	textColor                = new Color(0,0,0);	disabledTextColor        = new Color(130, 130, 130);	normalBackgroundColor    = new Color(192,192,192);    }        public Dimension getPreferredSize(JComponent c)     {	JTextComponent b = (JTextComponent) c;	View v = getRootView(b);	float w = v.getPreferredSpan(View.X_AXIS);	float h = v.getPreferredSpan(View.Y_AXIS);	return new Dimension((int)w, (int) h);    }        public void paint(Graphics g, JComponent c)    {      	//	view.paint(    }    public void damageRange(JTextComponent t, int p0, int p1)    {	damageRange(t, p0, p1, null, null);    }        public void damageRange(JTextComponent t, 		     int p0, int p1, 		     Position.Bias firstBias,		     Position.Bias secondBias)    {    }    public EditorKit getEditorKit(JTextComponent t)    {	return kit;    }        public int getNextVisualPositionFrom(JTextComponent t, 				  int pos,				  Position.Bias b, 				  int direction,				  Position.Bias[] biasRet)    {	return 0;    }        public View getRootView(JTextComponent t)    {	return view;    }        public Rectangle modelToView(JTextComponent t, int pos)    {	return modelToView(t, pos, null);    }        public Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias)    {	return null;    }        public int viewToModel(JTextComponent t, Point pt)    {	return viewToModel(t, pt, null);    }        public int viewToModel(JTextComponent t, Point pt, Position.Bias[] biasReturn)    {	return 0;    } }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -