Package java.awt

Examples of java.awt.GridBagLayout$MixedConstraints


    public Component getGUI() {
        JPanel p;
        if (gui == null) {
            gui = PaletteHelper.createVerticalPanel("Earthquakes");

            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints constraints = new GridBagConstraints();
            gui.setLayout(gridbag);
            constraints.fill = GridBagConstraints.HORIZONTAL; // fill
            // horizontally
            constraints.gridwidth = GridBagConstraints.REMAINDER; //another
            // row
            constraints.anchor = GridBagConstraints.EAST; // tack to
            // the left
            // edge

            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int index = Integer.parseInt(e.getActionCommand(), 10);
                    activeSites[index] = !activeSites[index];
                }
            };
            p = PaletteHelper.createCheckbox("Sites",
                    fingerSites,
                    activeSites,
                    al);
            gridbag.setConstraints(p, constraints);
            gui.add(p);

            JButton b = new JButton("Query Now");
            b.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // force refetch of data
                    lastDataFetchTime = 0;
                    doPrepare();
                }
            });
            gridbag.setConstraints(p, constraints);
            gui.add(b);

        }
        return gui;
    }
View Full Code Here


            namePanel.add(nameField);

            palette.add(namePanel);

            JPanel buttonPanel = new JPanel();
            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints c = new GridBagConstraints();

            buttonPanel.setLayout(gridbag);

            applybutton = new JButton(i18n.get(GoToMenu.class,
                    "addView",
                    "Add View"));
            applybutton.addActionListener(this);
            gridbag.setConstraints(applybutton, c);

            closebutton = new JButton(i18n.get(GoToMenu.class, "close", "Close"));
            closebutton.addActionListener(this);
            c.gridx = GridBagConstraints.RELATIVE;
            gridbag.setConstraints(closebutton, c);

            buttonPanel.add(applybutton);
            buttonPanel.add(closebutton);

            palette.add(buttonPanel);
View Full Code Here

        //      setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        //      setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        this.setOpaque(false);

        JPanel panel = new JPanel();
        GridBagLayout internalGridbag = new GridBagLayout();
        GridBagConstraints c2 = new GridBagConstraints();
        panel.setLayout(internalGridbag);

        zoomDelegate = new ZoomSupport(this);
        zoomInButton = getButton("zoomIn", "Zoom In", zoomInCmd);
        c2.gridx = 0;
        c2.gridy = 0;
        internalGridbag.setConstraints(zoomInButton, c2);
        panel.add(zoomInButton);

        zoomOutButton = getButton("zoomOut", "Zoom Out", zoomOutCmd);
        c2.gridy = 1;
        internalGridbag.setConstraints(zoomOutButton, c2);
        panel.add(zoomOutButton);

        add(panel);
    }
View Full Code Here

     * Creates and adds the labels and entry fields for latitude and
     * longitude
     */
    protected void makeWidgets() {
        String locText;
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();

        setLayout(gridbag);
        locText = i18n.get(MGRSCoordPanel.class, "border", "MGRS Coordinate");
        setBorder(new TitledBorder(new EtchedBorder(), locText));

        locText = i18n.get(MGRSCoordPanel.class, "mgrsLabel", "MGRS: ");
        JLabel mgrsLabel = new JLabel(locText);
        c.gridx = 0;
        gridbag.setConstraints(mgrsLabel, c);
        add(mgrsLabel);

        mgrs = new JTextField(20);
        c.gridx = 1;
        gridbag.setConstraints(mgrs, c);
        add(mgrs);
    }
View Full Code Here

                JButton removeButton = new JButton("Remove");
                removeButton.addActionListener(new RemoveShapesActionListener(fileDataList, shapeList));

                JLabel label = new JLabel(shpFileName, JLabel.LEFT);
                JPanel panel = new JPanel();
                GridBagLayout gridbag = new GridBagLayout();
                panel.setLayout(gridbag);
                GridBagConstraints c = new GridBagConstraints();
                c.weightx = 1.0;
                c.insets = new Insets(2, 2, 2, 2);
                c.anchor = GridBagConstraints.WEST;
                c.fill = GridBagConstraints.HORIZONTAL;
                gridbag.setConstraints(label, c);
                panel.add(label);
                c.weightx = 0;
                c.anchor = GridBagConstraints.EAST;
                c.fill = GridBagConstraints.NONE;
                gridbag.setConstraints(visibilityControl, c);
                panel.add(visibilityControl);
                gridbag.setConstraints(removeButton, c);
                panel.add(removeButton);

                shapeList.putAttribute(SHAPE_FILE_NAME_ATTRIBUTE, shpFileName);
                shapeList.putAttribute(SHAPE_VISIBILITY_CONTROL_ATTRIBUTE,
                        visibilityControl);
View Full Code Here

        Color light = Color.white;
        Color dark = Color.LIGHT_GRAY;
        Color current = dark;

        p.removeAll();
        GridBagLayout gridbag = new GridBagLayout();
        p.setLayout(gridbag);
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.NORTHWEST;
        c.gridx = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;

        getRegionIndex(false).clear();
        for (Iterator it = fileDataList.iterator(); it.hasNext();) {
            Object obj = it.next();
            if (obj instanceof EsriGraphicList) {
                EsriGraphicList shapeList = (EsriGraphicList) obj;
                JPanel control = (JPanel) shapeList.getAttribute(SHAPE_CONTROL_ATTRIBUTE);
                if (control != null) {
                    control.setBackground(current);
                    Component[] comps = control.getComponents();
                    for (int i = 0; i < comps.length; i++) {
                        comps[i].setBackground(current);
                    }
                    if (current == dark)
                        current = light;
                    else
                        current = dark;
                    gridbag.setConstraints(control, c);
                    p.add(control);
                }

                addToRegionIndex(shapeList, getRegionIndex(false));
            }
        }

        if (fileDataList.size() == 0) {
            JLabel label = new JLabel("No Shape Files Loaded", JButton.CENTER);
            c.anchor = GridBagConstraints.CENTER;
            gridbag.setConstraints(label, c);
            p.add(label);
        }

        c.fill = GridBagConstraints.BOTH;
        c.weighty = 1;
        JLabel filler = new JLabel("");
        gridbag.setConstraints(filler, c);
        p.add(filler);

        p.revalidate();
    }
View Full Code Here

    JCheckBox pointCheckButton;

    public Component getGUI() {
        if (panel == null) {
            panel = new JPanel();
            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints c = new GridBagConstraints();

            panel.setLayout(gridbag);
            c.gridx = GridBagConstraints.REMAINDER;
            c.weightx = 1.0;
            c.insets = new Insets(1, 5, 1, 5);
            c.fill = GridBagConstraints.HORIZONTAL;
            JPanel daPanel1 = PaletteHelper.createHorizontalPanel("Paint Settings for Shapes");
            daPanel1.add(shapeDA.getGUI());
            JPanel daPanel2 = PaletteHelper.createHorizontalPanel("Paint Settings for Intersected Shapes");
            daPanel2.add(shapeDASelected.getGUI());

            gridbag.setConstraints(daPanel1, c);
            gridbag.setConstraints(daPanel2, c);
            panel.add(daPanel1);
            panel.add(daPanel2);

            c.weighty = 1.0;
            c.fill = GridBagConstraints.BOTH;
            JPanel tablePanel = getFileListControl();
            gridbag.setConstraints(tablePanel, c);
            panel.add(tablePanel);

            JPanel checkPanel = new JPanel();
            GridBagLayout gb = new GridBagLayout();
            checkPanel.setLayout(gb);
            GridBagConstraints c2 = new GridBagConstraints();

            c2.anchor = GridBagConstraints.WEST;
            c2.gridx = GridBagConstraints.REMAINDER;
            showCrossingsButton = new JCheckBox("Show Crossing Points", showCrossingPoints);
            showCrossingsButton.setToolTipText("<html>Show ordered points where drawn lines cross Shapes.");
            showCrossingsButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    setShowCrossingPoints(((JCheckBox) ae.getSource()).isSelected());
                    doPrepare();
                }
            });
            gb.setConstraints(showCrossingsButton, c2);
            checkPanel.add(showCrossingsButton);

            pointCheckButton = new JCheckBox("Click Creates Image Mask", showCrossingPoints);
            pointCheckButton.setToolTipText("<html>When clicking on Shape, create image mask that shows Geo point<br>intersection vs. Java 2D. Green is good.");
            pointCheckButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    setCreatePointCheck(((JCheckBox) ae.getSource()).isSelected());
                    doPrepare();
                }
            });
            gb.setConstraints(pointCheckButton, c2);
            checkPanel.add(pointCheckButton);

            c.weightx = 0;
            c.weighty = 0;
            c.fill = GridBagConstraints.NONE;
View Full Code Here

        renderTypeList.setSelectedIndex(defaultGraphicAttributes.getRenderType() - 1);

        panel = PaletteHelper.createHorizontalPanel(i18n.get(OMDrawingToolLauncher.class,
                "panelGraphicAttributes",
                "Graphic Attributes:"));
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.CENTER;
        panel.setLayout(gridbag);

        String interString = i18n.get(OMDrawingToolLauncher.class,
                "panelRenderingType",
                "Rendering Type:");
        JPanel panel2 = new JPanel();
        JLabel renderTypeLabel = new JLabel(interString);
        panel2.add(renderTypeLabel);
        panel2.add(renderTypeList);

        panel3 = new JPanel();
        updateDrawingAttributesGUI();

        gridbag.setConstraints(panel2, c);
        panel.add(panel2);
        gridbag.setConstraints(panel3, c);
        panel.add(panel3);
        palette.add(panel);

        JButton createButton = new JButton(i18n.get(OMDrawingToolLauncher.class,
                "createButton",
View Full Code Here

    }

    private JPanel createToolButtonPanel() {
        // Otherwise, create a set of buttons.
        JPanel panel = new JPanel();
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        c.gridwidth = GridBagConstraints.REMAINDER;

        panel.setLayout(gridbag);

        ButtonGroup bg = new ButtonGroup();

        int toolbarCount = 0;
        boolean limitWidth = false;
        if (maxHorNumLoaderButtons >= 0) {
            limitWidth = true;
        }

        JToggleButton btn;
        JToolBar iconBar = null;
        boolean activeSet = false;
        for (Iterator it = getLoaders(); it.hasNext();) {

            if (toolbarCount == 0) {
                iconBar = new JToolBar();
                iconBar.setFloatable(false);
                gridbag.setConstraints(iconBar, c);
                panel.add(iconBar);
            }

            LoaderHolder lh = (LoaderHolder) it.next();
            String pName = lh.prettyName;
View Full Code Here

            layers = new Layer[0];
        }

        if (panesPanel == null) {
            panesPanel = new JPanel();
            gridbag = new GridBagLayout();
            c = new GridBagConstraints();

            panesPanel.setLayout(gridbag);

            c.gridwidth = GridBagConstraints.REMAINDER;
View Full Code Here

TOP

Related Classes of java.awt.GridBagLayout$MixedConstraints

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.