• title: 翻訳元から title: 翻訳元からの誤記 author: aterai pubdate: 2010-10-05 description: Java クラスドキュメントで翻訳元の英語版から修正した方が良さそうな誤字など。 pubdate: 2010-10-05getAccessibleIndexInParent description: Java クラスドキュメントで、オリジナルの英語版から修正した方が良さそうな誤字など。

概要

Java(Swing)のクラスドキュメントで、オリジナルの英語版から修正した方が良さそうな箇所をメモしています。

未修正

未修正

BasicTreeUI#getPathBounds(...)

TreePathのサンプルコードに非互換タイプエラー

UIManager.getString("Table.foreground")

UIManager

  • https://docs.oracle.com/javase/8/docs/api/javax/swing/UIManager.html
    • Some look and feels may aggressively look up defaults, so that changing a default may not have an effect after installing the look and feel. Other look and feels may lazily access defaults so that a change to the defaults may effect an existing look and feel.
  • https://docs.oracle.com/javase/jp/8/docs/api/javax/swing/UIManager.html
    • 積極的にデフォルトを検索するLook & Feelもあれば(この場合、Look & Feelのインストール後にデフォルトに変更を加えても効果はない)、めったにデフォルトにアクセスしないLook & Feelもあります。(この場合、デフォルトの変更が既存のLook & Feelに影響を及ぼす)
  • 修正案?
    • 積極的にデフォルトを検索するLookAndFeelなら、インストール後のデフォルト変更は効果があるような気がするのだが…、括弧内の説明が逆になっている?
    • ついでに、日本語訳としては句点は閉じ括弧の後に移動した方が良さそう

avadoc

  • Javadoc Command
    • 最下部の例で、javadocコマンドがavadocになっている
Example 1   
Oracle Solaris, Linux, and macOS:

avadoc -d /home/html -sourcepath /home/src java.awt \

translateMouseEvent()

SwingConstants#VERTICAL

getAlignmentY()

setAsksAllowsChildren

TableModelevent

HTML.Attribute.id

Typo: any of of them

JMX Specification.,

TableModel#isCellEditable(...)

Htmlの表がずれている

サンプルコードが一行になっている

JSpinnerサンプルコード

  • 余計な{がある。
    • catch (ParseException pe) {{
  • ;が抜けている。
    • JComponent editor = spinner.getEditor()
  • )が足りない。
    • ((DefaultEditor)editor).getTextField().setValue(spinner.getValue();

文字化け?

本来は、"win.messagebox.textColor" とか、全然別の値なのか、あるいは、この ページの先頭付近に載っているサンプルコード

#spandel
String propnames[] = (String[])Toolkit.getDefaultToolkit().getDesktopProperty("win.propNames");
#spanend
#spanadd
String propnames[] = (String[]) Toolkit.getDefaultToolkit()
#spanend
    .getDesktopProperty("win.propNames");

で、プロパティー一覧を取得しても、"win.messagebox.textColor" は存在しないので、 「メッセージボックスのフォントカラー」自体が設定できないのかもしれない。

他にも同様に、?がついて重複するプロパティー名が存在する。

「アイコンのサイズ」 "win.icon.hspacing" "win.icon.vspacing"???
「アイコンの横の間隔」 "win.icon.hspacing"
「アイコンの縦の間隔」 "win.icon.vspacing"

dataModelとnewModel

#spanend
#spandel
public void setModel(TableModel dataModel)
#spanend
#spandel
このテーブルのデータモデルを newModel に設定し、それに新しいデータモデルからのリスナー通知を登録します。
#spanend
#spandel
パラメータ:
#spanend
#spandel
dataModel - このテーブルの新しいデータソース
#spanend
#spandel
例外:
#spanend
#spandel
IllegalArgumentException - newModel が null の場合
#spanend
#spandel

Dimension オブジェクト、寸法オブジェクト

Component.AccessibleAWTComponent.getAccessibleIndexInParent()

getAccessibleIndexInParent()

コピペして、修正し忘れてるようで、注:が全部getAccessibleIndexInParentのものと同じになっている。

1.8.0 で修正済み

Typo: agressively

  • メモ1
    • Some look and feels may agressively look up defaults, so that changing a default may not have an effect after installing the look and feel. Other look and feels may lazily access defaults so that a change to the defaults may effect an existing look and feel.
この説明がよく分からない。逆のような気がするような、しないような…。
  • メモ2
    • UIManager.getString("Table.foreground")
この例だと、色をgetStringで取得しようとしているので、常に null になる。UIManager.get("Table.foreground") とか UIManager.getColor("Table.foreground") にした方がよさそう。

class MyApp java.io.Serializable

サンプルコードで、implements が抜けている。

コメント

Java 9 で修正済み

Typo: any of of them

サンプルコードが一行になっている

JSpinnerサンプルコード

  • 余計な{がある。
    • catch (ParseException pe) {{
  • ;が抜けている。
    • JComponent editor = spinner.getEditor()
  • )が足りない。
    • ((DefaultEditor)editor).getTextField().setValue(spinner.getValue();

dataModelとnewModel

#spanend
#spanadd
public void setModel(TableModel dataModel)
#spanend
#spanadd
このテーブルのデータモデルを newModel に設定し、それに新しいデータモデルからのリスナー通知を登録します。
#spanend
#spanadd
パラメータ:
#spanend
#spanadd
dataModel - このテーブルの新しいデータソース
#spanend
#spanadd
例外:
#spanend
#spanadd
IllegalArgumentException - newModel が null の場合
#spanend
#spanadd

Htmlの表がずれている

setAlignmentX, setAlignmentY, getAlignmentX, getAlignmentY javadoc of JComponent

水平と垂直が実際の動作と入れ替わっている。

DateTimeFormatter week-of-month

JEditorPane#scrollToReference(...)

コメント