// palette = new JPanel();
// palette.setLayout(new GridLayout(0, 1));
// The DTED Level selector
JPanel levelPanel = PaletteHelper.createPaletteJPanel("DTED Level");
ButtonGroup levels = new ButtonGroup();
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (cache != null) {
String ac = e.getActionCommand();
int newLevel;
if (ac.equalsIgnoreCase(level2Command))
newLevel = DTEDFrameSubframe.LEVEL_2;
else if (ac.equalsIgnoreCase(level1Command))
newLevel = DTEDFrameSubframe.LEVEL_1;
else
newLevel = DTEDFrameSubframe.LEVEL_0;
DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
dfsi.dtedLevel = newLevel;
// cache.setSubframeInfo(dfsi);
}
}
};
JRadioButton level0 = new JRadioButton("Level 0");
level0.addActionListener(al);
level0.setActionCommand(level0Command);
JRadioButton level1 = new JRadioButton("Level 1");
level1.addActionListener(al);
level1.setActionCommand(level1Command);
JRadioButton level2 = new JRadioButton("Level 2");
level2.addActionListener(al);
level2.setActionCommand(level2Command);
levels.add(level0);
levels.add(level1);
levels.add(level2);
switch (dtedLevel) {
case 2:
level2.setSelected(true);
break;