Package jsky.science

Examples of jsky.science.Quantity


    /**
     * sets the current min quantity of the range
     */
    public void setMinQuantity(Quantity inQ) {
        Quantity oldQ = fMinValue;
        fMinValue = inQ;
        updateTitle();
        updateScaleMinMax((int) fMinValue.getValue());
        fSlider.setValue((int) inQ.getValue());
        firePropertyChange(MINQUANTITY_PROPERTY, oldQ, inQ);
View Full Code Here


    /**
     * sets the current Max quantity of the range
     */
    public void setMaxQuantity(Quantity inQ) {
        Quantity oldQ = fMaxValue;
        fMaxValue = inQ;
        updateTitle();
        updateScaleMinMax((int) fMaxValue.getValue());
        fSlider.setExtent((int) (fMaxValue.getValue() - fMinValue.getValue()));
        firePropertyChange(MAXQUANTITY_PROPERTY, oldQ, inQ);
View Full Code Here

                double val = popupQuantityRequest(
                        "Min Value",
                        sb.toString());

                if (!Double.isNaN(val)) {
                    Quantity newQ = fMinValue.newInstance(val);
                    setMinQuantity(newQ);
                }
            } else if (fSlider.extentContains(e.getX(), e.getY())) {
                StringBuffer sb = new StringBuffer("Enter new max value (");
                sb.append(fMaxValue.getDefaultUnits());
                sb.append("):");
                double val = popupQuantityRequest(
                        "Max Value",
                        sb.toString());

                if (!Double.isNaN(val)) {
                    Quantity newQ = fMaxValue.newInstance(val);
                    setMaxQuantity(newQ);
                }
            }
        }
    }
View Full Code Here

    /**
     * Sets the Quantity instance to be editted.
     * @param newQ Quantity object to be editted
     **/
    public void setQuantity(Quantity newQ) {
        Quantity oldW = fQuantity;

        if ((newQ != null) && !fClass.isInstance(newQ)) {
            throw new ClassCastException();
        }

View Full Code Here

TOP

Related Classes of jsky.science.Quantity

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.