Package simtools.ui

Examples of simtools.ui.GridBagPanel


        spiHistSize = new JSpinner(spiModelHistSize);
        spiHistSize.setPreferredSize(new Dimension(120, 20));
        historyTextPanel = new JPanel();
       
        // Create panel
        GridBagPanel historyPanel = new GridBagPanel();
        GridBagPanel historySizePanel = new GridBagPanel();
        historySizePanel.addOnCurrentRow(lhistorySize);
        historySizePanel.addOnCurrentRow(spiHistSize);
        historySizePanel.carriageReturn();
        historyPanel.addOnCurrentRow(historySizePanel, 1, true, false, true);
        historyPanel.addOnCurrentRow(historyTextPanel, 1, true, true, true);
        return historyPanel;
    }
View Full Code Here


        headerPanel.setTitle(resources.getString("pageSetup"));  
        headerPanel.displayInfo(resources.getString("pageSetupTip"));
        content.add(headerPanel, BorderLayout.NORTH);

        // Inner panel
        GridBagPanel pageSetupPanel = new GridBagPanel();
        GridBagPanel pageModePanel = new GridBagPanel();
        GridBagPanel pageFormatPanel = new GridBagPanel( resources.getStringValue("pageFormat"));
 
        // Mode
        normalView = resources.getRadioButton("layoutMode", this);
        printView = resources.getRadioButton("pageMode", this);
        normalView.setSelected(false);
        printView.setSelected(false);
       
        ButtonGroup modeGroup = new ButtonGroup();
        modeGroup.add(normalView);
        modeGroup.add(printView);

        pageModePanel.addOnCurrentRow(normalView);
        pageModePanel.carriageReturn();
        pageModePanel.addOnCurrentRow(printView);
        pageModePanel.carriageReturn();
               
        // Format
        paperFormatList = new JComboBox( pageFormats );
        paperFormatList.addActionListener(this);
       
        SpinnerNumberModel heightSpi = new SpinnerNumberModel();
        heightSpi.setStepSize(new Integer(1));
        heightSpi.setMinimum(new Integer(50));
        heightSpi.setMaximum(new Integer(10000));
        heightSpi.setValue(new Integer(1));
        height = new JSpinner(heightSpi);
       
        SpinnerNumberModel widthSpi = new SpinnerNumberModel();
        widthSpi.setStepSize(new Integer(1));
        widthSpi.setMinimum(new Integer(50));
        widthSpi.setMaximum(new Integer(10000));
        widthSpi.setValue(new Integer(1));
        width = new JSpinner(widthSpi);

        lformat = resources.getLabel("format");
        pageFormatPanel.addOnCurrentRow(lformat);
        pageFormatPanel.addOnCurrentRow(paperFormatList);


        portrait = resources.getRadioButton("portrait", this);
        landscape = resources.getRadioButton("landscape", this);
        portrait.setSelected(false);
        landscape.setSelected(false);
       
      /*  orientationGroup = new ButtonGroup();
        orientationGroup.add(portrait);
        orientationGroup.add(landscape);*/

        pageFormatPanel.addOnCurrentRow(portrait);
        pageFormatPanel.addOnCurrentRow(landscape);
        pageFormatPanel.carriageReturn();
        lwidth = resources.getLabel("width");
        pageFormatPanel.addOnCurrentRow(lwidth);
        pageFormatPanel.addOnCurrentRow(width);
        pageFormatPanel.carriageReturn();
       
        lheight = resources.getLabel("height");
        pageFormatPanel.addOnCurrentRow(lheight);
        pageFormatPanel.addOnCurrentRow(height);
        pageFormatPanel.carriageReturn();
       

        // Add all panels
        pageSetupPanel.addOnCurrentRow(pageModePanel, 3, true, true, true);
        pageSetupPanel.addOnCurrentRow(pageFormatPanel, 3, true, true, false);
View Full Code Here

    public TextPropertiesPanel(boolean showTransform, String shapeName) {
        super(false, true, true, showTransform, shapeName);
        source = null;
        tfText = new JTextField("");
        fontChooserPanel = new FontChooserPanel(this, simtools.shapes.AbstractShape.FONT_NAMES, tfText);
        dynamicDataPanel = new GridBagPanel(resources.getString("DynamicData"));
        textSizePanel = new GridBagPanel(resources.getString("TextSize"));
       
        // Create contents
        setTextSizePanel();
        setDynamicDataSource();
     
View Full Code Here

        // JSYnoptic formater
        lformatdigits = new JLabel(resources.getString("DecimalDigits:"));
        nfformat = new NumberField(0, 3);
        nfformat.setColumns(10);
        nfformat.setHorizontalAlignment(SwingConstants.RIGHT);
        GridBagPanel digitsPanel = new GridBagPanel();
        digitsPanel.addOnCurrentRow(lformatdigits);
        digitsPanel.addOnCurrentRow(nfformat);
        digitsPanel.carriageReturn();
        cards.add(digitsPanel, "jsynopticFormat");
        // Printf Formater
        GridBagPanel printfPanel = new GridBagPanel();
        lPrintfFormat = new JLabel(resources.getString("PrintfFormat"));
        tfPrintfFormat = new JTextField(10);
        printfPanel.addOnCurrentRow(lPrintfFormat);
        printfPanel.addOnCurrentRow(tfPrintfFormat);
        printfPanel.carriageReturn();
        cards.add(printfPanel, "printfFormat");
        cards.add(new GridBagPanel(), "noAttributes");
        // Mapper
        cbxmapper = new JComboBox();
        cbxmapper.addItem(resources.getString("=======NONE======="));
        int idx = 0;
        if (TextMapper.textMappers != null) {
            for (int i = 0; i < TextMapper.textMappers.size(); ++i) {
                TextMapper tm = (TextMapper) TextMapper.textMappers.get(i);
                if (tm.equals(mapper)) {
                    idx = i + 1;
                }
                cbxmapper.addItem(tm);
            }
        }
        cbxmapper.setEditable(false);
        cbxmapper.setSelectedIndex(idx);
        beditmapper = new JButton(resources.getString("Edit"));
        bnewmapper = new JButton(resources.getString("New"));
        bdelmapper = new JButton(resources.getString("Delete"));
        bduplicateMapper = new JButton(resources.getString("Duplicate"));
        if (idx == 0) {
            beditmapper.setEnabled(false);
            bdelmapper.setEnabled(false);
            bduplicateMapper.setEnabled(false);
        }
        cbxmapper.setRenderer(new ListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                    boolean cellHasFocus) {
                String s = value.toString();
                if (s.length() > 18) {
                    s = s.substring(0, 15) + "...";
                }
                return new JLabel(s);
            }
        });
        beditmapper.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (mapper == null) {
                    return;
                }
                mapper.editDialog(TextPropertiesPanel.this.getOwner());
                cbxmapper.repaint(); // in case of name change
            }
        });
        bnewmapper.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                mapper = TextMapper.createTextMapperDialog(TextPropertiesPanel.this.getOwner());
                if (TextMapper.textMappers == null) {
                    TextMapper.textMappers = new Vector();
                }
                TextMapper.textMappers.add(mapper);
                cbxmapper.addItem(mapper);
                cbxmapper.setSelectedItem(mapper);
                cards.revalidate();
            }
        });
        bdelmapper.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (mapper == null) {
                    return;
                }
                if (TextMapper.textMappers != null) {
                    TextMapper.textMappers.remove(mapper);
                }
                cbxmapper.removeItem(mapper);
                cbxmapper.setSelectedIndex(0);
                mapper = null;
                bdelmapper.setEnabled(false);
                bduplicateMapper.setEnabled(false);
                beditmapper.setEnabled(false);
            }
        });
       
        bduplicateMapper.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (mapper == null) {
                    return;
                }
                try {
                    TextMapper tm =  (TextMapper)((TextMapper)mapper).clone();
                    if (TextMapper.textMappers != null) {
                        TextMapper.textMappers.add(tm);
                    }
                    mapper = tm;
                    cbxmapper.addItem(mapper);
                    cbxmapper.setSelectedItem(mapper);
                   
                }catch (CloneNotSupportedException cnse){
                }
            }
        });
       
        cbxmapper.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int idx = cbxmapper.getSelectedIndex();
                if (idx == 0) {
                    beditmapper.setEnabled(false);
                    bdelmapper.setEnabled(false);
                    bduplicateMapper.setEnabled(false);
                    mapper = null;
                } else {
                    mapper = (TextMapper) cbxmapper.getItemAt(idx);
                    beditmapper.setEnabled(true);
                    bdelmapper.setEnabled(true);
                    bduplicateMapper.setEnabled(true);
                }
            }
        });
        GridBagPanel mapperPanel = new GridBagPanel();
        mapperPanel.addOnCurrentRow(cbxmapper, 2);
        mapperPanel.addOnCurrentRow(beditmapper);
        mapperPanel.addOnCurrentRow(bnewmapper);
        mapperPanel.addOnCurrentRow(bdelmapper);
        mapperPanel.addOnCurrentRow(bduplicateMapper);
        mapperPanel.carriageReturn();
        cards.add(mapperPanel, "mapper");
        CardLayout cl = (CardLayout) (cards.getLayout());
        if (cbxformat.getSelectedIndex() == TextShape.FORMAT_MAPPER) {
            cl.show(cards, "mapper");
        } else {
View Full Code Here

        taPoints.setText("");
        taPoints.setRows(5);
        JScrollPane jscPoints = new JScrollPane(taPoints);
        cbClose = new JCheckBox(resources.getString("CloseLine"), false);
        // Create line panel
        GridBagPanel linePanel = new GridBagPanel(resources.getString("Line"));
        linePanel.addOnCurrentRow(lpoints);
        linePanel.carriageReturn();
        linePanel.addOnCurrentRow(jscPoints, 1, true, true, true);
        linePanel.addOnCurrentRow(cbClose);
        return linePanel;
    }
View Full Code Here

        spiHistSize.setPreferredSize(new Dimension(120, 20));
        
        textPropertiesPanel= createTextPropertiesPanel(false, Builtin.resources.getString("History"));
       
        // Create panel
        GridBagPanel historyPanel = new GridBagPanel();
        GridBagPanel historySizePanel = new GridBagPanel();
        historySizePanel.addOnCurrentRow(lhistorySize);
        historySizePanel.addOnCurrentRow(spiHistSize);
        historySizePanel.carriageReturn();
       
        historyPanel.addOnCurrentRow(historySizePanel, 1, true, false, true);
        historyPanel.addOnCurrentRow(textPropertiesPanel, 1, true, true, true);
        return historyPanel;
    }
View Full Code Here

        }
        return res;
    }
   
    private void createPanel(){
        _panel=new GridBagPanel();
        _tf=new JTextField[_nbrPoints][];
        for(int i=0;i<_nbrPoints;i++){
            _tf[i]=new JTextField[3];
            _panel.addOnCurrentRow(new JLabel("P"+i)); // TODO i18N
            _panel.addOnCurrentRow(_tf[i][0]=new JTextField(""+defaultValues[i][0],NDIGIT));
View Full Code Here

        return _result;
    }
   
    private void createPanel(){
        Result r=new Result();
        _panel=new GridBagPanel();
        _panel.addOnCurrentRow(new JLabel("Radius")); // TODO i18N
        _panel.addOnCurrentRow(_tfR=new JTextField(""+r.radius,PointsDialog.NDIGIT));
        _panel.carriageReturn();
        _panel.addOnCurrentRow(new JLabel("Up")); // TODO i18N
        _panel.addOnCurrentRow(_cbUp=new JCheckBox());
View Full Code Here

                            .editDialog(ImagePropertiesPanel.this.getOwner());
                }
            }
        });
        // Create panels
        staticImagePanel = new GridBagPanel();
        staticImagePanel.addOnCurrentRow(bChoose, 2);
        staticImagePanel.addOnCurrentRow(lstatic);
        staticImagePanel.carriageReturn();
        staticImagePanel.addOnCurrentRow(rbFit, 2);
        staticImagePanel.addOnCurrentRow(rbResize, 2);
        staticImagePanel.carriageReturn();
       
        dynamicImagePanel = new GridBagPanel(resources.getString("UseDynamicImages"));
        dynamicImagePanel.addOnCurrentRow(cbDynamic, 4);
        dynamicImagePanel.addOnCurrentRow(lds, 4);
        dynamicImagePanel.carriageReturn();
        dynamicImagePanel.addOnCurrentRow(lcolorMapper, 4);
        dynamicImagePanel.addOnCurrentRow(lchooseDs, 4);
        dynamicImagePanel.carriageReturn();
        dynamicImagePanel.addOnCurrentRow(cmlistScrollPane, 4, true, true, false);
        dynamicImagePanel.addOnCurrentRow(dstree, 4, true, true, true);
        dynamicImagePanel.addOnCurrentRow(bnew);
        dynamicImagePanel.addOnCurrentRow(bdelete);
        dynamicImagePanel.addOnCurrentRow(bduplicate);
        GridBagPanel imagePanel = new GridBagPanel();
        imagePanel.addOnCurrentRow(staticImagePanel, 1, false, false, true);
        imagePanel.addOnCurrentRow(dynamicImagePanel, 1, true, true, true);// TODO
        return imagePanel;
    }
View Full Code Here

        nfmin.setColumns(20);
       
        nfmax = new NumberField(1.);
        nfmax.setColumns(20);
       
        GridBagPanel rectanglePanel = new GridBagPanel(resources.getString("DynamicFill"));
        rectanglePanel.addOnCurrentRow(cbProg, 2);
        rectanglePanel.carriageReturn();
        rectanglePanel.addOnCurrentRow(dstreeProg, 5, true, true, true); // full
       
        // line
        GridBagPanel linePanel = new GridBagPanel();
        linePanel.addOnCurrentRow(new JLabel(resources.getString("ProgressSourceMin")));
        linePanel.addOnCurrentRow(nfmin);
        linePanel.addOnCurrentRow(new JLabel(resources.getString("ProgressSourceMax")));
        linePanel.addOnCurrentRow(nfmax);
        linePanel.carriageReturn();
              
        rectanglePanel.addOnCurrentRow(linePanel, 5, false, false, true); // full

        return rectanglePanel;
    }
View Full Code Here

TOP

Related Classes of simtools.ui.GridBagPanel

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.