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 graphlab.ui.components.gpropertyeditor.utils.JFontChooser; 007 008 import javax.swing.*; 009 import java.awt.*; 010 011 /** 012 * User: root 013 */ 014 public class GFontEditor extends GDialogEditor<Font> { 015 016 JFontChooser jFontChooser; 017 018 public JComponent getComponent(Font font) { 019 jFontChooser = new JFontChooser(); 020 jFontChooser.setFont(font); 021 return jFontChooser; 022 } 023 024 public Font getEditorValue() { 025 return jFontChooser.getFont(); 026 } 027 028 public void setEditorValue(Font font) { 029 jFontChooser.setFont(font); 030 } 031 }