001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 package graphlab.ui.components.gpropertyeditor.editors; 005 006 import javax.swing.*; 007 import java.awt.*; 008 009 /** 010 * author: Azin Azadi 011 * Email: 012 */ 013 public class GColorEditor extends GDialogEditor<Color> { 014 private JColorChooser jc; 015 016 public JComponent getComponent(Color initialValue) { 017 jc = new JColorChooser(initialValue); 018 return jc; 019 } 020 021 public Color getEditorValue() { 022 return jc.getColor(); 023 } 024 025 public void setEditorValue(Color value) { 026 jc.setColor(value); 027 } 028 }