diff options
Diffstat (limited to 'robottino/all_versions/v4.0.1/src')
20 files changed, 497 insertions, 0 deletions
diff --git a/robottino/all_versions/v4.0.1/src/Frame.java b/robottino/all_versions/v4.0.1/src/Frame.java new file mode 100755 index 0000000..8ec087b --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/Frame.java | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.event.*; | ||
| 24 | |||
| 25 | public class Frame extends JFrame { | ||
| 26 | public class Listener implements ActionListener { | ||
| 27 | public void actionPerformed( ActionEvent e ) { | ||
| 28 | if ( e.getSource() == exit ) | ||
| 29 | System.exit(0); | ||
| 30 | else if ( e.getSource() == informazioni ) | ||
| 31 | JOptionPane.showMessageDialog( main.frame, "info", "Robottino v4.0 - Informazioni", JOptionPane.INFORMATION_MESSAGE ); | ||
| 32 | else if ( e.getSource() == nuovo ) { | ||
| 33 | String nome = JOptionPane.showInputDialog( main.frame, "Inserire il nome del nuovo robottino:", "Robot " + ( ++main.robots ) ); | ||
| 34 | if ( nome != null ) | ||
| 35 | main.list.newRobot( nome ); | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | public static Listener listener; | ||
| 40 | public static Main main; | ||
| 41 | public static JMenuBar barraMenu = new JMenuBar(); | ||
| 42 | public static JMenu file = new JMenu( "File" ); | ||
| 43 | public static JMenu info = new JMenu( "?" ); | ||
| 44 | public static JMenuItem exit = new JMenuItem( "Esci" ); | ||
| 45 | public static JMenuItem informazioni = new JMenuItem( "Informazioni" ); | ||
| 46 | public static JMenuItem nuovo = new JMenuItem( "Nuovo Robot" ); | ||
| 47 | public Frame() { | ||
| 48 | super( "Robottino versione 4.0" ); | ||
| 49 | listener = new Listener(); | ||
| 50 | main = new Main(); | ||
| 51 | exit.addActionListener( listener ); | ||
| 52 | exit.setMnemonic( 'E' ); | ||
| 53 | informazioni.addActionListener( listener ); | ||
| 54 | informazioni.setMnemonic( 'I' ); | ||
| 55 | nuovo.addActionListener( listener ); | ||
| 56 | nuovo.setMnemonic( 'N' ); | ||
| 57 | file.add( exit ); | ||
| 58 | file.add( nuovo ); | ||
| 59 | file.setMnemonic( 'F' ); | ||
| 60 | info.add( informazioni ); | ||
| 61 | info.setMnemonic( '?' ); | ||
| 62 | barraMenu.add( file ); | ||
| 63 | barraMenu.add( info ); | ||
| 64 | setJMenuBar( barraMenu ); | ||
| 65 | } | ||
| 66 | } \ No newline at end of file | ||
diff --git a/robottino/all_versions/v4.0.1/src/List.java b/robottino/all_versions/v4.0.1/src/List.java new file mode 100755 index 0000000..b4f9982 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/List.java | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.JOptionPane; | ||
| 23 | |||
| 24 | public class List { | ||
| 25 | public static Main main = new Main(); | ||
| 26 | public Robot primoRobot, ultimoRobot; | ||
| 27 | public List() { | ||
| 28 | primoRobot = ultimoRobot = null; | ||
| 29 | } | ||
| 30 | public boolean vuota() { | ||
| 31 | return primoRobot == null; | ||
| 32 | } | ||
| 33 | public Robot getRobot( String nome ) { | ||
| 34 | Robot i = primoRobot; | ||
| 35 | for ( ; !i.nomeRobot.equals( nome ); i = i.prossimoRobot ) ; | ||
| 36 | return i; | ||
| 37 | } | ||
| 38 | public void newRobot() { | ||
| 39 | newRobot( false, false, false, false, "" ); | ||
| 40 | } | ||
| 41 | public void newRobot( String nome ) { | ||
| 42 | newRobot( false, false, false, false, nome ); | ||
| 43 | } | ||
| 44 | public void newRobot( boolean la, boolean ra, boolean ll, boolean rl, String nome ) { | ||
| 45 | if ( vuota() ) | ||
| 46 | primoRobot = ultimoRobot = new Robot( la, ra, ll, rl, nome, null, null ); | ||
| 47 | else { | ||
| 48 | ultimoRobot = new Robot( la, ra, ll, rl, nome, ultimoRobot, null ); | ||
| 49 | ultimoRobot.precedenteRobot.prossimoRobot = ultimoRobot; | ||
| 50 | } | ||
| 51 | } | ||
| 52 | public void deleteRobot( String nome ) { | ||
| 53 | if ( vuota() ) | ||
| 54 | JOptionPane.showMessageDialog( main.frame, "Nessun robottino presente. Impossibile cancellarne uno", "Robottino v4.0 - Errore", JOptionPane.ERROR_MESSAGE ); | ||
| 55 | else { | ||
| 56 | Robot i = primoRobot; | ||
| 57 | for ( ; !i.nomeRobot.equals( nome ); i = i.prossimoRobot ) ; | ||
| 58 | if ( i.precedenteRobot != null ) | ||
| 59 | i.precedenteRobot.prossimoRobot = i.prossimoRobot; | ||
| 60 | else | ||
| 61 | primoRobot = i.prossimoRobot; | ||
| 62 | if ( i.prossimoRobot != null ) | ||
| 63 | i.prossimoRobot.precedenteRobot = i.precedenteRobot; | ||
| 64 | else | ||
| 65 | ultimoRobot = i.precedenteRobot; | ||
| 66 | } | ||
| 67 | } | ||
| 68 | public void printList() { | ||
| 69 | String lista = ""; | ||
| 70 | for ( Robot i = primoRobot; i != null; i = i.prossimoRobot ) | ||
| 71 | lista += i.getName() + " "; | ||
| 72 | JOptionPane.showMessageDialog( main.frame, lista, "Robottino v4.0 - Robottini Presenti", JOptionPane.PLAIN_MESSAGE ); | ||
| 73 | } | ||
| 74 | } \ No newline at end of file | ||
diff --git a/robottino/all_versions/v4.0.1/src/Main.java b/robottino/all_versions/v4.0.1/src/Main.java new file mode 100755 index 0000000..4ef0206 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/Main.java | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.JFrame; | ||
| 23 | |||
| 24 | public class Main { | ||
| 25 | public static int robots; | ||
| 26 | public static List list; | ||
| 27 | public static Frame frame; | ||
| 28 | public static void main ( String args[] ) { | ||
| 29 | robots = 0; | ||
| 30 | list = new List(); | ||
| 31 | frame = new Frame(); | ||
| 32 | frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); | ||
| 33 | frame.setSize( 350, 150 ); | ||
| 34 | frame.setVisible( true ); | ||
| 35 | } | ||
| 36 | } \ No newline at end of file | ||
diff --git a/robottino/all_versions/v4.0.1/src/Robot.java b/robottino/all_versions/v4.0.1/src/Robot.java new file mode 100755 index 0000000..6a57c4d --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/Robot.java | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.event.*; | ||
| 24 | import java.awt.*; | ||
| 25 | |||
| 26 | public class Robot { | ||
| 27 | public static Main main = new Main(); | ||
| 28 | boolean leftArm, rightArm, leftLeg, rightLeg; | ||
| 29 | String nomeRobot; | ||
| 30 | Robot precedenteRobot, prossimoRobot; | ||
| 31 | RobotFrame robotFrame; | ||
| 32 | Robot() { | ||
| 33 | this( false, false, false, false, "", main.list.ultimoRobot, null ); | ||
| 34 | } | ||
| 35 | Robot( String nome ) { | ||
| 36 | this ( false, false, false, false, nome, main.list.ultimoRobot, null ); | ||
| 37 | } | ||
| 38 | Robot( boolean la, boolean ra, boolean ll, boolean rl, String nome, Robot prec, Robot prox ) { | ||
| 39 | leftArm = la; | ||
| 40 | rightArm = ra; | ||
| 41 | leftLeg = ll; | ||
| 42 | rightLeg = rl; | ||
| 43 | nomeRobot = nome; | ||
| 44 | precedenteRobot = prec; | ||
| 45 | prossimoRobot = prox; | ||
| 46 | robotFrame = new RobotFrame( nome ); | ||
| 47 | robotFrame.setSize( 350, 600 ); | ||
| 48 | robotFrame.setVisible( true ); | ||
| 49 | robotFrame.setDefaultCloseOperation( JFrame.DO_NOTHING_ON_CLOSE ); | ||
| 50 | robotFrame.addWindowListener( | ||
| 51 | new WindowAdapter() { | ||
| 52 | public void windowClosing( WindowEvent e ) { | ||
| 53 | int selezione = JOptionPane.showOptionDialog( Robot.this.robotFrame, "Eliminare il robottino " + Robot.this.getName() + " ?", "Robottino v4.0 - Cancellazione robottino", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { "Si", "No" }, "No" ); | ||
| 54 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 55 | main.list.deleteRobot( Robot.this.getName() ); | ||
| 56 | robotFrame.dispose(); | ||
| 57 | } | ||
| 58 | else { | ||
| 59 | try { | ||
| 60 | Thread.currentThread().sleep( 50 ); | ||
| 61 | } catch ( Exception e2 ) {} | ||
| 62 | robotFrame.repaint(); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | } | ||
| 66 | ); | ||
| 67 | } | ||
| 68 | void setLA( boolean la ) { | ||
| 69 | setPositions( la, this.rightArm, this.leftLeg, this.rightLeg ); | ||
| 70 | } | ||
| 71 | void setRA( boolean ra ) { | ||
| 72 | setPositions( this.leftArm, ra, this.leftLeg, this.rightLeg ); | ||
| 73 | } | ||
| 74 | void setLL( boolean ll ) { | ||
| 75 | setPositions( this.leftArm, this.rightArm, ll, this.rightLeg ); | ||
| 76 | } | ||
| 77 | void setRL( boolean rl ) { | ||
| 78 | setPositions( this.leftArm, this.rightArm, this.leftLeg, rl ); | ||
| 79 | } | ||
| 80 | void setPositions( boolean la, boolean ra, boolean ll, boolean rl ) { | ||
| 81 | leftArm = la; | ||
| 82 | rightArm = ra; | ||
| 83 | leftLeg = ll; | ||
| 84 | rightLeg = rl; | ||
| 85 | } | ||
| 86 | void setName( String nome ) { | ||
| 87 | nomeRobot = nome; | ||
| 88 | } | ||
| 89 | boolean getLA() { | ||
| 90 | return leftArm; | ||
| 91 | } | ||
| 92 | boolean getRA() { | ||
| 93 | return rightArm; | ||
| 94 | } | ||
| 95 | boolean getLL() { | ||
| 96 | return leftLeg; | ||
| 97 | } | ||
| 98 | boolean getRL() { | ||
| 99 | return rightLeg; | ||
| 100 | } | ||
| 101 | String getName() { | ||
| 102 | return nomeRobot; | ||
| 103 | } | ||
| 104 | Robot getNext() { | ||
| 105 | return prossimoRobot; | ||
| 106 | } | ||
| 107 | } \ No newline at end of file | ||
diff --git a/robottino/all_versions/v4.0.1/src/RobotFrame.java b/robottino/all_versions/v4.0.1/src/RobotFrame.java new file mode 100755 index 0000000..df099f1 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/RobotFrame.java | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.event.*; | ||
| 24 | import java.awt.*; | ||
| 25 | |||
| 26 | public class RobotFrame extends JFrame implements ActionListener { | ||
| 27 | public static Main main; | ||
| 28 | public static RobotPanel robotPanel; | ||
| 29 | public static JMenuBar barraMenu; | ||
| 30 | public static JMenu modifica, raMenu, laMenu, rlMenu, llMenu; | ||
| 31 | public static JMenuItem raonMenuItem, raoffMenuItem, rachangeMenuItem, laonMenuItem, laoffMenuItem, lachangeMenuItem; | ||
| 32 | public static JMenuItem rlonMenuItem, rloffMenuItem, rlchangeMenuItem, llonMenuItem, lloffMenuItem, llchangeMenuItem; | ||
| 33 | RobotFrame( String titolo ) { | ||
| 34 | super ( titolo ); | ||
| 35 | robotPanel = new RobotPanel( titolo ); | ||
| 36 | raonMenuItem = new JMenuItem( "Alza" ); | ||
| 37 | laonMenuItem = new JMenuItem( "Alza" ); | ||
| 38 | rlonMenuItem = new JMenuItem( "Alza" ); | ||
| 39 | llonMenuItem = new JMenuItem( "Alza" ); | ||
| 40 | raoffMenuItem = new JMenuItem( "Abbassa" ); | ||
| 41 | laoffMenuItem = new JMenuItem( "Abbassa" ); | ||
| 42 | rloffMenuItem = new JMenuItem( "Abbassa" ); | ||
| 43 | lloffMenuItem = new JMenuItem( "Abbassa" ); | ||
| 44 | rachangeMenuItem = new JMenuItem( "Cambia posizione" ); | ||
| 45 | lachangeMenuItem = new JMenuItem( "Cambia posizione" ); | ||
| 46 | rlchangeMenuItem = new JMenuItem( "Cambia posizione" ); | ||
| 47 | llchangeMenuItem = new JMenuItem( "Cambia posizione" ); | ||
| 48 | raonMenuItem.addActionListener( this ); | ||
| 49 | raoffMenuItem.addActionListener( this ); | ||
| 50 | rachangeMenuItem.addActionListener( this ); | ||
| 51 | laonMenuItem.addActionListener( this ); | ||
| 52 | laoffMenuItem.addActionListener( this ); | ||
| 53 | lachangeMenuItem.addActionListener( this ); | ||
| 54 | rlonMenuItem.addActionListener( this ); | ||
| 55 | rloffMenuItem.addActionListener( this ); | ||
| 56 | rlchangeMenuItem.addActionListener( this ); | ||
| 57 | llonMenuItem.addActionListener( this ); | ||
| 58 | lloffMenuItem.addActionListener( this ); | ||
| 59 | llchangeMenuItem.addActionListener( this ); | ||
| 60 | raMenu = new JMenu( "Braccio destro" ); | ||
| 61 | raMenu.add( raonMenuItem ); | ||
| 62 | raMenu.add( raoffMenuItem ); | ||
| 63 | raMenu.add( rachangeMenuItem ); | ||
| 64 | laMenu = new JMenu( "Braccio sinistro" ); | ||
| 65 | laMenu.add( laonMenuItem ); | ||
| 66 | laMenu.add( laoffMenuItem ); | ||
| 67 | laMenu.add( lachangeMenuItem ); | ||
| 68 | rlMenu = new JMenu( "Gamba destra" ); | ||
| 69 | rlMenu.add( rlonMenuItem ); | ||
| 70 | rlMenu.add( rloffMenuItem ); | ||
| 71 | rlMenu.add( rlchangeMenuItem ); | ||
| 72 | llMenu = new JMenu( "Gamba sinistra" ); | ||
| 73 | llMenu.add( llonMenuItem ); | ||
| 74 | llMenu.add( lloffMenuItem ); | ||
| 75 | llMenu.add( llchangeMenuItem ); | ||
| 76 | modifica = new JMenu( "Modifica" ); | ||
| 77 | modifica.add( raMenu ); | ||
| 78 | modifica.add( laMenu ); | ||
| 79 | modifica.add( rlMenu ); | ||
| 80 | modifica.add( llMenu ); | ||
| 81 | barraMenu = new JMenuBar(); | ||
| 82 | barraMenu.add( modifica ); | ||
| 83 | setJMenuBar( barraMenu ); | ||
| 84 | add( robotPanel ); | ||
| 85 | } | ||
| 86 | public void actionPerformed( ActionEvent e ) { | ||
| 87 | esegui( e ); | ||
| 88 | } | ||
| 89 | public void esegui( ActionEvent e ) { | ||
| 90 | if ( e.getSource() == raonMenuItem ) | ||
| 91 | main.list.getRobot( this.getTitle() ).rightArm = true; | ||
| 92 | else if ( e.getSource() == raoffMenuItem ) | ||
| 93 | main.list.getRobot( this.getTitle() ).rightArm = false; | ||
| 94 | else if ( e.getSource() == rachangeMenuItem ) | ||
| 95 | main.list.getRobot( this.getTitle() ).rightArm = !main.list.getRobot( this.getTitle() ).rightArm; | ||
| 96 | else if ( e.getSource() == laonMenuItem ) | ||
| 97 | main.list.getRobot( this.getTitle() ).leftArm = true; | ||
| 98 | else if ( e.getSource() == laoffMenuItem ) | ||
| 99 | main.list.getRobot( this.getTitle() ).leftArm = false; | ||
| 100 | else if ( e.getSource() == lachangeMenuItem ) | ||
| 101 | main.list.getRobot( this.getTitle() ).leftArm = !main.list.getRobot( this.getTitle() ).leftArm; | ||
| 102 | if ( e.getSource() == rlonMenuItem ) | ||
| 103 | main.list.getRobot( this.getTitle() ).rightLeg = true; | ||
| 104 | else if ( e.getSource() == rloffMenuItem ) | ||
| 105 | main.list.getRobot( this.getTitle() ).rightLeg = false; | ||
| 106 | else if ( e.getSource() == rlchangeMenuItem ) | ||
| 107 | main.list.getRobot( this.getTitle() ).rightLeg = !main.list.getRobot( this.getTitle() ).rightLeg; | ||
| 108 | else if ( e.getSource() == llonMenuItem ) | ||
| 109 | main.list.getRobot( this.getTitle() ).leftLeg = true; | ||
| 110 | else if ( e.getSource() == lloffMenuItem ) | ||
| 111 | main.list.getRobot( this.getTitle() ).leftLeg = false; | ||
| 112 | else if ( e.getSource() == llchangeMenuItem ) | ||
| 113 | main.list.getRobot( this.getTitle() ).leftLeg = !main.list.getRobot( this.getTitle() ).leftLeg; | ||
| 114 | robotPanel.setImages(); | ||
| 115 | repaint(); | ||
| 116 | } | ||
| 117 | |||
| 118 | } \ No newline at end of file | ||
diff --git a/robottino/all_versions/v4.0.1/src/RobotPanel.java b/robottino/all_versions/v4.0.1/src/RobotPanel.java new file mode 100755 index 0000000..b66d90e --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/RobotPanel.java | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2008, 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This 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 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.*; | ||
| 24 | |||
| 25 | public 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 | ||
diff --git a/robottino/all_versions/v4.0.1/src/img/birra1.jpg b/robottino/all_versions/v4.0.1/src/img/birra1.jpg new file mode 100755 index 0000000..6cbf8a8 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/birra1.jpg | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/birra2.jpg b/robottino/all_versions/v4.0.1/src/img/birra2.jpg new file mode 100755 index 0000000..3b3caae --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/birra2.jpg | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/birra3.jpg b/robottino/all_versions/v4.0.1/src/img/birra3.jpg new file mode 100755 index 0000000..9bc6971 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/birra3.jpg | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/birra4.jpg b/robottino/all_versions/v4.0.1/src/img/birra4.jpg new file mode 100755 index 0000000..970f2ff --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/birra4.jpg | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/birra5.gif b/robottino/all_versions/v4.0.1/src/img/birra5.gif new file mode 100755 index 0000000..6318d90 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/birra5.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/laoff.gif b/robottino/all_versions/v4.0.1/src/img/laoff.gif new file mode 100755 index 0000000..49d9db0 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/laoff.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/laon.gif b/robottino/all_versions/v4.0.1/src/img/laon.gif new file mode 100755 index 0000000..1880677 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/laon.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/lloff.gif b/robottino/all_versions/v4.0.1/src/img/lloff.gif new file mode 100755 index 0000000..3db1ceb --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/lloff.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/llon.gif b/robottino/all_versions/v4.0.1/src/img/llon.gif new file mode 100755 index 0000000..ab1ff75 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/llon.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/raoff.gif b/robottino/all_versions/v4.0.1/src/img/raoff.gif new file mode 100755 index 0000000..88aabc4 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/raoff.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/raon.gif b/robottino/all_versions/v4.0.1/src/img/raon.gif new file mode 100755 index 0000000..46190a8 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/raon.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/rloff.gif b/robottino/all_versions/v4.0.1/src/img/rloff.gif new file mode 100755 index 0000000..04bda22 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/rloff.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/rlon.gif b/robottino/all_versions/v4.0.1/src/img/rlon.gif new file mode 100755 index 0000000..447464b --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/rlon.gif | |||
| Binary files differ | |||
diff --git a/robottino/all_versions/v4.0.1/src/img/robot.gif b/robottino/all_versions/v4.0.1/src/img/robot.gif new file mode 100755 index 0000000..db87686 --- /dev/null +++ b/robottino/all_versions/v4.0.1/src/img/robot.gif | |||
| Binary files differ | |||
