[31] | 1 | /************************************************************************************ |
---|
| 2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
| 3 | * All rights reserved. |
---|
| 4 | * Refer to LICENSE for terms and conditions of use. |
---|
| 5 | ***********************************************************************************/ |
---|
| 6 | package vnsim.gui.selector; |
---|
| 7 | |
---|
| 8 | import javax.swing.*; |
---|
| 9 | |
---|
| 10 | import vnsim.map.object.Map; |
---|
| 11 | import vnsim.vehicular.scenarios.EntryExitScenario; |
---|
| 12 | import vnsim.vehicular.scenarios.EntryScenario; |
---|
| 13 | import vnsim.vehicular.scenarios.Route; |
---|
| 14 | import vnsim.vehicular.scenarios.Scenario; |
---|
| 15 | import vnsim.vehicular.scenarios.ScenarioMap; |
---|
| 16 | import vnsim.vehicular.simulator.Location; |
---|
| 17 | import vnsim.gui.Utils; |
---|
| 18 | |
---|
| 19 | import java.awt.*; |
---|
| 20 | import java.awt.event.ActionEvent; |
---|
| 21 | import java.awt.event.ActionListener; |
---|
| 22 | import java.util.Vector; |
---|
| 23 | import java.util.logging.Logger; |
---|
| 24 | import java.util.logging.Level; |
---|
| 25 | import java.io.*; |
---|
| 26 | |
---|
| 27 | public class EntryExitConfig extends JPanel { |
---|
| 28 | |
---|
| 29 | /** Logger used by this class */ |
---|
| 30 | private static final transient Logger logger = Logger.getLogger("gui.selector.EntryExitConfig"); |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | * |
---|
| 34 | */ |
---|
| 35 | private static final long serialVersionUID = -2386010293426825417L; |
---|
| 36 | |
---|
| 37 | ScenarioMap inScenario; |
---|
| 38 | |
---|
| 39 | EntryScenario currentEntryScenario; |
---|
| 40 | |
---|
| 41 | Location currentEntry; |
---|
| 42 | |
---|
| 43 | JPanel mainConfig; |
---|
| 44 | |
---|
| 45 | Vector<Integer> validExits; |
---|
| 46 | |
---|
| 47 | RouteSelector routePanel; |
---|
| 48 | |
---|
| 49 | int hight; |
---|
| 50 | |
---|
| 51 | JLabel flow, exitLabel; |
---|
| 52 | |
---|
| 53 | JLabel[] driverTypes; |
---|
| 54 | |
---|
| 55 | JTextField flowValue; |
---|
| 56 | |
---|
| 57 | JTextField[] driverTypesValue; |
---|
| 58 | |
---|
| 59 | JButton[] routeName; |
---|
| 60 | |
---|
| 61 | JTextField[] routeProcents; |
---|
| 62 | |
---|
| 63 | JComboBox exitSelect; |
---|
| 64 | |
---|
| 65 | Scenario outScenario; |
---|
| 66 | |
---|
| 67 | ScenarioConfiguration sc = null; |
---|
| 68 | |
---|
| 69 | myActionListener myListener; |
---|
| 70 | |
---|
| 71 | EntryExitScenario currentEntryExitScenario; |
---|
| 72 | |
---|
| 73 | public class myActionListener implements ActionListener { |
---|
| 74 | public void actionPerformed(ActionEvent e) { |
---|
| 75 | if (e.getSource() == exitSelect) { |
---|
| 76 | int idx = exitSelect.getSelectedIndex(); |
---|
| 77 | if (idx >= 0) { |
---|
| 78 | Location newExit = outScenario.exits.get(validExits.elementAt(idx)); |
---|
| 79 | if (!newExit.equals(routePanel.stop)) { |
---|
| 80 | routePanel.setVisible(false); |
---|
| 81 | routePanel.saveRouteValues(); |
---|
| 82 | routePanel = new RouteSelector(currentEntry, newExit); |
---|
| 83 | ScenarioConfiguration.mapRepresentation.setStop(outScenario.exits |
---|
| 84 | .get(validExits.elementAt(idx))); |
---|
| 85 | ScenarioConfiguration.mapRepresentation.setRoute(null); |
---|
| 86 | } |
---|
| 87 | for (int i = 0; i < outScenario.allRoutes.size(); i++) { |
---|
| 88 | if (outScenario.allRoutes.get(i).entry.equals(ScenarioConfiguration.mapRepresentation.start) |
---|
| 89 | && outScenario.allRoutes.get(i).exit.equals(ScenarioConfiguration.mapRepresentation.stop)) { |
---|
| 90 | ScenarioConfiguration.mapRepresentation.currentRoute=outScenario.allRoutes.get(i); |
---|
| 91 | break; |
---|
| 92 | } |
---|
| 93 | } |
---|
| 94 | } |
---|
| 95 | } |
---|
| 96 | } |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | public class RouteSelector extends JPanel { |
---|
| 100 | /** |
---|
| 101 | * |
---|
| 102 | */ |
---|
| 103 | private static final long serialVersionUID = -708491299953270966L; |
---|
| 104 | Location start, stop; |
---|
| 105 | |
---|
| 106 | public RouteSelector(Location start, Location stop) { |
---|
| 107 | super(); |
---|
| 108 | this.start = start; |
---|
| 109 | this.stop = stop; |
---|
| 110 | setPanel(); |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | public void setPanel() { |
---|
| 114 | int i = 0, k = 0; |
---|
| 115 | boolean found = false; |
---|
| 116 | SpringLayout sp = new SpringLayout(); |
---|
| 117 | this.setLayout(sp); |
---|
| 118 | SpringLayout.Constraints constraint; |
---|
| 119 | Route r; |
---|
| 120 | EntryExitScenario exs = null; |
---|
| 121 | for (k = 0; k < currentEntryScenario.entryExits.size(); k++) { |
---|
| 122 | exs = currentEntryScenario.entryExits.get(k); |
---|
| 123 | if (exs.entry.equals(this.start) && exs.exit.equals(this.stop)) { |
---|
| 124 | found = true; |
---|
| 125 | break; |
---|
| 126 | } |
---|
| 127 | } |
---|
| 128 | if (!found) { |
---|
| 129 | exs = new EntryExitScenario(this.start, this.stop); |
---|
| 130 | |
---|
| 131 | for (k = 0; k < inScenario.allRoutes.size(); k++) { |
---|
| 132 | r = inScenario.allRoutes.get(k); |
---|
| 133 | if (r.entry.equals(this.start) && r.exit.equals(this.stop)) { |
---|
| 134 | exs.routes.add(r); |
---|
| 135 | exs.percentsEachRoute.add(new Integer(0)); |
---|
| 136 | } |
---|
| 137 | } |
---|
| 138 | routeName = new JButton[exs.routes.size()]; |
---|
| 139 | routeProcents = new JTextField[exs.routes.size()]; |
---|
| 140 | for (i = 0; i < exs.routes.size(); i++) { |
---|
| 141 | routeName[i] = new JButton("Route " + i); |
---|
| 142 | routeProcents[i] = new JTextField(); |
---|
| 143 | |
---|
| 144 | constraint = sp.getConstraints(routeName[i]); |
---|
| 145 | constraint.setX(Spring.constant(1)); |
---|
| 146 | constraint.setY(Spring.constant(1 + i * 50)); |
---|
| 147 | constraint.setWidth(Spring.constant(100)); |
---|
| 148 | constraint.setHeight(Spring.constant(40)); |
---|
| 149 | |
---|
| 150 | constraint = sp.getConstraints(routeProcents[i]); |
---|
| 151 | constraint.setX(Spring.constant(150)); |
---|
| 152 | constraint.setY(Spring.constant(1 + i * 50)); |
---|
| 153 | constraint.setWidth(Spring.constant(100)); |
---|
| 154 | constraint.setHeight(Spring.constant(40)); |
---|
| 155 | routeName[i].addActionListener(myListener); |
---|
| 156 | this.add(routeName[i]); |
---|
| 157 | this.add(routeProcents[i]); |
---|
| 158 | } |
---|
| 159 | currentEntryExitScenario = exs; |
---|
| 160 | currentEntryScenario.entryExits.add(exs); |
---|
| 161 | } else { |
---|
| 162 | routeName = new JButton[exs.routes.size()]; |
---|
| 163 | routeProcents = new JTextField[exs.routes.size()]; |
---|
| 164 | // System.out.println("FOR " + this.start + "- " + this.stop |
---|
| 165 | // + " Exist nr=" + exs.routes.size() + " routes"); |
---|
| 166 | for (i = 0; i < exs.routes.size(); i++) { |
---|
| 167 | routeName[i] = new JButton("Route " + i); |
---|
| 168 | routeProcents[i] = new JTextField("" + exs.percentsEachRoute.get(i)); |
---|
| 169 | constraint = sp.getConstraints(routeName[i]); |
---|
| 170 | constraint.setX(Spring.constant(1)); |
---|
| 171 | constraint.setY(Spring.constant(1 + i * 50)); |
---|
| 172 | constraint.setWidth(Spring.constant(100)); |
---|
| 173 | constraint.setHeight(Spring.constant(40)); |
---|
| 174 | |
---|
| 175 | constraint = sp.getConstraints(routeProcents[i]); |
---|
| 176 | constraint.setX(Spring.constant(150)); |
---|
| 177 | constraint.setY(Spring.constant(1 + i * 50)); |
---|
| 178 | constraint.setWidth(Spring.constant(100)); |
---|
| 179 | constraint.setHeight(Spring.constant(40)); |
---|
| 180 | routeName[i].addActionListener(myListener); |
---|
| 181 | this.add(routeName[i]); |
---|
| 182 | this.add(routeProcents[i]); |
---|
| 183 | } |
---|
| 184 | currentEntryExitScenario = exs; |
---|
| 185 | } |
---|
| 186 | this.setPreferredSize(new Dimension(300, i * 50 + 50)); |
---|
| 187 | this.setVisible(true); |
---|
| 188 | } |
---|
| 189 | |
---|
| 190 | public void saveRouteValues() { |
---|
| 191 | int i; |
---|
| 192 | EntryExitScenario exs = null; |
---|
| 193 | String text; |
---|
| 194 | int val; |
---|
| 195 | exs = currentEntryExitScenario; |
---|
| 196 | if (exs != null) { |
---|
| 197 | for (i = 0; i < exs.routes.size() - 1; i++) { |
---|
| 198 | text = routeProcents[i].getText(); |
---|
| 199 | try { |
---|
| 200 | val = (new Integer(text)).intValue(); |
---|
| 201 | if (val >= 0) { |
---|
| 202 | exs.percentsEachRoute.setElementAt(100, i); |
---|
| 203 | } |
---|
| 204 | } catch (Exception e) { |
---|
| 205 | } |
---|
| 206 | } |
---|
| 207 | exs.percentOfFlow=100; |
---|
| 208 | } |
---|
| 209 | } |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | public EntryExitConfig(ScenarioConfiguration sc, ScenarioMap inS, Location entry, Scenario outScenario) { |
---|
| 213 | super(); |
---|
| 214 | int i; |
---|
| 215 | this.sc = sc; |
---|
| 216 | this.inScenario = inS; |
---|
| 217 | this.currentEntry = entry; |
---|
| 218 | this.outScenario = outScenario; |
---|
| 219 | this.myListener = new myActionListener(); |
---|
| 220 | setCurrentEntryScenario(); |
---|
| 221 | int hight = 500 + (50 * inS.driverTypes.size()); |
---|
| 222 | |
---|
| 223 | SpringLayout l1 = new SpringLayout(); |
---|
| 224 | SpringLayout l2 = new SpringLayout(); |
---|
| 225 | this.setLocation(100, 100); |
---|
| 226 | this.setLayout(l1); |
---|
| 227 | // get the map from the file! |
---|
| 228 | Map tempMap = null; |
---|
| 229 | try { |
---|
| 230 | ObjectInputStream ois = null; |
---|
| 231 | if (inScenario.mapFileName.startsWith(".")) |
---|
| 232 | inScenario.mapFileName = inScenario.mapFileName.substring(1); |
---|
| 233 | String path = System.getProperty("user.home") + File.separatorChar |
---|
| 234 | + inScenario.mapFileName.replace('\\', File.separatorChar).replace('/', File.separatorChar); |
---|
| 235 | File f = new File(path); |
---|
| 236 | if (f.exists() && f.isFile() && f.canRead()) |
---|
| 237 | ois = new ObjectInputStream(new FileInputStream(path)); |
---|
| 238 | else { |
---|
| 239 | ois = new ObjectInputStream(Utils.getInstance().openStream(inScenario.mapFileName.replace('\\', '/'))); |
---|
| 240 | } |
---|
| 241 | tempMap = (Map) ois.readObject(); |
---|
| 242 | ois.close(); |
---|
| 243 | } catch (Exception ex) { |
---|
| 244 | logger.log(Level.SEVERE, "Got exception for " + inScenario.mapFileName, ex); |
---|
| 245 | } |
---|
| 246 | |
---|
| 247 | ScenarioConfiguration.mapRepresentation = new MapPanel(hight-10, hight-10, tempMap); |
---|
| 248 | ScenarioConfiguration.mapRepresentation.eec = this; |
---|
| 249 | ScenarioConfiguration.mapRepresentation.setStart(currentEntry); |
---|
| 250 | |
---|
| 251 | mainConfig = new JPanel(); |
---|
| 252 | mainConfig.setSize(198, hight); |
---|
| 253 | mainConfig.setLayout(l2); |
---|
| 254 | flow = new JLabel("cars/h/lane"); |
---|
| 255 | exitLabel = new JLabel("Select the exit:"); |
---|
| 256 | flowValue = new JTextField(); |
---|
| 257 | |
---|
| 258 | driverTypes = new JLabel[inScenario.driverTypes.size()]; |
---|
| 259 | driverTypesValue = new JTextField[inScenario.driverTypes.size()]; |
---|
| 260 | for (i = 0; i < inScenario.driverTypes.size(); i++) { |
---|
| 261 | driverTypes[i] = new JLabel(inScenario.driverTypes.get(i)); |
---|
| 262 | driverTypesValue[i] = new JTextField(); |
---|
| 263 | } |
---|
| 264 | |
---|
| 265 | String[] exitString = getValidExits(entry); |
---|
| 266 | exitSelect = new JComboBox(exitString); |
---|
| 267 | exitSelect.addActionListener(myListener); |
---|
| 268 | System.err.println("-" + validExits.size() + " " + entry.roadIdx); |
---|
| 269 | routePanel = new RouteSelector(entry, outScenario.exits.get(validExits.elementAt(0))); |
---|
| 270 | ScenarioConfiguration.mapRepresentation.setStop(outScenario.exits.get(validExits.elementAt(0))); |
---|
| 271 | |
---|
| 272 | flow.setSize(100, 40); |
---|
| 273 | SpringLayout.Constraints constraint; |
---|
| 274 | |
---|
| 275 | constraint = l2.getConstraints(exitLabel); |
---|
| 276 | constraint.setX(Spring.constant(1)); |
---|
| 277 | constraint.setY(Spring.constant(2)); |
---|
| 278 | constraint.setWidth(Spring.constant(193)); |
---|
| 279 | constraint.setHeight(Spring.constant(20)); |
---|
| 280 | |
---|
| 281 | constraint = l2.getConstraints(exitSelect); |
---|
| 282 | constraint.setX(Spring.constant(1)); |
---|
| 283 | constraint.setY(Spring.constant(25)); |
---|
| 284 | constraint.setWidth(Spring.constant(193)); |
---|
| 285 | constraint.setHeight(Spring.constant(20)); |
---|
| 286 | |
---|
| 287 | constraint = l2.getConstraints(flow); |
---|
| 288 | constraint.setX(Spring.constant(1)); |
---|
| 289 | constraint.setY(Spring.constant(75)); |
---|
| 290 | constraint.setWidth(Spring.constant(100)); |
---|
| 291 | constraint.setHeight(Spring.constant(20)); |
---|
| 292 | |
---|
| 293 | constraint = l2.getConstraints(flowValue); |
---|
| 294 | constraint.setX(Spring.constant(100)); |
---|
| 295 | constraint.setY(Spring.constant(75)); |
---|
| 296 | constraint.setWidth(Spring.constant(93)); |
---|
| 297 | constraint.setHeight(Spring.constant(20)); |
---|
| 298 | |
---|
| 299 | for (i = 0; i < inScenario.driverTypes.size(); i++) { |
---|
| 300 | |
---|
| 301 | constraint = l2.getConstraints(driverTypes[i]); |
---|
| 302 | constraint.setX(Spring.constant(1)); |
---|
| 303 | constraint.setY(Spring.constant(100 + 25 * i)); |
---|
| 304 | constraint.setWidth(Spring.constant(100)); |
---|
| 305 | constraint.setHeight(Spring.constant(20)); |
---|
| 306 | |
---|
| 307 | constraint = l2.getConstraints(driverTypesValue[i]); |
---|
| 308 | constraint.setX(Spring.constant(100)); |
---|
| 309 | constraint.setY(Spring.constant(100 + 25 * i)); |
---|
| 310 | constraint.setWidth(Spring.constant(93)); |
---|
| 311 | constraint.setHeight(Spring.constant(20)); |
---|
| 312 | |
---|
| 313 | driverTypes[i].setSize(100, 20); |
---|
| 314 | driverTypesValue[i].setSize(100, 20); |
---|
| 315 | } |
---|
| 316 | |
---|
| 317 | exitSelect.setSize(193, 20); |
---|
| 318 | exitSelect.addActionListener(myListener); |
---|
| 319 | |
---|
| 320 | mainConfig.add(exitLabel); |
---|
| 321 | mainConfig.add(this.exitSelect); |
---|
| 322 | mainConfig.add(this.flow); |
---|
| 323 | mainConfig.add(this.flowValue); |
---|
| 324 | for (i = 0; i < inScenario.driverTypes.size(); i++) { |
---|
| 325 | mainConfig.add(this.driverTypes[i]); |
---|
| 326 | mainConfig.add(this.driverTypesValue[i]); |
---|
| 327 | } |
---|
| 328 | mainConfig.setVisible(true); |
---|
| 329 | |
---|
| 330 | constraint = l1.getConstraints(this.mainConfig); |
---|
| 331 | constraint.setX(Spring.constant(1)); |
---|
| 332 | constraint.setY(Spring.constant(1)); |
---|
| 333 | constraint.setWidth(Spring.constant(195)); |
---|
| 334 | constraint.setHeight(Spring.constant(hight)); |
---|
| 335 | ScenarioConfiguration.mapRepresentation.setSize(hight-10, hight-10); |
---|
| 336 | ScenarioConfiguration.mapRepresentation.setVisible(true); |
---|
| 337 | |
---|
| 338 | mainConfig.setSize(195, hight); |
---|
| 339 | |
---|
| 340 | this.add(this.mainConfig); |
---|
| 341 | this.setSize(195, hight); |
---|
| 342 | fillAllValues(); |
---|
| 343 | this.setVisible(true); |
---|
| 344 | |
---|
| 345 | } |
---|
| 346 | |
---|
| 347 | public void setNewEntry(Location newEntry) { |
---|
| 348 | // if (!newEntry.equals(currentEntry)) { |
---|
| 349 | saveChanges(); |
---|
| 350 | this.currentEntry = newEntry; |
---|
| 351 | String[] exitString = getValidExits(newEntry); |
---|
| 352 | exitSelect.removeActionListener(this.myListener); |
---|
| 353 | exitSelect.removeAllItems(); |
---|
| 354 | setCurrentEntryScenario(); |
---|
| 355 | for (int i = 0; i < exitString.length; i++) { |
---|
| 356 | exitSelect.addItem(exitString[i]); |
---|
| 357 | } |
---|
| 358 | if (exitSelect.getItemCount() > 0) { |
---|
| 359 | exitSelect.addActionListener(this.myListener); |
---|
| 360 | routePanel.setVisible(false); |
---|
| 361 | ScenarioConfiguration.mapRepresentation.setRoute(null); |
---|
| 362 | ScenarioConfiguration.mapRepresentation.setStart(currentEntry); |
---|
| 363 | ScenarioConfiguration.mapRepresentation.setStop(outScenario.exits.get(validExits.elementAt(0))); |
---|
| 364 | routePanel = new RouteSelector(currentEntry, outScenario.exits.get(validExits.elementAt(0))); |
---|
| 365 | fillAllValues(); |
---|
| 366 | } |
---|
| 367 | exitSelect.setSelectedIndex(0); |
---|
| 368 | // } |
---|
| 369 | |
---|
| 370 | } |
---|
| 371 | |
---|
| 372 | public void fillAllValues() { |
---|
| 373 | this.flowValue.setText("" + currentEntryScenario.flow); |
---|
| 374 | for (int i = 0; i < currentEntryScenario.percentsDriverTypes.size(); i++) { |
---|
| 375 | this.driverTypesValue[i].setText("" + currentEntryScenario.percentsDriverTypes.get(i)); |
---|
| 376 | } |
---|
| 377 | } |
---|
| 378 | |
---|
| 379 | public void setCurrentEntryScenario() { |
---|
| 380 | EntryScenario es; |
---|
| 381 | for (int i = 0; i < outScenario.entryScenarios.size(); i++) { |
---|
| 382 | es = outScenario.entryScenarios.get(i); |
---|
| 383 | if (es.entry.equals(this.currentEntry)) { |
---|
| 384 | currentEntryScenario = es; |
---|
| 385 | return; |
---|
| 386 | } |
---|
| 387 | } |
---|
| 388 | es = new EntryScenario(this.currentEntry); |
---|
| 389 | for (int i = 0; i < inScenario.driverTypes.size(); i++) { |
---|
| 390 | if (i < inScenario.driverTypes.size() - 1) { |
---|
| 391 | es.percentsDriverTypes.add(new Integer(100 / inScenario.driverTypes.size())); |
---|
| 392 | } else { |
---|
| 393 | es.percentsDriverTypes.add(new Integer(100 - (inScenario.driverTypes.size() - 1) |
---|
| 394 | * (new Integer(100 / inScenario.driverTypes.size())).intValue())); |
---|
| 395 | } |
---|
| 396 | } |
---|
| 397 | currentEntryScenario = es; |
---|
| 398 | outScenario.entryScenarios.add(es); |
---|
| 399 | return; |
---|
| 400 | } |
---|
| 401 | |
---|
| 402 | public void saveChanges() { |
---|
| 403 | String text; |
---|
| 404 | int val; |
---|
| 405 | text = this.flowValue.getText(); |
---|
| 406 | try { |
---|
| 407 | val = new Integer(text); |
---|
| 408 | if (val >= 0) { |
---|
| 409 | currentEntryScenario.flow = val; |
---|
| 410 | } |
---|
| 411 | } catch (Exception e) { |
---|
| 412 | System.out.println("FLOW VALUE incorect"); |
---|
| 413 | } |
---|
| 414 | for (int i = 0; i < currentEntryScenario.percentsDriverTypes.size(); i++) { |
---|
| 415 | text = this.driverTypesValue[i].getText(); |
---|
| 416 | try { |
---|
| 417 | val = new Integer(text); |
---|
| 418 | if (val >= 0) { |
---|
| 419 | currentEntryScenario.percentsDriverTypes.setElementAt(new Integer(val), i); |
---|
| 420 | } |
---|
| 421 | } catch (Exception e) { |
---|
| 422 | System.out.println("DriverType " + i + " incorect value"); |
---|
| 423 | } |
---|
| 424 | } |
---|
| 425 | routePanel.saveRouteValues(); |
---|
| 426 | } |
---|
| 427 | |
---|
| 428 | public String[] getValidExits(Location entry) { |
---|
| 429 | String[] exits; |
---|
| 430 | this.validExits = new Vector<Integer>(); |
---|
| 431 | Location exit; |
---|
| 432 | Route r; |
---|
| 433 | System.err.println("%1 " + outScenario.exits.size()); |
---|
| 434 | System.err.println("%2 " + entry.roadIdx); |
---|
| 435 | for (int i = 0; i < this.outScenario.exits.size(); i++) { |
---|
| 436 | exit = outScenario.exits.get(i); |
---|
| 437 | for (int j = 0; j < outScenario.allRoutes.size(); j++) { |
---|
| 438 | r = outScenario.allRoutes.get(j); |
---|
| 439 | try { |
---|
| 440 | if (r.entry.equals(entry) && r.exit.equals(exit)) { |
---|
| 441 | this.validExits.add(new Integer(i)); |
---|
| 442 | break; |
---|
| 443 | } |
---|
| 444 | } catch (Exception e) { |
---|
| 445 | e.printStackTrace(); |
---|
| 446 | } |
---|
| 447 | } |
---|
| 448 | } |
---|
| 449 | System.out.println("@2 " + validExits.size()); |
---|
| 450 | exits = new String[this.validExits.size()]; |
---|
| 451 | for (int i = 0; i < this.validExits.size(); i++) { |
---|
| 452 | exits[i] = new String("Exit " + this.validExits.elementAt(i)); |
---|
| 453 | } |
---|
| 454 | return exits; |
---|
| 455 | } |
---|
| 456 | |
---|
| 457 | public void disableIt() { |
---|
| 458 | this.mainConfig.setVisible(false); |
---|
| 459 | } |
---|
| 460 | |
---|
| 461 | public void enableIt() { |
---|
| 462 | this.mainConfig.setVisible(true); |
---|
| 463 | } |
---|
| 464 | } |
---|