Simple single-color 8x8x8 LED Cube with AVRs
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. import javax.swing.event.*;
  5. import java.io.File;
  6. import com.sun.j3d.utils.universe.*;
  7. import com.sun.j3d.utils.geometry.*;
  8. import javax.media.j3d.*;
  9. import javax.vecmath.*;
  10. /*
  11. * frame.java
  12. *
  13. *
  14. * Copyright 2011 Thomas Buck <xythobuz@me.com>
  15. * Copyright 2011 Max Nuding <max.nuding@gmail.com>
  16. * Copyright 2011 Felix Bäder <baeder.felix@gmail.com>
  17. *
  18. * This file is part of LED-Cube.
  19. *
  20. * LED-Cube is free software: you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation, either version 3 of the License, or
  23. * (at your option) any later version.
  24. *
  25. * LED-Cube is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU General Public License
  31. * along with LED-Cube. If not, see <http://www.gnu.org/licenses/>.
  32. */
  33. public class frame extends JFrame implements ListSelectionListener {
  34. // Anfang Variablen
  35. private GraphicsConfiguration gConfig = SimpleUniverse.getPreferredConfiguration();
  36. private Canvas3D cubeCanvas = new Canvas3D(gConfig);
  37. SimpleUniverse universe;
  38. Transform3D transform3d;
  39. TransformGroup transroot;
  40. BranchGroup branchgroup;
  41. // Anfang Attribute
  42. private JButton editA = new JButton();
  43. private JButton editB = new JButton();
  44. private JButton editC = new JButton();
  45. private JButton editD = new JButton();
  46. private JButton editE = new JButton();
  47. private JButton editF = new JButton();
  48. private JButton editG = new JButton();
  49. private JButton editH = new JButton();
  50. private DefaultListModel frameListModel = new DefaultListModel();
  51. private JList frameList = new JList();
  52. private JScrollPane frameListScrollPane = new JScrollPane(frameList);
  53. private JButton frameUp = new JButton();
  54. private JButton frameDown = new JButton();
  55. private JButton frameAdd = new JButton();
  56. private JButton frameRemove = new JButton();
  57. private JButton frame = new JButton();
  58. private JList animList = new JList();
  59. private DefaultListModel animModel = new DefaultListModel();
  60. private JScrollPane animScrollPane = new JScrollPane(animList);
  61. private JButton animUp = new JButton();
  62. private JButton animDown = new JButton();
  63. private JButton animAdd = new JButton();
  64. private JButton animRemove = new JButton();
  65. private JTextField animPath = new JTextField();
  66. private JButton load = new JButton();
  67. private JButton save = new JButton();
  68. private JButton saveAs = new JButton();
  69. private JComboBox jComboBox1 = new JComboBox();
  70. private JButton upload = new JButton();
  71. private JButton download = new JButton();
  72. private JLabel jLabel4 = new JLabel();
  73. private JTextField frameRemaining = new JTextField();
  74. // Ende Attribute
  75. private cubeWorker worker = new cubeWorker();
  76. private boolean fileSelected = false;
  77. // Ende Variablen
  78. private int saveExitDialog() {
  79. String[] Optionen = {"Yes", "No"};
  80. int Auswahl = JOptionPane.showOptionDialog(this, "Do you want to save your changes?", "Save?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, Optionen, Optionen[0]);
  81. if (Auswahl == JOptionPane.YES_OPTION) {
  82. worker.saveState(animPath.getText());
  83. return 1;
  84. } else {
  85. return 0;
  86. }
  87. }
  88. private void errorMessage(String s) {
  89. String[] Optionen = {"OK"};
  90. JOptionPane.showOptionDialog(this, s, "Error!", JOptionPane.YES_OPTION, JOptionPane.ERROR_MESSAGE, null, Optionen, Optionen[0]);
  91. }
  92. public void valueChanged(ListSelectionEvent evt) {
  93. if (!evt.getValueIsAdjusting()) {
  94. int anim = animList.getSelectedIndex();
  95. for (int i = 0; i < worker.numOfFrames(anim); i++) {
  96. frameListModel.add(i, worker.getFrameName(anim, i));
  97. }
  98. frameList.setModel(frameListModel);
  99. }
  100. }
  101. public frame(String title) {
  102. // Frame-Initialisierung
  103. super(title);
  104. String[] sPorts = worker.getSerialPorts();
  105. for(int i = 0; i < sPorts.length; i++){
  106. jComboBox1.addItem(sPorts[i]);
  107. }
  108. for(int i = 0; i < worker.numOfAnimations(); i++){
  109. animModel.addElement(worker.getAnimationName(i));
  110. }
  111. addWindowListener(new WindowAdapter() {
  112. public void windowClosing(WindowEvent evt) {
  113. if (worker.changedStateSinceSave()) {
  114. saveExitDialog();
  115. }
  116. System.exit(0);
  117. }
  118. });
  119. int frameWidth = 661;
  120. int frameHeight = 417;
  121. setSize(frameWidth, frameHeight);
  122. Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
  123. int x = (d.width - getSize().width) / 2;
  124. int y = (d.height - getSize().height) / 2 ;
  125. setLocation(x, y);
  126. Container cp = getContentPane();
  127. cp.setLayout(null);
  128. // Anfang Komponenten
  129. //----- 3D-----
  130. //-------------
  131. cubeCanvas.setBounds(8, 8, 250, 250);
  132. cp.add(cubeCanvas);
  133. ColorCube cube1 = new ColorCube(0.3);
  134. universe = new SimpleUniverse(cubeCanvas);
  135. universe.getViewingPlatform().setNominalViewingTransform();
  136. transform3d = new Transform3D();
  137. transroot = new TransformGroup(transform3d);
  138. transform3d.rotZ (Math.toRadians(30));
  139. transroot.addChild(cube1);
  140. transform3d.setTranslation(new Vector3d(2,2,2));
  141. branchgroup = new BranchGroup();
  142. branchgroup.addChild(transroot);
  143. universe.addBranchGraph(branchgroup);
  144. //-------------
  145. editA.setBounds(264, 8, 107, 25);
  146. editA.setText("Layer A");
  147. editA.setFont(new Font("Dialog", Font.PLAIN, 13));
  148. cp.add(editA);
  149. editA.addActionListener(new ActionListener() {
  150. public void actionPerformed(ActionEvent evt) {
  151. editA_ActionPerformed(evt);
  152. }
  153. });
  154. editB.setBounds(264, 40, 107, 25);
  155. editB.setText("Layer B");
  156. editB.setFont(new Font("Dialog", Font.PLAIN, 13));
  157. cp.add(editB);
  158. editB.addActionListener(new ActionListener() {
  159. public void actionPerformed(ActionEvent evt) {
  160. editB_ActionPerformed(evt);
  161. }
  162. });
  163. editC.setBounds(264, 72, 107, 25);
  164. editC.setText("Layer C");
  165. editC.setFont(new Font("Dialog", Font.PLAIN, 13));
  166. cp.add(editC);
  167. editC.addActionListener(new ActionListener() {
  168. public void actionPerformed(ActionEvent evt) {
  169. editC_ActionPerformed(evt);
  170. }
  171. });
  172. editD.setBounds(264, 104, 107, 25);
  173. editD.setText("Layer D");
  174. editD.setFont(new Font("Dialog", Font.PLAIN, 13));
  175. cp.add(editD);
  176. editD.addActionListener(new ActionListener() {
  177. public void actionPerformed(ActionEvent evt) {
  178. editD_ActionPerformed(evt);
  179. }
  180. });
  181. editE.setBounds(264, 136, 107, 25);
  182. editE.setText("Layer E");
  183. editE.setFont(new Font("Dialog", Font.PLAIN, 13));
  184. cp.add(editE);
  185. editE.addActionListener(new ActionListener() {
  186. public void actionPerformed(ActionEvent evt) {
  187. editE_ActionPerformed(evt);
  188. }
  189. });
  190. editF.setBounds(264, 168, 107, 25);
  191. editF.setText("Layer F");
  192. editF.setFont(new Font("Dialog", Font.PLAIN, 13));
  193. cp.add(editF);
  194. editF.addActionListener(new ActionListener() {
  195. public void actionPerformed(ActionEvent evt) {
  196. editF_ActionPerformed(evt);
  197. }
  198. });
  199. editG.setBounds(264, 200, 107, 25);
  200. editG.setText("Layer G");
  201. editG.setFont(new Font("Dialog", Font.PLAIN, 13));
  202. cp.add(editG);
  203. editG.addActionListener(new ActionListener() {
  204. public void actionPerformed(ActionEvent evt) {
  205. editG_ActionPerformed(evt);
  206. }
  207. });
  208. editH.setBounds(264, 232, 107, 25);
  209. editH.setText("Layer H");
  210. editH.setFont(new Font("Dialog", Font.PLAIN, 13));
  211. cp.add(editH);
  212. editH.addActionListener(new ActionListener() {
  213. public void actionPerformed(ActionEvent evt) {
  214. editH_ActionPerformed(evt);
  215. }
  216. });
  217. frameListScrollPane.setBounds(384, 8, 145, 249);
  218. frameList.setModel(frameListModel);
  219. //frameListModel.addElement();
  220. cp.add(frameListScrollPane);
  221. frameUp.setBounds(544, 8, 107, 33);
  222. frameUp.setText("Move up");
  223. frameUp.setFont(new Font("Dialog", Font.PLAIN, 13));
  224. cp.add(frameUp);
  225. frameUp.addActionListener(new ActionListener() {
  226. public void actionPerformed(ActionEvent evt) {
  227. frameUp_ActionPerformed(evt);
  228. }
  229. });
  230. frameDown.setBounds(544, 152, 107, 33);
  231. frameDown.setText("Move down");
  232. frameDown.setFont(new Font("Dialog", Font.PLAIN, 13));
  233. cp.add(frameDown);
  234. frameDown.addActionListener(new ActionListener() {
  235. public void actionPerformed(ActionEvent evt) {
  236. frameDown_ActionPerformed(evt);
  237. }
  238. });
  239. frameAdd.setBounds(544, 56, 107, 33);
  240. frameAdd.setText("Add");
  241. frameAdd.setFont(new Font("Dialog", Font.PLAIN, 13));
  242. cp.add(frameAdd);
  243. frameAdd.addActionListener(new ActionListener() {
  244. public void actionPerformed(ActionEvent evt) {
  245. frameAdd_ActionPerformed(evt);
  246. }
  247. });
  248. frameRemove.setBounds(544, 104, 107, 33);
  249. frameRemove.setText("Remove");
  250. frameRemove.setFont(new Font("Dialog", Font.PLAIN, 13));
  251. cp.add(frameRemove);
  252. frameRemove.addActionListener(new ActionListener() {
  253. public void actionPerformed(ActionEvent evt) {
  254. frameRemove_ActionPerformed(evt);
  255. }
  256. });
  257. animScrollPane.setBounds(8, 264, 209, 121);
  258. animList.setModel(animModel);
  259. //jList2Model.addElement("");
  260. cp.add(animScrollPane);
  261. animUp.setBounds(224, 264, 99, 25);
  262. animUp.setText("Move up");
  263. animUp.setFont(new Font("Dialog", Font.PLAIN, 13));
  264. cp.add(animUp);
  265. animUp.addActionListener(new ActionListener() {
  266. public void actionPerformed(ActionEvent evt) {
  267. animUp_ActionPerformed(evt);
  268. }
  269. });
  270. animDown.setBounds(224, 360, 99, 25);
  271. animDown.setText("Move down");
  272. animDown.setFont(new Font("Dialog", Font.PLAIN, 13));
  273. cp.add(animDown);
  274. animDown.addActionListener(new ActionListener() {
  275. public void actionPerformed(ActionEvent evt) {
  276. animDown_ActionPerformed(evt);
  277. }
  278. });
  279. animAdd.setBounds(224, 296, 99, 25);
  280. animAdd.setText("Add");
  281. animAdd.setFont(new Font("Dialog", Font.PLAIN, 13));
  282. cp.add(animAdd);
  283. animAdd.addActionListener(new ActionListener() {
  284. public void actionPerformed(ActionEvent evt) {
  285. animAdd_ActionPerformed(evt);
  286. }
  287. });
  288. animRemove.setBounds(224, 328, 99, 25);
  289. animRemove.setText("Remove");
  290. animRemove.setFont(new Font("Dialog", Font.PLAIN, 13));
  291. cp.add(animRemove);
  292. animRemove.addActionListener(new ActionListener() {
  293. public void actionPerformed(ActionEvent evt) {
  294. animRemove_ActionPerformed(evt);
  295. }
  296. });
  297. animPath.setBounds(344, 264, 305, 24);
  298. animPath.setEditable(false);
  299. animPath.setText("Load/Save an animation file...");
  300. animPath.setFont(new Font("Dialog", Font.PLAIN, 13));
  301. cp.add(animPath);
  302. load.setBounds(344, 296, 100, 25);
  303. load.setText("Load");
  304. load.setFont(new Font("Dialog", Font.PLAIN, 13));
  305. cp.add(load);
  306. load.addActionListener(new ActionListener() {
  307. public void actionPerformed(ActionEvent evt) {
  308. load_ActionPerformed(evt);
  309. }
  310. });
  311. save.setBounds(454, 296, 100, 25);
  312. save.setText("Save");
  313. save.setFont(new Font("Dialog", Font.PLAIN, 13));
  314. cp.add(save);
  315. save.addActionListener(new ActionListener() {
  316. public void actionPerformed(ActionEvent evt) {
  317. save_ActionPerformed(evt);
  318. }
  319. });
  320. saveAs.setBounds(564, 296, 90, 25);
  321. saveAs.setText("Save As");
  322. saveAs.setFont(new Font("Dialog", Font.PLAIN, 13));
  323. cp.add(saveAs);
  324. saveAs.addActionListener(new ActionListener() {
  325. public void actionPerformed(ActionEvent evt) {
  326. saveAs_ActionPerformed(evt);
  327. }
  328. });
  329. jComboBox1.setBounds(344, 328, 305, 24);
  330. jComboBox1.setFont(new Font("Dialog", Font.PLAIN, 13));
  331. cp.add(jComboBox1);
  332. upload.setBounds(344, 360, 147, 25);
  333. upload.setText("Upload");
  334. upload.setFont(new Font("Dialog", Font.PLAIN, 13));
  335. cp.add(upload);
  336. upload.addActionListener(new ActionListener() {
  337. public void actionPerformed(ActionEvent evt) {
  338. upload_ActionPerformed(evt);
  339. }
  340. });
  341. download.setBounds(504, 360, 147, 25);
  342. download.setText("Download");
  343. download.setFont(new Font("Dialog", Font.PLAIN, 13));
  344. cp.add(download);
  345. download.addActionListener(new ActionListener() {
  346. public void actionPerformed(ActionEvent evt) {
  347. download_ActionPerformed(evt);
  348. }
  349. });
  350. jLabel4.setBounds(536, 208, 112, 20);
  351. jLabel4.setText("Frames remaining:");
  352. jLabel4.setFont(new Font("Dialog", Font.PLAIN, 13));
  353. cp.add(jLabel4);
  354. frameRemaining.setBounds(536, 232, 113, 24);
  355. frameRemaining.setEditable(false);
  356. frameRemaining.setText("2048");
  357. frameRemaining.setFont(new Font("Dialog", Font.PLAIN, 13));
  358. cp.add(frameRemaining);
  359. animList.setFont(new Font("Dialog", Font.PLAIN, 13));
  360. frameList.setFont(new Font("Dialog", Font.PLAIN, 13));
  361. // Ende Komponenten
  362. animList.addListSelectionListener(this);
  363. setResizable(false);
  364. setVisible(true);
  365. }
  366. // Anfang Methoden
  367. // Anfang Ereignisprozeduren
  368. public void editA_ActionPerformed(ActionEvent evt) {
  369. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(0));
  370. }
  371. public void editB_ActionPerformed(ActionEvent evt) {
  372. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(1));
  373. }
  374. public void editC_ActionPerformed(ActionEvent evt) {
  375. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(2));
  376. }
  377. public void editD_ActionPerformed(ActionEvent evt) {
  378. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(3));
  379. }
  380. public void editE_ActionPerformed(ActionEvent evt) {
  381. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(4));
  382. }
  383. public void editF_ActionPerformed(ActionEvent evt) {
  384. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(5));
  385. }
  386. public void editG_ActionPerformed(ActionEvent evt) {
  387. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(6));
  388. }
  389. public void editH_ActionPerformed(ActionEvent evt) {
  390. // layerEditFrame layerFrame1 = new layerEditFrame(worker.getLayer(7));
  391. }
  392. public void frameUp_ActionPerformed(ActionEvent evt) {
  393. int i = frameList.getSelectedIndex();
  394. if ((i > 0) && (frameListModel.getSize() >= 2)) {
  395. Object tmp = frameListModel.get(i);
  396. frameListModel.set(i, frameListModel.get(i - 1));
  397. frameListModel.set(i - 1, tmp);
  398. frameList.setSelectedIndex(i - 1);
  399. worker.moveFrame(worker.UP, animList.getSelectedIndex(), frameList.getSelectedIndex());
  400. }
  401. }
  402. public void frameDown_ActionPerformed(ActionEvent evt) {
  403. int i = frameList.getSelectedIndex();
  404. if ((i >= 0) && (frameListModel.getSize() >= 2) && (i < (frameListModel.getSize() - 1))) {
  405. Object tmp = frameListModel.get(i);
  406. frameListModel.set(i, frameListModel.get(i + 1));
  407. frameListModel.set(i + 1, tmp);
  408. frameList.setSelectedIndex(i + 1);
  409. worker.moveFrame(worker.DOWN, animList.getSelectedIndex(), frameList.getSelectedIndex());
  410. }
  411. }
  412. public void frameAdd_ActionPerformed(ActionEvent evt) {
  413. worker.addFrame(animList.getSelectedIndex());
  414. frameRemaining.setText(Integer.toString(worker.framesRemaining()));
  415. int n = worker.numOfFrames(animList.getSelectedIndex()) - 1;
  416. if (n < 0) {
  417. n = 0;
  418. }
  419. frameListModel.add(n, worker.getFrameName(animList.getSelectedIndex(), n));
  420. frameList.setModel(frameListModel);
  421. }
  422. public void frameRemove_ActionPerformed(ActionEvent evt) {
  423. worker.removeFrame(animList.getSelectedIndex(), frameList.getSelectedIndex());
  424. frameRemaining.setText(Integer.toString(worker.framesRemaining()));
  425. frameListModel.removeElementAt(frameList.getSelectedIndex());
  426. frameList.setModel(frameListModel);
  427. }
  428. public void animUp_ActionPerformed(ActionEvent evt) {
  429. int i = animList.getSelectedIndex();
  430. if ((i > 0) && (animModel.getSize() >= 2)) {
  431. Object tmp = animModel.get(i);
  432. animModel.set(i, animModel.get(i - 1));
  433. animModel.set(i - 1, tmp);
  434. animList.setSelectedIndex(i - 1);
  435. worker.moveAnimation(worker.UP, animList.getSelectedIndex());
  436. }
  437. }
  438. public void animDown_ActionPerformed(ActionEvent evt) {
  439. int i = animList.getSelectedIndex();
  440. if ((i >= 0) && (animModel.getSize() >= 2) && (i < (animModel.getSize() - 1))) {
  441. Object tmp = animModel.get(i);
  442. animModel.set(i, animModel.get(i + 1));
  443. animModel.set(i + 1, tmp);
  444. animList.setSelectedIndex(i + 1);
  445. worker.moveAnimation(worker.DOWN, animList.getSelectedIndex());
  446. }
  447. }
  448. public void animAdd_ActionPerformed(ActionEvent evt) {
  449. if(worker.addAnimation() == -1){
  450. errorMessage("Could not add animation!");
  451. } else {
  452. int n = worker.numOfAnimations() - 1;
  453. if (n < 0) {
  454. n = 0;
  455. }
  456. animModel.add(n, worker.getAnimationName(n));
  457. animList.setModel(animModel);
  458. }
  459. }
  460. public void animRemove_ActionPerformed(ActionEvent evt) {
  461. worker.removeAnimation(animList.getSelectedIndex());
  462. animModel.removeElementAt(animList.getSelectedIndex());
  463. animList.setModel(animModel);
  464. }
  465. public void load_ActionPerformed(ActionEvent evt) {
  466. JFileChooser fc = new JFileChooser();
  467. int ret = fc.showOpenDialog(this);
  468. if (ret == JFileChooser.APPROVE_OPTION) {
  469. File file = fc.getSelectedFile();
  470. if (fileSelected == false) {
  471. fileSelected = true;
  472. }
  473. animPath.setText(file.getPath());
  474. worker.loadState(animPath.getText());
  475. }
  476. }
  477. public void save_ActionPerformed(ActionEvent evt) {
  478. if (fileSelected == false) {
  479. JFileChooser fc = new JFileChooser();
  480. int ret = fc.showSaveDialog(this);
  481. if (ret == JFileChooser.APPROVE_OPTION) {
  482. File file = fc.getSelectedFile();
  483. fileSelected = true;
  484. animPath.setText(file.getPath());
  485. worker.saveState(animPath.getText());
  486. }
  487. } else {
  488. worker.saveState(animPath.getText());
  489. }
  490. }
  491. public void saveAs_ActionPerformed(ActionEvent evt) {
  492. JFileChooser fc;
  493. if (fileSelected == true) {
  494. fc = new JFileChooser(new File(animPath.getText()).getParentFile());
  495. } else {
  496. fc = new JFileChooser();
  497. }
  498. int ret = fc.showSaveDialog(this);
  499. if (ret == JFileChooser.APPROVE_OPTION) {
  500. File file = fc.getSelectedFile();
  501. if (fileSelected == false) {
  502. fileSelected = true;
  503. }
  504. animPath.setText(file.getPath());
  505. worker.saveState(animPath.getText());
  506. }
  507. }
  508. public void upload_ActionPerformed(ActionEvent evt) {
  509. if (jComboBox1.getSelectedItem().equals("Select serial port...")) {
  510. errorMessage("No serial port selected...");
  511. } else {
  512. worker.uploadState((String)jComboBox1.getSelectedItem());
  513. }
  514. }
  515. public void download_ActionPerformed(ActionEvent evt) {
  516. if (jComboBox1.getSelectedItem().equals("Select serial port...")) {
  517. errorMessage("No serial port selected...");
  518. } else {
  519. worker.downloadState((String)jComboBox1.getSelectedItem());
  520. }
  521. }
  522. // Ende Ereignisprozeduren
  523. public static void main(String[] args) {
  524. new frame("Cube Control");
  525. }
  526. // Ende Methoden
  527. }