import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.image.BufferedImage;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
boolean mouseDragging = false;
- boolean MAC = false;
-
// for editing cursor
int cursorX = 0;
*/
public AnnotationPanel(AlignmentPanel ap)
{
-
- MAC = jalview.util.Platform.isAMac();
-
ToolTipManager.sharedInstance().registerComponent(this);
ToolTipManager.sharedInstance().setInitialDelay(0);
ToolTipManager.sharedInstance().setDismissDelay(10000);
else if (action.equals(LABEL))
{
String exMesg = collectAnnotVals(anot, LABEL);
- String label = JOptionPane.showInputDialog(this,
+ String label = JvOptionPane.showInputDialog(this,
MessageManager.getString("label.enter_label"), exMesg);
if (label == null)
aa[activeRow].hasIcons = true;
}
- String label = JOptionPane.showInputDialog(MessageManager
+ String label = JvOptionPane.showInputDialog(MessageManager
.getString("label.enter_label_for_the_structure"), symbol);
if (label == null)
StringBuilder collatedInput = new StringBuilder(64);
String last = "";
ColumnSelection viscols = av.getColumnSelection();
- // TODO: refactor and save av.getColumnSelection for efficiency
- List<Integer> selected = viscols.getSelected();
+
+ /*
+ * the selection list (read-only view) is in selection order, not
+ * column order; make a copy so we can sort it
+ */
+ List<Integer> selected = new ArrayList<Integer>(viscols.getSelected());
Collections.sort(selected);
for (int index : selected)
{
String tlabel = null;
if (anots[index] != null)
{ // LML added stem code
- if (type.equals(HELIX) || type.equals(SHEET)
- || type.equals(STEM) || type.equals(LABEL))
+ if (type.equals(HELIX) || type.equals(SHEET) || type.equals(STEM)
+ || type.equals(LABEL))
{
tlabel = anots[index].description;
if (tlabel == null || tlabel.length() < 1)
}
}
+ /*
+ * isPopupTrigger fires in mousePressed on Mac,
+ * not until mouseRelease on Windows
+ */
if (evt.isPopupTrigger() && activeRow != -1)
{
showPopupMenu(y, evt.getX());
}
ap.getScalePanel().mousePressed(evt);
-
}
/**
mouseDragging = false;
ap.getScalePanel().mouseReleased(evt);
+ /*
+ * isPopupTrigger is set in mouseReleased on Windows
+ * (in mousePressed on Mac)
+ */
if (evt.isPopupTrigger() && activeRow != -1)
{
showPopupMenu(evt.getY(), evt.getX());
{
text.append(", ")
.append(MessageManager.getString("label.sequence"))
- .append(" ")
- .append(seqIndex + 1);
+ .append(" ").append(seqIndex + 1);
char residue = seqref.getCharAt(column);
if (!Comparison.isGap(residue))
{
return null;
}
}
+
+ /**
+ * Try to ensure any references held are nulled
+ */
+ public void dispose()
+ {
+ av = null;
+ ap = null;
+ image = null;
+ fadedImage = null;
+ gg = null;
+ _mwl = null;
+
+ /*
+ * I created the renderer so I will dispose of it
+ */
+ if (renderer != null)
+ {
+ renderer.dispose();
+ }
+ }
}