Package org.noos.xing.yasaf.plaf.action

Examples of org.noos.xing.yasaf.plaf.action.ViewContextSource


        // Left
        panel.addEntry(0, 0, "enabled : ", enabledBox = new JCheckBox());
        enabledBox.setAction(new DynamicAction(FloatingTypeDescriptor.class,
                "enabled",
                new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                new ChecBoxSelectionSource(enabledBox)));

        panel.addEntry(1, 0, "modal : ", modal = new JCheckBox());
        modal.setAction(new DynamicAction(FloatingTypeDescriptor.class,
                "modal",
                new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                new ChecBoxSelectionSource(modal)));

        panel.addEntry(2, 0, "animating : ", animating = new JCheckBox());
        animating.setSelected(true);
        animating.setAction(new DynamicAction(ToolWindowTypeDescriptor.class,
                "animating",
                new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                new ChecBoxSelectionSource(animating)));

        panel.addEntry(3, 0, "idVisibleOnTitleBar : ", idVisibleOnTitleBar = new JCheckBox());
        idVisibleOnTitleBar.setAction(new DynamicAction(ToolWindowTypeDescriptor.class,
                "idVisibleOnTitleBar",
                new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                new ChecBoxSelectionSource(idVisibleOnTitleBar)));

        // Right
        panel.add(new JLabel("transparentMode : "), "5,1,r,c");
        panel.add(transparentMode = new JCheckBox(), "7,1,FULL,FULL");
        transparentMode.setAction(new DynamicAction(FloatingTypeDescriptor.class,
                "transparentMode",
                new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                new ChecBoxSelectionSource(transparentMode)));

        panel.add(new JLabel("transparentDelay : "), "5,3,r,c");
        panel.add(transparentDelay = new JSpinner(new SpinnerNumberModel(0, 0, 5000, 500)), "7,3,FULL,FULL");
        transparentDelay.addChangeListener(
                new ChangeListenerAction(FloatingTypeDescriptor.class,
                        "transparentDelay",
                        new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                        new SpinnerValueSource(transparentDelay))
        );

        panel.add(new JLabel("transparentRatio : "), "5,5,r,c");
        panel.add(transparentRatio = new JSpinner(new SpinnerNumberModel(0.0, 0.0, 1.0, 0.05)), "7,5,FULL,FULL");
        transparentRatio.addChangeListener(
                new ChangeListenerAction(FloatingTypeDescriptor.class,
                        "transparentRatio",
                        new ViewContextSource(viewContext, FloatingTypeDescriptor.class),
                        new ToFloatSource(new SpinnerValueSource(transparentRatio)))
        );

        return panel;
    }
View Full Code Here


            // Column 0
            panel.addEntry(0, 0, "numberingEnabled : ", numberingEnabled = new JCheckBox());
            numberingEnabled.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                         "numberingEnabled",
                                                         new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                         new ChecBoxSelectionSource(numberingEnabled)));

            panel.addEntry(1, 0, "previewEnabled : ", previewEnabled = new JCheckBox());
            previewEnabled.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                       "previewEnabled",
                                                       new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                       new ChecBoxSelectionSource(previewEnabled)));

            panel.addEntry(2, 0, "DividerSize (LEFT) : ",
                           leftDividerSize = new JSpinner(new SpinnerNumberModel(5, 0, 20, 1)));
            leftDividerSize.addChangeListener(
                    new ChangeListenerAction(ToolWindowManagerDescriptor.class,
                                             "setDividerSize",
                                             new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                             new AndSource(
                                                     new ConstantSource(ToolWindowAnchor.LEFT),
                                                     new SpinnerValueSource(leftDividerSize)
                                             )
                    )
            );

            panel.addEntry(3, 0, "DividerSize (RIGHT) : ",
                           rightDividerSize = new JSpinner(new SpinnerNumberModel(5, 0, 20, 1)));
            rightDividerSize.addChangeListener(
                    new ChangeListenerAction(ToolWindowManagerDescriptor.class,
                                             "setDividerSize",
                                             new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                             new AndSource(
                                                     new ConstantSource(ToolWindowAnchor.RIGHT),
                                                     new SpinnerValueSource(rightDividerSize)
                                             )
                    )
            );

            panel.addEntry(4, 0, "DividerSize (TOP) : ",
                           topDividerSize = new JSpinner(new SpinnerNumberModel(5, 0, 20, 1)));
            topDividerSize.addChangeListener(
                    new ChangeListenerAction(ToolWindowManagerDescriptor.class,
                                             "setDividerSize",
                                             new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                             new AndSource(
                                                     new ConstantSource(ToolWindowAnchor.TOP),
                                                     new SpinnerValueSource(topDividerSize)
                                             )
                    )
            );

            panel.addEntry(5, 0, "DividerSize (BOTTOM) : ",
                           bottomDividerSize = new JSpinner(new SpinnerNumberModel(5, 0, 20, 1)));
            bottomDividerSize.addChangeListener(
                    new ChangeListenerAction(ToolWindowManagerDescriptor.class,
                                             "setDividerSize",
                                             new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                             new AndSource(
                                                     new ConstantSource(ToolWindowAnchor.BOTTOM),
                                                     new SpinnerValueSource(bottomDividerSize)
                                             )
                    )
            );

            // Column 1
            pushAwayMode = new JComboBox(new Object[]{
                    PushAwayMode.ANTICLOCKWISE,
                    PushAwayMode.HORIZONTAL,
                    PushAwayMode.VERTICAL,
                    PushAwayMode.MOST_RECENT
            });
            pushAwayMode.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    viewContext.put(PushAwayMode.class, e.getItem());
                }
            });
            panel.addEntry(0, 1, "pushAwayMode : ", pushAwayMode);


            panel.addEntry(1, 1, "Agg Mode (LEFT) : ", leftAggregateMode = new JCheckBox());
            leftAggregateMode.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                          "setAggregateMode",
                                                          new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                          new AndSource(
                                                                  new ConstantSource(ToolWindowAnchor.LEFT),
                                                                  new ChecBoxSelectionSource(leftAggregateMode)
                                                          )
            ));

            panel.addEntry(2, 1, "Agg Mode (RIGHT) : ", rightAggregateMode = new JCheckBox());
            rightAggregateMode.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                           "setAggregateMode",
                                                           new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                           new AndSource(
                                                                   new ConstantSource(ToolWindowAnchor.RIGHT),
                                                                   new ChecBoxSelectionSource(rightAggregateMode)
                                                           )
            ));


            panel.addEntry(3, 1, "Agg Mode (TOP) : ", topAggregateMode = new JCheckBox());
            topAggregateMode.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                         "setAggregateMode",
                                                         new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                         new AndSource(
                                                                 new ConstantSource(ToolWindowAnchor.TOP),
                                                                 new ChecBoxSelectionSource(topAggregateMode)
                                                         )
            ));


            panel.addEntry(4, 1, "Agg Mode (BOTTOM) : ", bottomAggregateMode = new JCheckBox());
            bottomAggregateMode.setAction(new DynamicAction(ToolWindowManagerDescriptor.class,
                                                            "setAggregateMode",
                                                            new ViewContextSource(viewContext, ToolWindowManagerDescriptor.class),
                                                            new AndSource(
                                                                    new ConstantSource(ToolWindowAnchor.BOTTOM),
                                                                    new ChecBoxSelectionSource(topAggregateMode)
                                                            )
            ));
View Full Code Here

TOP

Related Classes of org.noos.xing.yasaf.plaf.action.ViewContextSource

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.