git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-629 Change all stdout and stderr output to use Console.outPrintln and Console...
[jalview.git]
/
src
/
jalview
/
gui
/
AlignmentPanel.java
diff --git
a/src/jalview/gui/AlignmentPanel.java
b/src/jalview/gui/AlignmentPanel.java
index
9fb1a23
..
3de02bc
100644
(file)
--- a/
src/jalview/gui/AlignmentPanel.java
+++ b/
src/jalview/gui/AlignmentPanel.java
@@
-48,6
+48,7
@@
import jalview.analysis.AnnotationSorter;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
@@
-57,6
+58,7
@@
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.ImageExporter.ImageWriterI;
import jalview.io.HTMLOutput;
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.jbgui.GAlignmentPanel;
import jalview.math.AlignmentDimension;
import jalview.schemes.ResidueProperties;
@@
-64,6
+66,7
@@
import jalview.structure.StructureSelectionManager;
import jalview.util.Comparison;
import jalview.util.ImageMaker;
import jalview.util.MessageManager;
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;
import jalview.viewmodel.ViewportListenerI;
import jalview.viewmodel.ViewportRanges;
@@
-229,6
+232,10
@@
public class AlignmentPanel extends GAlignmentPanel implements
// to prevent drawing old image
FontMetrics fm = getFontMetrics(av.getFont());
// to prevent drawing old image
FontMetrics fm = getFontMetrics(av.getFont());
+ // update the flag controlling whether the grid is too small to render the
+ // font
+ av.validCharWidth = fm.charWidth('M') <= av.getCharWidth();
+
scalePanelHolder.setPreferredSize(
new Dimension(10, av.getCharHeight() + fm.getDescent()));
idSpaceFillerPanel1.setPreferredSize(
scalePanelHolder.setPreferredSize(
new Dimension(10, av.getCharHeight() + fm.getDescent()));
idSpaceFillerPanel1.setPreferredSize(
@@
-536,7
+543,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
// this is called after loading new annotation onto alignment
if (alignFrame.getHeight() == 0)
{
// this is called after loading new annotation onto alignment
if (alignFrame.getHeight() == 0)
{
- System.out.println("NEEDS FIXING");
+ jalview.bin.Console.outPrintln("NEEDS FIXING");
}
validateAnnotationDimensions(true);
addNotify();
}
validateAnnotationDimensions(true);
addNotify();
@@
-804,7
+811,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
// could not be validated and it is not clear if it is now being
// called. Log warning here in case it is called and unforeseen
// problems occur
// could not be validated and it is not clear if it is now being
// called. Log warning here in case it is called and unforeseen
// problems occur
- Cache.log.warn(
+ Console.warn(
"Unexpected path through code: Wrapped jar file opened with wrap alignment set in preferences");
// scroll to start of panel
"Unexpected path through code: Wrapped jar file opened with wrap alignment set in preferences");
// scroll to start of panel
@@
-1041,6
+1048,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
*/
alignmentGraphics.translate(alignmentGraphicsOffset,
alignmentDrawnHeight);
*/
alignmentGraphics.translate(alignmentGraphicsOffset,
alignmentDrawnHeight);
+ updateLayout();
getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,
alignmentGraphics, -1, startRes, endRes + 1);
}
getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,
alignmentGraphics, -1, startRes, endRes + 1);
}
@@
-1167,14
+1175,23
@@
public class AlignmentPanel extends GAlignmentPanel implements
return (w > 0 ? w : calculateIdWidth().width);
}
return (w > 0 ? w : calculateIdWidth().width);
}
+ void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer) throws ImageOutputException
+ {
+ makeAlignmentImage(type, file, renderer,
+ BitmapImageSizing.nullBitmapImageSizing());
+ }
+
/**
* Builds an image of the alignment of the specified type (EPS/PNG/SVG) and
* writes it to the specified file
*
* @param type
* @param file
/**
* Builds an image of the alignment of the specified type (EPS/PNG/SVG) and
* writes it to the specified file
*
* @param type
* @param file
+ * @param textrenderer
+ * @param bitmapscale
*/
*/
- void makeAlignmentImage(ImageMaker.TYPE type, File file)
+ void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer,
+ BitmapImageSizing userBis) throws ImageOutputException
{
final int borderBottomOffset = 5;
{
final int borderBottomOffset = 5;
@@
-1204,7
+1221,8
@@
public class AlignmentPanel extends GAlignmentPanel implements
int imageWidth = aDimension.getWidth();
int imageHeight = aDimension.getHeight() + borderBottomOffset;
String of = MessageManager.getString("label.alignment");
int imageWidth = aDimension.getWidth();
int imageHeight = aDimension.getHeight() + borderBottomOffset;
String of = MessageManager.getString("label.alignment");
- exporter.doExport(file, this, imageWidth, imageHeight, of);
+ exporter.doExport(file, this, imageWidth, imageHeight, of, renderer,
+ userBis);
}
/**
}
/**
@@
-1248,7
+1266,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
}
- public void makePNGImageMap(File imgMapFile, String imageName)
+ public void makePNGImageMap(File imgMapFile, String imageName) throws ImageOutputException
{
// /////ONLY WORKS WITH NON WRAPPED ALIGNMENTS
// ////////////////////////////////////////////
{
// /////ONLY WORKS WITH NON WRAPPED ALIGNMENTS
// ////////////////////////////////////////////
@@
-1373,7
+1391,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
} catch (Exception ex)
{
} catch (Exception ex)
{
- ex.printStackTrace();
+ throw new ImageOutputException("couldn't write ImageMap due to unexpected error",ex);
}
} // /////////END OF IMAGE MAP
}
} // /////////END OF IMAGE MAP
@@
-1464,9
+1482,9
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
else
{
}
else
{
- if (Cache.log.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
{
- Cache.log.warn("Closing alignment panel which is already closed.");
+ Console.warn("Closing alignment panel which is already closed.");
}
}
}
}
}
}
@@
-1541,13
+1559,17
@@
public class AlignmentPanel extends GAlignmentPanel implements
} catch (Exception ex)
{
}
} catch (Exception ex)
{
}
-
if (b)
{
if (b)
{
- alignFrame.setDisplayedView(this);
+ setAlignFrameView();
}
}
}
}
+ public void setAlignFrameView()
+ {
+ alignFrame.setDisplayedView(this);
+ }
+
@Override
public StructureSelectionManager getStructureSelectionManager()
{
@Override
public StructureSelectionManager getStructureSelectionManager()
{
@@
-1763,4
+1785,16
@@
public class AlignmentPanel extends GAlignmentPanel implements
return overviewTitle;
}
return overviewTitle;
}
+ /**
+ * If this alignment panel has an Overview panel open, closes it
+ */
+ public void closeOverviewPanel()
+ {
+ if (overviewPanel != null)
+ {
+ overviewPanel.close();
+ overviewPanel = null;
+ }
+ }
+
}
}