Package com.lightcrafts.ui.layout

Examples of com.lightcrafts.ui.layout.Box


        Component left = slider.getLabel();
        Component center = slider.getSlider();
        Component text = slider.getText();

        Box right = Box.createVerticalBox();
        right.add(Box.createVerticalGlue());
        right.add(text);
        right.add(Box.createVerticalGlue());

        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.BOTH;
        c.gridy = count;
        c.weighty = 1.;
View Full Code Here


                        );
                    }
                }
            }
        );
        Box buttons = Box.createHorizontalBox();
//        buttons.add(auto);
//        buttons.add(Box.createHorizontalStrut(8));
        buttons.add(asShot);

        Box colorContent = getColorContent();
        colorContent.add(Box.createHorizontalStrut(8), 0);
//        colorContent.add(auto, 1);
//        colorContent.add(Box.createHorizontalStrut(8), 2);
        colorContent.add(asShot, 1);
        colorContent.add(Box.createHorizontalStrut(8), 2);
    }
View Full Code Here

        );
        Color color = op.getWhitePoint();
        swatch = new ColorSwatch(color);
        text = new ColorText(color);

        Box content = Box.createHorizontalBox();
        content.add(swatch);
        content.add(Box.createHorizontalStrut(8));
        content.add(text);
        content.add(Box.createHorizontalStrut(32));
        content.add(dropperButton);

        content.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

        setContent(content);

        readyForUndo();
    }
View Full Code Here

        ZoneContainer zones = new ZoneContainer(widget, reference);
        zones.setBackground(Background);
        zones.setPreferredSize(PreferredSize);

        Box container = Box.createVerticalBox();
        container.add(zones);
        container.add(scales);

        setContent(container);
    }
View Full Code Here

    protected void operationChanged(Operation operation) {
        super.operationChanged(operation);

        this.op = (GenericOperation) operation;

        Box box = Box.createVerticalBox();

        box.add(Box.createVerticalStrut(6));

        // Add all the sliders:

        // A special layout that aligns the GenericSlider pieces in rows
        // and columns:
        GenericSliderContainer sliderContainer = new GenericSliderContainer();

        List sliderKeys = op.getSliderKeys();
        for (Iterator i=sliderKeys.iterator(); i.hasNext(); ) {
            final String key = (String) i.next();
            final String userKey = getUserPresentableKey(key);
            final SliderConfig config = op.getSliderConfig(key);
            final GenericSlider slider = new GenericSlider(userKey, config);
            slider.addChangeListener(
                new ChangeListener() {
                    public void stateChanged(ChangeEvent event) {
                        double value = slider.getConfiguredValue();
                        op.setSliderValue(key, value);
                    }
                }
            );
            GenericSlider oldSlider = (GenericSlider) sliders.get(key);
            if (oldSlider != null) {
                slider.setConfiguredValue(oldSlider.getConfiguredValue());
            }
            slider.addSliderMouseListener(
                new MouseAdapter() {
                    public void mousePressed(MouseEvent event) {
                        op.changeBatchStarted();
                    }
                    public void mouseReleased(MouseEvent event) {
                        op.changeBatchEnded();
                        undoSupport.postEdit(key + " Slider");
                    }
                }
            );
            slider.setBackgroundRecurse(Background);
            slider.setFontRecurse(ControlFont);
            sliderContainer.addGenericSlider(slider);

            sliders.put(key, slider);
        }
        sliderContainer.setBackground(Background);
        box.add(sliderContainer);

        // Add all the checkboxes:

        List checkboxKeys = op.getCheckboxKeys();
        for (Iterator i=checkboxKeys.iterator(); i.hasNext(); ) {
            final String key = (String) i.next();
            final String userKey = getUserPresentableKey(key);
            final JCheckBox checkbox = new JCheckBox(userKey);
            checkbox.addItemListener(
                new ItemListener() {
                    public void itemStateChanged(ItemEvent event) {
                        boolean value = checkbox.isSelected();
                        op.setCheckboxValue(key, value);
                        undoSupport.postEdit(key + " Checkbox");
                    }
                }
            );
            JCheckBox oldCheckbox = (JCheckBox) checkboxes.get(key);
            if (oldCheckbox != null) {
                checkbox.setSelected(oldCheckbox.isSelected());
            }
            checkbox.setBackground(Background);
            checkbox.setFont(ControlFont);
            box.add(checkbox);

            checkboxes.put(key, checkbox);
        }

        // Add all the choices:

        List choiceKeys = op.getChoiceKeys();
        for (Iterator i=choiceKeys.iterator(); i.hasNext(); ) {
            final String key = (String) i.next();
            Vector values = new Vector(op.getChoiceValues(key));
            final JComboBox choice = new JComboBox(values);
            choice.addActionListener(
                new ActionListener() {
                    public void actionPerformed(ActionEvent event) {
                        String value = (String) choice.getSelectedItem();
                        op.setChoiceValue(key, value);
                        undoSupport.postEdit(key + " Choice");
                    }
                }
            );
            JComboBox oldChoice = (JComboBox) choices.get(key);
            if (oldChoice != null) {
                choice.setSelectedItem(oldChoice.getSelectedItem());
            }
            choice.setBackground(Background);
            choice.setFont(ControlFont);
            box.add(choice);

            choices.put(key, choice);
        }
        box.add(Box.createVerticalStrut(6));

        setContent(box);

        undoSupport.initialize();
    }
View Full Code Here

        layerControls = new LayerControls(control, layerModes, pcs);
        invertRegionSwitch = new InvertRegionCheckBox(control, pcs);
        colorControls = new ColorSelectionControls(control, pcs);

        Box blendBox = Box.createVerticalBox();
        blendBox.add(Box.createVerticalStrut(5));
        blendBox.add(layerControls);
        blendBox.add(invertRegionSwitch);
        blendBox.setBackground(LightZoneSkin.Colors.ToolPanesBackground);
        layerControls.setAlignmentX( Component.LEFT_ALIGNMENT );
        invertRegionSwitch.setAlignmentX( Component.LEFT_ALIGNMENT );

        tabPane = new JTabbedPane();
        tabPane.setFont(LightZoneSkin.fontSet.getSmallFont());
View Full Code Here

        slider.setMajorTickSpacing(50);
        slider.setMinorTickSpacing(10);
        slider.setToolTipText(LOCALE.get("OpacityToolTip"));
        slider.setUI(new LCSliderUI(slider));

        final Box blendingModeBox = Box.createHorizontalBox();
        JLabel blendLabel = new JLabel( LOCALE.get( "BlendingModeMenuLabel" ) + ": " );
        blendLabel.setFont(LightZoneSkin.fontSet.getSmallFont());
        blendingModeBox.add(blendLabel);
        blendingModeBox.add(combo);

        final Box opacityBox = Box.createHorizontalBox();
        JLabel opacityLabel = new JLabel( LOCALE.get( "ToolOpacitySliderLabel" ) + ":  " );
        opacityLabel.setFont(LightZoneSkin.fontSet.getSmallFont());
        opacityBox.add(opacityLabel);
        opacityBox.add(slider);

        final Box combinedBox = Box.createVerticalBox();
        combinedBox.add(blendingModeBox);
        combinedBox.add(opacityBox);
        blendingModeBox.setAlignmentX( Component.LEFT_ALIGNMENT );
        opacityBox.setAlignmentX( Component.LEFT_ALIGNMENT );

        add(Box.createHorizontalStrut(5));
        add(combinedBox);
View Full Code Here

            }
        };
        wheel.addMouseListener(listener);
        wheel.addMouseMotionListener(listener);

        Box colorContent = Box.createHorizontalBox();

        colorContent.add(wheel);
        colorContent.add(Box.createHorizontalStrut(8));
        colorContent.add(new ColorSwatch(Color.gray));
        colorContent.add(Box.createHorizontalStrut(8));
        colorContent.add(new ColorText(Color.gray));
        colorContent.add(Box.createHorizontalStrut(8));
        colorContent.add(new DropperButton());

        colorContent.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

        JFrame frame = new JFrame("Test");
        frame.setContentPane(colorContent);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
View Full Code Here

TOP

Related Classes of com.lightcrafts.ui.layout.Box

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.