|
From: Hirzel P. <ph...@us...> - 2006-06-29 22:50:08
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30229/src/org/tcotool/standard/drawing Modified Files: NodeFigure.java DependencyView.java EdgeFigure.java DependencyLineConnection.java Layout.java Log Message: Refactoring: Log-API adapted Index: EdgeFigure.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/EdgeFigure.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EdgeFigure.java 17 Sep 2005 17:19:44 -0000 1.3 --- EdgeFigure.java 29 Jun 2006 22:50:05 -0000 1.4 *************** *** 114,118 **** start = getDiagram().findNodeConnector(getStartElement(), x, y); if (start == null) { ! Tracer.getInstance().developerWarning(this, "connectNodes()", "AUTO-CORRECT: Missing StartNode->there must have been an improper deletion of nodes/edges before=>" + getSourceName(getStartElement()));//$NON-NLS-2$//$NON-NLS-1$ // shouldWarn(NlsUtils.formatMessage(resEdgeFigure.getString("CWMissingStartNode"), getSourceName(getStartElement()))); //$NON-NLS-1$ // removeVisually(); --- 114,118 ---- start = getDiagram().findNodeConnector(getStartElement(), x, y); if (start == null) { ! Tracer.getInstance().developerWarning("AUTO-CORRECT: Missing StartNode->there must have been an improper deletion of nodes/edges before=>" + getSourceName(getStartElement()));//$NON-NLS-2$//$NON-NLS-1$ // shouldWarn(NlsUtils.formatMessage(resEdgeFigure.getString("CWMissingStartNode"), getSourceName(getStartElement()))); //$NON-NLS-1$ // removeVisually(); *************** *** 121,125 **** Connector end = getDiagram().findNodeConnector(getEndElement(), x, y); if (end == null) { ! Tracer.getInstance().developerWarning(this, "connectNodes()", "AUTO-CORRECT: Missing EndNode->there must have been an improper deletion of nodes/edges before=>" + getSourceName(getEndElement()));//$NON-NLS-2$//$NON-NLS-1$ //shouldWarn(NlsUtils.formatMessage(resEdgeFigure.getString("CWMissingEndNode"), getSourceName(getEndElement()))); //$NON-NLS-1$ // removeVisually(); --- 121,125 ---- Connector end = getDiagram().findNodeConnector(getEndElement(), x, y); if (end == null) { ! Tracer.getInstance().developerWarning("AUTO-CORRECT: Missing EndNode->there must have been an improper deletion of nodes/edges before=>" + getSourceName(getEndElement()));//$NON-NLS-2$//$NON-NLS-1$ //shouldWarn(NlsUtils.formatMessage(resEdgeFigure.getString("CWMissingEndNode"), getSourceName(getEndElement()))); //$NON-NLS-1$ // removeVisually(); *************** *** 141,145 **** } } catch(Throwable e) { ! Tracer.getInstance().debug(this, "connectNodes()", e.toString()); } } --- 141,145 ---- } } catch(Throwable e) { ! Tracer.getInstance().debug(e.toString()); } } Index: DependencyView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/DependencyView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DependencyView.java 18 Mar 2006 17:11:32 -0000 1.5 --- DependencyView.java 29 Jun 2006 22:50:05 -0000 1.6 *************** *** 125,129 **** return add(new PackageFigure(this, element)); } else { ! throw new DeveloperException(this, "add(TcoObject)", "wrong type", element.toString()); } } --- 125,129 ---- return add(new PackageFigure(this, element)); } else { ! throw new DeveloperException("wrong type", element.toString()); } } *************** *** 160,166 **** */ protected ServiceFigure findServiceFigure(int x, int y) { ! FigureEnumeration enum = drawing().figures(); ! while (enum.hasNextFigure()) { ! Figure figure = enum.nextFigure(); if ((figure instanceof ServiceFigure) && (figure.containsPoint(x, y))) { --- 160,166 ---- */ protected ServiceFigure findServiceFigure(int x, int y) { ! FigureEnumeration enumeration = drawing().figures(); ! while (enumeration.hasNextFigure()) { ! Figure figure = enumeration.nextFigure(); if ((figure instanceof ServiceFigure) && (figure.containsPoint(x, y))) { *************** *** 212,218 **** //TUNE THIS METHOD! if (element != null) { ! FigureEnumeration enum = drawing().figures(); ! while (enum.hasNextFigure()) { ! Figure figure = enum.nextFigure(); /* if ((figure instanceof RoleDefFigure) || (figure instanceof AssociationAttributeFigure)) { --- 212,218 ---- //TUNE THIS METHOD! if (element != null) { ! FigureEnumeration enumeration = drawing().figures(); ! while (enumeration.hasNextFigure()) { ! Figure figure = enumeration.nextFigure(); /* if ((figure instanceof RoleDefFigure) || (figure instanceof AssociationAttributeFigure)) { *************** *** 274,279 **** */ public void keyPressed(KeyEvent e) { - int code = e.getKeyCode(); /* addToSelection(figure); Command cmd = new DeleteCommand("Delete", this); --- 274,280 ---- */ public void keyPressed(KeyEvent e) { /* + int code = e.getKeyCode(); + addToSelection(figure); Command cmd = new DeleteCommand("Delete", this); *************** *** 368,374 **** showCosts = visible; ! FigureEnumeration enum = drawing().figures(); ! while (enum.hasNextFigure()) { ! Figure figure = enum.nextFigure(); if (figure instanceof NodeFigure) { ((NodeFigure)figure).updateView(); --- 369,375 ---- showCosts = visible; ! FigureEnumeration enumeration = drawing().figures(); ! while (enumeration.hasNextFigure()) { ! Figure figure = enumeration.nextFigure(); if (figure instanceof NodeFigure) { ((NodeFigure)figure).updateView(); Index: Layout.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/Layout.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Layout.java 17 Sep 2005 17:19:44 -0000 1.3 --- Layout.java 29 Jun 2006 22:50:05 -0000 1.4 *************** *** 113,117 **** max_trials=nodev_size; // TODO should throw an exception ! Tracer.getInstance().runtimeWarning(this, "doit()", "stop layout; would run for to long"); return; } --- 113,117 ---- max_trials=nodev_size; // TODO should throw an exception ! Tracer.getInstance().runtimeWarning("stop layout; would run for to long"); return; } *************** *** 159,165 **** */ // Var.II: collect by Figure's ! FigureEnumeration enum = view.drawing().figures(); ! while (enum.hasNextFigure()) { ! Figure figure = enum.nextFigure(); if (figure instanceof EdgeFigure) { edgev.add(figure); --- 159,165 ---- */ // Var.II: collect by Figure's ! FigureEnumeration enumeration = view.drawing().figures(); ! while (enumeration.hasNextFigure()) { ! Figure figure = enumeration.nextFigure(); if (figure instanceof EdgeFigure) { edgev.add(figure); *************** *** 186,191 **** TcoObject object = (TcoObject) node.getModelElement(); Rectangle rect = node.displayBox(); ! Tracer.getInstance().debug(Layout.class, "dumpNodes()", ! "DumpNode: " + object.getName() + "\nx0=" + rect.getX() --- 186,190 ---- TcoObject object = (TcoObject) node.getModelElement(); Rectangle rect = node.displayBox(); ! Tracer.getInstance().debug("DumpNode: " + object.getName() + "\nx0=" + rect.getX() Index: NodeFigure.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/NodeFigure.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NodeFigure.java 21 Sep 2005 11:34:15 -0000 1.5 --- NodeFigure.java 29 Jun 2006 22:50:05 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- import org.tcotool.presentation.PresentationElement; import org.tcotool.presentation.PresentationNode; + import org.tcotool.tools.ModelUtility; import org.jhotdraw.standard.*; *************** *** 67,71 **** PresentationElement tmp = (PresentationElement)iterator.next(); if (tmp.getSubject() == null) { ! throw new DeveloperException(this, "NodeFigure()", "XML does not contain Subject-REF or reading failure"); } if (tmp.getSubject().equals(element)) { --- 68,72 ---- PresentationElement tmp = (PresentationElement)iterator.next(); if (tmp.getSubject() == null) { ! throw new DeveloperException("XML does not contain Subject-REF or reading failure"); } if (tmp.getSubject().equals(element)) { *************** *** 76,80 **** if (node == null) { // not yet displayed ! node = (PresentationNode)LauncherView.getInstance().getUtility().createDbObject(((TcoObject)element).getObjectServer(), PresentationNode.class); node.setSubject(element); } --- 77,81 ---- if (node == null) { // not yet displayed ! node = (PresentationNode)ModelUtility.createDbObject(((TcoObject)element).getObjectServer(), PresentationNode.class); node.setSubject(element); } *************** *** 283,287 **** protected void handleException(java.lang.Throwable exception) { try { ! Tracer.getInstance().developerWarning(this, "handleException()", exception.getLocalizedMessage()); LauncherView.getInstance().handleException(exception); } finally { --- 284,288 ---- protected void handleException(java.lang.Throwable exception) { try { ! Tracer.getInstance().developerWarning(exception.getLocalizedMessage()); LauncherView.getInstance().handleException(exception); } finally { *************** *** 436,440 **** */ public void updateView() { ! // TUNE!!! // show the saved colors -> should precede setNode(node) ! --- 437,441 ---- */ public void updateView() { ! //TODO TUNE!!! // show the saved colors -> should precede setNode(node) ! Index: DependencyLineConnection.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/DependencyLineConnection.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DependencyLineConnection.java 18 Mar 2006 17:11:32 -0000 1.4 --- DependencyLineConnection.java 29 Jun 2006 22:50:05 -0000 1.5 *************** *** 18,22 **** import org.tcotool.model.Dependency; - import org.tcotool.model.TcoObject; import org.jhotdraw.figures.ArrowTip; --- 18,21 ---- *************** *** 62,66 **** /*supplier = (TcoObject)*/ ((NodeFigure)end).getModelElement(); } catch(ClassCastException e) { ! Tracer.getInstance().developerWarning(this, "canConnect()", "Wrong dependency"); return false; } --- 61,65 ---- /*supplier = (TcoObject)*/ ((NodeFigure)end).getModelElement(); } catch(ClassCastException e) { ! Tracer.getInstance().developerWarning("Wrong dependency"); return false; } |