From 2f0a27d1518d031c59ccf224cd986f6961a9243b Mon Sep 17 00:00:00 2001 From: tcarver <tjc> Date: Tue, 8 Oct 2013 15:37:40 +0100 Subject: [PATCH] add getVisibleCount() --- .../artemis/components/BasePlotGroup.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/uk/ac/sanger/artemis/components/BasePlotGroup.java b/uk/ac/sanger/artemis/components/BasePlotGroup.java index 0de7102b6..0b2e6a568 100644 --- a/uk/ac/sanger/artemis/components/BasePlotGroup.java +++ b/uk/ac/sanger/artemis/components/BasePlotGroup.java @@ -308,6 +308,24 @@ public class BasePlotGroup extends JPanel final Component base_plot = findPlotByAlgorithm(algorithm); return base_plot.isVisible (); } + + + /** + * Return the number of visible plots + * @return + */ + public int getVisibleCount() + { + int cnt = 0; + Component comp[] = getComponents(); + for(int i = 0 ; i<comp.length ; ++i) + if(comp[i] instanceof BasePlot) + { + if(comp[i].isVisible()) + cnt++; + } + return cnt; + } /** * Given an Algorithm, find and set the visibility of the corresponding -- GitLab