Package javax.swing.JToggleButton

Examples of javax.swing.JToggleButton.ToggleButtonModel


        ItsNatButtonGroup compGroup = compMgr.getItsNatButtonGroup(group);
        compGroup.addButton(buttonComp1);
        compGroup.addButton(buttonComp2);


        ToggleButtonModel dataModel1 = buttonComp1.getToggleButtonModel();
        dataModel1.addActionListener(this);
        dataModel1.addItemListener(this);

        ToggleButtonModel dataModel2 = buttonComp2.getToggleButtonModel();
        dataModel2.addActionListener(this);
        dataModel2.addItemListener(this);
    }
View Full Code Here


    }

    public void updateDecoration(ItsNatFreeRadioButton buttonComp)
    {
        Element buttonElem = buttonComp.getElement();
        ToggleButtonModel model = buttonComp.getToggleButtonModel();
        if (model.isSelected())
            setAttribute(buttonElem,"style","background: rgb(253,147,173);"); // weak red
        else
            buttonElem.removeAttribute("style");
    }
View Full Code Here

    {
        Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("checkboxId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputCheckBox input = (ItsNatHTMLInputCheckBox)componentMgr.findItsNatComponent(inputElem);
        ToggleButtonModel dataModel = new ToggleButtonModel();
        input.setButtonModel(dataModel);

        input.addEventListener("click",this);
        // Los dem�s tipos de eventos ya est�n testeados con el tipo de bot�n normal (default)

        dataModel.addChangeListener(this);
    }
View Full Code Here

        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.buttonComp = (ItsNatFreeCheckBox)compMgr.createItsNatComponentById("buttonId","freeCheckBox",null);
        buttonComp.addEventListener("click",this);

        ToggleButtonModel dataModel = buttonComp.getToggleButtonModel();
        dataModel.addChangeListener(this);
        dataModel.addItemListener(this);
    }
View Full Code Here

    }

    public void updateDecoration()
    {
        Element buttonElem = buttonComp.getElement();
        ToggleButtonModel model = buttonComp.getToggleButtonModel();
        if (model.isSelected())
            setAttribute(buttonElem,"style","background: rgb(253,147,173);"); // weak red
        else
            buttonElem.removeAttribute("style");
    }
View Full Code Here

            ItsNatButtonGroup htmlGroup = compMgr.getItsNatButtonGroup(group);
            htmlGroup.addButton(inputComp1);
            htmlGroup.addButton(inputComp2);
        }

        ToggleButtonModel dataModel1 = inputComp1.getToggleButtonModel();
        dataModel1.addActionListener(this);
        dataModel1.addItemListener(this);

        ToggleButtonModel dataModel2 = inputComp2.getToggleButtonModel();
        dataModel2.addActionListener(this);
        dataModel2.addItemListener(this);
    }
View Full Code Here

        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.inputComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponentById("inputId");
        inputComp.addEventListener("click",this);

        ToggleButtonModel dataModel = inputComp.getToggleButtonModel();
        dataModel.addChangeListener(this);
        dataModel.addItemListener(this);
    }
View Full Code Here

    }

    public void preSetDefaultDataModel(Object dataModel)
    {
        HTMLInputElement elem = getItsNatHTMLInputButtonToggle().getHTMLInputElement();
        ToggleButtonModel buttonModel = (ToggleButtonModel)dataModel;

        boolean checked = elem.getChecked();
        buttonModel.setSelected(checked);
    }
View Full Code Here

                checked = false;
                break;
        }

        ItsNatHTMLInputButtonToggleImpl comp = getItsNatHTMLInputButtonToggle();
        ToggleButtonModel dataModel = comp.getToggleButtonModel();
        if (dataModel.isSelected() != checked)
        {
            boolean uiEnabled = comp.isUIEnabled();
            comp.setUIEnabled(false);
            try
            {
                dataModel.setSelected(checked);
            }
            finally
            {
                comp.setUIEnabled(uiEnabled); // Restaura
            }
View Full Code Here

    @Override
    public ToggleButtonModel getToggleButtonModel()
    {
        // Como el cambio de ButtonGroup en el data model no genera eventos hemos de sincronizar en cuanto se pueda
        ToggleButtonModel model = super.getToggleButtonModel();
        setButtonGroup(model.getGroup()); // Si no hay cambio no hace nada
        return model;
    }
View Full Code Here

TOP

Related Classes of javax.swing.JToggleButton.ToggleButtonModel

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.