Example usage for java.lang Double Double

List of usage examples for java.lang Double Double

Introduction

In this page you can find the example usage for java.lang Double Double.

Prototype

@Deprecated(since = "9")
public Double(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Double object that represents the floating-point value of type double represented by the string.

Usage

From source file:org.jfree.chart.demo.SampleXYZDataset2.java

public Number getZ(int i, int j) {
    return new Double(zVal[i][j]);
}

From source file:org.jfree.expdemo.SelectionDemo7ScatterRenderer.java

private static List listOfValues(double[] values) {
    List result = new java.util.ArrayList();
    for (int i = 0; i < values.length; i++) {
        result.add(new Double(values[i]));
    }//ww w.  j  a  v  a 2s. c o  m
    return result;
}

From source file:Visuals.AreaChart.java

public ChartPanel drawAreaChart() {
    DefaultCategoryDataset areadataset = new DefaultCategoryDataset();
    areadataset.addValue(new Double(successCount), "Success", "Success (" + successCount + ")");
    areadataset.addValue(new Double(failCount), "Fail", "Fail (" + failCount + ")");

    JFreeChart areachart = ChartFactory.createBarChart("", // Title  
            "Result", "Attempts", areadataset // Dataset   
    );//from w  w  w . j a va2 s  .  c o m

    final CategoryPlot plot = areachart.getCategoryPlot();
    CategoryItemRenderer renderer = new CustomRendererAudit();

    areachart.removeLegend();
    plot.setRenderer(renderer);
    areachart.getCategoryPlot().setRenderer(renderer);
    //        plot.set("Success", new Color(230, 27, 27)); 
    //        plot.setSectionPaint("Fail", new Color(230, 90, 27)); 
    final CategoryPlot plotx = areachart.getCategoryPlot();
    ((BarRenderer) plotx.getRenderer()).setBarPainter(new StandardBarPainter());

    plotx.setBackgroundPaint(new Color(210, 234, 243));
    ChartPanel chartPanel = new ChartPanel(areachart);
    return chartPanel;
}

From source file:com.jaspersoft.studio.editor.preview.input.array.number.DoubleElement.java

@Override
protected Object convertString(String str) {
    return new Double(str);
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.DoubleCalculator.java

public Object add(Object obj1, Object obj2) {
    Double doubleData1 = (Double) obj1;
    Double doubleData2 = (Double) obj2;

    return (Object) (new Double((double) (doubleData1.doubleValue() + doubleData2.doubleValue())));
}

From source file:Main.java

public Main() {
    super(new BorderLayout());
    amountDisplayFormat = NumberFormat.getCurrencyInstance();
    System.out.println(amountDisplayFormat.format(1200));
    amountDisplayFormat.setMinimumFractionDigits(0);
    amountEditFormat = NumberFormat.getNumberInstance();
    amountField = new JFormattedTextField(new DefaultFormatterFactory(new NumberFormatter(amountDisplayFormat),
            new NumberFormatter(amountDisplayFormat), new NumberFormatter(amountEditFormat)));
    amountField.setValue(new Double(amount));
    amountField.setColumns(10);//from w  w  w  .j  a  v a 2 s . c o  m
    amountField.addPropertyChangeListener("value", this);

    JPanel fieldPane = new JPanel(new GridLayout(0, 1));
    fieldPane.add(amountField);

    add(fieldPane, BorderLayout.LINE_END);
    add(new JButton("Hello"), BorderLayout.SOUTH);
}

From source file:de.odysseus.calyxo.base.util.ParseUtils.java

private static Object nullValue(Class type) {
        if (type.isPrimitive()) {
            if (type == boolean.class)
                return Boolean.FALSE;
            if (type == byte.class)
                return new Byte((byte) 0);
            if (type == char.class)
                return new Character((char) 0);
            if (type == short.class)
                return new Short((short) 0);
            if (type == int.class)
                return new Integer(0);
            if (type == long.class)
                return new Long(0);
            if (type == float.class)
                return new Float(0);
            if (type == double.class)
                return new Double(0);
        }/*from w  ww  . j a  v  a2  s  . co m*/
        return null;
    }

From source file:com.github.ipaas.ifw.util.IPUtil.java

/**
 * IP???//w  ww.  j  av a2 s  .  c o m
 * 
 * @param ip
 * @return
 */
public static long convertIpToInt(String ip) {
    // IP
    String[] ipArray = StringUtils.split(ip, '.');
    // IP
    long ipInt = 0;
    // 
    try {
        for (int i = 0; i < ipArray.length; i++) {
            if (ipArray[i] == null || ipArray[i].trim().equals("")) {
                ipArray[i] = "0";
            }
            if (new Integer(ipArray[i].toString()).intValue() < 0) {
                Double j = new Double(Math.abs(new Integer(ipArray[i].toString()).intValue()));
                ipArray[i] = j.toString();
            }
            if (new Integer(ipArray[i].toString()).intValue() > 255) {
                ipArray[i] = "255";
            }
        }
        ipInt = new Double(ipArray[0]).longValue() * 256 * 256 * 256
                + new Double(ipArray[1]).longValue() * 256 * 256 + new Double(ipArray[2]).longValue() * 256
                + new Double(ipArray[3]).longValue();
        // 
    } catch (Exception e) {
        e.printStackTrace();
    }
    return ipInt;
}

From source file:com.bstek.dorado.data.type.DoubleDataType.java

@Override
public Object fromObject(Object value) {
    if (value == null) {
        return null;
    } else if (value instanceof Double) {
        return value;
    } else if (value instanceof Number) {
        return new Double(((Number) value).doubleValue());
    } else if (value instanceof String) {
        return fromText((String) value);
    } else {/* w  w w  . ja v  a 2  s . c o  m*/
        throw new DataConvertException(value.getClass(), Double.class);
    }
}

From source file:Componentes.TermometroMin.java

@Override
public void pintar(javax.swing.JPanel p, int pos) {
    p.removeAll();//from  www.j  a  va 2  s. c om
    DefaultValueDataset data = new DefaultValueDataset(new Double(ventana.getGraphdata().getTmin()));

    ThermometerPlot plot = new ThermometerPlot(data);
    chart = new JFreeChart("Temperatura Mnima, \nMES: " + Calculos.get_mes(ventana.getMonthdata().getdata()), // chart title
            JFreeChart.DEFAULT_TITLE_FONT, plot, // plot
            false);
    Color Darkorange = new Color(255, 140, 0);
    Color Crimson = new Color(220, 20, 60);
    Color Aquamarine = new Color(127, 255, 212);
    Color Darkslategray = new Color(47, 79, 79);

    plot.setMercuryPaint(Aquamarine);
    plot.setSubrange(NORMAL, 0, 2.5);
    plot.setSubrange(WARNING, 2.6, 7.5);
    plot.setSubrange(CRITICAL, 7.6, 20);
    plot.setSubrangePaint(NORMAL, Aquamarine);
    plot.setSubrangePaint(WARNING, Darkorange);
    plot.setSubrangePaint(CRITICAL, Crimson);

    plot.setThermometerStroke(new BasicStroke(2.0f));
    plot.setThermometerPaint(Darkslategray);

    plot.setDisplayRange(2, Calculos.get_min(datos.getTmin()), Calculos.get_max(datos.getTmin()));
    plot.setRange(Calculos.get_min(datos.getTmin()), Calculos.get_max(datos.getTmin()));

    panel = new ChartPanel(chart);
    panel.setBounds(5, 5, 300, 300);
    panel.repaint();
    p.add(panel);
    // jPanel1.repaint();
    p.updateUI();
    // aoIndex=aoAux;
    ///aoAux = 0;
}