Package org.jdesktop.beansbinding

Examples of org.jdesktop.beansbinding.BindingGroup


    @SuppressWarnings("unchecked")
    private void bindSelection(Object... components) {
        painterDemos.setCellRenderer(new DefaultTreeRenderer(
                DisplayValues.DISPLAY_INFO_DESCRIPTION));
        Converter<?, ?> painterConverter = new DisplayInfoConverter<Painter>();
        BindingGroup group = new BindingGroup();
        for (int i = 0; i < components.length; i++) {
            BeanProperty p = BeanProperty.create(
                    i == 0 ? "backgroundPainter" : "painter");
            Binding b = Bindings.createAutoBinding(READ,
                    painterDemos, BeanProperty.create("selectedElement_UNWRAP_NODE"),
                    components[i], p);
            b.setConverter(painterConverter);
            group.addBinding(b);
           
        }
        group.bind();
    }
View Full Code Here


   
    /**
     * @param property
     */
    private void bindInversCollapsed(String property, JComponent... components ) {
        BindingGroup group = new BindingGroup();
        for (JComponent comp : components) {
            group.addBinding(Bindings.createAutoBinding(READ,
                    painterControl, ELProperty.create("${!" + property + "}"),
                    comp, BeanProperty.create("collapsed")));
        }
        group.bind();
    }
View Full Code Here

    /**
     * @param string
     */
    private void bindEnabled(String property, JComponent... components ) {
        BindingGroup group = new BindingGroup();
        for (JComponent comp : components) {
            group.addBinding(Bindings.createAutoBinding(READ,
                    painterControl, BeanProperty.create(property),
                    comp, BeanProperty.create("enabled")));
           
        }
        group.bind();
    }
View Full Code Here

        }

        @SuppressWarnings("unchecked")
        private void updateAreaBindings() {
            if (areaEnabled) {
                areaGroup = new BindingGroup();
                areaGroup.addBinding(Bindings.createAutoBinding(READ,
                        paintStretchedBox, BeanProperty.create("selected"),
                        painter, BeanProperty.create("paintStretched")));
                areaGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ,
                        styleBox, BeanProperty.create("selectedItem"),
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        private void updateBaseBindings() {
            if (baseEnabled) {
                baseGroup = new BindingGroup();
                baseGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ,
                        interpolationBox, BeanProperty.create("selectedItem"),
                        painter, BeanProperty.create("interpolation")));
                baseGroup.addBinding(Bindings.createAutoBinding(READ,
                        visibleBox, BeanProperty.create("selected"),
View Full Code Here

         *
         */
        @SuppressWarnings("unchecked")
        private void updateAlignBindings() {
            if (alignEnabled) {
                alignGroup = new BindingGroup();
                alignGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ,
                        horizontalAlignmentBox, BeanProperty.create("selectedItem"),
                        painter, BeanProperty.create("horizontalAlignment")));
                alignGroup.addBinding(Bindings.createAutoBinding(READ,
                        verticalAlignmentBox, BeanProperty.create("selectedItem"),
View Full Code Here

    }
   
    @SuppressWarnings("unchecked")
    private void bind() {
       
        BindingGroup group = new BindingGroup();
        group.addBinding(Bindings.createAutoBinding(READ,
                datePicker, BeanProperty.create("date"),
                dateEchoField, BeanProperty.create("value")
        ));

        group.addBinding(Bindings.createAutoBinding(READ,
            interactivity, BeanProperty.create("selected"),
            datePicker, BeanProperty.create("enabled")
        ));
       
        group.addBinding(Bindings.createAutoBinding(READ,
            editability, BeanProperty.create("selected"),
            datePicker, BeanProperty.create("editable")
        ));
       
        Binding b = Bindings.createAutoBinding(READ,
            orientation, BeanProperty.create("selected"),
            datePicker, BeanProperty.create("componentOrientation"));
        b.setConverter(new ComponentOrientationConverter());
        group.addBinding(b);
        group.bind();
    }
View Full Code Here

            }
        }
    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_DEFAULT_FOLDER)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_SDK_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SHOW_TOOLBAR_LABELS)));
        menuView.addSeparator();
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));
       
        // Menu Tools
        JMenu toolsView = new JMenu(resourceMap.getString("menu.tools"));
        toolsView.add(new JMenuItem(actionMap.get(ACTION_INSTALL)));
        toolsView.addSeparator();
        toolsView.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(toolsView);
        bar.add(menuHelp);
       
        menuBinding.bind();

        return bar;
    }
View Full Code Here

            }
        }
    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_DEFAULT_FOLDER)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_SDK_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SHOW_TOOLBAR_LABELS)));
        menuView.addSeparator();
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));
       
        // Menu Tools
        JMenu toolsView = new JMenu(resourceMap.getString("menu.tools"));
        toolsView.add(new JMenuItem(actionMap.get(ACTION_INSTALL)));
        toolsView.addSeparator();
        toolsView.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(toolsView);
        bar.add(menuHelp);
       
        menuBinding.bind();

        return bar;
    }
View Full Code Here

            }
        }
    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));
        menuEdit.addSeparator();
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(menuHelp);
       
        menuBinding.bind();

        return bar;
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.beansbinding.BindingGroup

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.