View Javadoc
1 /* ------------------------------------------------------------------- 2 * Java source file for the class FloatEditor 3 * 4 * Copyright (c), 2002, Masahiro Takatsuka. 5 * All Rights Researved. 6 * 7 * Original Author: Masahiro Takatsuka (masa@jbeans.net) 8 * $Author: takatsukam $ 9 * 10 * $Date: 2003/07/25 04:51:45 $ 11 * 12 * $Id: FloatEditor.java,v 1.1.1.1 2003/07/25 04:51:45 takatsukam Exp $ 13 * 14 * Reference: Document no: 15 * ___ ___ 16 * 17 * To Do: 18 * ___ 19 * 20 ------------------------------------------------------------------- */ 21 22 /* --------------------------- Package ---------------------------- */ 23 package net.jbeans.bean.property.editor; 24 25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">color="#329900"> ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900"> ------------------ Import classes (packages) ------------------- */ 26 import java.awt.event.*; 27 import javax.swing.*; 28 29 import net.jbeans.util.text.*; 30 31 /*==================================================================== 32 Implementation of class FloatEditor 33 ====================================================================*/ 34 /*** 35 * An PropertyEdtitor for editing numbers. 36 * 37 * @version $Revision: 1.1.1.1 $ 38 * @author Masahiro Takatsuka (masa@jbeans.net) 39 * @see NumberEditor 40 */ 41 42 public final class FloatEditor extends NumberEditor { 43 public FloatEditor() { 44 super(); 45 } 46 47 protected void setMyValue(String value) { 48 setValue(new Float(value)); 49 } 50 51 public final String getJavaInitializationString() { 52 Float value = (Float) getValue(); 53 if (value.isNaN()) { 54 return "Float.NaN"; 55 } 56 return value + "F"; 57 } 58 }

This page was automatically generated by Maven