Package com.bbn.openmap.gui

Examples of com.bbn.openmap.gui.GridBagToolBar


        return getPolyGUI(true, true, true);
    }

    public JToolBar getPolyGUI(boolean includeEnclose, boolean includeAdd,
                               boolean includeDelete) {
        JToolBar buttonBox = new GridBagToolBar();

        URL url;
        ImageIcon imageIcon;
        if (polygonButton == null) {
            url = getImageURL("enclosepoly.gif");
            imageIcon = new ImageIcon(url);
            polygonButton = new JToggleButton(imageIcon);
            polygonButton.setToolTipText(i18n.get(EditableOMPoly.class,
                    "polygonButton.tooltip",
                    "Automatically link first and last nodes"));
        }

        polygonButton.setSelected(isEnclosed());
        polygonButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (getStateMachine().getState() instanceof GraphicSelectedState) {
                    enclose(((JToggleButton) e.getSource()).isSelected());
                } else {
                    setEnclosed(((JToggleButton) e.getSource()).isSelected());
                }
            }
        });
        if (includeEnclose) {
            buttonBox.add(polygonButton);
        }

        if (addButton == null) {
            url = getImageURL("addpoint.gif");
            imageIcon = new ImageIcon(url);
            addButton = new JButton(imageIcon);
            addButton.setToolTipText(i18n.get(EditableOMPoly.class,
                    "addButton.tooltip",
                    "Add a node to the polygon"));
        }
        addButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ((PolyStateMachine) stateMachine).setAddNode();
                enablePolygonEditButtons(false);
            }
        });
        addButton.setEnabled(false);
        if (includeAdd) {
            buttonBox.add(addButton);
        }

        if (deleteButton == null) {
            url = getImageURL("deletepoint.gif");
            imageIcon = new ImageIcon(url);
            deleteButton = new JButton(imageIcon);
            deleteButton.setToolTipText(i18n.get(EditableOMPoly.class,
                    "deleteButton.tooltip",
                    "Delete a node from the polygon"));
        }
        deleteButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ((PolyStateMachine) stateMachine).setDeleteNode();
                enablePolygonEditButtons(false);
            }
        });
        deleteButton.setEnabled(false);
        if (includeDelete) {
            buttonBox.add(deleteButton);
        }

        return buttonBox;
    }
View Full Code Here


    protected transient DecimalFormat df = new DecimalFormat();
    protected I18n i18n = Environment.getI18n();

    protected JToolBar getRangeRingGUI() {
        if (rrToolBar == null) {
            rrToolBar = new GridBagToolBar();
            rrToolBar.setFloatable(false);
            rrToolBar.setMargin(new Insets(0, 1, 0, 1));

            configureRangeRings();
            intervalField = makeIntervalField();
View Full Code Here

     *
     * @return String The key for this tool.
     */
    public Container getFace() {
        if (face == null) {
            JToolBar faceTB = new GridBagToolBar();
//            int orientation = ((EditorLayer) getLayer()).getOrientation();
//            faceTB.setOrientation(orientation);

            if (bg == null) {
                bg = new ButtonGroup();
            }

            fillFaceToolBar(faceTB, bg);

            unpickBtn = new JToggleButton("", false);
            unpickBtn.setActionCommand(RESET_CMD);
            unpickBtn.addActionListener(this);
            unpickBtn.setVisible(false);
            bg.add(unpickBtn);
            faceTB.add(unpickBtn);

            if (drawingTool != null && showAttributes) {
//                drawingTool.setOrientation(orientation);
                faceTB.add(drawingTool);
                drawingTool.showPalette();
            }

            face = faceTB;
            face.setVisible(visible);
View Full Code Here

    protected JToolBar pToolBar = null;

    protected JToolBar getPointGUI() {
        if (pToolBar == null) {
            pToolBar = new GridBagToolBar();
            // Add buttons to toggle oval/rect, radius of point.
        }

        return pToolBar;
    }
View Full Code Here

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

            toolbar = new GridBagToolBar();
            gridbag.setConstraints(toolbar, c);
        }

        resetGUI();
        palette.removeAll(); // Remove cruft from past OMGraphics
View Full Code Here

TOP

Related Classes of com.bbn.openmap.gui.GridBagToolBar

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.