Package fr.soleil.comete.box.scalarbox

Examples of fr.soleil.comete.box.scalarbox.StringScalarBox


        final JPanel panel = new JPanel(new BorderLayout());

        JPanel stringPanel = new JPanel(new BorderLayout());
        JPanel numberPanel = new JPanel(new BorderLayout());

        StringScalarBox stringBox = new StringScalarBox();
        NumberScalarBox numberBox = new NumberScalarBox();

        TangoKey stringKey = new TangoKey();
        TangoKeyTool.registerAttribute(stringKey, "tango/tangotest/titan", "string_scalar");

        TangoKey stringImageKey = new TangoKey();
        TangoKeyTool.registerAttribute(stringImageKey, "tango/tangotest/titan", "string_spectrum_ro");

        TangoKey numberKey = new TangoKey();
        TangoKeyTool.registerAttribute(numberKey, "tango/tangotest/titan", "ampli");

        // text component
        TextField textfield = new TextField();
        TextArea textArea = new TextArea();
        FileBrowser fileBrowser = new FileBrowser();

        stringBox.connectWidget(textfield, stringKey);
        stringBox.connectWidget(textArea, stringImageKey);
        stringBox.connectWidget(fileBrowser, stringKey);

        fileBrowser.setUpdateAllowed(true);

        // added to stringPanel component
        stringPanel.add(textfield, BorderLayout.WEST);
View Full Code Here


public class LabelTest {

    private static JPanel initPanel() {
        final JPanel panel = new JPanel();

        StringScalarBox stringBox = new StringScalarBox();

        TangoKey stringScalarKey = new TangoKey();
        TangoKeyTool.registerAttribute(stringScalarKey, "tango/tangotest/titan", "string_scalar");

        TangoKey stateKey = new TangoKey();
        TangoKeyTool.registerAttribute(stateKey, "tango/tangotest/titan", "State");

        TangoKey numberScalarKey = new TangoKey();
        TangoKeyTool.registerAttribute(numberScalarKey, "tango/tangotest/titan", "double_scalar");

        TangoKey numberScalarKey2 = new TangoKey();
        TangoKeyTool.registerAttribute(numberScalarKey2, "tango/tangotest/titaN", "double_scalar");

        TangoKey motorPositionKey = new TangoKey();
        TangoKeyTool.registerAttribute(motorPositionKey, "samba/mono/b1", "offset");

        Label stringLabel = new Label();
        Label stateLabel = new Label();
        Label numberLabel = new Label();
        Label numberLabel2 = new Label();
        Label motorLabel = new Label();

        stringBox.connectWidget(stringLabel, stringScalarKey);
        stringBox.connectWidget(stateLabel, stateKey);
        stringBox.connectWidget(numberLabel, numberScalarKey);
        stringBox.connectWidget(numberLabel2, numberScalarKey2);
        // stringBox.setFormatEnabled(numberLabel, true);
        // stringBox.setFormatEnabled(numberLabel2, true);
        // stringBox.setSettable(numberLabel, false);
        stringBox.connectWidget(motorLabel, motorPositionKey);

        panel.add(stringLabel);
        panel.add(stateLabel);
        panel.add(numberLabel);
        panel.add(numberLabel2);
View Full Code Here

    private final StringScalarBox stringBox;

    public CommandPanel() {
        commandButton = new StringButton();
        commandButton.setButtonLook(true);
        stringBox = new StringScalarBox();
        add(commandButton);
    }
View Full Code Here

    @Override
    protected AbstractCometeBox<?> initBox() {
        qualityBox = new NumberScalarBox();

        return new StringScalarBox();
    }
View Full Code Here

        return new TextField();
    }

    @Override
    protected AbstractCometeBox<ITextTarget> initBox() {
        return new StringScalarBox();
    }
View Full Code Here

        tangoType = TangoAttributeHelper.getAttributeType(getDeviceName(), getAttributeName());
        tangoFormat = TangoAttributeHelper.getAttributeFormat(getDeviceName(), getAttributeName());

        if (getDeviceName() == null || getAttributeName() == null) {
            boxType = (AbstractCometeBox<T>) new StringScalarBox();
        }
        else if (tangoType == TangoConstHelper.SCALAR_TYPE) {
            if (tangoFormat == TangoConstHelper.BOOLEAN_FORMAT) {
                boxType = (AbstractCometeBox<T>) new BooleanScalarBox();
            }
            else if (tangoFormat == TangoConstHelper.STRING_FORMAT) {
                boxType = (AbstractCometeBox<T>) new StringScalarBox();
            }
            else if (tangoFormat == TangoConstHelper.NUMERICAL_FORMAT) {
                boxType = (AbstractCometeBox<T>) new StringScalarBox();
            }
        }
        else if (tangoType == TangoConstHelper.ARRAY_TYPE) {
            boxType = (AbstractCometeBox<T>) new ChartViewerBox();
        }
View Full Code Here

public class StringFieldTest {

    private static JPanel initPanel() {
        final JPanel panel = new JPanel(new BorderLayout());

        StringScalarBox stringBox = new StringScalarBox();

        TangoKey key = new TangoKey();
        TangoKeyTool.registerAttribute(key, "tango/tangotest/titan", "string_scalar");

        TangoKey otherKey = new TangoKey();
        TangoKeyTool.registerSettable(otherKey, false);
        TangoKeyTool.registerAttribute(otherKey, "tango/tangotest/titan", "string_scalar");

        TextField textfield = stringBox.createAdvancedWidget(TextField.class, key);
        TextArea textArea = stringBox.createAdvancedWidget(TextArea.class, otherKey);
        FileBrowser fileBrowser = stringBox.createAdvancedWidget(FileBrowser.class, key);
        fileBrowser.setUpdateAllowed(true);

        panel.add(textfield, BorderLayout.CENTER);
        panel.add(textArea, BorderLayout.EAST);
        panel.add(fileBrowser, BorderLayout.NORTH);
View Full Code Here

        return new StringButton();
    }

    @Override
    protected StringScalarBox initBox() {
        return new StringScalarBox();
    }
View Full Code Here

        return new TextFieldButton();
    }

    @Override
    protected StringScalarBox initBox() {
        return new StringScalarBox();
    }
View Full Code Here

    @Override
    protected StringScalarBox initBox() {
        qualityBox = new NumberScalarBox();

        return new StringScalarBox();
    }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.box.scalarbox.StringScalarBox

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.