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;
import javax.swing.JColorChooser;
import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.Scrollable;
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)
{
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;
}
}
- imgWidth = (av.endRes - av.startRes + 1) * av.getCharWidth();
+ imgWidth = (av.getEndRes() - av.getStartRes() + 1) * av.getCharWidth();
if (imgWidth < 1)
{
return;
imageFresh = true;
}
- drawComponent(gg, av.startRes, av.endRes + 1);
+ drawComponent(gg, av.getStartRes(), av.getEndRes() + 1);
imageFresh = false;
g.drawImage(image, 0, 0, this);
}
gg.copyArea(0, 0, imgWidth, getHeight(),
-horizontal * av.getCharWidth(), 0);
long mtime = System.currentTimeMillis();
- int sr = av.startRes;
- int er = av.endRes + 1;
+ int sr = av.getStartRes();
+ int er = av.getEndRes() + 1;
int transX = 0;
if (horizontal > 0) // scrollbar pulled right, image to the left
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();
+ }
+ }
}