package org.helioviewer.plugins.eveplugin.radio.model;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

public class PlotConfig {
    private final BufferedImage image;
    private final DrawableAreaMap map;
    private boolean visible;
    private Long downloadID;
    private Long imageId;

    public PlotConfig(BufferedImage image, DrawableAreaMap map, boolean visible, Long downloadID, Long imageID) {
        super();
        this.image = image;
        this.map = map;
        this.visible = visible;
        this.downloadID = downloadID;
        imageId = imageID;
    }

    public void draw(Graphics g) {
        if (visible) {
            // Thread.dumpStack();
            // Log.trace("Draw image on : " + map);
            g.drawImage(image, map.getDestinationX0(), map.getDestinationY0(), map.getDestinationX1(), map.getDestinationY1(),
                    map.getSourceX0(), map.getSourceY0(), map.getSourceX1(), map.getSourceY1(), null);
        }
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public int getDrawWidth() {
        return map.getDestinationX1() - map.getDestinationX0();
    }

    public Long getDownloadID() {
        return downloadID;
    }

    public void setDownloadID(Long downloadID) {
        this.downloadID = downloadID;
    }

    public Long getImageId() {
        return imageId;
    }

    public void setImageId(Long imageId) {
        this.imageId = imageId;
    }

}

@@ -151,22 +151,16 @@
 private 
-final 
 Buffered
@@ -168,24 +168,24 @@
 mage image;%0A
+
     private 
@@ -858,28 +858,8 @@
 1(),
-%0A                   
  map
@@ -1470,24 +1470,24 @@
  imageId) %7B%0A
-
         this
@@ -1513,10 +1513,112 @@
 %0A    %7D%0A%0A
+    public void setBufferedImage(BufferedImage bufferedImage) %7B%0A        image = bufferedImage;%0A    %7D%0A%0A
 %7D%0A

Allow the buffered image to be set in PlotConfig