Revision 15139
import/ext3D/trunk/ext3D/src/com/iver/ai2/gvsig3d/gui/TransparencyPanel.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import java.awt.Color; |
44 | 44 |
import java.awt.Dimension; |
45 |
import java.awt.Image; |
|
45 | 46 |
import java.awt.Insets; |
46 | 47 |
import java.awt.event.ActionEvent; |
47 | 48 |
import java.awt.event.ActionListener; |
48 |
import java.awt.event.MouseAdapter; |
|
49 | 49 |
|
50 | 50 |
import javax.swing.AbstractAction; |
51 | 51 |
import javax.swing.Action; |
52 | 52 |
import javax.swing.BorderFactory; |
53 |
import javax.swing.ImageIcon; |
|
53 | 54 |
import javax.swing.JCheckBox; |
54 | 55 |
import javax.swing.JLabel; |
55 | 56 |
import javax.swing.JSlider; |
... | ... | |
60 | 61 |
import org.gvsig.gui.beans.swing.JButton; |
61 | 62 |
|
62 | 63 |
import com.iver.ai2.gvsig3d.ProjectView3D; |
63 |
import com.iver.ai2.gvsig3d.map3d.layers.FLayers3D; |
|
64 | 64 |
import com.iver.ai2.gvsig3d.map3d.layers.Layer3DProps; |
65 | 65 |
import com.iver.andami.PluginServices; |
66 | 66 |
import com.iver.andami.ui.mdiManager.SingletonWindow; |
67 | 67 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
68 | 68 |
import com.iver.cit.gvsig.fmap.MapContext; |
69 | 69 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
70 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
71 |
import com.iver.cit.gvsig.fmap.layers.FLyrWMS; |
|
72 | 70 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
73 | 71 |
|
74 |
import es.upv.ai2.libjosg.planets.Planet.PlanetType; |
|
75 |
|
|
76 | 72 |
/** |
77 | 73 |
* Dialogo donde se muestran las propiedades de una vista |
78 | 74 |
* |
... | ... | |
104 | 100 |
private Layer3DProps layer3DProps; |
105 | 101 |
|
106 | 102 |
private float opacity; |
107 |
|
|
103 |
|
|
108 | 104 |
private float opacityTemp; |
109 | 105 |
|
110 | 106 |
private boolean refreshDirec; |
... | ... | |
132 | 128 |
// && (selectedExtent[0] instanceof FLyrVect)) { |
133 | 129 |
if (selectedExtent.length == 1 && selectedExtent[0].isAvailable()) { |
134 | 130 |
|
135 |
if (selectedExtent[0] instanceof FLyrVect) { |
|
136 |
FLyrVect lyr3D = (FLyrVect) selectedExtent[0];
|
|
137 |
layer3DProps = Layer3DProps.getLayer3DProps(lyr3D);
|
|
138 |
} |
|
139 |
if (selectedExtent[0] instanceof FLyrWMS) { |
|
140 |
FLyrWMS lyr3D = (FLyrWMS) selectedExtent[0];
|
|
141 |
layer3DProps = Layer3DProps.getLayer3DProps(lyr3D);
|
|
142 |
} |
|
131 |
// if (selectedExtent[0] instanceof FLyrVect) {
|
|
132 |
// FLyrVect lyr3D = (FLyrVect) selectedExtent[0];
|
|
133 |
// layer3DProps = Layer3DProps.getLayer3DProps(lyr3D);
|
|
134 |
// }
|
|
135 |
// if (selectedExtent[0] instanceof FLyrWMS) {
|
|
136 |
// FLyrWMS lyr3D = (FLyrWMS) selectedExtent[0];
|
|
137 |
// layer3DProps = Layer3DProps.getLayer3DProps(lyr3D);
|
|
138 |
// }
|
|
143 | 139 |
|
140 |
FLayer lyr3D = (FLayer) selectedExtent[0]; |
|
141 |
layer3DProps = Layer3DProps.getLayer3DProps(lyr3D); |
|
142 |
|
|
144 | 143 |
// Getting selected layer |
145 | 144 |
// FLyrVect lyr3D = (FLyrVect) selectedExtent[0]; |
146 | 145 |
// FLayer lyr3D = (FLayer) selectedExtent[0]; |
... | ... | |
149 | 148 |
opacity = layer3DProps.getOpacity(); |
150 | 149 |
opacityTemp = opacity; |
151 | 150 |
order = layer3DProps.getOrder(); |
152 |
|
|
153 | 151 |
|
154 | 152 |
} |
155 | 153 |
|
... | ... | |
172 | 170 |
|
173 | 171 |
this.addComponent(getSliderTrans(), new Insets(5, 35, 5, 5)); |
174 | 172 |
this.addComponent(getLblColor(), new Insets(5, 90, 5, 5)); |
173 |
// this.addComponent(getLblColor(),getSliderTrans()); |
|
175 | 174 |
|
176 | 175 |
this.addComponent(getCheckBox(), new Insets(2, 5, 2, 5)); |
177 | 176 |
// Accept buton |
... | ... | |
191 | 190 |
} |
192 | 191 |
}; |
193 | 192 |
checkBox = new JCheckBox(action); |
194 |
checkBox.setText(PluginServices.getText(this, "Refresh_automaticaly")); |
|
193 |
checkBox.setText(PluginServices.getText(this, |
|
194 |
"Refresh_automaticaly")); |
|
195 | 195 |
} |
196 | 196 |
return checkBox; |
197 | 197 |
} |
... | ... | |
234 | 234 |
if (lblColor == null) { |
235 | 235 |
lblColor = new javax.swing.JLabel(); |
236 | 236 |
lblColor.setText(""); |
237 |
|
|
238 |
lblColor.setPreferredSize(new java.awt.Dimension(100, 100)); |
|
237 |
// ImageIcon ico = new ImageIcon(getClass().getClassLoader() |
|
238 |
// .getResource("images/logo3D_es.png")); |
|
239 |
// Image a = ico.getImage(); |
|
240 |
// |
|
241 |
// lblColor.setIcon(ico); |
|
242 |
|
|
243 |
lblColor.setPreferredSize(new java.awt.Dimension(100,100)); |
|
239 | 244 |
Color theColor = new Color(0.0f, 0.0f, 0.0f, opacity); |
240 | 245 |
lblColor.setBorder(BorderFactory.createLineBorder(Color.black)); |
241 | 246 |
if (theColor == null) |
... | ... | |
280 | 285 |
}; |
281 | 286 |
cancelAction = new java.awt.event.ActionListener() { |
282 | 287 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
283 |
// Setting opaciti in layer properties
|
|
288 |
// Setting opaciti in layer properties
|
|
284 | 289 |
layer3DProps.setOpacity(opacityTemp); |
285 | 290 |
// Notify the opacity to planet |
286 | 291 |
view3D.getPlanet().setTextureOpacity(order, opacityTemp); |
Also available in: Unified diff