associateLookup(new ProxyLookup(new AbstractLookup(content),
new AbstractLookup(saveLookup), Lookups.singleton(this)));
content.add(dataInfo);
final Parameters params = new Parameters(dataInfo, this);
content.add(params);
final ColorMapper cm = new ColorMapper(params, this);
content.add(cm);
if(img==null){
// it's important to call these ColorEngine method in this order
cm.getEngine().updateOrder();
cm.getEngine().updateBases();
img = new BufferedImage(cm.getEngine().getUpperXbound(),
cm.getEngine().getUpperYbound(), BufferedImage.TYPE_INT_RGB);
}
image = new ImagePane();
listeners = new EventListenerList();
atx = new AffineTransform();
resetImageManipulation();
image.setDoubleBuffered(false);
image.setBackground(Color.gray);
image.setForeground(Color.white);
image.setOpaque(true);
// Let the user scroll by dragging to outside the window.
image.setAutoscrolls(true);
// this will set more stuff and possibly resize
// this panel component
setOffScreenImage(img);
scrollPane = new JScrollPane(image);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
setLayout(new BorderLayout());
add(scrollPane, BorderLayout.CENTER);
add(params, BorderLayout.NORTH);
add(cm, BorderLayout.SOUTH);
count++;
setDisplayName("Image " + count);
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
params.setVisible(true);
cm.setVisible(true);
impl = Lookup.getDefault().lookup(SaveCookie.class);
}
});
}