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

概要

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

翻訳元から?

agressively

未修正

BasicTreeUI#getPathBounds(...)

Typo

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

  • 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.
この説明がよく分からない。逆のような気がするような、しないような…。

UIManager.getString("Table.foreground")

  • 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なら、インストール後のデフォルト変更は効果があるような気がするのだが…、括弧内の説明が逆になっている?
    • ついでに、日本語訳としては句点は閉じ括弧の後に移動した方が良さそう
この例だと、色をgetStringで取得しようとしているので、常に null になる。UIManager.get("Table.foreground") とか UIManager.getColor("Table.foreground") にした方がよさそう。

avadoc

  • Javadoc Command
    • 最下部の例で、javadocコマンドがavadocになっている

Htmlの表がずれている

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

translateMouseEvent()

class MyApp java.io.Serializable

SwingConstants#VERTICAL

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

getAlignmentY()

setAsksAllowsChildren

TableModelevent

HTML.Attribute.id

JMX Specification.,

TableModel#isCellEditable(...)

文字化け?

本来は、"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"

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

getAccessibleIndexInParent()

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

1.8.0 で修正済み

Typo: agressively

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

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

ピクセルの色調を明るくする場合は true

Htmlの表がずれている

#spanend
#spandel
import java.awt.*;
#spanend
#spandel
import java.awt.image.*;
#spanend
#spandel
import java.net.*;
#spanend
#spandel
import javax.swing.*;
#spanend
#spandel
public class GrayFilterTest {
#spanend
  public JComponent makeUI() {
    URL url = null;
    try {
      url = new URL("http://lh4.ggpht.com/_9Z4BYR88imo/TRD2KGq73BI/AAAAAAAAAwA/N8-6EXongNk/s800/webstart.png");
    } catch (MalformedURLException e) {
      throw new InternalError();
    }
    ImageIcon original = new ImageIcon(url);
    ImageProducer ip = original.getImage().getSource();
    Box box = Box.createVerticalBox();
    box.add(makeLabel("original  ", original));
    box.add(makeLabel("false,   0", makeGrayImageIcon(ip, false, 0)));
    box.add(makeLabel("false,  50", makeGrayImageIcon(ip, false, 50)));
    box.add(makeLabel("false, 100", makeGrayImageIcon(ip, false, 100)));
    box.add(makeLabel("true,    0", makeGrayImageIcon(ip, true,  0)));
    box.add(makeLabel("true,   50", makeGrayImageIcon(ip, true,  50)));
    box.add(makeLabel("true,  100", makeGrayImageIcon(ip, true,  100)));
    return box;
  }
  private JLabel makeLabel(String title, Icon icon) {
    return new JLabel(title, icon, SwingConstants.HORIZONTAL);
  }
  private Icon makeGrayImageIcon(ImageProducer ip, boolean b, int p) {
    return new ImageIcon(Toolkit.getDefaultToolkit().createImage(
        new FilteredImageSource(ip, new GrayFilter(b, p))));
  }
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() { createAndShowGUI(); }
    });
  }
  public static void createAndShowGUI() {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.getContentPane().add(new GrayFilterTest().makeUI());
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
  }
#spandel
}
#spanend
#spandel

setAlignmentX, setAlignmentY, getAlignmentX, getAlignmentY javadoc of JComponent

TableModel#isCellEditable(...)

Component.AccessibleAWTComponent.getAccessibleIndexInParent()

DateTimeFormatter week-of-month

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

JEditorPane#scrollToReference(...)

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

JMX 仕様。, MXBean にアクセスする方法

コメント

コメント