svn-gvsig-desktop / trunk / extensions / extGraph / src / com / iver / cit / gvsig / graph / gui / wizard / servicearea / ServiceAreaPage2.java @ 17631
History | View | Annotate | Download (5.56 KB)
1 |
package com.iver.cit.gvsig.graph.gui.wizard.servicearea; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
import java.awt.Color; |
5 |
import java.awt.GridLayout; |
6 |
import java.awt.event.ActionEvent; |
7 |
import java.awt.event.ActionListener; |
8 |
import java.awt.event.MouseEvent; |
9 |
import java.awt.event.MouseListener; |
10 |
|
11 |
import javax.swing.ButtonGroup; |
12 |
import javax.swing.JLabel; |
13 |
import javax.swing.JPanel; |
14 |
import javax.swing.JRadioButton; |
15 |
import javax.swing.border.TitledBorder; |
16 |
|
17 |
import jwizardcomponent.JWizardPanel; |
18 |
|
19 |
import com.iver.andami.PluginServices; |
20 |
|
21 |
public class ServiceAreaPage2 extends JWizardPanel implements ActionListener, MouseListener{ |
22 |
|
23 |
private JLabel labelChooseArea; |
24 |
private JPanel panelAreaTypes; |
25 |
private ButtonGroup groupAreaTypes; |
26 |
private JPanel panelAreaTypesCompact; |
27 |
private TitledBorder titledBorderAreaTypesCompact; |
28 |
private JRadioButton radioAreaTypesCompact; |
29 |
private JPanel panelAreaTypesCompactPicture; |
30 |
private JLabel labelAreaTypesCompactPicture; |
31 |
private JPanel panelAreaTypesConvex; |
32 |
private TitledBorder titledBorderAreaTypesConvex; |
33 |
private JRadioButton radioAreaTypesConvex; |
34 |
private JPanel panelAreaTypesConvexPicture; |
35 |
private JLabel labelAreaTypesConvexPicture; |
36 |
|
37 |
/**
|
38 |
*
|
39 |
*/
|
40 |
private static final long serialVersionUID = 5139067753651358490L; |
41 |
|
42 |
private ServiceAreaWizard owner;
|
43 |
|
44 |
public ServiceAreaPage2(ServiceAreaWizard wizard){
|
45 |
super(wizard.getWizardComponents());
|
46 |
this.owner=wizard;
|
47 |
this.initialize();
|
48 |
} |
49 |
|
50 |
private void initialize(){ |
51 |
this.labelChooseArea=new JLabel("<html><b>Escoge el tipo de ?rea:</b></html>", JLabel.LEFT); |
52 |
this.panelAreaTypes=new JPanel(); |
53 |
this.groupAreaTypes=new ButtonGroup(); |
54 |
this.panelAreaTypesCompact=new JPanel(); |
55 |
this.titledBorderAreaTypesCompact=new TitledBorder("?rea compacta"); |
56 |
this.panelAreaTypesCompact.setBorder(this.titledBorderAreaTypesCompact); |
57 |
this.radioAreaTypesCompact=new JRadioButton("<html>?rea compacta</html>"); |
58 |
this.radioAreaTypesCompact.addActionListener(this); |
59 |
this.radioAreaTypesCompact.setSelected(true); |
60 |
this.groupAreaTypes.add(this.radioAreaTypesCompact); |
61 |
this.panelAreaTypesCompactPicture=new JPanel(); |
62 |
this.labelAreaTypesCompactPicture=new JLabel(); |
63 |
this.labelAreaTypesCompactPicture.setOpaque(true); |
64 |
this.labelAreaTypesCompactPicture.setIcon(PluginServices.getIconTheme().get("service_area_compact")); |
65 |
this.labelAreaTypesCompactPicture.setEnabled(true); |
66 |
this.labelAreaTypesCompactPicture.addMouseListener(this); |
67 |
this.panelAreaTypesConvex=new JPanel(); |
68 |
this.titledBorderAreaTypesConvex=new TitledBorder("?rea convexa"); |
69 |
this.panelAreaTypesConvex.setBorder(this.titledBorderAreaTypesConvex); |
70 |
this.radioAreaTypesConvex=new JRadioButton("?rea convexa"); |
71 |
this.radioAreaTypesConvex.addActionListener(this); |
72 |
this.groupAreaTypes.add(this.radioAreaTypesConvex); |
73 |
this.panelAreaTypesConvexPicture=new JPanel(); |
74 |
this.labelAreaTypesConvexPicture=new JLabel(); |
75 |
this.labelAreaTypesConvexPicture.setOpaque(true); |
76 |
this.labelAreaTypesConvexPicture.setBackground(Color.BLUE); |
77 |
this.labelAreaTypesConvexPicture.setIcon(PluginServices.getIconTheme().get("service_area_convex")); |
78 |
this.labelAreaTypesConvexPicture.setEnabled(false); |
79 |
this.labelAreaTypesConvexPicture.addMouseListener(this); |
80 |
|
81 |
this.labelAreaTypesCompactPicture.setSize(this.labelAreaTypesCompactPicture.getIcon().getIconWidth(), this.labelAreaTypesCompactPicture.getIcon().getIconHeight()); |
82 |
this.panelAreaTypesCompactPicture.add(this.labelAreaTypesCompactPicture); |
83 |
this.panelAreaTypesCompactPicture.setSize(this.labelAreaTypesCompactPicture.getSize()); |
84 |
this.panelAreaTypesCompact.setLayout(new GridLayout(2, 1, 7, 7)); |
85 |
this.panelAreaTypesCompact.add(this.radioAreaTypesCompact); |
86 |
this.panelAreaTypesCompact.add(this.panelAreaTypesCompactPicture); |
87 |
|
88 |
this.labelAreaTypesConvexPicture.setSize(this.labelAreaTypesConvexPicture.getIcon().getIconWidth(), this.labelAreaTypesConvexPicture.getIcon().getIconHeight()); |
89 |
this.panelAreaTypesConvexPicture.add(this.labelAreaTypesConvexPicture); |
90 |
this.panelAreaTypesConvexPicture.setSize(this.labelAreaTypesConvexPicture.getSize()); |
91 |
this.panelAreaTypesConvex.setLayout(new GridLayout(2, 1, 7, 7)); |
92 |
this.panelAreaTypesConvex.add(this.radioAreaTypesConvex); |
93 |
this.panelAreaTypesConvex.add(this.panelAreaTypesConvexPicture); |
94 |
|
95 |
this.panelAreaTypes.setLayout(new GridLayout(2, 1, 7, 7)); |
96 |
this.panelAreaTypes.add(this.panelAreaTypesCompact); |
97 |
this.panelAreaTypes.add(this.panelAreaTypesConvex); |
98 |
|
99 |
this.setLayout(new BorderLayout(7, 7)); |
100 |
this.add(this.labelChooseArea, BorderLayout.NORTH); |
101 |
this.add(this.panelAreaTypes, BorderLayout.CENTER); |
102 |
|
103 |
this.radioAreaTypesCompact.doClick();
|
104 |
} |
105 |
|
106 |
public void next(){ |
107 |
super.next();
|
108 |
} |
109 |
|
110 |
public void actionPerformed(ActionEvent e) { |
111 |
if(e.getSource()==this.radioAreaTypesCompact){ |
112 |
this.labelAreaTypesCompactPicture.setEnabled(true); |
113 |
this.labelAreaTypesConvexPicture.setEnabled(false); |
114 |
this.owner.getController().setCompactAreas(true); |
115 |
} |
116 |
else if(e.getSource()==this.radioAreaTypesConvex){ |
117 |
this.labelAreaTypesCompactPicture.setEnabled(false); |
118 |
this.labelAreaTypesConvexPicture.setEnabled(true); |
119 |
this.owner.getController().setCompactAreas(false); |
120 |
} |
121 |
} |
122 |
|
123 |
public void mouseClicked(MouseEvent e) { |
124 |
if(e.getSource()==this.labelAreaTypesCompactPicture){ |
125 |
this.radioAreaTypesCompact.setSelected(true); |
126 |
this.radioAreaTypesCompact.doClick();
|
127 |
} |
128 |
else if(e.getSource()==this.labelAreaTypesConvexPicture){ |
129 |
this.radioAreaTypesConvex.setSelected(true); |
130 |
this.radioAreaTypesConvex.doClick();
|
131 |
} |
132 |
} |
133 |
|
134 |
public void mouseEntered(MouseEvent e) { |
135 |
} |
136 |
|
137 |
public void mouseExited(MouseEvent e) { |
138 |
} |
139 |
|
140 |
public void mousePressed(MouseEvent e) { |
141 |
} |
142 |
|
143 |
public void mouseReleased(MouseEvent e) { |
144 |
} |
145 |
} |