|
@@ -417,7 +417,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
for (CpsEdge con : model.getEdgesOnCanvas()) {
|
|
|
if (con.getA().getID() != model.getSelectedObjectID() && con.getB().getID() != model.getSelectedObjectID()
|
|
|
&& con != edgeHighlight) {
|
|
|
- if (con.getConnected()) {
|
|
|
+ if (con.getConnected() == 0) {
|
|
|
if (con.getState()) {
|
|
|
g2.setColor(Color.GREEN);
|
|
|
if (con.getCapacity() != -1) {
|
|
@@ -435,14 +435,16 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
con.getA().getPosition().y + controller.getScaleDiv2(),
|
|
|
con.getB().getPosition().x + controller.getScaleDiv2(),
|
|
|
con.getB().getPosition().y + controller.getScaleDiv2());
|
|
|
-
|
|
|
+
|
|
|
if (con.getCapacity() == -1) {
|
|
|
maxCap = Character.toString('\u221e');
|
|
|
+ } else if (con.getCapacity() == -2){
|
|
|
+ maxCap = "???";
|
|
|
} else {
|
|
|
maxCap = String.valueOf(con.getCapacity());
|
|
|
}
|
|
|
if (showedInformation[0]) {
|
|
|
- if (con.getConnected()) {
|
|
|
+ if (con.getConnected() == 0 || con.getConnected() == 1) {
|
|
|
g2.drawString(con.getFlow() + "/" + maxCap,
|
|
|
(con.getA().getPosition().x + con.getB().getPosition().x) / 2
|
|
|
+ controller.getScaleDiv2(),
|
|
@@ -477,14 +479,17 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
con.getA().getPosition().y + controller.getScaleDiv2(),
|
|
|
con.getB().getPosition().x + controller.getScaleDiv2(),
|
|
|
con.getB().getPosition().y + controller.getScaleDiv2());
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (con.getCapacity() == -1) {
|
|
|
maxCap = Character.toString('\u221e');
|
|
|
+ } else if (con.getCapacity() == -2) {
|
|
|
+ maxCap = "???";
|
|
|
} else {
|
|
|
maxCap = String.valueOf(con.getCapacity());
|
|
|
}
|
|
|
if (showedInformation[0]) {
|
|
|
- if (con.getConnected()) {
|
|
|
+ if (con.getConnected() == 0 || con.getConnected() == 1) {
|
|
|
g2.drawString(con.getFlow() + "/" + maxCap,
|
|
|
(con.getA().getPosition().x + con.getB().getPosition().x) / 2
|
|
|
+ controller.getScaleDiv2(),
|
|
@@ -511,9 +516,12 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
edgeHighlight.getA().getPosition().y + controller.getScaleDiv2(),
|
|
|
edgeHighlight.getB().getPosition().x + controller.getScaleDiv2(),
|
|
|
edgeHighlight.getB().getPosition().y + controller.getScaleDiv2());
|
|
|
+
|
|
|
|
|
|
if (edgeHighlight.getCapacity() == -1) {
|
|
|
maxCap = Character.toString('\u221e');
|
|
|
+ } else if (edgeHighlight.getCapacity() == -2) {
|
|
|
+ maxCap = "???";
|
|
|
} else {
|
|
|
maxCap = String.valueOf(edgeHighlight.getCapacity());
|
|
|
}
|