|
@@ -113,11 +113,7 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
|
|
private Position unPos;
|
|
private Position unPos;
|
|
private ArrayList<Position> savePos;
|
|
private ArrayList<Position> savePos;
|
|
|
|
|
|
- // Background Image
|
|
|
|
- private String imgPath = "";
|
|
|
|
- private int backgroundMode = 0;
|
|
|
|
- private int backgroundWidth = 0;
|
|
|
|
- private int backgroundHeight = 0;
|
|
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Constructor.
|
|
* Constructor.
|
|
@@ -418,9 +414,21 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
|
|
g2.setRenderingHints(rh);
|
|
g2.setRenderingHints(rh);
|
|
|
|
|
|
// Paint the Background
|
|
// Paint the Background
|
|
- if (!imgPath.isEmpty()) {
|
|
|
|
- img = new ImageIcon(imgPath).getImage();
|
|
|
|
- g2.drawImage(img, borderPos, 0, model.getCanvasX(), model.getCanvasY(), null);
|
|
|
|
|
|
+ if (!upperNode.getImagePath().isEmpty()) {
|
|
|
|
+ img = new ImageIcon(upperNode.getImagePath()).getImage();
|
|
|
|
+ switch (upperNode.getBackgroundMode()) {
|
|
|
|
+ case BackgroundPopUp.IMAGE_PIXELS:
|
|
|
|
+ g2.drawImage(img, 0, 0, img.getWidth(null), img.getHeight(null), null);
|
|
|
|
+ break;
|
|
|
|
+ case BackgroundPopUp.STRETCHED:
|
|
|
|
+ g2.drawImage(img, 0, 0, model.getCanvasX(), model.getCanvasY(), null);
|
|
|
|
+ break;
|
|
|
|
+ case BackgroundPopUp.CUSTOM:
|
|
|
|
+ g2.drawImage(img, 0, 0, upperNode.getImageWidht(), upperNode.getImageHeight(), null);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// Left Border
|
|
// Left Border
|
|
@@ -1459,10 +1467,7 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
|
|
* Image custom height
|
|
* Image custom height
|
|
*/
|
|
*/
|
|
public void setBackgroundImage(String imagePath, int mode, int width, int height) {
|
|
public void setBackgroundImage(String imagePath, int mode, int width, int height) {
|
|
- imgPath = imagePath;
|
|
|
|
- backgroundMode = mode;
|
|
|
|
- backgroundWidth = width;
|
|
|
|
- backgroundHeight = height;
|
|
|
|
|
|
+ upperNode.setBackgroundImage(imagePath, mode, width, height);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|