Skip to content
Snippets Groups Projects
Commit b568e09c authored by tcarver's avatar tcarver
Browse files

fix for closing graph panels when switching indexed sequence

parent fe3b2717
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ import java.util.Vector;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
/**
* This is a super-component containing several BasePlot components, each of
......@@ -208,6 +209,7 @@ public class BasePlotGroup extends JPanel
{
final StringBuffer closingPlots = new StringBuffer();
final Component[] children = getComponents();
int nvis = 0;
for(int i = 0 ; i<children.length ; ++i)
{
if(children[i] instanceof BasePlot)
......@@ -222,11 +224,13 @@ public class BasePlotGroup extends JPanel
findPlotByAlgorithm(alg).isVisible())
{
closingPlots.append(alg.getAlgorithmName()+"\n");
setVisibleByAlgorithm(alg, false);
children[i].setVisible(false);
continue;
}
}
if(children[i].isVisible())
nvis++;
((BasePlot)children[i]).displayAdjustmentValueChanged(event);
}
}
......@@ -234,9 +238,16 @@ public class BasePlotGroup extends JPanel
if(event.getType() == DisplayAdjustmentEvent.IDX_SEQUENCE_CHANGE &&
closingPlots.length() > 0)
{
if(nvis == 0 && getParent() instanceof JSplitPane)
{
JSplitPane splitPane = (JSplitPane) getParent();
splitPane.setDividerSize(0);
splitPane.setDividerLocation(0);
}
JOptionPane.showMessageDialog(this,
closingPlots.toString()+
"\nAs the sequence is changing the above user plots are closing as they are\n"+
"\nAs the sequence is changing the above user plot(s) are closing as they are\n"+
"not indexed with multiple sequences. You can load in the correponding plot\n"+
"for the new sequence.",
"Closing Userplot", JOptionPane.INFORMATION_MESSAGE);
......
......@@ -358,7 +358,8 @@ public class GraphMenu extends JMenu
splitPane.setDividerLocation(0);
}
else if( ( thisGraphOn && nvisible == 1 ) ||
(usageDisplayed && nvisible == 2) )
(usageDisplayed && nvisible == 2) ||
(splitPane.getDividerLocation() == 0))
{
splitPane.setDividerSize(3);
splitPane.setDividerLocation(0.2d);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment