Statistics
| Revision:

root / trunk / extensions / extCAD / src / com / iver / cit / gvsig / project / documents / view / snapping / gui / DefaultConfigurePanel.java @ 8943

History | View | Annotate | Download (2.94 KB)

1
package com.iver.cit.gvsig.project.documents.view.snapping.gui;
2

    
3
import java.awt.Color;
4
import java.awt.event.ActionListener;
5

    
6
import javax.swing.JButton;
7
import javax.swing.JDialog;
8
import javax.swing.JLabel;
9
import javax.swing.JPanel;
10

    
11
import org.gvsig.gui.beans.AcceptCancelPanel;
12

    
13
import com.iver.andami.PluginServices;
14
import com.iver.andami.ui.mdiManager.IWindow;
15
import com.iver.andami.ui.mdiManager.WindowInfo;
16
import com.iver.cit.gvsig.project.documents.view.snapping.AbstractSnapper;
17
import com.iver.cit.gvsig.project.documents.view.snapping.ISnapper;
18

    
19
public class DefaultConfigurePanel extends JPanel implements IWindow {
20
        private ISnapper snapper;
21
        private JLabel lblColor = null;
22
        private JButton bColor = null;
23
        private WindowInfo wi=null;
24
        private AcceptCancelPanel acceptCancelPanel;
25
        /**
26
         * This is the default constructor
27
         */
28
        public DefaultConfigurePanel() {
29
                super();
30
                initialize();
31
        }
32

    
33
        /**
34
         * This method initializes this
35
         *
36
         * @return void
37
         */
38
        private void initialize() {
39
                lblColor = new JLabel();
40
                lblColor.setText("color");
41
                this.setSize(269, 91);
42
                this.add(lblColor, null);
43
                this.add(getBColor(), null);
44
                this.add(getPAcceptCancel(),null);
45
        }
46
        public void setSnapper(ISnapper snapper) {
47
                this.snapper=snapper;
48
                //((AbstractSnapper)this.snapper).setColor(Color.blue);
49
        }
50

    
51
        /**
52
         * This method initializes bColor
53
         *
54
         * @return javax.swing.JButton
55
         */
56
        private JButton getBColor() {
57
                if (bColor == null) {
58
                        bColor = new JButton();
59
                        bColor.setText("...");
60
                }
61
                return bColor;
62
        }
63

    
64
        protected AcceptCancelPanel getPAcceptCancel() {
65
                if (acceptCancelPanel==null) {
66
                        ActionListener okAction = new java.awt.event.ActionListener() {
67
                                public void actionPerformed(java.awt.event.ActionEvent e) {
68

    
69
                                        if (PluginServices.getMainFrame() == null) {
70
                        ((JDialog) (getParent().getParent().getParent()
71
                                .getParent())).dispose();
72
                    } else {
73
                        PluginServices.getMDIManager().closeWindow(DefaultConfigurePanel.this);
74
                    }
75
                                }
76
                        };
77
                        ActionListener cancelAction = new java.awt.event.ActionListener() {
78
                                public void actionPerformed(java.awt.event.ActionEvent e) {
79
                    if (PluginServices.getMainFrame() != null) {
80
                        PluginServices.getMDIManager().closeWindow(DefaultConfigurePanel.this);
81
                    } else {
82
                        ((JDialog) (getParent().getParent().getParent()
83
                                        .getParent())).dispose();
84
                    }
85
                                }
86
                        };
87
                        acceptCancelPanel=new AcceptCancelPanel(okAction,cancelAction);
88

    
89
                }
90
                return acceptCancelPanel;
91
        }
92

    
93
        public WindowInfo getWindowInfo() {
94
                if (wi==null) {
95
                        wi=new WindowInfo(WindowInfo.MODALDIALOG|WindowInfo.RESIZABLE);
96
                        wi.setWidth(this.getWidth());
97
                        wi.setHeight(this.getHeight());
98
                        wi.setTitle(PluginServices.getText(this,"propiedades"));
99
                }
100
                return wi;
101
        }
102

    
103
}  //  @jve:decl-index=0:visual-constraint="10,10"