- static String ADDNEW = "Add New Row";
- static String EDITNAME="Edit Label/Description";
- static String HIDE = "Hide This Row";
- static String DELETE = "Delete This Row";
- static String SHOWALL = "Show All Hidden Rows";
- static String OUTPUT_TEXT = "Export Annotation";
- static String COPYCONS_SEQ = "Copy Consensus Sequence";
- boolean resizePanel = false;
- Image image;
- AlignmentPanel ap;
- AlignViewport av;
- boolean resizing = false;
- MouseEvent dragEvent;
- int oldY;
- int selectedRow;
- int scrollOffset = 0;
- Font font = new Font("Arial", Font.PLAIN, 11);
-
-
- /**
- * Creates a new AnnotationLabels object.
- *
- * @param ap DOCUMENT ME!
- */
- public AnnotationLabels(AlignmentPanel ap)
+ /**
+ * width in pixels within which height adjuster arrows are shown and active
+ */
+ private static final int HEIGHT_ADJUSTER_WIDTH = 50;
+
+ /**
+ * height in pixels for allowing height adjuster to be active
+ */
+ private static int HEIGHT_ADJUSTER_HEIGHT = 10;
+
+ private static final Pattern LEFT_ANGLE_BRACKET_PATTERN = Pattern
+ .compile("<");
+
+ private static final Font font = new Font("Arial", Font.PLAIN, 11);
+
+ private static final String TOGGLE_LABELSCALE = MessageManager
+ .getString("label.scale_label_to_column");
+
+ private static final String ADDNEW = MessageManager
+ .getString("label.add_new_row");
+
+ private static final String EDITNAME = MessageManager
+ .getString("label.edit_label_description");
+
+ private static final String HIDE = MessageManager
+ .getString("label.hide_row");
+
+ private static final String DELETE = MessageManager
+ .getString("label.delete_row");
+
+ private static final String SHOWALL = MessageManager
+ .getString("label.show_all_hidden_rows");
+
+ private static final String OUTPUT_TEXT = MessageManager
+ .getString("label.export_annotation");
+
+ private static final String COPYCONS_SEQ = MessageManager
+ .getString("label.copy_consensus_sequence");
+
+ private final boolean debugRedraw = false;
+
+ private AlignmentPanel ap;
+
+ AlignViewport av;
+
+ private MouseEvent dragEvent;
+
+ private int oldY;
+
+ private int selectedRow;
+
+ private int scrollOffset = 0;
+
+ private boolean hasHiddenRows;
+
+ private boolean resizePanel = false;
+
+ /**
+ * Creates a new AnnotationLabels object
+ *
+ * @param ap
+ */
+ public AnnotationLabels(AlignmentPanel ap)
+ {
+ this.ap = ap;
+ av = ap.av;
+ ToolTipManager.sharedInstance().registerComponent(this);
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ addMouseWheelListener(ap.getAnnotationPanel());
+ }
+
+ public AnnotationLabels(AlignViewport av)
+ {
+ this.av = av;
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param y
+ * DOCUMENT ME!
+ */
+ public void setScrollOffset(int y)
+ {
+ scrollOffset = y;
+ repaint();
+ }
+
+ /**
+ * sets selectedRow to -2 if no annotation preset, -1 if no visible row is at
+ * y
+ *
+ * @param y
+ * coordinate position to search for a row
+ */
+ void getSelectedRow(int y)
+ {
+ int height = 0;
+ AlignmentAnnotation[] aa = ap.av.getAlignment()
+ .getAlignmentAnnotation();
+ selectedRow = -2;
+ if (aa != null)