import jalview.datamodel.SequenceI;
import jalview.gui.ImageExporter.ImageWriterI;
import jalview.io.HTMLOutput;
+import jalview.io.exceptions.ImageOutputException;
import jalview.jbgui.GAlignmentPanel;
import jalview.math.AlignmentDimension;
import jalview.schemes.ResidueProperties;
import jalview.util.Comparison;
import jalview.util.ImageMaker;
import jalview.util.MessageManager;
+import jalview.util.imagemaker.BitmapImageSizing;
import jalview.viewmodel.ViewportListenerI;
import jalview.viewmodel.ViewportRanges;
Dimension r = null;
if (av.getIdWidth() < 0)
{
- int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
- int idWidth = Math.min(afwidth - 200, 2 * afwidth / 3);
- int maxwidth = Math.max(IdwidthAdjuster.MIN_ID_WIDTH, idWidth);
- r = calculateIdWidth(maxwidth);
+ r = calculateDefaultAlignmentIdWidth();
av.setIdWidth(r.width);
}
else
return r;
}
+ public Dimension calculateDefaultAlignmentIdWidth()
+ {
+ int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
+ int idWidth = Math.min(afwidth - 200, 2 * afwidth / 3);
+ int maxwidth = Math.max(IdwidthAdjuster.MIN_ID_WIDTH, idWidth);
+ return calculateIdWidth(-1);
+ }
+
/**
* Calculate the width of the alignment labels based on the displayed names
* and any bounds on label width set in preferences.
}
void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer)
+ throws ImageOutputException
{
- makeAlignmentImage(type, file, renderer, 0.0f, 0, 0);
+ makeAlignmentImage(type, file, renderer,
+ BitmapImageSizing.nullBitmapImageSizing());
}
/**
* @param bitmapscale
*/
void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer,
- float bitmapscale, int bitmapwidth, int bitmapheight)
+ BitmapImageSizing userBis) throws ImageOutputException
{
final int borderBottomOffset = 5;
int imageHeight = aDimension.getHeight() + borderBottomOffset;
String of = MessageManager.getString("label.alignment");
exporter.doExport(file, this, imageWidth, imageHeight, of, renderer,
- bitmapscale, bitmapwidth, bitmapheight);
+ userBis);
}
/**
}
public void makePNGImageMap(File imgMapFile, String imageName)
+ throws ImageOutputException
{
// /////ONLY WORKS WITH NON WRAPPED ALIGNMENTS
// ////////////////////////////////////////////
} catch (Exception ex)
{
- ex.printStackTrace();
+ throw new ImageOutputException(
+ "couldn't write ImageMap due to unexpected error", ex);
}
} // /////////END OF IMAGE MAP