label.show_experimental = Enable experimental features
label.show_experimental_tip = Enable any new and currently 'experimental' features (see Latest Release Notes for details)
label.warning_hidden = Warning: {0} {1} is currently hidden
-label.oview_calc = Recalculating overview...
+label.overview_settings = Overview settings
+label.ov_legacy_gap = Use legacy gap colouring (gaps are white)
+label.gap_colour = Gap colour:
+label.ov_show_hide_default = Show hidden regions when opening overview
+label.hidden_colour = Hidden colour:
+label.select_gap_colour = Select gap colour
+label.select_hidden_colour = Select hidden colour
+label.overview = Overview
- label.reset_to_defaults = Reset to defaults
++label.reset_to_defaults = Reset to defaults
++label.oview_calc = Recalculating overview...
label.show_experimental = Habilitar funciones experimentales
label.show_experimental_tip = Habilitar funciones nuevas y experimentales (ver Latest Release Notes para más detalles)
label.warning_hidden = Advertencia: {0} {1} está actualmente oculto
-label.oview_calc = Recalculando resumen
+label.overview_settings = Ajustes para la ventana resumen
+label.ov_legacy_gap = <html>Utilizar el color heredado de huecos<br>(los huecos son blancos)
+label.gap_colour = Color de huecos:
+label.ov_show_hide_default = Mostrar regiones ocultas al abrir el resumen
+label.hidden_colour = Color de las regiones ocultas:
+label.select_gap_colour = Seleccionar color de huecos
+label.select_hidden_colour = Seleccionar color de las regiones ocultas
+label.overview = Resumen
- label.reset_to_defaults = Restablecen a los predeterminados
++label.reset_to_defaults = Restablecen a los predeterminados
++label.oview_calc = Recalculando resumen
package jalview.gui;
import jalview.api.AlignViewportI;
+import jalview.bin.Cache;
import jalview.renderer.OverviewRenderer;
+import jalview.renderer.OverviewResColourFinder;
import jalview.viewmodel.OverviewDimensions;
+ import java.awt.AlphaComposite;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.Graphics;
+ import java.awt.Graphics2D;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import javax.swing.JComponent;
private AlignViewportI av;
++
+ private OverviewResColourFinder cf;
+
+ private float alpha = 0f;
+
+ private long startTime = -1;
+
+ private final Timer timer;
+
+ private ProgressPanel progressPanel;
+
public OverviewCanvas(OverviewDimensions overviewDims,
- AlignViewportI alignvp)
+ AlignViewportI alignvp, ProgressPanel pp)
{
od = overviewDims;
av = alignvp;
sr = new SequenceRenderer(av);
sr.renderGaps = false;
- sr.forOverview = true;
fr = new jalview.renderer.seqfeatures.FeatureRenderer(av);
+ boolean useLegacy = Cache.getDefault(Preferences.USE_LEGACY_GAP, false);
+ Color gapCol = Cache.getDefaultColour(Preferences.GAP_COLOUR,
+ Preferences.OVERVIEW_DEFAULT_GAP);
+ Color hiddenCol = Cache.getDefaultColour(Preferences.HIDDEN_COLOUR,
+ Preferences.OVERVIEW_DEFAULT_HIDDEN);
+ cf = new OverviewResColourFinder(useLegacy, gapCol, hiddenCol);
++
+ setSize(od.getWidth(), od.getHeight());
+
+ timer = new Timer(SPEED, new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (startTime < 0)
+ {
+ startTime = System.currentTimeMillis();
+ }
+ else
+ {
+
+ long time = System.currentTimeMillis();
+ long duration = time - startTime;
+ if (duration >= RUNNING_TIME)
+ {
+ startTime = -1;
+ ((Timer) e.getSource()).stop();
+ alpha = 0f;
+ }
+ else
+ {
+ alpha = 1f - ((float) duration / (float) RUNNING_TIME);
+ }
+ repaint();
+ }
+ }
+ });
++
}
/**
fr.transferSettings(transferRenderer);
}
- or = new OverviewRenderer(sr, fr, od);
+ setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
+
+ or = new OverviewRenderer(fr, od, av.getAlignment(),
+ av.getResidueShading(), cf);
++
+ or.addPropertyChangeListener(progressPanel);
++
miniMe = or.draw(od.getRows(av.getAlignment()),
od.getColumns(av.getAlignment()));
*/
package jalview.gui;
+import jalview.bin.Cache;
+ import jalview.renderer.OverviewRenderer;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.viewmodel.OverviewDimensions;
this.av = alPanel.av;
this.ap = alPanel;
- od = new OverviewDimensionsShowHidden(av.getRanges(),
- (av.isShowAnnotation() && av
- .getAlignmentConservationAnnotation() != null));
+ showHidden = Cache.getDefault(Preferences.SHOW_OV_HIDDEN_AT_START,
+ true);
+ if (showHidden)
+ {
+ od = new OverviewDimensionsShowHidden(av.getRanges(),
+ (av.isShowAnnotation()
+ && av.getAlignmentConservationAnnotation() != null));
+ }
+ else
+ {
+ od = new OverviewDimensionsHideHidden(av.getRanges(),
+ (av.isShowAnnotation()
+ && av.getAlignmentConservationAnnotation() != null));
+ }
- setSize(od.getWidth(), od.getHeight());
-
- oviewCanvas = new OverviewCanvas(od, av);
setLayout(new BorderLayout());
+ progressPanel = new ProgressPanel(OverviewRenderer.UPDATE,
+ MessageManager.getString("label.oview_calc"), getWidth());
+ this.add(progressPanel, BorderLayout.SOUTH);
+ oviewCanvas = new OverviewCanvas(od, av, progressPanel);
+
add(oviewCanvas, BorderLayout.CENTER);
av.getRanges().addPropertyChangeListener(this);
buildGroupURLMenu(sg, groupLinks);
}
// Add a 'show all structures' for the current selection
- Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>(),
- reppdb = new Hashtable<String, PDBEntry>();
+ Hashtable<String, PDBEntry> pdbe = new Hashtable<>(), reppdb = new Hashtable<>();
++
SequenceI sqass = null;
for (SequenceI sq : ap.av.getSequenceSelection())
{
* Temporary store to hold distinct calcId / type pairs for the tooltip.
* Using TreeMap means calcIds are shown in alphabetical order.
*/
- SortedMap<String, String> tipEntries = new TreeMap<String, String>();
- final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<SequenceI, List<AlignmentAnnotation>>();
+ SortedMap<String, String> tipEntries = new TreeMap<>();
+ final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<>();
AlignmentI al = this.ap.av.getAlignment();
- AlignmentUtils.findAddableReferenceAnnotations(forSequences,
- tipEntries, candidates, al);
+ AlignmentUtils.findAddableReferenceAnnotations(forSequences, tipEntries,
+ candidates, al);
if (!candidates.isEmpty())
{
StringBuilder tooltip = new StringBuilder(64);
import jalview.api.AlignmentColsCollectionI;
import jalview.api.AlignmentRowsCollectionI;
+ import jalview.api.RendererListenerI;
import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.renderer.seqfeatures.FeatureColourFinder;
import jalview.renderer.seqfeatures.FeatureRenderer;
import jalview.viewmodel.OverviewDimensions;
+import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
+ import java.beans.PropertyChangeSupport;
public class OverviewRenderer
{
+ // transparency of hidden cols/seqs overlay
+ private final float TRANSPARENCY = 0.5f;
+
+ private final Color HIDDEN_COLOUR = Color.DARK_GRAY.darker();
+
+ public static final String UPDATE = "OverviewUpdate";
+
+ private static final int MAX_PROGRESS = 100;
+
+ private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
+ this);
+
private FeatureColourFinder finder;
- private jalview.api.SequenceRenderer sr;
-
// image to render on
private BufferedImage miniMe;
miniMe.setRGB(col, row, rgbcolor);
}
}
-
+
+ sendProgressUpdate((pixelCol + 1) * (endRow - pixelRow),
+ totalPixels, lastRowUpdate);
++
pixelCol = endCol + 1;
}
colIndex++;
seqIndex++;
}
+ overlayHiddenRegions(rows, cols);
+ // final update to progress bar if present
+ if (redraw)
+ {
+ sendProgressUpdate(pixelRow - 1, alignmentHeight, 0);
+ }
+ else
+ {
+ sendProgressUpdate(alignmentHeight, miniMe.getHeight(), 0);
+ }
return miniMe;
}
- /**
+ /*
+ * Calculate progress update value and fire event
+ */
+ private int sendProgressUpdate(int position, int maximum, int offset)
+ {
+ int newUpdate = offset
+ + Math.round(MAX_PROGRESS * ((float) position / maximum));
+ if (newUpdate > offset)
+ {
+ changeSupport.firePropertyChange(UPDATE, offset, newUpdate);
+ return newUpdate;
+ }
+ return offset;
+ }
+
+ /*
* Find the colour of a sequence at a specified column position
+ *
+ * @param seq
+ * sequence to get colour for
+ * @param lastcol
+ * column position to get colour for
+ * @param fcfinder
+ * FeatureColourFinder to use
+ * @return colour of sequence at this position, as RGB
*/
- private int getColumnColourFromSequence(jalview.datamodel.SequenceI seq,
- boolean isHidden, int lastcol, FeatureColourFinder fcfinder)
+ private int getColumnColourFromSequence(SequenceGroup[] allGroups,
+ jalview.datamodel.SequenceI seq,
+ int lastcol, FeatureColourFinder fcfinder)
{
Color color = Color.white;
colIndex++;
}
}
+ changeSupport.firePropertyChange(UPDATE, MAX_PROGRESS - 1,
+ MAX_PROGRESS);
}
+ /**
+ * Allows redraw flag to be set
+ *
+ * @param b
+ * value to set redraw to: true = redraw is occurring, false = no
+ * redraw
+ */
public void setRedraw(boolean b)
{
synchronized (this)