*/
package jalview.gui;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-
-import javax.swing.*;
-
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceI;
import jalview.renderer.AnnotationRenderer;
import jalview.renderer.AwtRenderPanelI;
import jalview.util.MessageManager;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JColorChooser;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.Scrollable;
+import javax.swing.SwingUtilities;
+import javax.swing.ToolTipManager;
+
/**
* AnnotationPanel displays visible portion of annotation rows below unwrapped
* alignment
int index = av.getColumnSelection().columnAt(i);
if (!av.getColumnSelection().isVisible(index))
+ {
continue;
+ }
if (anot[index] == null)
{
int index = av.getColumnSelection().columnAt(i);
if (!av.getColumnSelection().isVisible(index))
+ {
continue;
+ }
if (anot[index] == null)
{
int index = av.getColumnSelection().columnAt(i);
if (!av.getColumnSelection().isVisible(index))
+ {
continue;
+ }
if (anot[index] == null)
{
anot[index] = new Annotation(label, "", type, 0);
}
- anot[index].secondaryStructure = type;
+
+ anot[index].secondaryStructure = type != 'S' ? type : label
+ .length() == 0 ? ' ' : label.charAt(0);
anot[index].displayCharacter = label;
}
int index = columnSelection.columnAt(i);
// always check for current display state - just in case
if (!viscols.isVisible(index))
+ {
continue;
+ }
String tlabel = null;
if (anot[index] != null)
{ // LML added stem code
}
imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;
if (imgWidth < 1)
+ {
return;
+ }
if (image == null || imgWidth != image.getWidth(this)
|| image.getHeight(this) != getHeight())
{
return bounds;
}
else
+ {
return null;
+ }
}
}
private boolean predefinedColours = false;
private boolean seqAssociated = false;
- Color rnaHelices[] = null;
- private void initRnaHelicesShading(int n)
- {
- int j = 0;
- if (rnaHelices==null)
- {
- rnaHelices = new Color[n + 1];
- }
- else
- if (rnaHelices != null && rnaHelices.length <= n)
- {
- Color[] t = new Color[n + 1];
- System.arraycopy(rnaHelices, 0, t, 0, rnaHelices.length);
- j = rnaHelices.length;
- rnaHelices = t;
- }
- else
- {
- return;
- }
- // Generate random colors and store
- for (; j <= n; j++)
- {
- rnaHelices[j] = jalview.util.ColorUtils
- .generateRandomColor(Color.white);
- }
- }
/**
* false if the scheme was constructed without a minColour and maxColour used
* to decide if existing colours should be taken from annotation elements when
aamin = annotation.graphMin;
if (annotation.isRNA())
{
- initRnaHelicesShading(1 + (int) aamax);
+ ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
}
}
}
if (rna)
{
- initRnaHelicesShading(1 + (int) aamax);
+ ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
}
}
}
{
if (annotation.isRNA())
{
- currentColour = rnaHelices[(int) aj.value];
+ currentColour = ColourSchemeProperty.rnaHelices[(int) aj.value];
}
else
{
return col;
}
+
+ public static Color rnaHelices[] = null;
+
+ public static void initRnaHelicesShading(int n)
+ {
+ int j = 0;
+ if (rnaHelices == null)
+ {
+ rnaHelices = new Color[n + 1];
+ }
+ else if (rnaHelices != null && rnaHelices.length <= n)
+ {
+ Color[] t = new Color[n + 1];
+ System.arraycopy(rnaHelices, 0, t, 0, rnaHelices.length);
+ j = rnaHelices.length;
+ rnaHelices = t;
+ }
+ else
+ {
+ return;
+ }
+ // Generate random colors and store
+ for (; j <= n; j++)
+ {
+ rnaHelices[j] = jalview.util.ColorUtils
+ .generateRandomColor(Color.white);
+ }
+ }
+
}