CompoundEdit ce=null;
if(collectivePlots.isEmpty()){
// a simple zoom, all the exes are taken into account
HashMap plot1OldValues=plot1.getAxesProperties(null, -1);
plot1.zoom(x1, x2, y1, y2, false);
ce=plot1.new PlotCompoundEdit(plot1OldValues);
plot1.repaintDiagram(plot1.getBounds());
}
else{
// a collective zoom
ce = new CompoundEdit();
HashMap plot1OldValues=plot1.getAxesProperties(null, Plot.PX);
if(plot1.secondaryX!=null){
plot1.getAxesProperties(plot1OldValues, Plot.SX);
}
// X axes zoom only
plot1.zoom(x1, x2, 0., 0., true);
PlotCompoundEdit ce1=plot1.new PlotCompoundEdit(plot1OldValues);
plot1.repaintDiagram(plot1.getBounds());
ce.addEdit(ce1);
// apply plot1 X axes properties to the other compliants plots
Iterator it=collectivePlots.iterator();
while(it.hasNext()){
Plot plot=(Plot)it.next();
HashMap oldValues=plot.getAxesProperties(null, Plot.PX);
if(plot.secondaryX!=null){
plot.getAxesProperties(oldValues, Plot.SX);
}
Iterator vit=oldValues.keySet().iterator();
while(vit.hasNext()){
String k=(String)vit.next();
plot.setPropertyValue(k,plot1.getPropertyValue(k));
}
PlotCompoundEdit ce2=plot.new PlotCompoundEdit(oldValues);
plot.repaintDiagram(plot.getBounds());
ce.addEdit(ce2);
}
ce.end();
}