Package simtools.ui

Examples of simtools.ui.ImageMapper$ImageEditor


                }
            }
        });
        bnew.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ImageMapper im = ImageMapper.createImageMapperDialog(ImagePropertiesPanel.this.getOwner());
                if (im == null) {
                    return;
                }
                if (ImageMapper.imageMappers == null) {
                    ImageMapper.imageMappers = new Vector();
                }
                if (ImageMapper.imageMappers.contains(im)) {
                    String[] message = new String[] { messageWriter.print1args("ReplaceExistingImageMapperNamed?", im
                            .toString()) };
                    int answer = JOptionPane.showConfirmDialog(ImagePropertiesPanel.this.getOwner(), message,
                            messageWriter.print0args("MapperAlreadyExists!"), JOptionPane.YES_NO_OPTION);
                    if (answer == JOptionPane.YES_OPTION) {
                        // Object.equals is magic...
                        int index = ImageMapper.imageMappers.indexOf(im);
                        ImageMapper.imageMappers.set(index, im);
                        listModel.update();
                        cmlist.setSelectedValue(im, true);
                    }
                    return;
                }
                ImageMapper.imageMappers.add(im);
                listModel.update();
                cmlist.setSelectedValue(im, true);
            }
        });
        bdelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Object o = cmlist.getSelectedValue();
                if (o == null) {
                    return;
                }
                if (ImageMapper.imageMappers != null) {
                    ImageMapper.imageMappers.remove(o);
                }
                listModel.update();
                updateWarnings();
            }
        });
        bdelete.setEnabled(false);
       
        bduplicate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Object o = cmlist.getSelectedValue();
                if ((o == null) || !(o instanceof ImageMapper)) {
                    return;
                }
                try{
                    ImageMapper im =  (ImageMapper)((ImageMapper)o).clone();
                    if (ImageMapper.imageMappers != null) {
                        ImageMapper.imageMappers.add(im);
                    }
                    listModel.update();
                }catch (CloneNotSupportedException cnse){
View Full Code Here

TOP

Related Classes of simtools.ui.ImageMapper$ImageEditor

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.