Swing/RatingLabel のバックアップ差分(No.9)
- バックアップ一覧
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Swing/RatingLabel へ行く。
- 1 (2006-08-21 (月) 11:55:27)
- 2 (2006-08-21 (月) 14:45:47)
- 3 (2006-08-23 (水) 17:33:51)
- 4 (2006-11-07 (火) 12:38:34)
- 5 (2006-11-09 (木) 20:53:32)
- 6 (2007-08-23 (木) 23:03:37)
- 7 (2008-10-20 (月) 18:20:37)
- 8 (2008-11-25 (火) 11:19:25)
- 9 (2012-10-20 (土) 04:20:53)
- 10 (2013-02-24 (日) 22:31:53)
- 11 (2013-12-10 (火) 20:18:42)
- 12 (2014-01-31 (金) 21:23:15)
- 13 (2014-11-28 (金) 16:31:17)
- 14 (2016-02-16 (火) 19:35:51)
- 15 (2017-07-11 (火) 15:31:58)
- 16 (2018-02-24 (土) 19:51:30)
- 17 (2018-07-12 (木) 18:07:59)
- 18 (2018-12-19 (水) 20:39:43)
- 19 (2020-11-12 (木) 09:41:03)
- 20 (2022-11-16 (水) 16:41:11)
- 追加された行はこの色です。
- 削除された行はこの色です。
TITLE:RGBImageFilterでアイコンの色調を変更 #navi(../) RIGHT:Posted by &author(aterai); at 2006-08-21 *RGBImageFilterでアイコンの色調を変更 [#w9fce2db] Posted by [[terai]] at 2006-08-21 #contents **概要 [#l9857d29] RGBImageFilterで色調を変更したアイコンの用意し、評価用コンポーネントを作成します。 -&jnlp; -&jar; -&zip; #screenshot //#screenshot #ref(http://lh4.ggpht.com/_9Z4BYR88imo/TQTRfRNaARI/AAAAAAAAAhQ/8Rj6Rw8bkwU/s800/RatingLabel.png) **サンプルコード [#a85a2963] #code{{ #code(link){{ private final ImageProducer ip = orgIcon.getImage().getSource(); private ImageIcon makeStarImageIcon(float[] filter) { SelectedImageFilter sif = new SelectedImageFilter(filter); return new ImageIcon( createImage(new FilteredImageSource(ip, sif))); } private class SelectedImageFilter extends RGBImageFilter { private final float[] filter; public SelectedImageFilter(float[] filter) { this.filter = filter; canFilterIndexColorModel = true; } public int filterRGB(int x, int y, int argb) { Color color = new Color(argb, true); float[] array = new float[4]; color.getComponents(array); return new Color(array[0]*filter[0], array[1]*filter[1], array[2]*filter[2], array[3]).getRGB(); } } }} **解説 [#s11c2ccf] RGBImageFilterを使用して、一つのアイコンから複数の色の異なるアイコンを生成しています。 上記のサンプルは、アマゾンなど((いろんな所でよく見かけるのですが、オリジナルは何処なんでしょうか?))でよく見かける5段階の評価を行うコンポーネントです。クリックしたアイコンの位置が評価レベルになります。 **参考リンク [#s1cec87d] -[[PI Diagona Icons Pack 1.0 - Download Royalty Free Icons and Stock Images For Web & Graphics Design>http://www.freeiconsdownload.com/Free_Downloads.asp?id=60]] -[http://www.freeiconsdownload.com/Free_Downloads.asp?id=60 PI Diagona Icons Pack 1.0 - Download Royalty Free Icons and Stock Images For Web & Graphics Design] --アイコンを利用しています。 **コメント [#afaf0ed0] - 素晴しい!:)-- &new{2006-08-23 (水) 17:34:40}; - 「Rating Bar」と言うみたいです。[[Masuga Design » Unobtrusive AJAX Star Rating Bar>http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/]] -- [[terai]] &new{2006-11-07 (火) 12:38:34}; - アイコンを変更、アイコンの間隔を設定 -- [[terai]] &new{2008-10-20 (月) 18:20:50}; - 「Rating Bar」と言うみたいです。[http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/ Masuga Design » Unobtrusive AJAX Star Rating Bar] -- [[aterai]] &new{2006-11-07 (火) 12:38:34}; - アイコンを変更、アイコンの間隔を設定 -- [[aterai]] &new{2008-10-20 (月) 18:20:50}; - スクリーンショットを更新 -- [[aterai]] &new{2008-11-25 (火) 11:19:25}; #comment