From 032a18c91d1ba77d98932a000615a935f74bd5b3 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Sun, 23 Mar 2003 09:19:04 +0000 Subject: 2003-03-23 Michael Koch * javax/swing/Action.java (ACCELERATOR_KEY): New constant. (ACTION_COMMAND_KEY): Likewise. (MNEMONIC_KEY): Likewise. * javax/swing/UnsupportedLookAndFeelException.java (UnsupportedLookAndFeelException): Must be public. * javax/swing/WindowConstants.java (EXIT_ON_CLOSE): New constant. * javax/swing/text/BadLocationException.java (offset): New member variable. (BadLocationException): New implementation, documentation added. (offsetRequested): New method. * javax/swing/text/Caret.java: Reformated. * javax/swing/text/Document.java: Reformated. --- ChangeLog | 19 +++++++++ javax/swing/Action.java | 15 +++++++ javax/swing/UnsupportedLookAndFeelException.java | 2 +- javax/swing/WindowConstants.java | 5 +++ javax/swing/text/BadLocationException.java | 24 ++++++++++-- javax/swing/text/Caret.java | 50 ++++++++++++++++-------- javax/swing/text/Document.java | 38 ++++++++++-------- 7 files changed, 115 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f07dbe15..882bea3cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2003-03-23 Michael Koch + + * javax/swing/Action.java + (ACCELERATOR_KEY): New constant. + (ACTION_COMMAND_KEY): Likewise. + (MNEMONIC_KEY): Likewise. + * javax/swing/UnsupportedLookAndFeelException.java + (UnsupportedLookAndFeelException): Must be public. + * javax/swing/WindowConstants.java + (EXIT_ON_CLOSE): New constant. + * javax/swing/text/BadLocationException.java + (offset): New member variable. + (BadLocationException): New implementation, documentation added. + (offsetRequested): New method. + * javax/swing/text/Caret.java: + Reformated. + * javax/swing/text/Document.java: + Reformated. + 2003-03-23 Michael Koch * java/rmi/activation/Activatable.java diff --git a/javax/swing/Action.java b/javax/swing/Action.java index e9fbc762b..c091a261e 100644 --- a/javax/swing/Action.java +++ b/javax/swing/Action.java @@ -78,6 +78,21 @@ public interface Action extends ActionListener { */ public static final String SMALL_ICON = "SmallIcon"; + /** + * ACCELERATOR_KEY + */ + public static final String ACCELERATOR_KEY = "AcceleratorKey"; + + /** + * ACTION_COMMAND_KEY + */ + public static final String ACTION_COMMAND_KEY = "ActionCommandKey"; + + /** + * MNEMONIC_KEY + */ + public static final String MNEMONIC_KEY = "MnemonicKey"; + //------------------------------------------------------------- // Interface: Action ------------------------------------------ diff --git a/javax/swing/UnsupportedLookAndFeelException.java b/javax/swing/UnsupportedLookAndFeelException.java index 18488648d..2e032cd94 100644 --- a/javax/swing/UnsupportedLookAndFeelException.java +++ b/javax/swing/UnsupportedLookAndFeelException.java @@ -40,7 +40,7 @@ package javax.swing; public class UnsupportedLookAndFeelException extends Exception { - UnsupportedLookAndFeelException(String a) + public UnsupportedLookAndFeelException(String a) { super(a); } diff --git a/javax/swing/WindowConstants.java b/javax/swing/WindowConstants.java index ca501c0d6..1eec7f6bb 100644 --- a/javax/swing/WindowConstants.java +++ b/javax/swing/WindowConstants.java @@ -63,5 +63,10 @@ public interface WindowConstants { */ public static final int DISPOSE_ON_CLOSE = 2; + /** + * EXIT_ON_CLOSE + */ + public static final int EXIT_ON_CLOSE =3; + } // WindowConstants diff --git a/javax/swing/text/BadLocationException.java b/javax/swing/text/BadLocationException.java index 81e6cc8dc..d62ad5465 100644 --- a/javax/swing/text/BadLocationException.java +++ b/javax/swing/text/BadLocationException.java @@ -40,7 +40,25 @@ package javax.swing.text; public class BadLocationException extends Exception { - BadLocationException() - { - } + int offset; + + /** + * Constructs a BadLocationException + * + * @param str A string indicating what was wrong with the arguments + * @param offset Offset within the document that was requested >= 0 + */ + public BadLocationException (String str, int offset) + { + super (str); + this.offset = offset; + } + + /** + * Returns the offset into the document that was not legal + */ + public int offsetRequested () + { + return offset; + } } diff --git a/javax/swing/text/Caret.java b/javax/swing/text/Caret.java index c013937f0..f78f24edf 100644 --- a/javax/swing/text/Caret.java +++ b/javax/swing/text/Caret.java @@ -42,21 +42,37 @@ import javax.swing.event.*; public interface Caret { - void addChangeListener(ChangeListener l); - void deinstall(JTextComponent c); - int getBlinkRate(); - int getDot(); - Point getMagicCaretPosition(); - int getMark(); - void install(JTextComponent c); - boolean isSelectionVisible(); - boolean isVisible(); - void moveDot(int dot); - void paint(Graphics g); - void removeChangeListener(ChangeListener l); - void setBlinkRate(int rate); - void setDot(int dot); - void setMagicCaretPosition(Point p); - void setSelectionVisible(boolean v); - void setVisible(boolean v); + void addChangeListener(ChangeListener l); + + void deinstall(JTextComponent c); + + int getBlinkRate(); + + int getDot(); + + Point getMagicCaretPosition(); + + int getMark(); + + void install(JTextComponent c); + + boolean isSelectionVisible(); + + boolean isVisible(); + + void moveDot(int dot); + + void paint(Graphics g); + + void removeChangeListener(ChangeListener l); + + void setBlinkRate(int rate); + + void setDot(int dot); + + void setMagicCaretPosition(Point p); + + void setSelectionVisible(boolean v); + + void setVisible(boolean v); } diff --git a/javax/swing/text/Document.java b/javax/swing/text/Document.java index 398030f08..fa7b1ce28 100644 --- a/javax/swing/text/Document.java +++ b/javax/swing/text/Document.java @@ -42,21 +42,25 @@ import javax.swing.event.*; public interface Document { - void addDocumentListener(DocumentListener listener); - void addUndoableEditListener(UndoableEditListener listener); - Position createPosition(int offs); - Element getDefaultRootElement(); - Position getEndPosition(); - int getLength(); - Object getProperty(Object key); - Element[] getRootElements(); - Position getStartPosition(); - String getText(int offset, int length); - void getText(int offset, int length, Segment txt); - void insertString(int offset, String str, AttributeSet a); - void putProperty(Object key, Object value); - void remove(int offs, int len); - void removeDocumentListener(DocumentListener listener); - void removeUndoableEditListener(UndoableEditListener listener); - void render(Runnable r); + public static final String StreamDescriptionProperty = "stream"; + + public static final String TitleProperty = "text"; + + void addDocumentListener(DocumentListener listener); + void addUndoableEditListener(UndoableEditListener listener); + Position createPosition(int offs); + Element getDefaultRootElement(); + Position getEndPosition(); + int getLength(); + Object getProperty(Object key); + Element[] getRootElements(); + Position getStartPosition(); + String getText(int offset, int length); + void getText(int offset, int length, Segment txt); + void insertString(int offset, String str, AttributeSet a); + void putProperty(Object key, Object value); + void remove(int offs, int len); + void removeDocumentListener(DocumentListener listener); + void removeUndoableEditListener(UndoableEditListener listener); + void render(Runnable r); } -- cgit v1.2.1