JavaTM 2 Platform
Std. Ed. v1.3

クラス
javax.swing.text.BadLocationException の使用

BadLocationException を使用しているパッケージ
javax.swing すべてのプラットフォームで可能な限り同じように機能する、「軽量」(Java 共通言語) コンポーネントのセットを提供します。 
javax.swing.plaf 1 つのインタフェースおよび多くの抽象クラスを提供しており、Swing は、プラグイン可能な Look & Feel 機能を実現するためにこれらのクラスを利用します。 
javax.swing.plaf.basic 基本 Look & Feel に従って作成されたユーザインタフェースオブジェクトを提供します。 
javax.swing.plaf.multi 多重 Look & Feel を利用すると、デフォルトの Look & Feel に補助的な Look & Feel を結合できます。 
javax.swing.text 編集可能/編集不能テキストコンポーネントを処理するクラスとインタフェースを提供します。 
javax.swing.text.html HTML テキストエディタを作成するための HTMLEditorKit クラスとサポートクラスを提供します。  
javax.swing.text.rtf Rich-Text-Format テキストエディタを作成するためのクラス (RTFEditorKit) を提供します。  
 

javax.swing での BadLocationException の使用
 

BadLocationException をスローする javax.swing のメソッド
 String JPasswordField.getText(int offs, int len)
          推奨されていません。 Java 2 プラットフォーム v1.2 以降、getPassword() に置き換えられました。
 int JTextArea.getLineOfOffset(int offset)
          コンポーネントテキストのオフセットを行番号に変換します。
 int JTextArea.getLineStartOffset(int line)
          指定された行の開始オフセットを返します。
 int JTextArea.getLineEndOffset(int line)
          指定された行の終了オフセットを返します。
 

javax.swing.plaf での BadLocationException の使用
 

BadLocationException をスローする javax.swing.plaf のメソッド
abstract  Rectangle TextUI.modelToView(JTextComponent t, int pos)
          モデル内の指定された位置をビューの座標系での位置に変換します。
abstract  Rectangle TextUI.modelToView(JTextComponent t, int pos, Position.Bias bias)
          モデル内の指定された位置をビューの座標系での位置に変換します。
abstract  int TextUI.getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
 

javax.swing.plaf.basic での BadLocationException の使用
 

BadLocationException をスローする javax.swing.plaf.basic のメソッド
 Rectangle BasicTextUI.modelToView(JTextComponent tc, int pos)
          モデル内の指定された位置を、ビュー座標体系内の場所に変換します。
 Rectangle BasicTextUI.modelToView(JTextComponent tc, int pos, Position.Bias bias)
          モデル内の指定された位置を、ビュー座標体系内の場所に変換します。
 int BasicTextUI.getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
 

javax.swing.plaf.multi での BadLocationException の使用
 

BadLocationException をスローする javax.swing.plaf.multi のメソッド
 Rectangle MultiTextUI.modelToView(JTextComponent a, int b)
          この MultiUI が扱う各 UI で、modelToView を呼び出します。
 Rectangle MultiTextUI.modelToView(JTextComponent t, int pos, Position.Bias bias)
          モデル内の指定された位置をビューの座標体系での位置に変換します。
 int MultiTextUI.getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
 

javax.swing.text での BadLocationException の使用
 

BadLocationException をスローする javax.swing.text のメソッド
 String JTextComponent.getText(int offs, int len)
          コンポーネントが表すテキストの一部を取り出します。
 Rectangle JTextComponent.modelToView(int pos)
          モデル内の指定された位置を、ビュー座標体系内の場所に変換します。
 Object DefaultHighlighter.addHighlight(int p0, int p1, Highlighter.HighlightPainter p)
          ビューにハイライトを追加します。
 void DefaultHighlighter.changeHighlight(Object tag, int p0, int p1)
          ハイライトを変更します。
 int View.getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
abstract  Shape View.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 Shape View.modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 Shape View.modelToView(int pos, Shape a)
          推奨されていません。  
 Shape CompositeView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 Shape CompositeView.modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 int CompositeView.getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
protected  int CompositeView.getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          カーソルを置くことのできる、次の視覚的な位置を返します。
protected  int CompositeView.getNextEastWestVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          カーソルを置くことのできる、次の視覚的な位置を返します。
 void Document.remove(int offs, int len)
          ドキュメントのコンテンツの一部を削除します。
 void Document.insertString(int offset, String str, AttributeSet a)
          ドキュメントのコンテンツの文字列を挿入します。
 String Document.getText(int offset, int length)
          ドキュメントの指定部分内にあるテキストを取り出します。
 void Document.getText(int offset, int length, Segment txt)
          ドキュメントの指定部分内にあるテキストを取り出します。
 Position Document.createPosition(int offs)
          このメソッドを使用すると文字コンテンツのシーケンスの位置にマークを付けられます。
 Shape GlyphView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 int GlyphView.getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
abstract  void EditorKit.read(InputStream in, Document doc, int pos)
          このタイプのコンテンツハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。
abstract  void EditorKit.write(OutputStream out, Document doc, int pos, int len)
          このタイプのコンテンツハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。
abstract  void EditorKit.read(Reader in, Document doc, int pos)
          このタイプのコンテンツハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。
abstract  void EditorKit.write(Writer out, Document doc, int pos, int len)
          このタイプのコンテンツハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。
 Object Highlighter.addHighlight(int p0, int p1, Highlighter.HighlightPainter p)
          ビューにハイライトを追加します。
 void Highlighter.changeHighlight(Object tag, int p0, int p1)
          指定されたハイライトを、ドキュメントの異なる部分を占めるように変更します。
 Shape BoxView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間から、それにマップされるビューの座標空間へのマッピングを提供します。
protected  int ParagraphView.getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          CompositeView からオーバーライドされます。
protected  int ParagraphView.getClosestPositionTo(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet, int rowIndex, int x)
          x にもっとも近接したモデル内の位置を返します。
protected abstract  void AbstractWriter.write()
          この抽象メソッドは、サブクラスによって実装される必要があります。
protected  String AbstractWriter.getText(Element elem)
          要素に関連したテキストを返します。
protected  void AbstractWriter.text(Element elem)
          テキストを書き出します。
protected  int PlainView.drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を、選択解除した通常のテキストで描画します。
protected  int PlainView.drawSelectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を、選択されたテキストとして描画します。
 Shape PlainView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 Shape FieldView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 void DefaultEditorKit.read(InputStream in, Document doc, int pos)
          このタイプのコンテンツハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。
 void DefaultEditorKit.write(OutputStream out, Document doc, int pos, int len)
          このタイプのコンテンツハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。
 void DefaultEditorKit.read(Reader in, Document doc, int pos)
          指定されたストリームからの内容を挿入します。
 void DefaultEditorKit.write(Writer out, Document doc, int pos, int len)
          ドキュメントからの内容を、指定されたストリームにプレーンテキストとして書き込みます。
 void AbstractDocument.remove(int offs, int len)
          ドキュメントから内容を削除します。
 void AbstractDocument.insertString(int offs, String str, AttributeSet a)
          ドキュメントに内容を挿入します。
 String AbstractDocument.getText(int offset, int length)
          ドキュメントからテキストのシーケンスを取得します。
 void AbstractDocument.getText(int offset, int length, Segment txt)
          ドキュメントからテキストを取得しますが、コピーは作成しません。
 Position AbstractDocument.createPosition(int offs)
          ドキュメントが変更されたときに、変更を追跡する位置を返します。
 Position AbstractDocument.Content.createPosition(int offset)
          コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。
 UndoableEdit AbstractDocument.Content.insertString(int where, String str)
          シーケンスに文字列を挿入します。
 UndoableEdit AbstractDocument.Content.remove(int where, int nitems)
          シーケンスの一部を削除します。
 String AbstractDocument.Content.getString(int where, int len)
          シーケンスに含まれる文字列を返します。
 void AbstractDocument.Content.getChars(int where, int len, Segment txt)
          文字のシーケンスを取得して、セグメントにコピーします。
 UndoableEdit StringContent.insertString(int where, String str)
          コンテンツに文字列を挿入します。
 UndoableEdit StringContent.remove(int where, int nitems)
          コンテンツの一部を削除します。
 String StringContent.getString(int where, int len)
          コンテンツの一部を取り出します。
 void StringContent.getChars(int where, int len, Segment chars)
          コンテンツの一部を取り出します。
 Position StringContent.createPosition(int offset)
          コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。
protected  int PasswordView.drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を、選択解除した通常のテキストとして描画します。
protected  int PasswordView.drawSelectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を、選択したテキストとして描画します。
 Shape PasswordView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 Shape AsyncBoxView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
abstract  Shape GlyphView.GlyphPainter.modelToView(GlyphView v, int pos, Position.Bias bias, Shape a)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
 int GlyphView.GlyphPainter.getNextVisualPositionFrom(GlyphView v, int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。
 UndoableEdit GapContent.insertString(int where, String str)
          コンテンツに文字列を挿入します。
 UndoableEdit GapContent.remove(int where, int nitems)
          コンテンツの一部を削除します。
 String GapContent.getString(int where, int len)
          コンテンツの一部を取り出します。
 void GapContent.getChars(int where, int len, Segment chars)
          コンテンツの一部を取り出します。
 Position GapContent.createPosition(int offset)
          コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。
 Shape ComponentView.modelToView(int pos, Shape a, Position.Bias b)
          モデルの座標空間から、ビューの座標空間へのマッピングを提供します。
 Shape IconView.modelToView(int pos, Shape a, Position.Bias b)
          ドキュメントモデルの座標空間からビューの座標空間へのマッピングを提供します。
protected  int WrappedPlainView.drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を通常の選択されていないテキストとして描画します。
protected  int WrappedPlainView.drawSelectedText(Graphics g, int x, int y, int p0, int p1)
          モデル内の指定された範囲を、選択されたテキストとして描画します。
static int Utilities.getRowStart(JTextComponent c, int offs)
          指定されたモデル位置を含む行の、開始行モデル位置を指定します。
static int Utilities.getRowEnd(JTextComponent c, int offs)
          指定されたモデル位置を含む行の、終了行モデル位置を指定します。
static int Utilities.getPositionAbove(JTextComponent c, int offs, int x)
          上の行で指定されたビュー位置にもっとも近いモデル内の位置を決定します。
static int Utilities.getPositionBelow(JTextComponent c, int offs, int x)
          下の行で指定されたビュー位置にもっとも近いモデル内の位置を決定します。
static int Utilities.getWordStart(JTextComponent c, int offs)
          指定されたモデル位置の語の開始位置を決定します。
static int Utilities.getWordEnd(JTextComponent c, int offs)
          指定された位置の語の終了位置を決定します。
static int Utilities.getNextWord(JTextComponent c, int offs)
          指定された位置の次の語の開始位置を決定します。
static int Utilities.getPreviousWord(JTextComponent c, int offs)
          指定された位置の直前の語の開始位置を指定します。
protected  void DefaultStyledDocument.insert(int offset, DefaultStyledDocument.ElementSpec[] data)
          新しい要素を一括して挿入します。
 

javax.swing.text.html での BadLocationException の使用
 

BadLocationException をスローする javax.swing.text.html のメソッド
protected  void HTMLDocument.insert(int offset, DefaultStyledDocument.ElementSpec[] data)
          新しい要素を一括して挿入します。
 void HTMLDocument.setInnerHTML(Element elem, String htmlText)
          指定された要素の子を HTML 文字列として指定されたコンテンツと置き換えます。
 void HTMLDocument.setOuterHTML(Element elem, String htmlText)
          指定された親の要素を HTML 文字列として指定されたコンテンツと置き換えます。
 void HTMLDocument.insertAfterStart(Element elem, String htmlText)
          要素の開始位置に文字列として指定された HTML を挿入します。
 void HTMLDocument.insertBeforeEnd(Element elem, String htmlText)
          要素の終了位置に文字列として指定された HTML を挿入します。
 void HTMLDocument.insertBeforeStart(Element elem, String htmlText)
          指定された要素が開始される前に文字列として指定された HTML を挿入します。
 void HTMLDocument.insertAfterEnd(Element elem, String htmlText)
          指定要素が終了後に文字列として指定された HTML を挿入します。
 void HTMLEditorKit.read(Reader in, Document doc, int pos)
          指定されたストリームからコンテンツを挿入します。
 void HTMLEditorKit.insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag)
          既存のドキュメントに HTML を挿入します。
 void HTMLEditorKit.write(Writer out, Document doc, int pos, int len)
          このタイプのコンテンツハンドラに適合した書式であることが期待されるストリームに、ドキュメントのコンテンツを適した形式でストリームに挿入します。
 void HTMLEditorKit.ParserCallback.flush()
           
 void HTMLDocument.HTMLReader.flush()
          HTML リーダで呼び出される最後のメソッドです。
 void HTMLWriter.write()
          要素ツリーで反復され、すべてのタグとその属性の書き込みを制御します。
protected  void HTMLWriter.emptyTag(Element elem)
          すべての空要素 (対応する終了タグのないタグすべて) を書き出します。
protected  void HTMLWriter.startTag(Element elem)
          要素の開始タグを書き出します。
protected  void HTMLWriter.textAreaContent(AttributeSet attr)
          フォーム要素の TEXTAREA に格納されているテキストを書き出します。
protected  void HTMLWriter.text(Element elem)
          テキストを書き出します。
protected  void HTMLWriter.comment(Element elem)
          コメントを書き出します。
 void MinimalHTMLWriter.write()
          StyledDocument から HTML 出力を生成します。
protected  void MinimalHTMLWriter.text(Element elem)
          テキストを書き出します。
protected  void MinimalHTMLWriter.writeBody()
          ドキュメント内の要素で反復し、枝の要素か葉の要素かを判断して要素を処理します。
protected  void MinimalHTMLWriter.writeContent(Element elem, boolean needsIndenting)
          HTML に準拠した方法で属性セットを書き出します。
 

javax.swing.text.rtf での BadLocationException の使用
 

BadLocationException をスローする javax.swing.text.rtf のメソッド
 void RTFEditorKit.read(InputStream in, Document doc, int pos)
          このタイプのコンテンツハンドラに適合した書式であることが要求されるストリームに、コンテンツを挿入します。
 void RTFEditorKit.write(OutputStream out, Document doc, int pos, int len)
          このタイプのコンテンツハンドラに適合した書式であることが要求されるストリームに、ドキュメントのコンテンツを適した形式でストリームに挿入します。
 void RTFEditorKit.read(Reader in, Document doc, int pos)
          指定されたストリームからコンテンツを挿入します。
 void RTFEditorKit.write(Writer out, Document doc, int pos, int len)
          ドキュメントのコンテンツをプレーンテキストとしてストリームに書き込みます。
 


JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.