// The DTED view selector
JPanel viewPanel = PaletteHelper.createPaletteJPanel("View Type");
String[] viewStrings = { "None", "Shading", "Elevation Shading",
"Elevation Bands (Meters)", "Elevation Bands (Feet)" };
JComboBox viewList = new JComboBox(viewStrings);
viewList.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JComboBox jcb = (JComboBox) e.getSource();
int newView = jcb.getSelectedIndex();
switch (newView) {
case 0:
viewType = DTEDFrameSubframe.NOSHADING;
break;
case 1:
viewType = DTEDFrameSubframe.SLOPESHADING;
break;
case 2:
viewType = DTEDFrameSubframe.COLOREDSHADING;
break;
case 3:
viewType = DTEDFrameSubframe.METERSHADING;
break;
case 4:
viewType = DTEDFrameSubframe.FEETSHADING;
break;
default:
viewType = DTEDFrameSubframe.NOSHADING;
}
if (cache != null) {
DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
dfsi.viewType = viewType;
// cache.setSubframeInfo(dfsi);
}
}
});
int selectedView;
switch (viewType) {
case 0:
case 1:
selectedView = viewType;
break;
case 2:
case 3:
selectedView = viewType + 1;
break;
case 4:
// This puts the layer in testing mode, and the menu
// changes.
String[] viewStrings2 = { "None", "Shading",
"Elevation Bands (Meters)", "Elevation Bands (Feet)",
"Subframe Testing", "Elevation Shading" };
viewList = new JComboBox(viewStrings2);
viewList.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JComboBox jcb = (JComboBox) e.getSource();
int newView = jcb.getSelectedIndex();
if (cache != null) {
DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
dfsi.viewType = newView;
// cache.setSubframeInfo(dfsi);
}