Package com.nexirius.framework.datamodel

Examples of com.nexirius.framework.datamodel.LimitIntModel


        double percentage = -1.0;

        if (getDataModel() instanceof DoubleModel) {
            percentage = ((DoubleModel) getDataModel()).getDouble();
        } else if (getDataModel() instanceof LimitIntModel) {
            LimitIntModel lim = (LimitIntModel) getDataModel();

            percentage = (double) (lim.getInt() - lim.getLowLimit()) / (double) (lim.getHighLimit() - lim.getLowLimit());
        } else if (getDataModel() instanceof IntModel) {
            percentage = ((IntModel) getDataModel()).getInt() / 100.0;
        }

        if (percentage < 0.0) {
View Full Code Here


     * data model.
     */
    public void update() {
        if (isCreated()) {
            if (model instanceof LimitIntModel) {
                LimitIntModel lim = (LimitIntModel) model;
                getJSlider().setMinimum(lim.getLowLimit());
                getJSlider().setMaximum(lim.getHighLimit());
                getJSlider().setValue(lim.getInt());
            } else {
                int percentage = getPercentage();

                if (model.isExceptional() || percentage < 0) {
                    getJSlider().setValue(0);
View Full Code Here

        public void stateChanged(ChangeEvent e) {
            int value = slider.getValue();

            if (model instanceof LimitIntModel) {
                LimitIntModel limitIntModel = (LimitIntModel)model;

                limitIntModel.setInt(value);
            } else {
                setPercentage(value);
            }
        }
View Full Code Here

TOP

Related Classes of com.nexirius.framework.datamodel.LimitIntModel

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.