Skip to content

Commit 1d5813d

Browse files
committed
Debugged
1 parent 9185a8c commit 1d5813d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/fxsimulator/CanvasController.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public void handle(MouseEvent mouseEvent) {
357357
}
358358

359359
calculated = true;
360-
} else if (calculate && calculated && !articulationPoint) {
360+
} else if (calculate && calculated && !articulationPoint & !mst) {
361361

362362
for (NodeFX n : circles) {
363363
n.isSelected = false;
@@ -1217,6 +1217,8 @@ public MST() {
12171217
for (NodeFX x : circles) {
12181218
x.node.previous = x.node;
12191219
}
1220+
1221+
//<editor-fold defaultstate="collapsed" desc="Detail Information">
12201222
String init = "Intially : \n";
12211223
for(NodeFX x : circles){
12221224
final String s = "Node : " + x.node.name + " , Parent: " + x.node.previous.name + "\n";
@@ -1234,7 +1236,7 @@ public MST() {
12341236
});
12351237
fdss.onFinishedProperty();
12361238
st.getChildren().add(fdss);
1237-
1239+
//</editor-fold>
12381240
Collections.sort(mstEdges, new Comparator<Edge>() {
12391241
public int compare(Edge o1, Edge o2) {
12401242
if (o1.weight == o2.weight) {
@@ -1250,6 +1252,7 @@ public int compare(Edge o1, Edge o2) {
12501252
ft1.setToValue(Color.DARKORANGE);
12511253
st.getChildren().add(ft1);
12521254

1255+
//<editor-fold defaultstate="collapsed" desc="Detail Information">
12531256
final String se = "Selected Edge:- (" + e.source.name.trim() + "--" + e.target.name.trim()+") Weight: "+ String.valueOf(e.weight) +" \n";
12541257
FadeTransition fdx = new FadeTransition(Duration.millis(10), textFlow);
12551258
fdx.setOnFinished(evx -> {
@@ -1273,12 +1276,13 @@ public int compare(Edge o1, Edge o2) {
12731276
});
12741277
fdx3.onFinishedProperty();
12751278
st.getChildren().add(fdx3);
1279+
//</editor-fold>
12761280

12771281
if (findParent(e.source.previous) != findParent(e.target.previous)) {
12781282
unionNode(e.source, e.target);
12791283
mstValue += e.weight;
12801284

1281-
1285+
//<editor-fold defaultstate="collapsed" desc="Detail Information">
12821286
final String sa = "\t---->Unioned\n";
12831287
final String sa1 = "\t\t->Node :" + e.source.name.trim() + " Parent: " + findParent(e.source.previous).name.trim() + "\n";
12841288
final String sa2 = "\t\t->Node :" + e.target.name.trim() + " Parent: " + findParent(e.target.previous).name.trim() + "\n";
@@ -1313,15 +1317,17 @@ public int compare(Edge o1, Edge o2) {
13131317
ft3 = new FillTransition(Duration.millis(time), e.target.circle);
13141318
ft3.setToValue(Color.AQUA);
13151319
st.getChildren().add(ft3);
1320+
//</editor-fold>
13161321
}else{
1322+
//<editor-fold defaultstate="collapsed" desc="Detail Info">
13171323
final String sa = "\t---->Cycle Detected\n";
13181324
FadeTransition fdx7 = new FadeTransition(Duration.millis(10), textFlow);
13191325
fdx7.setOnFinished(evx -> {
13201326
textFlow.appendText(sa);
13211327
});
13221328
fdx7.onFinishedProperty();
13231329
st.getChildren().add(fdx7);
1324-
1330+
//</editor-fold>
13251331
StrokeTransition ft2 = new StrokeTransition(Duration.millis(time), e.line);
13261332
ft2.setToValue(Color.DARKRED);
13271333
st.getChildren().add(ft2);

0 commit comments

Comments
 (0)