alignPanels.addElement(ap);
+ PaintRefresher.Register(ap, ap.av.getSequenceSetId());
+
int aSize = alignPanels.size();
tabbedPane.setVisible(aSize>1 || ap.av.viewName!=null);
*/
void setMenusFromViewport(AlignViewport av)
{
+ padGapsMenuitem.setSelected(av.padGaps);
colourTextMenuItem.setSelected(av.showColourText);
abovePIDThreshold.setSelected(av.getAbovePIDThreshold());
conservationMenuItem.setSelected(av.getConservationSelected());
seqLimits.setSelected(av.getShowJVSuffix());
+ idRightAlign.setSelected(av.idsAlignRight);
renderGapsMenuItem.setSelected(av.renderGaps);
wrapMenuItem.setSelected(av.wrapAlignment);
annotationPanelMenuItem.setState(av.showAnnotation);
viewport.redoList.push(command);
command.undoCommand();
+
viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;
updateEditMenuBar();
- viewport.firePropertyChange("alignment", null,
- viewport.getAlignment().getSequences());
+ viewport.firePropertyChange("alignment", null,null);
}
/**
viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null;
updateEditMenuBar();
- viewport.firePropertyChange("alignment", null, viewport.getAlignment().getSequences());
+ viewport.firePropertyChange("alignment", null, null);
}
alignPanel.repaint();
}
+ public void idRightAlign_actionPerformed(ActionEvent e)
+ {
+ viewport.idsAlignRight = idRightAlign.isSelected();
+ alignPanel.repaint();
+ }
+
+
/**
* DOCUMENT ME!
Color textColour = Color.black;
Color textColour2 = Color.white;
+ boolean idsAlignRight = false;
+
/**
* Creates a new AlignViewport object.
int imgHeight = 0;\r
boolean fastPaint = false;\r
java.util.Vector searchResults;\r
+ FontMetrics fm;\r
\r
/**\r
* Creates a new IdCanvas object.\r
*/\r
public void drawIdString(Graphics2D gg, SequenceI s, int i, int starty, int ypos)\r
{\r
+ int xPos = 0;\r
+ int panelWidth = getWidth();\r
int charHeight = av.charHeight;\r
\r
if ((searchResults != null) && searchResults.contains(s))\r
gg.setColor(Color.black);\r
}\r
\r
+ if (av.idsAlignRight)\r
+ {\r
+ xPos = panelWidth - fm.stringWidth(\r
+ s.getDisplayId(av.getShowJVSuffix())\r
+ ) - 4;\r
+ }\r
\r
gg.drawString( s.getDisplayId(av.getShowJVSuffix()),\r
- 0, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
+ xPos, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
\r
if (av.hasHiddenRows && av.showHiddenMarkers)\r
drawMarker(i, starty, ypos);\r
}\r
\r
gg = (Graphics2D) image.getGraphics();\r
+\r
//Fill in the background\r
gg.setColor(Color.white);\r
gg.fillRect(0, 0, getWidth(), imgHeight);\r
av.getFont().getSize());\r
\r
gg.setFont(italic);\r
+ fm = gg.getFontMetrics();\r
\r
if (av.antiAlias)\r
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r
else\r
{\r
//Now draw the id strings\r
+ int panelWidth = getWidth();\r
+ int xPos = 0;\r
\r
SequenceI sequence;\r
//Now draw the id strings\r
\r
String string = sequence.getDisplayId( av.getShowJVSuffix());\r
\r
- gg.drawString(string, 0,\r
+\r
+ if(av.idsAlignRight)\r
+ {\r
+ xPos = panelWidth - fm.stringWidth(string) - 4;\r
+ }\r
+\r
+ gg.drawString(string, xPos,\r
(((i - starty) * av.charHeight) + av.charHeight) -\r
(av.charHeight / 5));\r
\r
view.setShowBoxes(av.getShowBoxes());
view.setShowColourText(av.getColourText());
view.setShowFullId(av.getShowJVSuffix());
+ view.setRightAlignIds(av.idsAlignRight);
view.setShowSequenceFeatures(av.showSequenceFeatures);
view.setShowText(av.getShowText());
view.setWrapAlignment(av.getWrapAlignment());
af.viewport.setConservationSelected(view.getConservationSelected());
af.viewport.setShowJVSuffix(view.getShowFullId());
+ af.viewport.idsAlignRight=view.getRightAlignIds();
af.viewport.setFont(new java.awt.Font(view.getFontName(),
view.getFontStyle(), view.getFontSize()));
af.alignPanel.fontChanged();