import jalview.datamodel.ColumnSelection;
import jalview.datamodel.ContactListI;
import jalview.datamodel.ContactRange;
+import jalview.datamodel.GraphLine;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceI;
import jalview.gui.JalviewColourChooser.ColourChooserListener;
private MouseWheelListener[] _mwl;
+ private boolean notJustOne;
+
/**
* Creates a new AnnotationPanel object.
*
}
else
{
+ GraphLine thr = aa[graphStretch].getThreshold();
int currentX = getColumnForXPos(evt.getX());
ContactListI forCurrentX = av.getContactList(aa[graphStretch],
currentX);
int fr, to;
fr = Math.min(cXci.cStart, cXci.cEnd);
to = Math.max(cXci.cStart, cXci.cEnd);
- for (int c = fr; c <= to; c++)
+ // select corresponding range in segment under mouse
{
- av.getColumnSelection().addElement(c);
+ for (int c = fr; c <= to; c++)
+ {
+ av.getColumnSelection().addElement(c);
+ }
+ av.getColumnSelection().addElement(currentX);
+ }
+ // and also select everything lower than the max range adjacent
+ // (kind of works)
+ {
+ int c = fr - 1;
+ ContactRange cr = forCurrentX.getRangeFor(fr, to);
+ double cval;
+ while (c > 0)
+ {
+ cval = forCurrentX.getContactAt(c);
+ if (// cr.getMin() <= cval &&
+ cval <= cr.getMax())
+ {
+ av.getColumnSelection().addElement(c--);
+ }
+ else
+ {
+ break;
+ }
+ }
+ c = to;
+ while (c < forCurrentX.getContactHeight())
+ {
+ cval = forCurrentX.getContactAt(c);
+ if (// cr.getMin() <= cval &&
+ cval <= cr.getMax())
+ {
+ av.getColumnSelection().addElement(c++);
+ }
+ else
+ {
+ break;
+ }
+ }
}
- av.getColumnSelection().addElement(currentX);
}
}
}
* mostly vertical drag
*/
dragMode = DragMode.Resize;
+ notJustOne = evt.isShiftDown();
/*
* but could also be a matrix drag
AlignmentAnnotation graphAnnotation = av.getAlignment()
.getAlignmentAnnotation()[graphStretch];
int newHeight = Math.max(0, graphAnnotation.graphHeight + deltaY);
- graphAnnotation.graphHeight = newHeight;
+ if (notJustOne)
+ {
+ for (AlignmentAnnotation similar : av.getAlignment()
+ .findAnnotations(null, graphAnnotation.getCalcId(),
+ graphAnnotation.label))
+ {
+ similar.graphHeight = newHeight;
+ }
+
+ }
+ else
+ {
+ graphAnnotation.graphHeight = newHeight;
+ }
adjustPanelHeight();
ap.paintAlignment(false, false);
}
if (image == null || imgWidth != image.getWidth(this)
|| image.getHeight(this) != getHeight())
{
- try
- {
- image = new BufferedImage(imgWidth,
- ap.getAnnotationPanel().getHeight(),
- BufferedImage.TYPE_INT_RGB);
- } catch (OutOfMemoryError oom)
+ boolean tried = false;
+ image = null;
+ while (image == null && !tried)
{
try
{
- System.gc();
- } catch (Exception x)
+ image = new BufferedImage(imgWidth,
+ ap.getAnnotationPanel().getHeight(),
+ BufferedImage.TYPE_INT_RGB);
+ tried = true;
+ } catch (IllegalArgumentException exc)
{
+ System.err.println(
+ "Serious issue with viewport geometry imgWidth requested was "
+ + imgWidth);
+ return;
+ } catch (OutOfMemoryError oom)
+ {
+ try
+ {
+ System.gc();
+ } catch (Exception x)
+ {
+ }
+ ;
+ new OOMWarning(
+ "Couldn't allocate memory to redraw screen. Please restart Jalview",
+ oom);
+ return;
}
- ;
- new OOMWarning(
- "Couldn't allocate memory to redraw screen. Please restart Jalview",
- oom);
- return;
+
}
gg = (Graphics2D) image.getGraphics();