This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[hui] Patch: javax.swing.text


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to improve javax.swing.text more.


Michael


2004-06-28  Michael Koch  <konqueror@gmx.de>

	* javax/swing/text/AttributeSet.java
	(CharacterAttribute): New interface
	(ColorAttribute): Likewise.
	(FontCharacterAttribute): Likewise.
	(ParagraphAttribute): Likewise.
	* javax/swing/text/DefaultCaret.java
	(moveCaret): New method.
	(positionCaret): Likewise.
	(repaint): Made protected.
	* javax/swing/text/JTextComponent.java
	(KeyBinding): Made it static.
	* javax/swing/text/View.java
	(getContainer): Honor parent == null.
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA3/4kWSOgCCdjSDsRAj3NAJ9YNOKfVz7qq0eCGfDJ4L3N4k7zEgCghtrs
3C8hoCSiauLeUtUTJe6KYuY=
=2Ipu
-----END PGP SIGNATURE-----
Index: javax/swing/text/AttributeSet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/AttributeSet.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 AttributeSet.java
--- javax/swing/text/AttributeSet.java	10 Jan 2004 21:07:44 -0000	1.2
+++ javax/swing/text/AttributeSet.java	28 Jun 2004 11:13:24 -0000
@@ -41,6 +41,22 @@
 
 public interface AttributeSet
 { 
+  static interface CharacterAttribute
+  {
+  }
+
+  static interface ColorAttribute
+  {
+  }
+
+  static interface FontCharacterAttribute
+  {
+  }
+
+  static interface ParagraphAttribute
+  {
+  }
+  
     boolean containsAttribute(Object name, Object value);
     boolean containsAttributes(AttributeSet attributes);
     AttributeSet copyAttributes();
Index: javax/swing/text/DefaultCaret.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.3.8.4
diff -u -b -B -r1.3.8.4 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java	20 Jun 2004 15:27:41 -0000	1.3.8.4
+++ javax/swing/text/DefaultCaret.java	28 Jun 2004 11:13:24 -0000
@@ -107,6 +107,14 @@
   {
   }
 
+  protected void moveCaret(MouseEvent event)
+  {
+  }
+
+  protected void positionCaret(MouseEvent event)
+  {
+  }
+
   public void deinstall(JTextComponent c)
   {
     parent.removeFocusListener(this);
@@ -148,7 +156,7 @@
     return vis_sel;
   }
 
-  private void repaint()
+  protected final void repaint()
   {
     if (parent != null)
       parent.repaint();
Index: javax/swing/text/JTextComponent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/JTextComponent.java,v
retrieving revision 1.4.2.11
diff -u -b -B -r1.4.2.11 JTextComponent.java
--- javax/swing/text/JTextComponent.java	24 Jun 2004 05:31:37 -0000	1.4.2.11
+++ javax/swing/text/JTextComponent.java	28 Jun 2004 11:13:24 -0000
@@ -265,7 +265,7 @@
     }
   }
 
-  public class KeyBinding
+  public static class KeyBinding
   {
     public KeyStroke key;
     public String actionName;
Index: javax/swing/text/View.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/View.java,v
retrieving revision 1.2.8.1
diff -u -b -B -r1.2.8.1 View.java
--- javax/swing/text/View.java	20 Jun 2004 15:27:41 -0000	1.2.8.1
+++ javax/swing/text/View.java	28 Jun 2004 11:13:24 -0000
@@ -82,7 +82,7 @@
 
   public Container getContainer()
   {
-    return parent.getContainer();
+    return parent != null ? parent.getContainer() : null;
   }
   
   public Document getDocument()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]