TITLE:翻訳元から - Javadoc

Posted by at 2010-10-05

翻訳元から?

agressively

Typo

  • 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")

この例だと、常に null になるような。UIManager.get("Table.foreground") とか UIManager.getColor("Table.foreground") にした方がよさそう?

Htmlの表がずれている

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

class MyApp java.io.Serializable

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

文字化け?

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

String propnames[] = (String[])Toolkit.getDefaultToolkit().getDesktopProperty("win.propNames");

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

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

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

dataModelとnewModel

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

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

import java.awt.*;
import java.awt.image.*;
import java.net.*;
import javax.swing.*;
public class GrayFilterTest {
  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);
  }
}

TableModel#isCellEditable(...)

Component.AccessibleAWTComponent.getAccessibleIndexInParent()

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

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

コメント