📄 t55.java
字号:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import vrml.external.*;
import vrml.external.field.*;
import vrml.external.exception.*;
import vrml.external.Browser;
import vrml.external.Node;
public class t55 extends Applet
{
//图形界面构件
private Label Label10=new Label(" 地台:");
private Button Button33=new Button("默认");
private Label Label11=new Label(" 地板:");
private Choice Choice8=new Choice();
private Scrollbar c1=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,255);
Label rlabel=new Label("R");
private Scrollbar c2=new Scrollbar(Scrollbar.HORIZONTAL,255,1,0,255);
Label glabel=new Label("G");
private Scrollbar c3=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,255);
Label blabel=new Label("B");
private Label Label9=new Label(" 其它装饰:");
private Button Button31=new Button("添加");
private Button Button32=new Button("取消");
private Label Label8=new Label(" 书架:");
private Button Button26=new Button("复位");
private Button Button27=new Button("左移");
private Button Button28=new Button("右移");
private Button Button29=new Button("上移");
private Button Button30=new Button("下移");
private Choice Choice6=new Choice();
private Button Button39=new Button("旋转"); //书架
private Label Label3=new Label(" 茶几:");
private Button Button1=new Button("复位");
private Button Button2=new Button("左移");
private Button Button3=new Button("右移");
private Button Button4=new Button("上移");
private Button Button5=new Button("下移");
private Choice Choice1=new Choice();
private Button Button35=new Button("旋转"); //茶几
private Label Label4=new Label("沙发(上):");
private Button Button6=new Button("复位");
private Button Button7=new Button("左移");
private Button Button8=new Button("右移");
private Button Button9=new Button("上移");
private Button Button10=new Button("下移");
private Choice Choice2=new Choice();
private Button Button34=new Button("旋转");
private Label Label5=new Label("沙发(下):");
private Button Button11=new Button("复位");
private Button Button12=new Button("左移");
private Button Button13=new Button("右移");
private Button Button14=new Button("上移");
private Button Button15=new Button("下移");
private Choice Choice3=new Choice();
private Button Button36=new Button("旋转"); //沙发
private Label Label6=new Label(" 落地灯:");
private Button Button16=new Button("复位");
private Button Button17=new Button("左移");
private Button Button18=new Button("右移");
private Button Button19=new Button("上移");
private Button Button20=new Button("下移");
private Choice Choice4=new Choice();
private Button Button37=new Button("旋转"); //落地灯
private Label Label7=new Label(" 电视机:");
private Button Button21=new Button("复位");
private Button Button22=new Button("左移");
private Button Button23=new Button("右移");
private Button Button24=new Button("上移");
private Button Button25=new Button("下移");
private Choice Choice5=new Choice();
private Button Button38=new Button("旋转");//电视机
private Label Label12=new Label(" 移动步长:");
private Choice Choice10=new Choice();
Browser browser;
private Panel np=new Panel();
private Panel cp=new Panel();
private Panel sp=new Panel();
float[] vcha={51.71f,8.779f,24f};
float[] vsha1={51.71f,8.779f,-4f};
float[] vsha2={51.71f,8.779f,52f};
float[] vdeng={51.71f,30f,67f};
float[] vtv={-80f,20f,50f};
float[] vshu={51.71f,23f,-40f};
float[] rcha={0,1,0,0};
float[] rsha1={0,1,0,0};
float[] rsha2={0,1,0,-3.142f};
float[] rdeng={0,1,0,0};
float[] rtv={0,1,0,0};
float[] rshu={0,1,0,0};
int buchang=1;
Node switch1;
Node translation1;
Node switch2;
Node translation2;
Node switch3;
Node translation3;
Node switch4;
Node translation4;
Node switch5;
Node translation5;
Node switch6;
Node translation6;
Node switch7;
Node ccolor;
Node others;
Node rotation1;
Node rotation2;
Node rotation3;
Node rotation4;
Node rotation5;
Node rotation6;
boolean isScenceLoading=true;
public void start(){
while(isScenceLoading){
try{
browser=Browser.getBrowser(this);
ccolor=(Node)(browser.getNode("ccolor"));
switch1=(Node)(browser.getNode("chastyle"));
translation1=(Node)(browser.getNode("chaji"));
rotation1=(Node)(browser.getNode("chaji"));
switch2=(Node)(browser.getNode("shafa1style"));
translation2=(Node)(browser.getNode("shafa1"));
rotation2=(Node)(browser.getNode("shafa1"));
switch3=(Node)(browser.getNode("shafa2style"));
translation3=(Node)(browser.getNode("shafa2"));
rotation3=(Node)(browser.getNode("shafa2"));
switch4=(Node)(browser.getNode("dengstyle"));
translation4=(Node)(browser.getNode("deng"));
rotation4=(Node)(browser.getNode("deng"));
switch5=(Node)(browser.getNode("tvstyle"));
translation5=(Node)(browser.getNode("tv"));
rotation5=(Node)(browser.getNode("tv"));
switch6=(Node)(browser.getNode("shujiastyle"));
translation6=(Node)(browser.getNode("shujia"));
rotation6=(Node)(browser.getNode("shujia"));
switch7=(Node)(browser.getNode("dibanstyle"));
others=(Node)(browser.getNode("others"));
isScenceLoading=false;
}
catch(Exception e){}
}
}
public void init(){
setLayout(new BorderLayout(5,5));
add("North",np);
np.setBackground(Color.white);
np.add(Label10);
np.add(Button33);
np.add(rlabel);
np.add(c1);
np.add(glabel);
np.add(c2);
np.add(blabel);
np.add(c3);
np.add(Label11);
np.add(Choice8);
Choice8.add("样式1");
Choice8.add("样式2");
Choice8.add("样式3");
Choice8.add("无");
add("Center",cp);
cp.setBackground(Color.white);
cp.add(Label3);
cp.add(Button1);
cp.add(Button2);
cp.add(Button3);
cp.add(Button4);
cp.add(Button5);
cp.add(Button35);
cp.add(Choice1);
Choice1.add("样式1");
Choice1.add("样式2");
Choice1.add("样式3");
Choice1.add("无");
cp.add(Label4);
cp.add(Button6);
cp.add(Button7);
cp.add(Button8);
cp.add(Button9);
cp.add(Button10);
cp.add(Button34);
cp.add(Choice2);
Choice2.add("样式1");
Choice2.add("样式2");
Choice2.add("样式3");
Choice2.add("无");
cp.add(Label5);
cp.add(Button11);
cp.add(Button12);
cp.add(Button13);
cp.add(Button14);
cp.add(Button15);
cp.add(Button36);
cp.add(Choice3);
Choice3.add("样式1");
Choice3.add("样式2");
Choice3.add("样式3");
Choice3.add("无");
cp.add(Label6);
cp.add(Button16);
cp.add(Button17);
cp.add(Button18);
cp.add(Button19);
cp.add(Button20);
cp.add(Button37);
cp.add(Choice4);
Choice4.add("样式1");
Choice4.add("样式2");
Choice4.add("样式3");
Choice4.add("无");
cp.add(Label7);
cp.add(Button21);
cp.add(Button22);
cp.add(Button23);
cp.add(Button24);
cp.add(Button25);
cp.add(Button38);
cp.add(Choice5);
Choice5.add("样式1");
Choice5.add("样式2");
Choice5.add("样式3");
Choice5.add("无");
cp.add(Label8);
cp.add(Button26);
cp.add(Button27);
cp.add(Button28);
cp.add(Button29);
cp.add(Button30);
cp.add(Button39);
cp.add(Choice6);
Choice6.add("样式1");
Choice6.add("样式2");
Choice6.add("样式3");
Choice6.add("无");
add("South",sp);
sp.add(Label12);
sp.add(Choice10);
Choice10.add("1");
Choice10.add("2");
Choice10.add("3");
Choice10.add("4");
Choice10.add("5");
sp.add(Label9);
sp.add(Button31);
sp.add(Button32);
show();
}
public boolean handleEvent(Event event) {
if (event.target instanceof Scrollbar) {
colorChange();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button31) {
clickedBtnClick31();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button32) {
clickedBtnClick32();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button33) {
clickedBtnClick33();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button34) {
clickedBtnClick34();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button35) {
clickedBtnClick35();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button36) {
clickedBtnClick36();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button37) {
clickedBtnClick37();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button38) {
clickedBtnClick38();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button39) {
clickedBtnClick39();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Choice8) {
chooseBtnClick8();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button1) {
clickedBtnClick1();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button2) {
clickedBtnClick2();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button3) {
clickedBtnClick3();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button4) {
clickedBtnClick4();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button5) {
clickedBtnClick5();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Choice1) {
chooseBtnClick1();
return true;
}//茶几
if (event.id == Event.ACTION_EVENT && event.target == Button6) {
clickedBtnClick6();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button7) {
clickedBtnClick7();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button8) {
clickedBtnClick8();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button9) {
clickedBtnClick9();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button10) {
clickedBtnClick10();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Choice2) {
chooseBtnClick2();
return true;
}//沙发上
if (event.id == Event.ACTION_EVENT && event.target == Button11) {
clickedBtnClick11();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button12) {
clickedBtnClick12();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button13) {
clickedBtnClick13();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button14) {
clickedBtnClick14();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Button15) {
clickedBtnClick15();
return true;
}
if (event.id == Event.ACTION_EVENT && event.target == Choice3) {
chooseBtnClick3();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -