-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChangeDNAColorCubeAppearance.java
More file actions
31 lines (30 loc) · 1.39 KB
/
Copy pathChangeDNAColorCubeAppearance.java
File metadata and controls
31 lines (30 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import javax.media.j3d.Appearance;
import javax.media.j3d.TransparencyAttributes;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by lenovo on 10/2/2014.
*/
public class ChangeDNAColorCubeAppearance implements ActionListener {
@Override
public void actionPerformed(ActionEvent e){
Appearance normalAppearance= new Appearance();
Appearance transparentApearance = new Appearance();
TransparencyAttributes transparencyAttributes = new TransparencyAttributes(TransparencyAttributes.NICEST,0.8f);
transparentApearance.setTransparencyAttributes( transparencyAttributes );
if(!MainFrame.isAppearanceTransparent){
MainFrame.isAppearanceTransparent=true;
for (int i = 0; i < CanvasActionListener.colorCubeArrayList.size(); i++) {
DNAColorCube pickedCube = CanvasActionListener.colorCubeArrayList.get(i).canvasDNAColorCube;
pickedCube.setAppearance(transparentApearance);
}
}else{
MainFrame.isAppearanceTransparent=false;
for (int i = 0; i < CanvasActionListener.colorCubeArrayList.size(); i++) {
DNAColorCube pickedCube = CanvasActionListener.colorCubeArrayList.get(i).canvasDNAColorCube;
pickedCube.setAppearance(normalAppearance);
}
}
}
}