(ActionEvent e)
| 200 | |
| 201 | // Ereignismethoden |
| 202 | public void actionPerformed(ActionEvent e) { |
| 203 | String command = e.getActionCommand(); |
| 204 | // System.out.println(command ); |
| 205 | |
| 206 | if (command.length() >= 15 |
| 207 | && command.substring(0, 15).hashCode() == "basePlaneButton" |
| 208 | .hashCode()) { |
| 209 | // normalen Vergleich will er aus irgendeinem Grund nicht, desshalb muss es halt ueber den hashcode gehen ... |
| 210 | // klar: basePlaneButton |
| 211 | // System.out.println("plan"); |
| 212 | ListIterator li = eqnList.listIterator(); |
| 213 | Equation eq; |
| 214 | oldeq.setBasePlane(false); |
| 215 | while (li.hasNext()) { |
| 216 | eq = ((Equation) li.next()); |
| 217 | if (eq.basePlaneButton.getActionCommand() == command) { |
| 218 | // fertig |
| 219 | oldeq = eq; |
| 220 | updateScale(); |
| 221 | eq.setBasePlane(true, jv4sx, scale); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | // System.out.println(command); |
| 226 | if (command.length() >= 17 |
| 227 | && command.substring(0, 17).hashCode() == "deletePlaneButton" |
| 228 | .hashCode()) { |
| 229 | // normalen Vergleich will er aus irgendeinem Grund nicht, desshalb muss es halt ueber den hashcode gehen ... |
| 230 | // klar: deletePlaneButton |
| 231 | int internalEqnr = (new Integer(command.substring(17, command |
| 232 | .length()))).intValue(); |
| 233 | if (((Equation) eqnList.elementAt(internalEqnr - 1)).isBasePlane()) { |
| 234 | // dann muss ne andere die BasePlane werden |
| 235 | updateScale(); |
| 236 | if (internalEqnr != 1) { |
| 237 | ((Equation) eqnList.elementAt(internalEqnr - 2)) |
| 238 | .setBasePlane(true, jv4sx, scale); |
| 239 | } else { |
| 240 | if (eqnList.size() >= 2) { |
| 241 | // wurde die erste geloescht, setze die naechste als Baseplane |
| 242 | ((Equation) eqnList.elementAt(internalEqnr)) |
| 243 | .setBasePlane(true, jv4sx, scale); |
| 244 | } |
| 245 | // else sind keine Planes mehr da! |
| 246 | } |
| 247 | } |
| 248 | eqnList.removeElementAt(internalEqnr - 1); |
| 249 | // System.out.println("soze" + eqnList.size()); |
| 250 | updateEquationPanel(); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | /* |
| 255 | public void savePovCode(String filename) { |
nothing calls this directly
no test coverage detected