/** print action text */ private void jbn_PrintActionPerformed() { String header = "Gipo - Domain [" + curDomain.getName() + "] Author [" + curDomain.getAuthor() + "]"; HardcopyWriter hw; try { hw = new HardcopyWriter(owner, header, 10, .75, .5, .75, .5); } catch (HardcopyWriter.PrintCanceledException e) { JOptionPane.showMessageDialog( this, "Error Printing Action Sequence.", "GIPO Error", JOptionPane.ERROR_MESSAGE, null); return; } // Send output to it through a PrintWriter stream PrintWriter out = new PrintWriter(hw); actionPrint(out); out.close(); }
/** * do verification checks on operators.<br> * check each clause is for a different object; check each transition * * @param cur the current domain * @param mssgLst list to append results messages to * @return true if all checks passed */ public boolean check(oclDomain curDom, List mssgs) { List ids = new ArrayList(); List sorts = new ArrayList(); boolean ret = true; mssgs.add("Checking Events " + opName.toString()); ListIterator li = prevail.listIterator(); while (li.hasNext()) { oclSEPlus cur = (oclSEPlus) li.next(); if (alreadyUsed(cur.getName(), cur.getSort(), ids, sorts)) { mssgs.add("The object " + cur.getName() + " has more than one transition clause"); mssgs.add(" in the operator " + opName.toString()); ret = false; } else { ret = cur.check(curDom, mssgs); ids.add(cur.getName()); sorts.add(cur.getSort()); } } li = necessary.listIterator(); while (li.hasNext()) { oclSCPlus cur = (oclSCPlus) li.next(); if (alreadyUsed(cur.getName(), cur.getSort(), ids, sorts)) { mssgs.add("The object " + cur.getName() + " has more than one transition clause"); mssgs.add(" in the operator " + opName.toString()); ret = false; } else { ret = cur.check(curDom, mssgs); ids.add(cur.getName()); sorts.add(cur.getSort()); } } li = conditional.listIterator(); while (li.hasNext()) { oclSCPlus cur = (oclSCPlus) li.next(); if (alreadyUsed(cur.getName(), cur.getSort(), ids, sorts)) { mssgs.add("The object " + cur.getName() + " has more than one transition clause"); mssgs.add(" in the operator " + opName.toString()); ret = false; } else { ret = cur.check(curDom, mssgs); ids.add(cur.getName()); sorts.add(cur.getSort()); } } // Ron 12/11/02 allow rhs warnings to be switched off if (curDom.rhsWarnings) { boolean unreferenceVars = checkUnreferencedVariables(mssgs); if (ret) ret = unreferenceVars; } // change name opName = curDom.createEventSignature(this); // opName = createAllSignature(curDom); Utility.debugPrintln("\n>>opName. " + opName.toString()); return ret; }