aboutsummaryrefslogtreecommitdiff
path: root/robottino/all_versions/v4.1/src/RobotPanel.java
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-03-26 19:27:18 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-03-26 19:27:18 +0100
commit7167b4341ef290d56fb96e2af10883a4b925d83b (patch)
tree1eb1b9e5ab82ddd89540e68d6b22ae69514575c6 /robottino/all_versions/v4.1/src/RobotPanel.java
downloadancient-projects-7167b4341ef290d56fb96e2af10883a4b925d83b.tar.gz
ancient-projects-7167b4341ef290d56fb96e2af10883a4b925d83b.zip
I found my old code!HEADmaster
Diffstat (limited to 'robottino/all_versions/v4.1/src/RobotPanel.java')
-rwxr-xr-xrobottino/all_versions/v4.1/src/RobotPanel.java96
1 files changed, 96 insertions, 0 deletions
diff --git a/robottino/all_versions/v4.1/src/RobotPanel.java b/robottino/all_versions/v4.1/src/RobotPanel.java
new file mode 100755
index 0000000..b66d90e
--- /dev/null
+++ b/robottino/all_versions/v4.1/src/RobotPanel.java
@@ -0,0 +1,96 @@
1/*
2Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org>
3
4This file is part of Robottino.
5
6 Robottino is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 Robottino is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Robottino; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
20*/
21
22import javax.swing.*;
23import java.awt.*;
24
25public class RobotPanel extends JPanel {
26 public static String nomeRobot;
27 public static Main main;
28 public static ImageIcon ra, la, rl, ll, body;
29 public static int rax, ray, lax, lay, rlx, rly, llx, lly;
30 RobotPanel( String nomeRobot ) {
31 this.nomeRobot = nomeRobot;
32 rax = 66;
33 ray = 248;
34 lax = 225;
35 lay = 242;
36 rlx = 84;
37 rly = 367;
38 llx = 148;
39 lly = 367;
40 body = new ImageIcon( ClassLoader.getSystemResource( "img/robot.gif" ) );
41 ra = new ImageIcon( ClassLoader.getSystemResource( "img/raoff.gif" ) );
42 la = new ImageIcon( ClassLoader.getSystemResource( "img/laoff.gif" ) );
43 rl = new ImageIcon( ClassLoader.getSystemResource( "img/rloff.gif" ) );
44 ll = new ImageIcon( ClassLoader.getSystemResource( "img/lloff.gif" ) );
45 }
46 public void paint ( Graphics g ) {
47 super.paint( g );
48 body.paintIcon( this, g, 100, 60 );
49 ra.paintIcon( this, g, this.rax, this.ray );
50 la.paintIcon( this, g, this.lax, this.lay );
51 rl.paintIcon( this, g, this.rlx, this.rly );
52 ll.paintIcon( this, g, this.llx, this.lly );
53 }
54 public void setImages() {
55 if ( main.list.getRobot( nomeRobot ).rightArm ) {
56 this.ra = new ImageIcon( ClassLoader.getSystemResource( "img/raon.gif" ) );
57 this.rax = 68;
58 this.ray = 128;
59 }
60 else {
61 this.ra = new ImageIcon( ClassLoader.getSystemResource( "img/raoff.gif" ) );
62 this.rax = 66;
63 this.ray = 248;
64 }
65 if ( main.list.getRobot( nomeRobot ).leftArm ) {
66 this.la = new ImageIcon( ClassLoader.getSystemResource( "img/laon.gif" ) );
67 this.lax = 224;
68 this.lay = 118;
69 }
70 else {
71 this.la = new ImageIcon( ClassLoader.getSystemResource( "img/laoff.gif" ) );
72 this.lax = 225;
73 this.lay = 242;
74 }
75 if ( main.list.getRobot( nomeRobot ).rightLeg ) {
76 this.rl = new ImageIcon( ClassLoader.getSystemResource( "img/rlon.gif" ) );
77 this.rlx = 84;
78 this.rly = 356;
79 }
80 else {
81 this.rl = new ImageIcon( ClassLoader.getSystemResource( "img/rloff.gif" ) );
82 this.rlx = 84;
83 this.rly = 367;
84 }
85 if ( main.list.getRobot( nomeRobot ).leftLeg ) {
86 this.ll = new ImageIcon( ClassLoader.getSystemResource( "img/llon.gif" ) );
87 this.llx = 140;
88 this.lly = 363;
89 }
90 else {
91 this.ll = new ImageIcon( ClassLoader.getSystemResource( "img/lloff.gif" ) );
92 this.llx = 148;
93 this.lly = 367;
94 }
95 }
96} \ No newline at end of file

Generated with cgit - Back to sebastiano.tronto.net