Simulasi Lift Java Graphics
Simulasi Lift dengan Java Graphics, tugas kuliah yang materi yang berhubungan sama semulasi lift dan atau yang berhubungan dengan itu ga pernah di ajarin, makanya bikin kodenya sejadi jadinya / seadanya, jadi memanjang dan melebar ga karuan, program ini kalau di run outoutnya hanya animasi lift yang bergerak ke atas dan ke bawah, tapi kodenya puanjang sekali.
.
Bisa juga di buat dengan menggunakan JButton, jadi JButton di buat jadi angkanya, jika di klik maka akan menjalankan liftnya sesuai dengan nilai dari JButton , maka liftnya akan ke atas atau ke bawah.
.
yang di butuhkan dari java class Graphics2d
.
Sedikit kan ?, sekarang coba lihat selanjutnya kita buat method untuk membuat lift,panah naik-turun dan pintu lift setiap lantai :)
lihat jumlah barisnya .... fiiuuhhh ...
.
oke, kita lihat kode buat method pertama, method untuk membuat tampilan seluruh lift saat lift berhenti :
man, the fun has just begun ....
Selanjutnya membuat lift di lantai satu aktiv, buat berwarna...
.
buat sampai enam kali tapi dengan posisi warna pada pintu lift dan tombol berada di posisi lantai selanjutnya, karena jumlah lantainya ada 6, untuk bergerak turun juga dengan kode yang mirip, kodenya banyak sekali karena membuat grafiknya pergaris, entah bisa atau tidak pakai looping saya belom coba ...
yang di atas saja belum bisa jalan / bergerak liftnya, biar bisa bergerak tambahin kode setelah initComponents ga sebanyak yang di atas sii ...
.
supaya bergerak buat kode di bawah sebanyak screenshoot di atas ...
yang ijo itu method untuk membuat lift di lantai 1, yang merah itu waktu berapa lama animasi berjalan.
Thats all.
Bisa juga di buat dengan menggunakan JButton, jadi JButton di buat jadi angkanya, jika di klik maka akan menjalankan liftnya sesuai dengan nilai dari JButton , maka liftnya akan ke atas atau ke bawah.
.
yang di butuhkan dari java class Graphics2d
.
Sedikit kan ?, sekarang coba lihat selanjutnya kita buat method untuk membuat lift,panah naik-turun dan pintu lift setiap lantai :)
lihat jumlah barisnya .... fiiuuhhh ...
.
oke, kita lihat kode buat method pertama, method untuk membuat tampilan seluruh lift saat lift berhenti :
//====================== lift berhenti =======================//
//pintu 6 kiri
public void paint(Graphics g){
Graphics2D gd = (Graphics2D)g;
gd.setColor(Color.red);
super.paint(g);
//pintu kiri
GeneralPath gp = new GeneralPath();
gp.moveTo(160, 80); gp.lineTo(220, 80); gp.lineTo(220, 160); gp.lineTo(160, 160); gp.lineTo(160, 80);
gp.moveTo(160, 180); gp.lineTo(220, 180); gp.lineTo(220, 260); gp.lineTo(160, 260); gp.lineTo(160, 180);
gp.moveTo(160, 280); gp.lineTo(220, 280); gp.lineTo(220, 360); gp.lineTo(160, 360); gp.lineTo(160, 280);
gp.moveTo(160, 380); gp.lineTo(220, 380);gp.lineTo(220, 460);gp.lineTo(160, 460);gp.lineTo(160, 380);
gp.moveTo(160, 480);gp.lineTo(220, 480);gp.lineTo(220, 560);gp.lineTo(160, 560);gp.lineTo(160, 480);
gp.moveTo(160, 580);gp.lineTo(220, 580);gp.lineTo(220, 660);gp.lineTo(160, 660);gp.lineTo(160, 580);
//pintu kanan
gp.moveTo(360, 80); gp.lineTo(420, 80); gp.lineTo(420, 160); gp.lineTo(360, 160); gp.lineTo(360, 80);
gp.moveTo(360, 180); gp.lineTo(420, 180); gp.lineTo(420, 260); gp.lineTo(360, 260); gp.lineTo(360, 180);
gp.moveTo(360, 280); gp.lineTo(420, 280); gp.lineTo(420, 360); gp.lineTo(360, 360); gp.lineTo(360, 280);
gp.moveTo(360, 380); gp.lineTo(420, 380);gp.lineTo(420, 460);gp.lineTo(360, 460);gp.lineTo(360, 380);
gp.moveTo(360, 480);gp.lineTo(420, 480);gp.lineTo(420, 560);gp.lineTo(360, 560);gp.lineTo(360, 480);
gp.moveTo(360, 580);gp.lineTo(420, 580);gp.lineTo(420, 660);gp.lineTo(360, 660);gp.lineTo(360, 580);
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//kotak angka kiri
gp.moveTo(80, 80);gp.lineTo(100, 80);gp.lineTo(100, 100);gp.lineTo(80, 100);gp.lineTo(80, 80); //1
gp.moveTo(100, 80);gp.lineTo(120, 80);gp.lineTo(120, 100);gp.lineTo(100, 100);gp.lineTo(100, 80);//2
gp.moveTo(80, 100);gp.lineTo(100, 100);gp.lineTo(100, 120);gp.lineTo(80, 120);gp.lineTo(80, 100); //3
gp.moveTo(100, 100);gp.lineTo(120, 100);gp.lineTo(120, 120);gp.lineTo(100, 120);gp.lineTo(100, 100);//4
gp.moveTo(80, 120);gp.lineTo(100, 120);gp.lineTo(100, 140);gp.lineTo(80, 140);gp.lineTo(80, 120); //5
gp.moveTo(100, 120);gp.lineTo(120, 120);gp.lineTo(120, 140);gp.lineTo(100, 140);gp.lineTo(100, 120);//6
gp.moveTo(80, 140);gp.lineTo(100, 140);gp.lineTo(100, 160);gp.lineTo(80, 160);gp.lineTo(80, 140); //<
gp.moveTo(100, 140);gp.lineTo(120, 140);gp.lineTo(120, 160);gp.lineTo(100, 160);gp.lineTo(100, 140); //x
//angka
gd.drawString("1", 85, 95);gd.drawString("2", 105, 95);
gd.drawString("3", 85, 115);gd.drawString("4", 105, 115);
gd.drawString("5", 85, 135);gd.drawString("6", 105, 135);
gd.drawString("<", 85, 155);gd.drawString("X", 105, 155);
//kotak angka L5
gp.moveTo(80, 175);gp.lineTo(100, 175);gp.lineTo(100, 195);gp.lineTo(80, 195);gp.lineTo(80, 175); //1
gp.moveTo(100, 175);gp.lineTo(120, 175);gp.lineTo(120, 195);gp.lineTo(100, 195);gp.lineTo(100, 175);//2
gp.moveTo(80, 195);gp.lineTo(100, 195);gp.lineTo(100, 215);gp.lineTo(80, 215);gp.lineTo(80, 195); //3
gp.moveTo(100, 195);gp.lineTo(120, 195);gp.lineTo(120, 215);gp.lineTo(100, 215);gp.lineTo(100, 195);//4
gp.moveTo(80, 215);gp.lineTo(100, 215);gp.lineTo(100, 235);gp.lineTo(80, 235);gp.lineTo(80, 215); //5
gp.moveTo(100, 215);gp.lineTo(120, 215);gp.lineTo(120, 235);gp.lineTo(100, 235);gp.lineTo(100, 215);//6
gp.moveTo(80, 235);gp.lineTo(100, 235);gp.lineTo(100, 255);gp.lineTo(80, 255);gp.lineTo(80, 235); //<
gp.moveTo(100, 235);gp.lineTo(120, 235);gp.lineTo(120, 255);gp.lineTo(100, 255);gp.lineTo(100, 235); //x
gd.drawString("1", 85, 190);gd.drawString("2", 105, 190);
gd.drawString("3", 85, 210);gd.drawString("4", 105,210);
gd.drawString("5", 85, 230);gd.drawString("6", 105, 230);
gd.drawString("<", 85, 250);gd.drawString("X", 105, 250);
//L4
//kotak angka L4
gp.moveTo(80, 275);gp.lineTo(100, 275);gp.lineTo(100, 295);gp.lineTo(80, 295);gp.lineTo(80, 275); //1
gp.moveTo(100, 275);gp.lineTo(120, 275);gp.lineTo(120, 295);gp.lineTo(100, 295);gp.lineTo(100, 275);//2
gp.moveTo(80, 295);gp.lineTo(100, 295);gp.lineTo(100, 315);gp.lineTo(80, 315);gp.lineTo(80, 295); //3
gp.moveTo(100, 295);gp.lineTo(120, 295);gp.lineTo(120, 315);gp.lineTo(100, 315);gp.lineTo(100, 295);//4
gp.moveTo(80, 315);gp.lineTo(100, 315);gp.lineTo(100, 335);gp.lineTo(80, 335);gp.lineTo(80, 315); //5
gp.moveTo(100, 315);gp.lineTo(120, 315);gp.lineTo(120, 335);gp.lineTo(100, 335);gp.lineTo(100, 315);//6
gp.moveTo(80, 335);gp.lineTo(100, 335);gp.lineTo(100, 355);gp.lineTo(80, 355);gp.lineTo(80, 335); //<
gp.moveTo(100, 335);gp.lineTo(120, 335);gp.lineTo(120, 355);gp.lineTo(100, 355);gp.lineTo(100, 335); //x
gd.drawString("1", 85, 290);gd.drawString("2", 105, 290);
gd.drawString("3", 85, 310);gd.drawString("4", 105,310);
gd.drawString("5", 85, 330);gd.drawString("6", 105, 330);
gd.drawString("<", 85, 350);gd.drawString("X", 105, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(80, 375);gp.lineTo(100, 375);gp.lineTo(100, 395);gp.lineTo(80, 395);gp.lineTo(80, 375); //1
gp.moveTo(100, 375);gp.lineTo(120, 375);gp.lineTo(120, 395);gp.lineTo(100, 395);gp.lineTo(100, 375);//2
gp.moveTo(80, 395);gp.lineTo(100, 395);gp.lineTo(100, 415);gp.lineTo(80, 415);gp.lineTo(80, 395); //3
gp.moveTo(100, 395);gp.lineTo(120, 395);gp.lineTo(120, 415);gp.lineTo(100, 415);gp.lineTo(100, 395);//4
gp.moveTo(80, 415);gp.lineTo(100, 415);gp.lineTo(100, 435);gp.lineTo(80, 435);gp.lineTo(80, 415); //5
gp.moveTo(100, 415);gp.lineTo(120, 415);gp.lineTo(120, 435);gp.lineTo(100, 435);gp.lineTo(100, 415);//6
gp.moveTo(80, 435);gp.lineTo(100, 435);gp.lineTo(100, 455);gp.lineTo(80, 455);gp.lineTo(80, 435); //<
gp.moveTo(100, 435);gp.lineTo(120, 435);gp.lineTo(120, 455);gp.lineTo(100, 455);gp.lineTo(100, 435); //x
gd.drawString("1", 85, 390);gd.drawString("2", 105, 390);
gd.drawString("3", 85, 410);gd.drawString("4", 105,410);
gd.drawString("5", 85, 430);gd.drawString("6", 105, 430);
gd.drawString("<", 85, 450);gd.drawString("X", 105, 450);
//L2 ======================================================================L2
gp.moveTo(80, 475);gp.lineTo(100, 475);gp.lineTo(100, 495);gp.lineTo(80, 495);gp.lineTo(80, 475); //1
gp.moveTo(100, 475);gp.lineTo(120, 475);gp.lineTo(120, 495);gp.lineTo(100, 495);gp.lineTo(100, 475);//2
gp.moveTo(80, 495);gp.lineTo(100, 495);gp.lineTo(100, 515);gp.lineTo(80, 515);gp.lineTo(80, 495); //3
gp.moveTo(100, 495);gp.lineTo(120, 495);gp.lineTo(120, 515);gp.lineTo(100, 515);gp.lineTo(100, 495);//4
gp.moveTo(80, 515);gp.lineTo(100, 515);gp.lineTo(100, 535);gp.lineTo(80, 535);gp.lineTo(80, 515); //5
gp.moveTo(100, 515);gp.lineTo(120, 515);gp.lineTo(120, 535);gp.lineTo(100, 535);gp.lineTo(100, 515);//6
gp.moveTo(80, 535);gp.lineTo(100, 535);gp.lineTo(100, 555);gp.lineTo(80, 555);gp.lineTo(80, 535); //<
gp.moveTo(100, 535);gp.lineTo(120, 535);gp.lineTo(120, 555);gp.lineTo(100, 555);gp.lineTo(100, 535); //x
gd.drawString("1", 85, 490);gd.drawString("2", 105, 490);
gd.drawString("3", 85, 510);gd.drawString("4", 105,510);
gd.drawString("5", 85, 530);gd.drawString("6", 105, 530);
gd.drawString("<", 85, 550);gd.drawString("X", 105, 550);
//=================================================================L1
gp.moveTo(80, 575);gp.lineTo(100, 575);gp.lineTo(100, 595);gp.lineTo(80, 595);gp.lineTo(80, 575); //1
gp.moveTo(100, 575);gp.lineTo(120, 575);gp.lineTo(120, 595);gp.lineTo(100, 595);gp.lineTo(100, 575);//2
gp.moveTo(80, 595);gp.lineTo(100, 595);gp.lineTo(100, 615);gp.lineTo(80, 615);gp.lineTo(80, 595); //3
gp.moveTo(100, 595);gp.lineTo(120, 595);gp.lineTo(120, 615);gp.lineTo(100, 615);gp.lineTo(100, 595);//4
gp.moveTo(80, 615);gp.lineTo(100, 615);gp.lineTo(100, 635);gp.lineTo(80, 635);gp.lineTo(80, 615); //5
gp.moveTo(100, 615);gp.lineTo(120, 615);gp.lineTo(120, 635);gp.lineTo(100, 635);gp.lineTo(100, 615);//6
gp.moveTo(80, 635);gp.lineTo(100, 635);gp.lineTo(100, 655);gp.lineTo(80, 655);gp.lineTo(80, 635); //<
gp.moveTo(100, 635);gp.lineTo(120, 635);gp.lineTo(120, 655);gp.lineTo(100, 655);gp.lineTo(100, 635); //x
gd.drawString("1", 85, 590);gd.drawString("2", 105, 590);
gd.drawString("3", 85, 610);gd.drawString("4", 105,610);
gd.drawString("5", 85, 630);gd.drawString("6", 105, 630);
gd.drawString("<", 85, 650);gd.drawString("X", 105, 650);
//========================================================================================================
//========================================================================================================
//===================================== KOTAK KANAN ======================================================
//========================================================================================================
//========================================================================================================
//kotak angka kiri
gp.moveTo(450, 80);gp.lineTo(470, 80);gp.lineTo(470, 100);gp.lineTo(450, 100);gp.lineTo(450, 80); //1
gp.moveTo(470, 80);gp.lineTo(490, 80);gp.lineTo(490, 100);gp.lineTo(470, 100);gp.lineTo(470, 80);//2
gp.moveTo(450, 100);gp.lineTo(470, 100);gp.lineTo(470, 120);gp.lineTo(450, 120);gp.lineTo(450, 100); //3
gp.moveTo(470, 100);gp.lineTo(490, 100);gp.lineTo(490, 120);gp.lineTo(470, 120);gp.lineTo(470, 100);//4
gp.moveTo(450, 120);gp.lineTo(470, 120);gp.lineTo(470, 140);gp.lineTo(450, 140);gp.lineTo(450, 120); //5
gp.moveTo(470, 120);gp.lineTo(490, 120);gp.lineTo(490, 140);gp.lineTo(470, 140);gp.lineTo(470, 120);//6
gp.moveTo(450, 140);gp.lineTo(470, 140);gp.lineTo(470, 160);gp.lineTo(450, 160);gp.lineTo(450, 140); //<
gp.moveTo(470, 140);gp.lineTo(490, 140);gp.lineTo(490, 160);gp.lineTo(470, 160);gp.lineTo(470, 140); //x
//angka
gd.drawString("1", 460, 95);gd.drawString("2", 475, 95);
gd.drawString("3", 460, 115);gd.drawString("4", 475, 115);
gd.drawString("5", 460, 135);gd.drawString("6", 475, 135);
gd.drawString("<", 460, 155);gd.drawString("X", 475, 155);
//kotak angka L5
gp.moveTo(450, 175);gp.lineTo(470, 175);gp.lineTo(470, 195);gp.lineTo(450, 195);gp.lineTo(450, 175); //1
gp.moveTo(470, 175);gp.lineTo(490, 175);gp.lineTo(490, 195);gp.lineTo(470, 195);gp.lineTo(470, 175);//2
gp.moveTo(450, 195);gp.lineTo(470, 195);gp.lineTo(470, 215);gp.lineTo(450, 215);gp.lineTo(450, 195); //3
gp.moveTo(470, 195);gp.lineTo(490, 195);gp.lineTo(490, 215);gp.lineTo(470, 215);gp.lineTo(470, 195);//4
gp.moveTo(450, 215);gp.lineTo(470, 215);gp.lineTo(470, 235);gp.lineTo(450, 235);gp.lineTo(450, 215); //5
gp.moveTo(470, 215);gp.lineTo(490, 215);gp.lineTo(490, 235);gp.lineTo(470, 235);gp.lineTo(470, 215);//6
gp.moveTo(450, 235);gp.lineTo(470, 235);gp.lineTo(470, 255);gp.lineTo(450, 255);gp.lineTo(450, 235); //<
gp.moveTo(470, 235);gp.lineTo(490, 235);gp.lineTo(490, 255);gp.lineTo(470, 255);gp.lineTo(470, 235); //x
gd.drawString("1", 460, 190);gd.drawString("2", 475, 190);
gd.drawString("3", 460, 210);gd.drawString("4", 475,210);
gd.drawString("5", 460, 230);gd.drawString("6", 475, 230);
gd.drawString("<", 460, 250);gd.drawString("X", 475, 250);
//L4
//kotak angka L4
gp.moveTo(450, 275);gp.lineTo(470, 275);gp.lineTo(470, 295);gp.lineTo(450, 295);gp.lineTo(450, 275); //1
gp.moveTo(470, 275);gp.lineTo(490, 275);gp.lineTo(490, 295);gp.lineTo(470, 295);gp.lineTo(470, 275);//2
gp.moveTo(450, 295);gp.lineTo(470, 295);gp.lineTo(470, 315);gp.lineTo(450, 315);gp.lineTo(450, 295); //3
gp.moveTo(470, 295);gp.lineTo(490, 295);gp.lineTo(490, 315);gp.lineTo(470, 315);gp.lineTo(470, 295);//4
gp.moveTo(450, 315);gp.lineTo(470, 315);gp.lineTo(470, 335);gp.lineTo(450, 335);gp.lineTo(450, 315); //5
gp.moveTo(470, 315);gp.lineTo(490, 315);gp.lineTo(490, 335);gp.lineTo(470, 335);gp.lineTo(470, 315);//6
gp.moveTo(450, 335);gp.lineTo(470, 335);gp.lineTo(470, 355);gp.lineTo(450, 355);gp.lineTo(450, 335); //<
gp.moveTo(470, 335);gp.lineTo(490, 335);gp.lineTo(490, 355);gp.lineTo(470, 355);gp.lineTo(470, 335); //x
gd.drawString("1", 460, 290);gd.drawString("2", 475, 290);
gd.drawString("3", 460, 310);gd.drawString("4", 475,310);
gd.drawString("5", 460, 330);gd.drawString("6", 475, 330);
gd.drawString("<", 460, 350);gd.drawString("X", 475, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(450, 375);gp.lineTo(470, 375);gp.lineTo(470, 395);gp.lineTo(450, 395);gp.lineTo(450, 375); //1
gp.moveTo(470, 375);gp.lineTo(490, 375);gp.lineTo(490, 395);gp.lineTo(470, 395);gp.lineTo(470, 375);//2
gp.moveTo(450, 395);gp.lineTo(470, 395);gp.lineTo(470, 415);gp.lineTo(450, 415);gp.lineTo(450, 395); //3
gp.moveTo(470, 395);gp.lineTo(490, 395);gp.lineTo(490, 415);gp.lineTo(470, 415);gp.lineTo(470, 395);//4
gp.moveTo(450, 415);gp.lineTo(470, 415);gp.lineTo(470, 435);gp.lineTo(450, 435);gp.lineTo(450, 415); //5
gp.moveTo(470, 415);gp.lineTo(490, 415);gp.lineTo(490, 435);gp.lineTo(470, 435);gp.lineTo(470, 415);//6
gp.moveTo(450, 435);gp.lineTo(470, 435);gp.lineTo(470, 455);gp.lineTo(450, 455);gp.lineTo(450, 435); //<
gp.moveTo(470, 435);gp.lineTo(490, 435);gp.lineTo(490, 455);gp.lineTo(470, 455);gp.lineTo(470, 435); //x
gd.drawString("1", 460, 390);gd.drawString("2", 475, 390);
gd.drawString("3", 460, 410);gd.drawString("4", 475,410);
gd.drawString("5", 460, 430);gd.drawString("6", 475, 430);
gd.drawString("<", 460, 450);gd.drawString("X", 475, 450);
//L2 ======================================================================L2
gp.moveTo(450, 475);gp.lineTo(470, 475);gp.lineTo(470, 495);gp.lineTo(450, 495);gp.lineTo(450, 475); //1
gp.moveTo(470, 475);gp.lineTo(490, 475);gp.lineTo(490, 495);gp.lineTo(470, 495);gp.lineTo(470, 475);//2
gp.moveTo(450, 495);gp.lineTo(470, 495);gp.lineTo(470, 515);gp.lineTo(450, 515);gp.lineTo(450, 495); //3
gp.moveTo(470, 495);gp.lineTo(490, 495);gp.lineTo(490, 515);gp.lineTo(470, 515);gp.lineTo(470, 495);//4
gp.moveTo(450, 515);gp.lineTo(470, 515);gp.lineTo(470, 535);gp.lineTo(450, 535);gp.lineTo(450, 515); //5
gp.moveTo(470, 515);gp.lineTo(490, 515);gp.lineTo(490, 535);gp.lineTo(470, 535);gp.lineTo(470, 515);//6
gp.moveTo(450, 535);gp.lineTo(470, 535);gp.lineTo(470, 555);gp.lineTo(450, 555);gp.lineTo(450, 535); //<
gp.moveTo(470, 535);gp.lineTo(490, 535);gp.lineTo(490, 555);gp.lineTo(470, 555);gp.lineTo(470, 535); //x
gd.drawString("1", 460, 490);gd.drawString("2", 475, 490);
gd.drawString("3", 460, 510);gd.drawString("4", 475,510);
gd.drawString("5", 460, 530);gd.drawString("6", 475, 530);
gd.drawString("<", 460, 550);gd.drawString("X", 475, 550);
//=================================================================L1
gp.moveTo(450, 575);gp.lineTo(470, 575);gp.lineTo(470, 595);gp.lineTo(450, 595);gp.lineTo(450, 575); //1
gp.moveTo(470, 575);gp.lineTo(490, 575);gp.lineTo(490, 595);gp.lineTo(470, 595);gp.lineTo(470, 575);//2
gp.moveTo(450, 595);gp.lineTo(470, 595);gp.lineTo(470, 615);gp.lineTo(450, 615);gp.lineTo(450, 595); //3
gp.moveTo(470, 595);gp.lineTo(490, 595);gp.lineTo(490, 615);gp.lineTo(470, 615);gp.lineTo(470, 595);//4
gp.moveTo(450, 615);gp.lineTo(470, 615);gp.lineTo(470, 635);gp.lineTo(450, 635);gp.lineTo(450, 615); //5
gp.moveTo(470, 615);gp.lineTo(490, 615);gp.lineTo(490, 635);gp.lineTo(470, 635);gp.lineTo(470, 615);//6
gp.moveTo(450, 635);gp.lineTo(470, 635);gp.lineTo(470, 655);gp.lineTo(450, 655);gp.lineTo(450, 635); //<
gp.moveTo(470, 635);gp.lineTo(490, 635);gp.lineTo(490, 655);gp.lineTo(470, 655);gp.lineTo(470, 635); //x
gd.drawString("1", 460, 590);gd.drawString("2", 475, 590);
gd.drawString("3", 460, 610);gd.drawString("4", 475,610);
gd.drawString("5", 460, 630);gd.drawString("6", 475, 630);
gd.drawString("<", 460, 650);gd.drawString("X", 475, 650);
gp.moveTo(280, 120);gp.lineTo(300, 120);gp.lineTo(290, 135);gp.lineTo(280, 120);
gp.moveTo(280, 210);gp.lineTo(300, 210);gp.lineTo(290, 195);gp.lineTo(280, 210);
gp.moveTo(280, 220);gp.lineTo(300,220);gp.lineTo(290, 235);gp.lineTo(280, 220);
gp.moveTo(280, 310);gp.lineTo(300,310);gp.lineTo(290, 295);gp.lineTo(280, 310);
gp.moveTo(280, 320);gp.lineTo(300,320);gp.lineTo(290, 335);gp.lineTo(280, 320);
gp.moveTo(280, 410);gp.lineTo(300,410);gp.lineTo(290, 395);gp.lineTo(280, 410);
gp.moveTo(280, 420);gp.lineTo(300,420);gp.lineTo(290, 435);gp.lineTo(280, 420);
gp.moveTo(280, 510);gp.lineTo(300,510);gp.lineTo(290, 495);gp.lineTo(280, 510);
gp.moveTo(280, 520);gp.lineTo(300,520);gp.lineTo(290, 535);gp.lineTo(280, 520);
gp.moveTo(280, 610);gp.lineTo(300,610);gp.lineTo(290, 595);gp.lineTo(280, 610);
gd.draw(gp);
}
.//pintu 6 kiri
public void paint(Graphics g){
Graphics2D gd = (Graphics2D)g;
gd.setColor(Color.red);
super.paint(g);
//pintu kiri
GeneralPath gp = new GeneralPath();
gp.moveTo(160, 80); gp.lineTo(220, 80); gp.lineTo(220, 160); gp.lineTo(160, 160); gp.lineTo(160, 80);
gp.moveTo(160, 180); gp.lineTo(220, 180); gp.lineTo(220, 260); gp.lineTo(160, 260); gp.lineTo(160, 180);
gp.moveTo(160, 280); gp.lineTo(220, 280); gp.lineTo(220, 360); gp.lineTo(160, 360); gp.lineTo(160, 280);
gp.moveTo(160, 380); gp.lineTo(220, 380);gp.lineTo(220, 460);gp.lineTo(160, 460);gp.lineTo(160, 380);
gp.moveTo(160, 480);gp.lineTo(220, 480);gp.lineTo(220, 560);gp.lineTo(160, 560);gp.lineTo(160, 480);
gp.moveTo(160, 580);gp.lineTo(220, 580);gp.lineTo(220, 660);gp.lineTo(160, 660);gp.lineTo(160, 580);
//pintu kanan
gp.moveTo(360, 80); gp.lineTo(420, 80); gp.lineTo(420, 160); gp.lineTo(360, 160); gp.lineTo(360, 80);
gp.moveTo(360, 180); gp.lineTo(420, 180); gp.lineTo(420, 260); gp.lineTo(360, 260); gp.lineTo(360, 180);
gp.moveTo(360, 280); gp.lineTo(420, 280); gp.lineTo(420, 360); gp.lineTo(360, 360); gp.lineTo(360, 280);
gp.moveTo(360, 380); gp.lineTo(420, 380);gp.lineTo(420, 460);gp.lineTo(360, 460);gp.lineTo(360, 380);
gp.moveTo(360, 480);gp.lineTo(420, 480);gp.lineTo(420, 560);gp.lineTo(360, 560);gp.lineTo(360, 480);
gp.moveTo(360, 580);gp.lineTo(420, 580);gp.lineTo(420, 660);gp.lineTo(360, 660);gp.lineTo(360, 580);
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//kotak angka kiri
gp.moveTo(80, 80);gp.lineTo(100, 80);gp.lineTo(100, 100);gp.lineTo(80, 100);gp.lineTo(80, 80); //1
gp.moveTo(100, 80);gp.lineTo(120, 80);gp.lineTo(120, 100);gp.lineTo(100, 100);gp.lineTo(100, 80);//2
gp.moveTo(80, 100);gp.lineTo(100, 100);gp.lineTo(100, 120);gp.lineTo(80, 120);gp.lineTo(80, 100); //3
gp.moveTo(100, 100);gp.lineTo(120, 100);gp.lineTo(120, 120);gp.lineTo(100, 120);gp.lineTo(100, 100);//4
gp.moveTo(80, 120);gp.lineTo(100, 120);gp.lineTo(100, 140);gp.lineTo(80, 140);gp.lineTo(80, 120); //5
gp.moveTo(100, 120);gp.lineTo(120, 120);gp.lineTo(120, 140);gp.lineTo(100, 140);gp.lineTo(100, 120);//6
gp.moveTo(80, 140);gp.lineTo(100, 140);gp.lineTo(100, 160);gp.lineTo(80, 160);gp.lineTo(80, 140); //<
gp.moveTo(100, 140);gp.lineTo(120, 140);gp.lineTo(120, 160);gp.lineTo(100, 160);gp.lineTo(100, 140); //x
//angka
gd.drawString("1", 85, 95);gd.drawString("2", 105, 95);
gd.drawString("3", 85, 115);gd.drawString("4", 105, 115);
gd.drawString("5", 85, 135);gd.drawString("6", 105, 135);
gd.drawString("<", 85, 155);gd.drawString("X", 105, 155);
//kotak angka L5
gp.moveTo(80, 175);gp.lineTo(100, 175);gp.lineTo(100, 195);gp.lineTo(80, 195);gp.lineTo(80, 175); //1
gp.moveTo(100, 175);gp.lineTo(120, 175);gp.lineTo(120, 195);gp.lineTo(100, 195);gp.lineTo(100, 175);//2
gp.moveTo(80, 195);gp.lineTo(100, 195);gp.lineTo(100, 215);gp.lineTo(80, 215);gp.lineTo(80, 195); //3
gp.moveTo(100, 195);gp.lineTo(120, 195);gp.lineTo(120, 215);gp.lineTo(100, 215);gp.lineTo(100, 195);//4
gp.moveTo(80, 215);gp.lineTo(100, 215);gp.lineTo(100, 235);gp.lineTo(80, 235);gp.lineTo(80, 215); //5
gp.moveTo(100, 215);gp.lineTo(120, 215);gp.lineTo(120, 235);gp.lineTo(100, 235);gp.lineTo(100, 215);//6
gp.moveTo(80, 235);gp.lineTo(100, 235);gp.lineTo(100, 255);gp.lineTo(80, 255);gp.lineTo(80, 235); //<
gp.moveTo(100, 235);gp.lineTo(120, 235);gp.lineTo(120, 255);gp.lineTo(100, 255);gp.lineTo(100, 235); //x
gd.drawString("1", 85, 190);gd.drawString("2", 105, 190);
gd.drawString("3", 85, 210);gd.drawString("4", 105,210);
gd.drawString("5", 85, 230);gd.drawString("6", 105, 230);
gd.drawString("<", 85, 250);gd.drawString("X", 105, 250);
//L4
//kotak angka L4
gp.moveTo(80, 275);gp.lineTo(100, 275);gp.lineTo(100, 295);gp.lineTo(80, 295);gp.lineTo(80, 275); //1
gp.moveTo(100, 275);gp.lineTo(120, 275);gp.lineTo(120, 295);gp.lineTo(100, 295);gp.lineTo(100, 275);//2
gp.moveTo(80, 295);gp.lineTo(100, 295);gp.lineTo(100, 315);gp.lineTo(80, 315);gp.lineTo(80, 295); //3
gp.moveTo(100, 295);gp.lineTo(120, 295);gp.lineTo(120, 315);gp.lineTo(100, 315);gp.lineTo(100, 295);//4
gp.moveTo(80, 315);gp.lineTo(100, 315);gp.lineTo(100, 335);gp.lineTo(80, 335);gp.lineTo(80, 315); //5
gp.moveTo(100, 315);gp.lineTo(120, 315);gp.lineTo(120, 335);gp.lineTo(100, 335);gp.lineTo(100, 315);//6
gp.moveTo(80, 335);gp.lineTo(100, 335);gp.lineTo(100, 355);gp.lineTo(80, 355);gp.lineTo(80, 335); //<
gp.moveTo(100, 335);gp.lineTo(120, 335);gp.lineTo(120, 355);gp.lineTo(100, 355);gp.lineTo(100, 335); //x
gd.drawString("1", 85, 290);gd.drawString("2", 105, 290);
gd.drawString("3", 85, 310);gd.drawString("4", 105,310);
gd.drawString("5", 85, 330);gd.drawString("6", 105, 330);
gd.drawString("<", 85, 350);gd.drawString("X", 105, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(80, 375);gp.lineTo(100, 375);gp.lineTo(100, 395);gp.lineTo(80, 395);gp.lineTo(80, 375); //1
gp.moveTo(100, 375);gp.lineTo(120, 375);gp.lineTo(120, 395);gp.lineTo(100, 395);gp.lineTo(100, 375);//2
gp.moveTo(80, 395);gp.lineTo(100, 395);gp.lineTo(100, 415);gp.lineTo(80, 415);gp.lineTo(80, 395); //3
gp.moveTo(100, 395);gp.lineTo(120, 395);gp.lineTo(120, 415);gp.lineTo(100, 415);gp.lineTo(100, 395);//4
gp.moveTo(80, 415);gp.lineTo(100, 415);gp.lineTo(100, 435);gp.lineTo(80, 435);gp.lineTo(80, 415); //5
gp.moveTo(100, 415);gp.lineTo(120, 415);gp.lineTo(120, 435);gp.lineTo(100, 435);gp.lineTo(100, 415);//6
gp.moveTo(80, 435);gp.lineTo(100, 435);gp.lineTo(100, 455);gp.lineTo(80, 455);gp.lineTo(80, 435); //<
gp.moveTo(100, 435);gp.lineTo(120, 435);gp.lineTo(120, 455);gp.lineTo(100, 455);gp.lineTo(100, 435); //x
gd.drawString("1", 85, 390);gd.drawString("2", 105, 390);
gd.drawString("3", 85, 410);gd.drawString("4", 105,410);
gd.drawString("5", 85, 430);gd.drawString("6", 105, 430);
gd.drawString("<", 85, 450);gd.drawString("X", 105, 450);
//L2 ======================================================================L2
gp.moveTo(80, 475);gp.lineTo(100, 475);gp.lineTo(100, 495);gp.lineTo(80, 495);gp.lineTo(80, 475); //1
gp.moveTo(100, 475);gp.lineTo(120, 475);gp.lineTo(120, 495);gp.lineTo(100, 495);gp.lineTo(100, 475);//2
gp.moveTo(80, 495);gp.lineTo(100, 495);gp.lineTo(100, 515);gp.lineTo(80, 515);gp.lineTo(80, 495); //3
gp.moveTo(100, 495);gp.lineTo(120, 495);gp.lineTo(120, 515);gp.lineTo(100, 515);gp.lineTo(100, 495);//4
gp.moveTo(80, 515);gp.lineTo(100, 515);gp.lineTo(100, 535);gp.lineTo(80, 535);gp.lineTo(80, 515); //5
gp.moveTo(100, 515);gp.lineTo(120, 515);gp.lineTo(120, 535);gp.lineTo(100, 535);gp.lineTo(100, 515);//6
gp.moveTo(80, 535);gp.lineTo(100, 535);gp.lineTo(100, 555);gp.lineTo(80, 555);gp.lineTo(80, 535); //<
gp.moveTo(100, 535);gp.lineTo(120, 535);gp.lineTo(120, 555);gp.lineTo(100, 555);gp.lineTo(100, 535); //x
gd.drawString("1", 85, 490);gd.drawString("2", 105, 490);
gd.drawString("3", 85, 510);gd.drawString("4", 105,510);
gd.drawString("5", 85, 530);gd.drawString("6", 105, 530);
gd.drawString("<", 85, 550);gd.drawString("X", 105, 550);
//=================================================================L1
gp.moveTo(80, 575);gp.lineTo(100, 575);gp.lineTo(100, 595);gp.lineTo(80, 595);gp.lineTo(80, 575); //1
gp.moveTo(100, 575);gp.lineTo(120, 575);gp.lineTo(120, 595);gp.lineTo(100, 595);gp.lineTo(100, 575);//2
gp.moveTo(80, 595);gp.lineTo(100, 595);gp.lineTo(100, 615);gp.lineTo(80, 615);gp.lineTo(80, 595); //3
gp.moveTo(100, 595);gp.lineTo(120, 595);gp.lineTo(120, 615);gp.lineTo(100, 615);gp.lineTo(100, 595);//4
gp.moveTo(80, 615);gp.lineTo(100, 615);gp.lineTo(100, 635);gp.lineTo(80, 635);gp.lineTo(80, 615); //5
gp.moveTo(100, 615);gp.lineTo(120, 615);gp.lineTo(120, 635);gp.lineTo(100, 635);gp.lineTo(100, 615);//6
gp.moveTo(80, 635);gp.lineTo(100, 635);gp.lineTo(100, 655);gp.lineTo(80, 655);gp.lineTo(80, 635); //<
gp.moveTo(100, 635);gp.lineTo(120, 635);gp.lineTo(120, 655);gp.lineTo(100, 655);gp.lineTo(100, 635); //x
gd.drawString("1", 85, 590);gd.drawString("2", 105, 590);
gd.drawString("3", 85, 610);gd.drawString("4", 105,610);
gd.drawString("5", 85, 630);gd.drawString("6", 105, 630);
gd.drawString("<", 85, 650);gd.drawString("X", 105, 650);
//========================================================================================================
//========================================================================================================
//===================================== KOTAK KANAN ======================================================
//========================================================================================================
//========================================================================================================
//kotak angka kiri
gp.moveTo(450, 80);gp.lineTo(470, 80);gp.lineTo(470, 100);gp.lineTo(450, 100);gp.lineTo(450, 80); //1
gp.moveTo(470, 80);gp.lineTo(490, 80);gp.lineTo(490, 100);gp.lineTo(470, 100);gp.lineTo(470, 80);//2
gp.moveTo(450, 100);gp.lineTo(470, 100);gp.lineTo(470, 120);gp.lineTo(450, 120);gp.lineTo(450, 100); //3
gp.moveTo(470, 100);gp.lineTo(490, 100);gp.lineTo(490, 120);gp.lineTo(470, 120);gp.lineTo(470, 100);//4
gp.moveTo(450, 120);gp.lineTo(470, 120);gp.lineTo(470, 140);gp.lineTo(450, 140);gp.lineTo(450, 120); //5
gp.moveTo(470, 120);gp.lineTo(490, 120);gp.lineTo(490, 140);gp.lineTo(470, 140);gp.lineTo(470, 120);//6
gp.moveTo(450, 140);gp.lineTo(470, 140);gp.lineTo(470, 160);gp.lineTo(450, 160);gp.lineTo(450, 140); //<
gp.moveTo(470, 140);gp.lineTo(490, 140);gp.lineTo(490, 160);gp.lineTo(470, 160);gp.lineTo(470, 140); //x
//angka
gd.drawString("1", 460, 95);gd.drawString("2", 475, 95);
gd.drawString("3", 460, 115);gd.drawString("4", 475, 115);
gd.drawString("5", 460, 135);gd.drawString("6", 475, 135);
gd.drawString("<", 460, 155);gd.drawString("X", 475, 155);
//kotak angka L5
gp.moveTo(450, 175);gp.lineTo(470, 175);gp.lineTo(470, 195);gp.lineTo(450, 195);gp.lineTo(450, 175); //1
gp.moveTo(470, 175);gp.lineTo(490, 175);gp.lineTo(490, 195);gp.lineTo(470, 195);gp.lineTo(470, 175);//2
gp.moveTo(450, 195);gp.lineTo(470, 195);gp.lineTo(470, 215);gp.lineTo(450, 215);gp.lineTo(450, 195); //3
gp.moveTo(470, 195);gp.lineTo(490, 195);gp.lineTo(490, 215);gp.lineTo(470, 215);gp.lineTo(470, 195);//4
gp.moveTo(450, 215);gp.lineTo(470, 215);gp.lineTo(470, 235);gp.lineTo(450, 235);gp.lineTo(450, 215); //5
gp.moveTo(470, 215);gp.lineTo(490, 215);gp.lineTo(490, 235);gp.lineTo(470, 235);gp.lineTo(470, 215);//6
gp.moveTo(450, 235);gp.lineTo(470, 235);gp.lineTo(470, 255);gp.lineTo(450, 255);gp.lineTo(450, 235); //<
gp.moveTo(470, 235);gp.lineTo(490, 235);gp.lineTo(490, 255);gp.lineTo(470, 255);gp.lineTo(470, 235); //x
gd.drawString("1", 460, 190);gd.drawString("2", 475, 190);
gd.drawString("3", 460, 210);gd.drawString("4", 475,210);
gd.drawString("5", 460, 230);gd.drawString("6", 475, 230);
gd.drawString("<", 460, 250);gd.drawString("X", 475, 250);
//L4
//kotak angka L4
gp.moveTo(450, 275);gp.lineTo(470, 275);gp.lineTo(470, 295);gp.lineTo(450, 295);gp.lineTo(450, 275); //1
gp.moveTo(470, 275);gp.lineTo(490, 275);gp.lineTo(490, 295);gp.lineTo(470, 295);gp.lineTo(470, 275);//2
gp.moveTo(450, 295);gp.lineTo(470, 295);gp.lineTo(470, 315);gp.lineTo(450, 315);gp.lineTo(450, 295); //3
gp.moveTo(470, 295);gp.lineTo(490, 295);gp.lineTo(490, 315);gp.lineTo(470, 315);gp.lineTo(470, 295);//4
gp.moveTo(450, 315);gp.lineTo(470, 315);gp.lineTo(470, 335);gp.lineTo(450, 335);gp.lineTo(450, 315); //5
gp.moveTo(470, 315);gp.lineTo(490, 315);gp.lineTo(490, 335);gp.lineTo(470, 335);gp.lineTo(470, 315);//6
gp.moveTo(450, 335);gp.lineTo(470, 335);gp.lineTo(470, 355);gp.lineTo(450, 355);gp.lineTo(450, 335); //<
gp.moveTo(470, 335);gp.lineTo(490, 335);gp.lineTo(490, 355);gp.lineTo(470, 355);gp.lineTo(470, 335); //x
gd.drawString("1", 460, 290);gd.drawString("2", 475, 290);
gd.drawString("3", 460, 310);gd.drawString("4", 475,310);
gd.drawString("5", 460, 330);gd.drawString("6", 475, 330);
gd.drawString("<", 460, 350);gd.drawString("X", 475, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(450, 375);gp.lineTo(470, 375);gp.lineTo(470, 395);gp.lineTo(450, 395);gp.lineTo(450, 375); //1
gp.moveTo(470, 375);gp.lineTo(490, 375);gp.lineTo(490, 395);gp.lineTo(470, 395);gp.lineTo(470, 375);//2
gp.moveTo(450, 395);gp.lineTo(470, 395);gp.lineTo(470, 415);gp.lineTo(450, 415);gp.lineTo(450, 395); //3
gp.moveTo(470, 395);gp.lineTo(490, 395);gp.lineTo(490, 415);gp.lineTo(470, 415);gp.lineTo(470, 395);//4
gp.moveTo(450, 415);gp.lineTo(470, 415);gp.lineTo(470, 435);gp.lineTo(450, 435);gp.lineTo(450, 415); //5
gp.moveTo(470, 415);gp.lineTo(490, 415);gp.lineTo(490, 435);gp.lineTo(470, 435);gp.lineTo(470, 415);//6
gp.moveTo(450, 435);gp.lineTo(470, 435);gp.lineTo(470, 455);gp.lineTo(450, 455);gp.lineTo(450, 435); //<
gp.moveTo(470, 435);gp.lineTo(490, 435);gp.lineTo(490, 455);gp.lineTo(470, 455);gp.lineTo(470, 435); //x
gd.drawString("1", 460, 390);gd.drawString("2", 475, 390);
gd.drawString("3", 460, 410);gd.drawString("4", 475,410);
gd.drawString("5", 460, 430);gd.drawString("6", 475, 430);
gd.drawString("<", 460, 450);gd.drawString("X", 475, 450);
//L2 ======================================================================L2
gp.moveTo(450, 475);gp.lineTo(470, 475);gp.lineTo(470, 495);gp.lineTo(450, 495);gp.lineTo(450, 475); //1
gp.moveTo(470, 475);gp.lineTo(490, 475);gp.lineTo(490, 495);gp.lineTo(470, 495);gp.lineTo(470, 475);//2
gp.moveTo(450, 495);gp.lineTo(470, 495);gp.lineTo(470, 515);gp.lineTo(450, 515);gp.lineTo(450, 495); //3
gp.moveTo(470, 495);gp.lineTo(490, 495);gp.lineTo(490, 515);gp.lineTo(470, 515);gp.lineTo(470, 495);//4
gp.moveTo(450, 515);gp.lineTo(470, 515);gp.lineTo(470, 535);gp.lineTo(450, 535);gp.lineTo(450, 515); //5
gp.moveTo(470, 515);gp.lineTo(490, 515);gp.lineTo(490, 535);gp.lineTo(470, 535);gp.lineTo(470, 515);//6
gp.moveTo(450, 535);gp.lineTo(470, 535);gp.lineTo(470, 555);gp.lineTo(450, 555);gp.lineTo(450, 535); //<
gp.moveTo(470, 535);gp.lineTo(490, 535);gp.lineTo(490, 555);gp.lineTo(470, 555);gp.lineTo(470, 535); //x
gd.drawString("1", 460, 490);gd.drawString("2", 475, 490);
gd.drawString("3", 460, 510);gd.drawString("4", 475,510);
gd.drawString("5", 460, 530);gd.drawString("6", 475, 530);
gd.drawString("<", 460, 550);gd.drawString("X", 475, 550);
//=================================================================L1
gp.moveTo(450, 575);gp.lineTo(470, 575);gp.lineTo(470, 595);gp.lineTo(450, 595);gp.lineTo(450, 575); //1
gp.moveTo(470, 575);gp.lineTo(490, 575);gp.lineTo(490, 595);gp.lineTo(470, 595);gp.lineTo(470, 575);//2
gp.moveTo(450, 595);gp.lineTo(470, 595);gp.lineTo(470, 615);gp.lineTo(450, 615);gp.lineTo(450, 595); //3
gp.moveTo(470, 595);gp.lineTo(490, 595);gp.lineTo(490, 615);gp.lineTo(470, 615);gp.lineTo(470, 595);//4
gp.moveTo(450, 615);gp.lineTo(470, 615);gp.lineTo(470, 635);gp.lineTo(450, 635);gp.lineTo(450, 615); //5
gp.moveTo(470, 615);gp.lineTo(490, 615);gp.lineTo(490, 635);gp.lineTo(470, 635);gp.lineTo(470, 615);//6
gp.moveTo(450, 635);gp.lineTo(470, 635);gp.lineTo(470, 655);gp.lineTo(450, 655);gp.lineTo(450, 635); //<
gp.moveTo(470, 635);gp.lineTo(490, 635);gp.lineTo(490, 655);gp.lineTo(470, 655);gp.lineTo(470, 635); //x
gd.drawString("1", 460, 590);gd.drawString("2", 475, 590);
gd.drawString("3", 460, 610);gd.drawString("4", 475,610);
gd.drawString("5", 460, 630);gd.drawString("6", 475, 630);
gd.drawString("<", 460, 650);gd.drawString("X", 475, 650);
gp.moveTo(280, 120);gp.lineTo(300, 120);gp.lineTo(290, 135);gp.lineTo(280, 120);
gp.moveTo(280, 210);gp.lineTo(300, 210);gp.lineTo(290, 195);gp.lineTo(280, 210);
gp.moveTo(280, 220);gp.lineTo(300,220);gp.lineTo(290, 235);gp.lineTo(280, 220);
gp.moveTo(280, 310);gp.lineTo(300,310);gp.lineTo(290, 295);gp.lineTo(280, 310);
gp.moveTo(280, 320);gp.lineTo(300,320);gp.lineTo(290, 335);gp.lineTo(280, 320);
gp.moveTo(280, 410);gp.lineTo(300,410);gp.lineTo(290, 395);gp.lineTo(280, 410);
gp.moveTo(280, 420);gp.lineTo(300,420);gp.lineTo(290, 435);gp.lineTo(280, 420);
gp.moveTo(280, 510);gp.lineTo(300,510);gp.lineTo(290, 495);gp.lineTo(280, 510);
gp.moveTo(280, 520);gp.lineTo(300,520);gp.lineTo(290, 535);gp.lineTo(280, 520);
gp.moveTo(280, 610);gp.lineTo(300,610);gp.lineTo(290, 595);gp.lineTo(280, 610);
gd.draw(gp);
}
man, the fun has just begun ....
Selanjutnya membuat lift di lantai satu aktiv, buat berwarna...
//=============================== LIFT BERGERAK KE ATAS ==============================//
//======================== lift berlajan / berwarna ===============================//
public void colored1(Graphics g){
Graphics2D gd = (Graphics2D)g;
Graphics2D gd2 = (Graphics2D)g;
gd2.setColor(Color.red);
GeneralPath gp2 = new GeneralPath();
super.paint(g);
//pintu kiri
GeneralPath gp = new GeneralPath();
gp.moveTo(160, 80); gp.lineTo(220, 80); gp.lineTo(220, 160); gp.lineTo(160, 160); gp.lineTo(160, 80);
gp.moveTo(160, 180); gp.lineTo(220, 180); gp.lineTo(220, 260); gp.lineTo(160, 260); gp.lineTo(160, 180);
gp.moveTo(160, 280); gp.lineTo(220, 280); gp.lineTo(220, 360); gp.lineTo(160, 360); gp.lineTo(160, 280);
gp.moveTo(160, 380); gp.lineTo(220, 380);gp.lineTo(220, 460);gp.lineTo(160, 460);gp.lineTo(160, 380);
gp.moveTo(160, 480);gp.lineTo(220, 480);gp.lineTo(220, 560);gp.lineTo(160, 560);gp.lineTo(160, 480);
gp2.moveTo(160, 580);gp2.lineTo(220, 580);gp2.lineTo(220, 660);gp2.lineTo(160, 660);gp2.lineTo(160, 580);
//pintu kanan
gp.moveTo(360, 80); gp.lineTo(420, 80); gp.lineTo(420, 160); gp.lineTo(360, 160); gp.lineTo(360, 80);
gp.moveTo(360, 180); gp.lineTo(420, 180); gp.lineTo(420, 260); gp.lineTo(360, 260); gp.lineTo(360, 180);
gp.moveTo(360, 280); gp.lineTo(420, 280); gp.lineTo(420, 360); gp.lineTo(360, 360); gp.lineTo(360, 280);
gp.moveTo(360, 380); gp.lineTo(420, 380);gp.lineTo(420, 460);gp.lineTo(360, 460);gp.lineTo(360, 380);
gp.moveTo(360, 480);gp.lineTo(420, 480);gp.lineTo(420, 560);gp.lineTo(360, 560);gp.lineTo(360, 480);
gp2.moveTo(360, 580);gp2.lineTo(420, 580);gp2.lineTo(420, 660);gp2.lineTo(360, 660);gp2.lineTo(360, 580);
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//kotak angka kiri
gp.moveTo(80, 80);gp.lineTo(100, 80);gp.lineTo(100, 100);gp.lineTo(80, 100);gp.lineTo(80, 80); //1
gp.moveTo(100, 80);gp.lineTo(120, 80);gp.lineTo(120, 100);gp.lineTo(100, 100);gp.lineTo(100, 80);//2
gp.moveTo(80, 100);gp.lineTo(100, 100);gp.lineTo(100, 120);gp.lineTo(80, 120);gp.lineTo(80, 100); //3
gp.moveTo(100, 100);gp.lineTo(120, 100);gp.lineTo(120, 120);gp.lineTo(100, 120);gp.lineTo(100, 100);//4
gp.moveTo(80, 120);gp.lineTo(100, 120);gp.lineTo(100, 140);gp.lineTo(80, 140);gp.lineTo(80, 120); //5
gp.moveTo(100, 120);gp.lineTo(120, 120);gp.lineTo(120, 140);gp.lineTo(100, 140);gp.lineTo(100, 120);//6
gp.moveTo(80, 140);gp.lineTo(100, 140);gp.lineTo(100, 160);gp.lineTo(80, 160);gp.lineTo(80, 140); //<
gp.moveTo(100, 140);gp.lineTo(120, 140);gp.lineTo(120, 160);gp.lineTo(100, 160);gp.lineTo(100, 140); //x
//angka
gd.drawString("1", 85, 95);gd.drawString("2", 105, 95);
gd.drawString("3", 85, 115);gd.drawString("4", 105, 115);
gd.drawString("5", 85, 135);gd.drawString("6", 105, 135);
gd.drawString("<", 85, 155);gd.drawString("X", 105, 155);
//kotak angka L5
gp.moveTo(80, 175);gp.lineTo(100, 175);gp.lineTo(100, 195);gp.lineTo(80, 195);gp.lineTo(80, 175); //1
gp.moveTo(100, 175);gp.lineTo(120, 175);gp.lineTo(120, 195);gp.lineTo(100, 195);gp.lineTo(100, 175);//2
gp.moveTo(80, 195);gp.lineTo(100, 195);gp.lineTo(100, 215);gp.lineTo(80, 215);gp.lineTo(80, 195); //3
gp.moveTo(100, 195);gp.lineTo(120, 195);gp.lineTo(120, 215);gp.lineTo(100, 215);gp.lineTo(100, 195);//4
gp.moveTo(80, 215);gp.lineTo(100, 215);gp.lineTo(100, 235);gp.lineTo(80, 235);gp.lineTo(80, 215); //5
gp.moveTo(100, 215);gp.lineTo(120, 215);gp.lineTo(120, 235);gp.lineTo(100, 235);gp.lineTo(100, 215);//6
gp.moveTo(80, 235);gp.lineTo(100, 235);gp.lineTo(100, 255);gp.lineTo(80, 255);gp.lineTo(80, 235); //<
gp.moveTo(100, 235);gp.lineTo(120, 235);gp.lineTo(120, 255);gp.lineTo(100, 255);gp.lineTo(100, 235); //x
gd.drawString("1", 85, 190);gd.drawString("2", 105, 190);
gd.drawString("3", 85, 210);gd.drawString("4", 105,210);
gd.drawString("5", 85, 230);gd.drawString("6", 105, 230);
gd.drawString("<", 85, 250);gd.drawString("X", 105, 250);
//L4
//kotak angka L4
gp.moveTo(80, 275);gp.lineTo(100, 275);gp.lineTo(100, 295);gp.lineTo(80, 295);gp.lineTo(80, 275); //1
gp.moveTo(100, 275);gp.lineTo(120, 275);gp.lineTo(120, 295);gp.lineTo(100, 295);gp.lineTo(100, 275);//2
gp.moveTo(80, 295);gp.lineTo(100, 295);gp.lineTo(100, 315);gp.lineTo(80, 315);gp.lineTo(80, 295); //3
gp.moveTo(100, 295);gp.lineTo(120, 295);gp.lineTo(120, 315);gp.lineTo(100, 315);gp.lineTo(100, 295);//4
gp.moveTo(80, 315);gp.lineTo(100, 315);gp.lineTo(100, 335);gp.lineTo(80, 335);gp.lineTo(80, 315); //5
gp.moveTo(100, 315);gp.lineTo(120, 315);gp.lineTo(120, 335);gp.lineTo(100, 335);gp.lineTo(100, 315);//6
gp.moveTo(80, 335);gp.lineTo(100, 335);gp.lineTo(100, 355);gp.lineTo(80, 355);gp.lineTo(80, 335); //<
gp.moveTo(100, 335);gp.lineTo(120, 335);gp.lineTo(120, 355);gp.lineTo(100, 355);gp.lineTo(100, 335); //x
gd.drawString("1", 85, 290);gd.drawString("2", 105, 290);
gd.drawString("3", 85, 310);gd.drawString("4", 105,310);
gd.drawString("5", 85, 330);gd.drawString("6", 105, 330);
gd.drawString("<", 85, 350);gd.drawString("X", 105, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(80, 375);gp.lineTo(100, 375);gp.lineTo(100, 395);gp.lineTo(80, 395);gp.lineTo(80, 375); //1
gp.moveTo(100, 375);gp.lineTo(120, 375);gp.lineTo(120, 395);gp.lineTo(100, 395);gp.lineTo(100, 375);//2
gp.moveTo(80, 395);gp.lineTo(100, 395);gp.lineTo(100, 415);gp.lineTo(80, 415);gp.lineTo(80, 395); //3
gp.moveTo(100, 395);gp.lineTo(120, 395);gp.lineTo(120, 415);gp.lineTo(100, 415);gp.lineTo(100, 395);//4
gp.moveTo(80, 415);gp.lineTo(100, 415);gp.lineTo(100, 435);gp.lineTo(80, 435);gp.lineTo(80, 415); //5
gp.moveTo(100, 415);gp.lineTo(120, 415);gp.lineTo(120, 435);gp.lineTo(100, 435);gp.lineTo(100, 415);//6
gp.moveTo(80, 435);gp.lineTo(100, 435);gp.lineTo(100, 455);gp.lineTo(80, 455);gp.lineTo(80, 435); //<
gp.moveTo(100, 435);gp.lineTo(120, 435);gp.lineTo(120, 455);gp.lineTo(100, 455);gp.lineTo(100, 435); //x
gd.drawString("1", 85, 390);gd.drawString("2", 105, 390);
gd.drawString("3", 85, 410);gd.drawString("4", 105,410);
gd.drawString("5", 85, 430);gd.drawString("6", 105, 430);
gd.drawString("<", 85, 450);gd.drawString("X", 105, 450);
//L2 ======================================================================L2
gp.moveTo(80, 475);gp.lineTo(100, 475);gp.lineTo(100, 495);gp.lineTo(80, 495);gp.lineTo(80, 475); //1
gp.moveTo(100, 475);gp.lineTo(120, 475);gp.lineTo(120, 495);gp.lineTo(100, 495);gp.lineTo(100, 475);//2
gp.moveTo(80, 495);gp.lineTo(100, 495);gp.lineTo(100, 515);gp.lineTo(80, 515);gp.lineTo(80, 495); //3
gp.moveTo(100, 495);gp.lineTo(120, 495);gp.lineTo(120, 515);gp.lineTo(100, 515);gp.lineTo(100, 495);//4
gp.moveTo(80, 515);gp.lineTo(100, 515);gp.lineTo(100, 535);gp.lineTo(80, 535);gp.lineTo(80, 515); //5
gp.moveTo(100, 515);gp.lineTo(120, 515);gp.lineTo(120, 535);gp.lineTo(100, 535);gp.lineTo(100, 515);//6
gp.moveTo(80, 535);gp.lineTo(100, 535);gp.lineTo(100, 555);gp.lineTo(80, 555);gp.lineTo(80, 535); //<
gp.moveTo(100, 535);gp.lineTo(120, 535);gp.lineTo(120, 555);gp.lineTo(100, 555);gp.lineTo(100, 535); //x
gd.drawString("1", 85, 490);gd.drawString("2", 105, 490);
gd.drawString("3", 85, 510);gd.drawString("4", 105,510);
gd.drawString("5", 85, 530);gd.drawString("6", 105, 530);
gd.drawString("<", 85, 550);gd.drawString("X", 105, 550);
//=================================================================L1
gp2.moveTo(80, 575);gp2.lineTo(100, 575);gp2.lineTo(100, 595);gp2.lineTo(80, 595);gp2.lineTo(80, 575); //1
gp.moveTo(100, 575);gp.lineTo(120, 575);gp.lineTo(120, 595);gp.lineTo(100, 595);gp.lineTo(100, 575);//2
gp.moveTo(80, 595);gp.lineTo(100, 595);gp.lineTo(100, 615);gp.lineTo(80, 615);gp.lineTo(80, 595); //3
gp.moveTo(100, 595);gp.lineTo(120, 595);gp.lineTo(120, 615);gp.lineTo(100, 615);gp.lineTo(100, 595);//4
gp.moveTo(80, 615);gp.lineTo(100, 615);gp.lineTo(100, 635);gp.lineTo(80, 635);gp.lineTo(80, 615); //5
gp.moveTo(100, 615);gp.lineTo(120, 615);gp.lineTo(120, 635);gp.lineTo(100, 635);gp.lineTo(100, 615);//6
gp.moveTo(80, 635);gp.lineTo(100, 635);gp.lineTo(100, 655);gp.lineTo(80, 655);gp.lineTo(80, 635); //<
gp.moveTo(100, 635);gp.lineTo(120, 635);gp.lineTo(120, 655);gp.lineTo(100, 655);gp.lineTo(100, 635); //x
gd.drawString("1", 85, 590);gd.drawString("2", 105, 590);
gd.drawString("3", 85, 610);gd.drawString("4", 105,610);
gd.drawString("5", 85, 630);gd.drawString("6", 105, 630);
gd.drawString("<", 85, 650);gd.drawString("X", 105, 650);
//========================================================================================================
//========================================================================================================
//===================================== KOTAK KANAN ======================================================
//========================================================================================================
//========================================================================================================
//kotak
gp.moveTo(450, 80);gp.lineTo(470, 80);gp.lineTo(470, 100);gp.lineTo(450, 100);gp.lineTo(450, 80); //1
gp.moveTo(470, 80);gp.lineTo(490, 80);gp.lineTo(490, 100);gp.lineTo(470, 100);gp.lineTo(470, 80);//2
gp.moveTo(450, 100);gp.lineTo(470, 100);gp.lineTo(470, 120);gp.lineTo(450, 120);gp.lineTo(450, 100); //3
gp.moveTo(470, 100);gp.lineTo(490, 100);gp.lineTo(490, 120);gp.lineTo(470, 120);gp.lineTo(470, 100);//4
gp.moveTo(450, 120);gp.lineTo(470, 120);gp.lineTo(470, 140);gp.lineTo(450, 140);gp.lineTo(450, 120); //5
gp.moveTo(470, 120);gp.lineTo(490, 120);gp.lineTo(490, 140);gp.lineTo(470, 140);gp.lineTo(470, 120);//6
gp.moveTo(450, 140);gp.lineTo(470, 140);gp.lineTo(470, 160);gp.lineTo(450, 160);gp.lineTo(450, 140); //<
gp.moveTo(470, 140);gp.lineTo(490, 140);gp.lineTo(490, 160);gp.lineTo(470, 160);gp.lineTo(470, 140); //x
//angka
gd.drawString("1", 460, 95);gd.drawString("2", 475, 95);
gd.drawString("3", 460, 115);gd.drawString("4", 475, 115);
gd.drawString("5", 460, 135);gd.drawString("6", 475, 135);
gd.drawString("<", 460, 155);gd.drawString("X", 475, 155);
//kotak angka L5
gp.moveTo(450, 175);gp.lineTo(470, 175);gp.lineTo(470, 195);gp.lineTo(450, 195);gp.lineTo(450, 175); //1
gp.moveTo(470, 175);gp.lineTo(490, 175);gp.lineTo(490, 195);gp.lineTo(470, 195);gp.lineTo(470, 175);//2
gp.moveTo(450, 195);gp.lineTo(470, 195);gp.lineTo(470, 215);gp.lineTo(450, 215);gp.lineTo(450, 195); //3
gp.moveTo(470, 195);gp.lineTo(490, 195);gp.lineTo(490, 215);gp.lineTo(470, 215);gp.lineTo(470, 195);//4
gp.moveTo(450, 215);gp.lineTo(470, 215);gp.lineTo(470, 235);gp.lineTo(450, 235);gp.lineTo(450, 215); //5
gp.moveTo(470, 215);gp.lineTo(490, 215);gp.lineTo(490, 235);gp.lineTo(470, 235);gp.lineTo(470, 215);//6
gp.moveTo(450, 235);gp.lineTo(470, 235);gp.lineTo(470, 255);gp.lineTo(450, 255);gp.lineTo(450, 235); //<
gp.moveTo(470, 235);gp.lineTo(490, 235);gp.lineTo(490, 255);gp.lineTo(470, 255);gp.lineTo(470, 235); //x
gd.drawString("1", 460, 190);gd.drawString("2", 475, 190);
gd.drawString("3", 460, 210);gd.drawString("4", 475,210);
gd.drawString("5", 460, 230);gd.drawString("6", 475, 230);
gd.drawString("<", 460, 250);gd.drawString("X", 475, 250);
//L4
//kotak angka L4
gp.moveTo(450, 275);gp.lineTo(470, 275);gp.lineTo(470, 295);gp.lineTo(450, 295);gp.lineTo(450, 275); //1
gp.moveTo(470, 275);gp.lineTo(490, 275);gp.lineTo(490, 295);gp.lineTo(470, 295);gp.lineTo(470, 275);//2
gp.moveTo(450, 295);gp.lineTo(470, 295);gp.lineTo(470, 315);gp.lineTo(450, 315);gp.lineTo(450, 295); //3
gp.moveTo(470, 295);gp.lineTo(490, 295);gp.lineTo(490, 315);gp.lineTo(470, 315);gp.lineTo(470, 295);//4
gp.moveTo(450, 315);gp.lineTo(470, 315);gp.lineTo(470, 335);gp.lineTo(450, 335);gp.lineTo(450, 315); //5
gp.moveTo(470, 315);gp.lineTo(490, 315);gp.lineTo(490, 335);gp.lineTo(470, 335);gp.lineTo(470, 315);//6
gp.moveTo(450, 335);gp.lineTo(470, 335);gp.lineTo(470, 355);gp.lineTo(450, 355);gp.lineTo(450, 335); //<
gp.moveTo(470, 335);gp.lineTo(490, 335);gp.lineTo(490, 355);gp.lineTo(470, 355);gp.lineTo(470, 335); //x
gd.drawString("1", 460, 290);gd.drawString("2", 475, 290);
gd.drawString("3", 460, 310);gd.drawString("4", 475,310);
gd.drawString("5", 460, 330);gd.drawString("6", 475, 330);
gd.drawString("<", 460, 350);gd.drawString("X", 475, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(450, 375);gp.lineTo(470, 375);gp.lineTo(470, 395);gp.lineTo(450, 395);gp.lineTo(450, 375); //1
gp.moveTo(470, 375);gp.lineTo(490, 375);gp.lineTo(490, 395);gp.lineTo(470, 395);gp.lineTo(470, 375);//2
gp.moveTo(450, 395);gp.lineTo(470, 395);gp.lineTo(470, 415);gp.lineTo(450, 415);gp.lineTo(450, 395); //3
gp.moveTo(470, 395);gp.lineTo(490, 395);gp.lineTo(490, 415);gp.lineTo(470, 415);gp.lineTo(470, 395);//4
gp.moveTo(450, 415);gp.lineTo(470, 415);gp.lineTo(470, 435);gp.lineTo(450, 435);gp.lineTo(450, 415); //5
gp.moveTo(470, 415);gp.lineTo(490, 415);gp.lineTo(490, 435);gp.lineTo(470, 435);gp.lineTo(470, 415);//6
gp.moveTo(450, 435);gp.lineTo(470, 435);gp.lineTo(470, 455);gp.lineTo(450, 455);gp.lineTo(450, 435); //<
gp.moveTo(470, 435);gp.lineTo(490, 435);gp.lineTo(490, 455);gp.lineTo(470, 455);gp.lineTo(470, 435); //x
gd.drawString("1", 460, 390);gd.drawString("2", 475, 390);
gd.drawString("3", 460, 410);gd.drawString("4", 475,410);
gd.drawString("5", 460, 430);gd.drawString("6", 475, 430);
gd.drawString("<", 460, 450);gd.drawString("X", 475, 450);
//L2 ======================================================================L2
gp.moveTo(450, 475);gp.lineTo(470, 475);gp.lineTo(470, 495);gp.lineTo(450, 495);gp.lineTo(450, 475); //1
gp.moveTo(470, 475);gp.lineTo(490, 475);gp.lineTo(490, 495);gp.lineTo(470, 495);gp.lineTo(470, 475);//2
gp.moveTo(450, 495);gp.lineTo(470, 495);gp.lineTo(470, 515);gp.lineTo(450, 515);gp.lineTo(450, 495); //3
gp.moveTo(470, 495);gp.lineTo(490, 495);gp.lineTo(490, 515);gp.lineTo(470, 515);gp.lineTo(470, 495);//4
gp.moveTo(450, 515);gp.lineTo(470, 515);gp.lineTo(470, 535);gp.lineTo(450, 535);gp.lineTo(450, 515); //5
gp.moveTo(470, 515);gp.lineTo(490, 515);gp.lineTo(490, 535);gp.lineTo(470, 535);gp.lineTo(470, 515);//6
gp.moveTo(450, 535);gp.lineTo(470, 535);gp.lineTo(470, 555);gp.lineTo(450, 555);gp.lineTo(450, 535); //<
gp.moveTo(470, 535);gp.lineTo(490, 535);gp.lineTo(490, 555);gp.lineTo(470, 555);gp.lineTo(470, 535); //x
gd.drawString("1", 460, 490);gd.drawString("2", 475, 490);
gd.drawString("3", 460, 510);gd.drawString("4", 475,510);
gd.drawString("5", 460, 530);gd.drawString("6", 475, 530);
gd.drawString("<", 460, 550);gd.drawString("X", 475, 550);
//=================================================================L1
gp2.moveTo(450, 575);gp2.lineTo(470, 575);gp2.lineTo(470, 595);gp2.lineTo(450, 595);gp2.lineTo(450, 575); //1
gp.moveTo(470, 575);gp.lineTo(490, 575);gp.lineTo(490, 595);gp.lineTo(470, 595);gp.lineTo(470, 575);//2
gp.moveTo(450, 595);gp.lineTo(470, 595);gp.lineTo(470, 615);gp.lineTo(450, 615);gp.lineTo(450, 595); //3
gp.moveTo(470, 595);gp.lineTo(490, 595);gp.lineTo(490, 615);gp.lineTo(470, 615);gp.lineTo(470, 595);//4
gp.moveTo(450, 615);gp.lineTo(470, 615);gp.lineTo(470, 635);gp.lineTo(450, 635);gp.lineTo(450, 615); //5
gp.moveTo(470, 615);gp.lineTo(490, 615);gp.lineTo(490, 635);gp.lineTo(470, 635);gp.lineTo(470, 615);//6
gp.moveTo(450, 635);gp.lineTo(470, 635);gp.lineTo(470, 655);gp.lineTo(450, 655);gp.lineTo(450, 635); //<
gp.moveTo(470, 635);gp.lineTo(490, 635);gp.lineTo(490, 655);gp.lineTo(470, 655);gp.lineTo(470, 635); //x
gd.drawString("1", 460, 590);gd.drawString("2", 475, 590);
gd.drawString("3", 460, 610);gd.drawString("4", 475,610);
gd.drawString("5", 460, 630);gd.drawString("6", 475, 630);
gd.drawString("<", 460, 650);gd.drawString("X", 475, 650);
///segitiga
gp.moveTo(280, 120);gp.lineTo(300, 120);gp.lineTo(290, 135);gp.lineTo(280, 120);
gp.moveTo(280, 210);gp.lineTo(300, 210);gp.lineTo(290, 195);gp.lineTo(280, 210);
gp.moveTo(280, 220);gp.lineTo(300,220);gp.lineTo(290, 235);gp.lineTo(280, 220);
gp.moveTo(280, 310);gp.lineTo(300,310);gp.lineTo(290, 295);gp.lineTo(280, 310);
gp.moveTo(280, 320);gp.lineTo(300,320);gp.lineTo(290, 335);gp.lineTo(280, 320);
gp.moveTo(280, 410);gp.lineTo(300,410);gp.lineTo(290, 395);gp.lineTo(280, 410);
gp.moveTo(280, 420);gp.lineTo(300,420);gp.lineTo(290, 435);gp.lineTo(280, 420);
gp.moveTo(280, 510);gp.lineTo(300,510);gp.lineTo(290, 495);gp.lineTo(280, 510);
gp.moveTo(280, 520);gp.lineTo(300,520);gp.lineTo(290, 535);gp.lineTo(280, 520);
gp2.moveTo(280, 610);gp2.lineTo(300,610);gp2.lineTo(290, 595);gp2.lineTo(280, 610);
gd.draw(gp);
gd2.fill(gp2);
}
//======================== lift berlajan / berwarna ===============================//
public void colored1(Graphics g){
Graphics2D gd = (Graphics2D)g;
Graphics2D gd2 = (Graphics2D)g;
gd2.setColor(Color.red);
GeneralPath gp2 = new GeneralPath();
super.paint(g);
//pintu kiri
GeneralPath gp = new GeneralPath();
gp.moveTo(160, 80); gp.lineTo(220, 80); gp.lineTo(220, 160); gp.lineTo(160, 160); gp.lineTo(160, 80);
gp.moveTo(160, 180); gp.lineTo(220, 180); gp.lineTo(220, 260); gp.lineTo(160, 260); gp.lineTo(160, 180);
gp.moveTo(160, 280); gp.lineTo(220, 280); gp.lineTo(220, 360); gp.lineTo(160, 360); gp.lineTo(160, 280);
gp.moveTo(160, 380); gp.lineTo(220, 380);gp.lineTo(220, 460);gp.lineTo(160, 460);gp.lineTo(160, 380);
gp.moveTo(160, 480);gp.lineTo(220, 480);gp.lineTo(220, 560);gp.lineTo(160, 560);gp.lineTo(160, 480);
gp2.moveTo(160, 580);gp2.lineTo(220, 580);gp2.lineTo(220, 660);gp2.lineTo(160, 660);gp2.lineTo(160, 580);
//pintu kanan
gp.moveTo(360, 80); gp.lineTo(420, 80); gp.lineTo(420, 160); gp.lineTo(360, 160); gp.lineTo(360, 80);
gp.moveTo(360, 180); gp.lineTo(420, 180); gp.lineTo(420, 260); gp.lineTo(360, 260); gp.lineTo(360, 180);
gp.moveTo(360, 280); gp.lineTo(420, 280); gp.lineTo(420, 360); gp.lineTo(360, 360); gp.lineTo(360, 280);
gp.moveTo(360, 380); gp.lineTo(420, 380);gp.lineTo(420, 460);gp.lineTo(360, 460);gp.lineTo(360, 380);
gp.moveTo(360, 480);gp.lineTo(420, 480);gp.lineTo(420, 560);gp.lineTo(360, 560);gp.lineTo(360, 480);
gp2.moveTo(360, 580);gp2.lineTo(420, 580);gp2.lineTo(420, 660);gp2.lineTo(360, 660);gp2.lineTo(360, 580);
//=======================================================================================================================
//===================================================================================================================
//=================================================================================================================
//kotak angka kiri
gp.moveTo(80, 80);gp.lineTo(100, 80);gp.lineTo(100, 100);gp.lineTo(80, 100);gp.lineTo(80, 80); //1
gp.moveTo(100, 80);gp.lineTo(120, 80);gp.lineTo(120, 100);gp.lineTo(100, 100);gp.lineTo(100, 80);//2
gp.moveTo(80, 100);gp.lineTo(100, 100);gp.lineTo(100, 120);gp.lineTo(80, 120);gp.lineTo(80, 100); //3
gp.moveTo(100, 100);gp.lineTo(120, 100);gp.lineTo(120, 120);gp.lineTo(100, 120);gp.lineTo(100, 100);//4
gp.moveTo(80, 120);gp.lineTo(100, 120);gp.lineTo(100, 140);gp.lineTo(80, 140);gp.lineTo(80, 120); //5
gp.moveTo(100, 120);gp.lineTo(120, 120);gp.lineTo(120, 140);gp.lineTo(100, 140);gp.lineTo(100, 120);//6
gp.moveTo(80, 140);gp.lineTo(100, 140);gp.lineTo(100, 160);gp.lineTo(80, 160);gp.lineTo(80, 140); //<
gp.moveTo(100, 140);gp.lineTo(120, 140);gp.lineTo(120, 160);gp.lineTo(100, 160);gp.lineTo(100, 140); //x
//angka
gd.drawString("1", 85, 95);gd.drawString("2", 105, 95);
gd.drawString("3", 85, 115);gd.drawString("4", 105, 115);
gd.drawString("5", 85, 135);gd.drawString("6", 105, 135);
gd.drawString("<", 85, 155);gd.drawString("X", 105, 155);
//kotak angka L5
gp.moveTo(80, 175);gp.lineTo(100, 175);gp.lineTo(100, 195);gp.lineTo(80, 195);gp.lineTo(80, 175); //1
gp.moveTo(100, 175);gp.lineTo(120, 175);gp.lineTo(120, 195);gp.lineTo(100, 195);gp.lineTo(100, 175);//2
gp.moveTo(80, 195);gp.lineTo(100, 195);gp.lineTo(100, 215);gp.lineTo(80, 215);gp.lineTo(80, 195); //3
gp.moveTo(100, 195);gp.lineTo(120, 195);gp.lineTo(120, 215);gp.lineTo(100, 215);gp.lineTo(100, 195);//4
gp.moveTo(80, 215);gp.lineTo(100, 215);gp.lineTo(100, 235);gp.lineTo(80, 235);gp.lineTo(80, 215); //5
gp.moveTo(100, 215);gp.lineTo(120, 215);gp.lineTo(120, 235);gp.lineTo(100, 235);gp.lineTo(100, 215);//6
gp.moveTo(80, 235);gp.lineTo(100, 235);gp.lineTo(100, 255);gp.lineTo(80, 255);gp.lineTo(80, 235); //<
gp.moveTo(100, 235);gp.lineTo(120, 235);gp.lineTo(120, 255);gp.lineTo(100, 255);gp.lineTo(100, 235); //x
gd.drawString("1", 85, 190);gd.drawString("2", 105, 190);
gd.drawString("3", 85, 210);gd.drawString("4", 105,210);
gd.drawString("5", 85, 230);gd.drawString("6", 105, 230);
gd.drawString("<", 85, 250);gd.drawString("X", 105, 250);
//L4
//kotak angka L4
gp.moveTo(80, 275);gp.lineTo(100, 275);gp.lineTo(100, 295);gp.lineTo(80, 295);gp.lineTo(80, 275); //1
gp.moveTo(100, 275);gp.lineTo(120, 275);gp.lineTo(120, 295);gp.lineTo(100, 295);gp.lineTo(100, 275);//2
gp.moveTo(80, 295);gp.lineTo(100, 295);gp.lineTo(100, 315);gp.lineTo(80, 315);gp.lineTo(80, 295); //3
gp.moveTo(100, 295);gp.lineTo(120, 295);gp.lineTo(120, 315);gp.lineTo(100, 315);gp.lineTo(100, 295);//4
gp.moveTo(80, 315);gp.lineTo(100, 315);gp.lineTo(100, 335);gp.lineTo(80, 335);gp.lineTo(80, 315); //5
gp.moveTo(100, 315);gp.lineTo(120, 315);gp.lineTo(120, 335);gp.lineTo(100, 335);gp.lineTo(100, 315);//6
gp.moveTo(80, 335);gp.lineTo(100, 335);gp.lineTo(100, 355);gp.lineTo(80, 355);gp.lineTo(80, 335); //<
gp.moveTo(100, 335);gp.lineTo(120, 335);gp.lineTo(120, 355);gp.lineTo(100, 355);gp.lineTo(100, 335); //x
gd.drawString("1", 85, 290);gd.drawString("2", 105, 290);
gd.drawString("3", 85, 310);gd.drawString("4", 105,310);
gd.drawString("5", 85, 330);gd.drawString("6", 105, 330);
gd.drawString("<", 85, 350);gd.drawString("X", 105, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(80, 375);gp.lineTo(100, 375);gp.lineTo(100, 395);gp.lineTo(80, 395);gp.lineTo(80, 375); //1
gp.moveTo(100, 375);gp.lineTo(120, 375);gp.lineTo(120, 395);gp.lineTo(100, 395);gp.lineTo(100, 375);//2
gp.moveTo(80, 395);gp.lineTo(100, 395);gp.lineTo(100, 415);gp.lineTo(80, 415);gp.lineTo(80, 395); //3
gp.moveTo(100, 395);gp.lineTo(120, 395);gp.lineTo(120, 415);gp.lineTo(100, 415);gp.lineTo(100, 395);//4
gp.moveTo(80, 415);gp.lineTo(100, 415);gp.lineTo(100, 435);gp.lineTo(80, 435);gp.lineTo(80, 415); //5
gp.moveTo(100, 415);gp.lineTo(120, 415);gp.lineTo(120, 435);gp.lineTo(100, 435);gp.lineTo(100, 415);//6
gp.moveTo(80, 435);gp.lineTo(100, 435);gp.lineTo(100, 455);gp.lineTo(80, 455);gp.lineTo(80, 435); //<
gp.moveTo(100, 435);gp.lineTo(120, 435);gp.lineTo(120, 455);gp.lineTo(100, 455);gp.lineTo(100, 435); //x
gd.drawString("1", 85, 390);gd.drawString("2", 105, 390);
gd.drawString("3", 85, 410);gd.drawString("4", 105,410);
gd.drawString("5", 85, 430);gd.drawString("6", 105, 430);
gd.drawString("<", 85, 450);gd.drawString("X", 105, 450);
//L2 ======================================================================L2
gp.moveTo(80, 475);gp.lineTo(100, 475);gp.lineTo(100, 495);gp.lineTo(80, 495);gp.lineTo(80, 475); //1
gp.moveTo(100, 475);gp.lineTo(120, 475);gp.lineTo(120, 495);gp.lineTo(100, 495);gp.lineTo(100, 475);//2
gp.moveTo(80, 495);gp.lineTo(100, 495);gp.lineTo(100, 515);gp.lineTo(80, 515);gp.lineTo(80, 495); //3
gp.moveTo(100, 495);gp.lineTo(120, 495);gp.lineTo(120, 515);gp.lineTo(100, 515);gp.lineTo(100, 495);//4
gp.moveTo(80, 515);gp.lineTo(100, 515);gp.lineTo(100, 535);gp.lineTo(80, 535);gp.lineTo(80, 515); //5
gp.moveTo(100, 515);gp.lineTo(120, 515);gp.lineTo(120, 535);gp.lineTo(100, 535);gp.lineTo(100, 515);//6
gp.moveTo(80, 535);gp.lineTo(100, 535);gp.lineTo(100, 555);gp.lineTo(80, 555);gp.lineTo(80, 535); //<
gp.moveTo(100, 535);gp.lineTo(120, 535);gp.lineTo(120, 555);gp.lineTo(100, 555);gp.lineTo(100, 535); //x
gd.drawString("1", 85, 490);gd.drawString("2", 105, 490);
gd.drawString("3", 85, 510);gd.drawString("4", 105,510);
gd.drawString("5", 85, 530);gd.drawString("6", 105, 530);
gd.drawString("<", 85, 550);gd.drawString("X", 105, 550);
//=================================================================L1
gp2.moveTo(80, 575);gp2.lineTo(100, 575);gp2.lineTo(100, 595);gp2.lineTo(80, 595);gp2.lineTo(80, 575); //1
gp.moveTo(100, 575);gp.lineTo(120, 575);gp.lineTo(120, 595);gp.lineTo(100, 595);gp.lineTo(100, 575);//2
gp.moveTo(80, 595);gp.lineTo(100, 595);gp.lineTo(100, 615);gp.lineTo(80, 615);gp.lineTo(80, 595); //3
gp.moveTo(100, 595);gp.lineTo(120, 595);gp.lineTo(120, 615);gp.lineTo(100, 615);gp.lineTo(100, 595);//4
gp.moveTo(80, 615);gp.lineTo(100, 615);gp.lineTo(100, 635);gp.lineTo(80, 635);gp.lineTo(80, 615); //5
gp.moveTo(100, 615);gp.lineTo(120, 615);gp.lineTo(120, 635);gp.lineTo(100, 635);gp.lineTo(100, 615);//6
gp.moveTo(80, 635);gp.lineTo(100, 635);gp.lineTo(100, 655);gp.lineTo(80, 655);gp.lineTo(80, 635); //<
gp.moveTo(100, 635);gp.lineTo(120, 635);gp.lineTo(120, 655);gp.lineTo(100, 655);gp.lineTo(100, 635); //x
gd.drawString("1", 85, 590);gd.drawString("2", 105, 590);
gd.drawString("3", 85, 610);gd.drawString("4", 105,610);
gd.drawString("5", 85, 630);gd.drawString("6", 105, 630);
gd.drawString("<", 85, 650);gd.drawString("X", 105, 650);
//========================================================================================================
//========================================================================================================
//===================================== KOTAK KANAN ======================================================
//========================================================================================================
//========================================================================================================
//kotak
gp.moveTo(450, 80);gp.lineTo(470, 80);gp.lineTo(470, 100);gp.lineTo(450, 100);gp.lineTo(450, 80); //1
gp.moveTo(470, 80);gp.lineTo(490, 80);gp.lineTo(490, 100);gp.lineTo(470, 100);gp.lineTo(470, 80);//2
gp.moveTo(450, 100);gp.lineTo(470, 100);gp.lineTo(470, 120);gp.lineTo(450, 120);gp.lineTo(450, 100); //3
gp.moveTo(470, 100);gp.lineTo(490, 100);gp.lineTo(490, 120);gp.lineTo(470, 120);gp.lineTo(470, 100);//4
gp.moveTo(450, 120);gp.lineTo(470, 120);gp.lineTo(470, 140);gp.lineTo(450, 140);gp.lineTo(450, 120); //5
gp.moveTo(470, 120);gp.lineTo(490, 120);gp.lineTo(490, 140);gp.lineTo(470, 140);gp.lineTo(470, 120);//6
gp.moveTo(450, 140);gp.lineTo(470, 140);gp.lineTo(470, 160);gp.lineTo(450, 160);gp.lineTo(450, 140); //<
gp.moveTo(470, 140);gp.lineTo(490, 140);gp.lineTo(490, 160);gp.lineTo(470, 160);gp.lineTo(470, 140); //x
//angka
gd.drawString("1", 460, 95);gd.drawString("2", 475, 95);
gd.drawString("3", 460, 115);gd.drawString("4", 475, 115);
gd.drawString("5", 460, 135);gd.drawString("6", 475, 135);
gd.drawString("<", 460, 155);gd.drawString("X", 475, 155);
//kotak angka L5
gp.moveTo(450, 175);gp.lineTo(470, 175);gp.lineTo(470, 195);gp.lineTo(450, 195);gp.lineTo(450, 175); //1
gp.moveTo(470, 175);gp.lineTo(490, 175);gp.lineTo(490, 195);gp.lineTo(470, 195);gp.lineTo(470, 175);//2
gp.moveTo(450, 195);gp.lineTo(470, 195);gp.lineTo(470, 215);gp.lineTo(450, 215);gp.lineTo(450, 195); //3
gp.moveTo(470, 195);gp.lineTo(490, 195);gp.lineTo(490, 215);gp.lineTo(470, 215);gp.lineTo(470, 195);//4
gp.moveTo(450, 215);gp.lineTo(470, 215);gp.lineTo(470, 235);gp.lineTo(450, 235);gp.lineTo(450, 215); //5
gp.moveTo(470, 215);gp.lineTo(490, 215);gp.lineTo(490, 235);gp.lineTo(470, 235);gp.lineTo(470, 215);//6
gp.moveTo(450, 235);gp.lineTo(470, 235);gp.lineTo(470, 255);gp.lineTo(450, 255);gp.lineTo(450, 235); //<
gp.moveTo(470, 235);gp.lineTo(490, 235);gp.lineTo(490, 255);gp.lineTo(470, 255);gp.lineTo(470, 235); //x
gd.drawString("1", 460, 190);gd.drawString("2", 475, 190);
gd.drawString("3", 460, 210);gd.drawString("4", 475,210);
gd.drawString("5", 460, 230);gd.drawString("6", 475, 230);
gd.drawString("<", 460, 250);gd.drawString("X", 475, 250);
//L4
//kotak angka L4
gp.moveTo(450, 275);gp.lineTo(470, 275);gp.lineTo(470, 295);gp.lineTo(450, 295);gp.lineTo(450, 275); //1
gp.moveTo(470, 275);gp.lineTo(490, 275);gp.lineTo(490, 295);gp.lineTo(470, 295);gp.lineTo(470, 275);//2
gp.moveTo(450, 295);gp.lineTo(470, 295);gp.lineTo(470, 315);gp.lineTo(450, 315);gp.lineTo(450, 295); //3
gp.moveTo(470, 295);gp.lineTo(490, 295);gp.lineTo(490, 315);gp.lineTo(470, 315);gp.lineTo(470, 295);//4
gp.moveTo(450, 315);gp.lineTo(470, 315);gp.lineTo(470, 335);gp.lineTo(450, 335);gp.lineTo(450, 315); //5
gp.moveTo(470, 315);gp.lineTo(490, 315);gp.lineTo(490, 335);gp.lineTo(470, 335);gp.lineTo(470, 315);//6
gp.moveTo(450, 335);gp.lineTo(470, 335);gp.lineTo(470, 355);gp.lineTo(450, 355);gp.lineTo(450, 335); //<
gp.moveTo(470, 335);gp.lineTo(490, 335);gp.lineTo(490, 355);gp.lineTo(470, 355);gp.lineTo(470, 335); //x
gd.drawString("1", 460, 290);gd.drawString("2", 475, 290);
gd.drawString("3", 460, 310);gd.drawString("4", 475,310);
gd.drawString("5", 460, 330);gd.drawString("6", 475, 330);
gd.drawString("<", 460, 350);gd.drawString("X", 475, 350);
//-=============================== L3
//L4
//kotak angka L3
gp.moveTo(450, 375);gp.lineTo(470, 375);gp.lineTo(470, 395);gp.lineTo(450, 395);gp.lineTo(450, 375); //1
gp.moveTo(470, 375);gp.lineTo(490, 375);gp.lineTo(490, 395);gp.lineTo(470, 395);gp.lineTo(470, 375);//2
gp.moveTo(450, 395);gp.lineTo(470, 395);gp.lineTo(470, 415);gp.lineTo(450, 415);gp.lineTo(450, 395); //3
gp.moveTo(470, 395);gp.lineTo(490, 395);gp.lineTo(490, 415);gp.lineTo(470, 415);gp.lineTo(470, 395);//4
gp.moveTo(450, 415);gp.lineTo(470, 415);gp.lineTo(470, 435);gp.lineTo(450, 435);gp.lineTo(450, 415); //5
gp.moveTo(470, 415);gp.lineTo(490, 415);gp.lineTo(490, 435);gp.lineTo(470, 435);gp.lineTo(470, 415);//6
gp.moveTo(450, 435);gp.lineTo(470, 435);gp.lineTo(470, 455);gp.lineTo(450, 455);gp.lineTo(450, 435); //<
gp.moveTo(470, 435);gp.lineTo(490, 435);gp.lineTo(490, 455);gp.lineTo(470, 455);gp.lineTo(470, 435); //x
gd.drawString("1", 460, 390);gd.drawString("2", 475, 390);
gd.drawString("3", 460, 410);gd.drawString("4", 475,410);
gd.drawString("5", 460, 430);gd.drawString("6", 475, 430);
gd.drawString("<", 460, 450);gd.drawString("X", 475, 450);
//L2 ======================================================================L2
gp.moveTo(450, 475);gp.lineTo(470, 475);gp.lineTo(470, 495);gp.lineTo(450, 495);gp.lineTo(450, 475); //1
gp.moveTo(470, 475);gp.lineTo(490, 475);gp.lineTo(490, 495);gp.lineTo(470, 495);gp.lineTo(470, 475);//2
gp.moveTo(450, 495);gp.lineTo(470, 495);gp.lineTo(470, 515);gp.lineTo(450, 515);gp.lineTo(450, 495); //3
gp.moveTo(470, 495);gp.lineTo(490, 495);gp.lineTo(490, 515);gp.lineTo(470, 515);gp.lineTo(470, 495);//4
gp.moveTo(450, 515);gp.lineTo(470, 515);gp.lineTo(470, 535);gp.lineTo(450, 535);gp.lineTo(450, 515); //5
gp.moveTo(470, 515);gp.lineTo(490, 515);gp.lineTo(490, 535);gp.lineTo(470, 535);gp.lineTo(470, 515);//6
gp.moveTo(450, 535);gp.lineTo(470, 535);gp.lineTo(470, 555);gp.lineTo(450, 555);gp.lineTo(450, 535); //<
gp.moveTo(470, 535);gp.lineTo(490, 535);gp.lineTo(490, 555);gp.lineTo(470, 555);gp.lineTo(470, 535); //x
gd.drawString("1", 460, 490);gd.drawString("2", 475, 490);
gd.drawString("3", 460, 510);gd.drawString("4", 475,510);
gd.drawString("5", 460, 530);gd.drawString("6", 475, 530);
gd.drawString("<", 460, 550);gd.drawString("X", 475, 550);
//=================================================================L1
gp2.moveTo(450, 575);gp2.lineTo(470, 575);gp2.lineTo(470, 595);gp2.lineTo(450, 595);gp2.lineTo(450, 575); //1
gp.moveTo(470, 575);gp.lineTo(490, 575);gp.lineTo(490, 595);gp.lineTo(470, 595);gp.lineTo(470, 575);//2
gp.moveTo(450, 595);gp.lineTo(470, 595);gp.lineTo(470, 615);gp.lineTo(450, 615);gp.lineTo(450, 595); //3
gp.moveTo(470, 595);gp.lineTo(490, 595);gp.lineTo(490, 615);gp.lineTo(470, 615);gp.lineTo(470, 595);//4
gp.moveTo(450, 615);gp.lineTo(470, 615);gp.lineTo(470, 635);gp.lineTo(450, 635);gp.lineTo(450, 615); //5
gp.moveTo(470, 615);gp.lineTo(490, 615);gp.lineTo(490, 635);gp.lineTo(470, 635);gp.lineTo(470, 615);//6
gp.moveTo(450, 635);gp.lineTo(470, 635);gp.lineTo(470, 655);gp.lineTo(450, 655);gp.lineTo(450, 635); //<
gp.moveTo(470, 635);gp.lineTo(490, 635);gp.lineTo(490, 655);gp.lineTo(470, 655);gp.lineTo(470, 635); //x
gd.drawString("1", 460, 590);gd.drawString("2", 475, 590);
gd.drawString("3", 460, 610);gd.drawString("4", 475,610);
gd.drawString("5", 460, 630);gd.drawString("6", 475, 630);
gd.drawString("<", 460, 650);gd.drawString("X", 475, 650);
///segitiga
gp.moveTo(280, 120);gp.lineTo(300, 120);gp.lineTo(290, 135);gp.lineTo(280, 120);
gp.moveTo(280, 210);gp.lineTo(300, 210);gp.lineTo(290, 195);gp.lineTo(280, 210);
gp.moveTo(280, 220);gp.lineTo(300,220);gp.lineTo(290, 235);gp.lineTo(280, 220);
gp.moveTo(280, 310);gp.lineTo(300,310);gp.lineTo(290, 295);gp.lineTo(280, 310);
gp.moveTo(280, 320);gp.lineTo(300,320);gp.lineTo(290, 335);gp.lineTo(280, 320);
gp.moveTo(280, 410);gp.lineTo(300,410);gp.lineTo(290, 395);gp.lineTo(280, 410);
gp.moveTo(280, 420);gp.lineTo(300,420);gp.lineTo(290, 435);gp.lineTo(280, 420);
gp.moveTo(280, 510);gp.lineTo(300,510);gp.lineTo(290, 495);gp.lineTo(280, 510);
gp.moveTo(280, 520);gp.lineTo(300,520);gp.lineTo(290, 535);gp.lineTo(280, 520);
gp2.moveTo(280, 610);gp2.lineTo(300,610);gp2.lineTo(290, 595);gp2.lineTo(280, 610);
gd.draw(gp);
gd2.fill(gp2);
}
.
buat sampai enam kali tapi dengan posisi warna pada pintu lift dan tombol berada di posisi lantai selanjutnya, karena jumlah lantainya ada 6, untuk bergerak turun juga dengan kode yang mirip, kodenya banyak sekali karena membuat grafiknya pergaris, entah bisa atau tidak pakai looping saya belom coba ...
yang di atas saja belum bisa jalan / bergerak liftnya, biar bisa bergerak tambahin kode setelah initComponents ga sebanyak yang di atas sii ...
.
supaya bergerak buat kode di bawah sebanyak screenshoot di atas ...
java.util.Timer t = new java.util.Timer();.
t.schedule(new TimerTask() {
@Override
public void run() {
colored1(getGraphics());
//To change body of generated methods, choose Tools | Templates.
}
},1000);
yang ijo itu method untuk membuat lift di lantai 1, yang merah itu waktu berapa lama animasi berjalan.
Thats all.
No comments
Saya sangat berterimakasih apabila sahabat sekalian bersedia untuk tidak meninggalkan spam dan meninggalkan komentar yang berhubungan dengan artikel di atas.