Package java.awt

Examples of java.awt.GridBagLayout$Grid$GridSide


     */
    public Component getCustomEditor() {
        button.addActionListener(this);

        JPanel jp = new JPanel();
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        jp.setLayout(gridbag);

        c.weightx = 1f;
        c.fill = GridBagConstraints.HORIZONTAL;
        gridbag.setConstraints(textField, c);
        jp.add(textField);

        c.weightx = 0;
        c.anchor = GridBagConstraints.EAST;
        c.fill = GridBagConstraints.NONE;
        gridbag.setConstraints(button, c);
        jp.add(button);
        return jp;
    }
View Full Code Here


    /** Returns the editor GUI, ie a JTextField. */
    public Component getCustomEditor() {
        JPanel panel = new JPanel();

        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.WEST;
        panel.setLayout(gridbag);

        if (!getUseAltCommandStrings()) {
            trueButton.setActionCommand(TrueString);
            falseButton.setActionCommand(FalseString);
        }
        trueButton.addActionListener(this);
        falseButton.addActionListener(this);

        buttonGroup.add(trueButton);
        buttonGroup.add(falseButton);

        setSelected(option);

        gridbag.setConstraints(trueButton, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1;
        gridbag.setConstraints(falseButton, c);
        panel.add(trueButton);
        panel.add(falseButton);

        return panel;
    }
View Full Code Here

        return "Band Height Value";
    }
   
    public Component getGUI() {
        JPanel panel = new JPanel();
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.weightx = 1f;
        c.fill = GridBagConstraints.HORIZONTAL;
        panel.setLayout(gridbag);

        JPanel unitPanel = PaletteHelper.createPaletteJPanel(getUnitAdjustmentTitle());
        Object[] units = new Object[] { Length.METER, Length.FEET };
        JComboBox unitBox = new JComboBox(units);
        unitBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                JComboBox unitBox = (JComboBox) ae.getSource();
                setDisplayUnits((Length) unitBox.getSelectedItem());
            }
        });
        unitPanel.add(unitBox);
        gridbag.setConstraints(unitPanel, c);
        panel.add(unitPanel);

        // The DTED Bandheight Adjuster
        JPanel contrastPanel = PaletteHelper.createPaletteJPanel(getValueAdjustmentTitle());
        JSlider contrastSlide = new JSlider(JSlider.HORIZONTAL, 1/* min */, 500/* max */, getBandHeight()/* inital */);
        java.util.Hashtable dict = new java.util.Hashtable();
        dict.put(new Integer(1), new JLabel("1"));
        dict.put(new Integer(500), new JLabel("500"));
        dict.put(sliderLabelKey, new JLabel("(" + getBandHeight() + ")"));
        contrastSlide.setLabelTable(dict);
        contrastSlide.setPaintLabels(true);
        contrastSlide.setMajorTickSpacing(50);
        contrastSlide.setPaintTicks(true);
        contrastSlide.setSnapToTicks(false);
        contrastSlide.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent ce) {
                JSlider slider = (JSlider) ce.getSource();
                if (!slider.getValueIsAdjusting()) {
                    int value = slider.getValue();
                    JLabel label = (JLabel) slider.getLabelTable()
                            .get(sliderLabelKey);
                    label.setText("(" + value + ")");
                    setBandHeight(value);
                }
            }
        });
        contrastPanel.add(contrastSlide);
        gridbag.setConstraints(contrastPanel, c);
        panel.add(contrastPanel);

        return panel;
    }
View Full Code Here

    public Component getCustomEditor() {
        JPanel jp = new JPanel();
        textField.addActionListener(this);
        textField.addFocusListener(this);

        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        jp.setLayout(gridbag);

        c.weightx = 1f;
        c.fill = GridBagConstraints.HORIZONTAL;
        gridbag.setConstraints(textField, c);
        jp.add(textField);

        return jp;
    }
View Full Code Here

    /**
     * Hook to allow subclasses to use a different layout than the
     * GridBagLayout. Set the layout on this class in this method.
     */
    protected LayoutManager createLayout() {
        gridbag = new GridBagLayout();
        c = getGridBagConstraints();
        return gridbag;
    }
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(CoordPanel.class, "border", "Decimal Degrees");
        setBorder(new TitledBorder(new EtchedBorder(), locText));

        locText = i18n.get(CoordPanel.class, "latlabel", "Latitude: ");
        JLabel latlabel = new JLabel(locText);
        c.gridx = 0;
        c.gridy = 0;
        gridbag.setConstraints(latlabel, c);
        add(latlabel);

        latitude = new JTextField(10);
        c.gridx = 1;
        c.gridy = 0;
        gridbag.setConstraints(latitude, c);
        add(latitude);

        locText = i18n.get(CoordPanel.class, "lonlabel", "Longitude: ");
        JLabel lonlabel = new JLabel(locText);
        c.gridx = 0;
        c.gridy = 1;
        gridbag.setConstraints(lonlabel, c);
        add(lonlabel);

        longitude = new JTextField(10);
        c.gridx = 1;
        c.gridy = 1;
        gridbag.setConstraints(longitude, c);
        add(longitude);
    }
View Full Code Here

        setKey(defaultKey);
        panDelegate = new PanSupport(this);
        centerDelegate = new CenterSupport(this);

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

        // begin top row
        String info = i18n.get(NavigatePanel.class,
                "panNW.tooltip",
                "Pan Northwest");
        nwButton = getButton(nwName, info, panNWCmd);
        c2.gridx = 0;
        c2.gridy = 0;
        internalGridbag.setConstraints(nwButton, c2);
        panel.add(nwButton);

        info = i18n.get(NavigatePanel.class, "panN.tooltip", "Pan North");
        nButton = getButton(nName, info, panNCmd);
        c2.gridx = 1;
        c2.gridy = 0;
        internalGridbag.setConstraints(nButton, c2);
        panel.add(nButton);

        info = i18n.get(NavigatePanel.class, "panNE.tooltip", "Pan Northeast");
        neButton = getButton(neName, info, panNECmd);
        c2.gridx = 2;
        c2.gridy = 0;
        internalGridbag.setConstraints(neButton, c2);
        panel.add(neButton);

        // begin middle row
        info = i18n.get(NavigatePanel.class, "panW.tooltip", "Pan West");
        wButton = getButton(wName, info, panWCmd);
        c2.gridx = 0;
        c2.gridy = 1;
        internalGridbag.setConstraints(wButton, c2);
        panel.add(wButton);

        info = i18n.get(NavigatePanel.class,
                "center.tooltip",
                "Center Map at Starting Coords");
        cButton = getButton(cName, info, centerCmd);
        c2.gridx = 1;
        c2.gridy = 1;
        internalGridbag.setConstraints(cButton, c2);
        panel.add(cButton);

        info = i18n.get(NavigatePanel.class, "panE.tooltip", "Pan East");
        eButton = getButton(eName, info, panECmd);
        c2.gridx = 2;
        c2.gridy = 1;
        internalGridbag.setConstraints(eButton, c2);
        panel.add(eButton);

        // begin bottom row
        info = i18n.get(NavigatePanel.class, "panSW.tooltip", "Pan Southwest");
        swButton = getButton(swName, info, panSWCmd);
        c2.gridx = 0;
        c2.gridy = 2;
        internalGridbag.setConstraints(swButton, c2);
        panel.add(swButton);

        info = i18n.get(NavigatePanel.class, "panS.tooltip", "Pan South");
        sButton = getButton(sName, info, panSCmd);
        c2.gridx = 1;
        c2.gridy = 2;
        internalGridbag.setConstraints(sButton, c2);
        panel.add(sButton);

        info = i18n.get(NavigatePanel.class, "panSE.tooltip", "Pan Southeast");
        seButton = getButton(seName, info, panSECmd);
        c2.gridx = 2;
        c2.gridy = 2;
        internalGridbag.setConstraints(seButton, c2);
        panel.add(seButton);

        add(panel);
    }
View Full Code Here

        String defaultLayerName = i18n.get(LayerAddPanel.class, "defaultLayerName", DefaultLayerName);
        prefixTextField = new JTextField(defaultLayerName, 12);

        Object[] layerTypes = getLayerClasses().keySet().toArray();
       
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        setLayout(gridbag);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.insets = new Insets(10, 10, 5, 10);
       
        if (layerTypes.length == 0) {
            String message = i18n.get(LayerAddPanel.class,
                    "noLayersAvailableMessage",
                    "No Layers available for creation.");
            JLabel label = new JLabel(message);
            gridbag.setConstraints(label, c);
            add(label);
        } else {
            list = new JComboBox(layerTypes);
           
            gridbag.setConstraints(list, c);
            add(list);
            c.insets = new Insets(5, 10, 10, 10);
            c.gridwidth = GridBagConstraints.RELATIVE;
            gridbag.setConstraints(prefixTextField, c);
            add(prefixTextField);
           
            c.weightx = 0;
            gridbag.setConstraints(configureButton, c);
            add(configureButton);
        }
        invalidate();
    }
View Full Code Here

    targetfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

    GridBagConstraints constraint;

    JPanel pane = new JPanel();
    pane.setLayout(new GridBagLayout());

    JLabel srclbl = new JLabel("Source file/dir:");
    constraint = new GridBagConstraints();
    constraint.gridx = 0;
    constraint.gridy = 0;
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(UTMCoordPanel.class,
                "border",
                "Zone Number|Hemisphere|Easting|Northing");
        setBorder(new TitledBorder(new EtchedBorder(), locText));

        locText = i18n.get(UTMCoordPanel.class, "utmLabel", "UTM: ");
        JLabel utmLabel = new JLabel(locText);
        c.gridx = 0;
        gridbag.setConstraints(utmLabel, c);
        add(utmLabel);

        c.gridx = GridBagConstraints.RELATIVE;
        zoneNumber = new JTextField(3);
        zoneNumber.setToolTipText(i18n.get(UTMCoordPanel.class,
                "zone",
                I18n.TOOLTIP,
                "Zone Number: 1-60"));
        gridbag.setConstraints(zoneNumber, c);
        add(zoneNumber);

        zoneLetter = new JTextField(2);
        zoneLetter.setToolTipText(i18n.get(UTMCoordPanel.class,
                "hemi",
                I18n.TOOLTIP,
                "Hemisphere: N or S"));
        gridbag.setConstraints(zoneLetter, c);
        add(zoneLetter);

        easting = new JTextField(8);
        gridbag.setConstraints(easting, c);
        add(easting);

        northing = new JTextField(8);
        gridbag.setConstraints(northing, c);
        add(northing);
    }
View Full Code Here

TOP

Related Classes of java.awt.GridBagLayout$Grid$GridSide

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.