Package pl.eternalsh.simplecalc.common.events

Examples of pl.eternalsh.simplecalc.common.events.CalculateExpressionEvent


        placeButton(label, positionX, positionY, new ActionListener()
        {
            @Override
            public void actionPerformed(final ActionEvent actionEvent)
            {
                blockingQueue.add(new CalculateExpressionEvent(inputExpressionField.getText()));
            }
        });
    }
View Full Code Here


     *
     * @param event event sent by the GUI.
     */
    void handle(final ApplicationEvent event)
    {
        CalculateExpressionEvent calculateExprEvent = (CalculateExpressionEvent) event;

        try
        {
            Result result = model.parseExpression(calculateExprEvent.getExpression());
            view.updateResultField(result.toString().concat("=").concat(calculateExprEvent.getExpression()));
            System.out.println(result.toString());
        }
        catch(IllegalInputStringException illegalInputException)
        {
            view.updateResultField("Illegal characters found.");
View Full Code Here

TOP

Related Classes of pl.eternalsh.simplecalc.common.events.CalculateExpressionEvent

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.