Package Framework

Examples of Framework.NumericFormat


    // ------------
    public MoneyDomain() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();

        this.fmt = new NumericFormat(new TextData("$#,##0.00"), NumericFormat.qq_Resolver.cTEMPLATE);

    }
View Full Code Here


    // ----------------------
    // Accessors and Mutators
    // ----------------------
    private void setFmt(NumericFormat fmt) {
        NumericFormat oldValue = this.fmt;
        this.fmt = fmt;
//        this.qq_Listeners.firePropertyChange("fmt", oldValue, this.fmt);
    }
View Full Code Here

     * <p>
     * @param pShowCents Type: boolean
     */
    public void setFormat(boolean pShowCents) {
        if (pShowCents) {
            this.fmt = new NumericFormat(new TextData("$#,##0.00"), NumericFormat.qq_Resolver.cTEMPLATE);
        }
        else {
            this.fmt = new NumericFormat(new TextData("$#,##0"), NumericFormat.qq_Resolver.cTEMPLATE);
        }
    }
View Full Code Here

            }
            else if (attr.getIsNull()) {
                result.concat("<NULL>");
            }
            else if (attr instanceof DoubleData && ((DoubleData)attr).getValue() < 1e+012 && ((DoubleData)attr).getValue() > 1e-012) {
                result.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DoubleData)attr));
            }
            else if (attr instanceof DecimalData) {
                result.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DecimalData)attr));
            }
            else if (attr instanceof TextData) {
                result.concat("\"");
                result.concat(attr);
                result.concat("\"");
View Full Code Here

            return;
        if (template == null) {
            dataField.setFormatterFactory(null);
            return;
        }
        NumericFormat nf = new NumericFormat(template, NumericFormat.qq_Resolver.cTEMPLATE);
        DefaultFormatterFactory factory = new DefaultFormatterFactory(new NumberFormatter(nf.getFormatter()), // default
                new NumberFormatter(nf.getFormatter()), // display
                new NumberFormatter(nf.getFormatter()), // edit
                null); // null value
        dataField.setFormatterFactory(factory);
        if (dataField.getTable() != null) {
            JTable table = dataField.getTable();
            ArrayColumn ac = (ArrayColumn) table.getColumnModel().getColumn(dataField.getTableColumn());
View Full Code Here

                    }
                    if (sqlData.getValues().get(i-1).getIsNull()) {
                        str.concat("<NULL>");
                    }
                    else if (sqlData.getValues().get(i-1) instanceof DoubleData && ((DoubleData)(sqlData.getValues().get(i-1))).getValue() < 1e+012 && ((DoubleData)(sqlData.getValues().get(i-1))).getValue() > 1e-012) {
                        str.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DoubleData)(sqlData.getValues().get(i-1))));
                    }
                    else {
                        str.concat(sqlData.getValues().get(i-1).getClass().getSimpleName());
                        str.concat(":");
                        str.concat(sqlData.getValues().get(i-1));
View Full Code Here

        if (templateText != null) {
            if (type instanceof DateTimeData) {
                type.decodeValue(value.getTextValue(), new DateFormat(templateText));
            }
            else if (type instanceof NumericData) {
                type.decodeValue(value.getTextValue(), new NumericFormat(templateText));
            }
            else if (type instanceof TextData) {
                type.decodeValue(value.getTextValue(), new TextFormat(templateText, qq_Resolver.cTEMPLATE));
            }
            else {
View Full Code Here

            }
            else if (attr.getIsNull()) {
                result.concat("<NULL>");
            }
            else if (attr instanceof DoubleData && ((DoubleData)attr).getValue() < 1e+012 && ((DoubleData)attr).getValue() > 1e-012) {
                result.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DoubleData)attr));
            }
            else if (attr instanceof DecimalData) {
                result.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DecimalData)attr));
            }
            else if (attr instanceof TextData) {
                result.concat("\"");
                result.concat(attr);
                result.concat("\"");
View Full Code Here

    public DataFieldNumericFormat(DataField pComponent, String pValue) {
        super(pComponent);
        this.value = pValue;
    }
    public void performAction() {
        NumberFormat nf = new NumericFormat(this.value, NumericFormat.qq_Resolver.cTEMPLATE).getCorrectFormatter();
        DefaultFormatterFactory dff = new DefaultFormatterFactory(
                new NumberFormatter(nf),
                new NumberFormatter(nf),
                new NumberFormatter(nf),
                null);
View Full Code Here

            return;
        if (template == null) {
            dataField.setFormatterFactory(null);
            return;
        }
        NumericFormat nf = new NumericFormat(template, NumericFormat.qq_Resolver.cTEMPLATE);
        DefaultFormatterFactory factory = new DefaultFormatterFactory(new NumberFormatter(nf.getFormatter()), // default
                new NumberFormatter(nf.getFormatter()), // display
                new NumberFormatter(nf.getFormatter()), // edit
                null); // null value
        dataField.setFormatterFactory(factory);
        if (dataField.getTable() != null) {
            JTable table = dataField.getTable();
            ArrayColumn ac = (ArrayColumn) table.getColumnModel().getColumn(dataField.getTableColumn());
View Full Code Here

TOP

Related Classes of Framework.NumericFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.