|
@@ -103,12 +103,6 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
private int animDelay = 1000 / animFPS; // animation Delay
|
|
|
private int animSteps = animDuration / animDelay; // animation Steps;
|
|
|
|
|
|
- // Background Image
|
|
|
- private String imgPath = "";
|
|
|
- private int backgroundMode = 0;
|
|
|
- private int backgroundWidth = 0;
|
|
|
- private int backgroundHeight = 0;
|
|
|
-
|
|
|
// contains the value of the Capacity for new created Edges
|
|
|
|
|
|
/**
|
|
@@ -403,9 +397,9 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
g2.setRenderingHints(rh);
|
|
|
|
|
|
// Paint the Background
|
|
|
- if (!imgPath.isEmpty()) {
|
|
|
- img = new ImageIcon(imgPath).getImage();
|
|
|
- switch (backgroundMode) {
|
|
|
+ if (!model.getCanvasImagePath().isEmpty()) {
|
|
|
+ img = new ImageIcon(model.getCanvasImagePath()).getImage();
|
|
|
+ switch (model.getCanvasImageMode()) {
|
|
|
case BackgroundPopUp.IMAGE_PIXELS:
|
|
|
g2.drawImage(img, 0, 0, img.getWidth(null), img.getHeight(null), null);
|
|
|
break;
|
|
@@ -413,7 +407,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
g2.drawImage(img, 0, 0, model.getCanvasX(), model.getCanvasY(), null);
|
|
|
break;
|
|
|
case BackgroundPopUp.CUSTOM:
|
|
|
- g2.drawImage(img, 0, 0, backgroundWidth, backgroundHeight, null);
|
|
|
+ g2.drawImage(img, 0, 0, model.getCanvasImageWidth(), model.getCanvasImageHeight(), null);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1136,27 +1130,4 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
public boolean[] getShowedInformation() {
|
|
|
return showedInformation;
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Set the Background Image;
|
|
|
- *
|
|
|
- * @param imagePath
|
|
|
- * Image Path
|
|
|
- * @param mode
|
|
|
- * Image Mode
|
|
|
- * @param width
|
|
|
- * Image custom width
|
|
|
- * @param height
|
|
|
- * Image custom height
|
|
|
- */
|
|
|
- public void setBackgroundImage(String imagePath, int mode, int width, int height) {
|
|
|
- imgPath = imagePath;
|
|
|
- backgroundMode = mode;
|
|
|
- backgroundWidth = width;
|
|
|
- backgroundHeight = height;
|
|
|
- }
|
|
|
-
|
|
|
- public String getBackgroundPath(){
|
|
|
- return imgPath;
|
|
|
- }
|
|
|
}
|