@ -42,7 +42,7 @@ import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree;
import com.fr.workspace.WorkContext ;
import javax.swing.BorderFactory ;
import javax.swing.JOptionPane ;
import javax.swing.DefaultComboBoxModel ;
import javax.swing.JPanel ;
import javax.swing.SwingConstants ;
import javax.swing.SwingWorker ;
@ -51,6 +51,8 @@ import javax.swing.event.PopupMenuListener;
import javax.swing.tree.DefaultMutableTreeNode ;
import javax.swing.tree.TreeNode ;
import javax.swing.tree.TreePath ;
import java.util.ArrayList ;
import java.util.List ;
import java.awt.BorderLayout ;
import java.awt.CardLayout ;
import java.awt.Component ;
@ -61,8 +63,6 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener ;
import java.awt.event.MouseEvent ;
import java.awt.event.MouseListener ;
import java.util.ArrayList ;
import java.util.List ;
/ * *
* Created by Mitisky on 16 / 5 / 11 .
@ -280,14 +280,12 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
public void popupMenuWillBecomeVisible ( PopupMenuEvent e ) {
String selected = Utils . objectToString ( gisLayer . getSelectedItem ( ) ) ;
ZoomLevel zoomSelected = ( ZoomLevel ) zoomLevel . getSelectedItem ( ) ;
gisLayer . removeAllItems ( ) ;
for ( String item : MapLayerConfigManager . getLayerItems ( ) ) {
gisLayer . addItem ( item ) ;
}
gisLayer . setModel ( new DefaultComboBoxModel ( MapLayerConfigManager . getLayerItems ( ) ) ) ;
gisLayer . setSelectedItem ( selected ) ;
zoomLevel . setSelectedItem ( zoomSelected ) ;
}
} ) ;
@ -346,10 +344,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
} else {
levels = ZOOM_LEVELS ;
}
zoomLevel . removeAllItems ( ) ;
for ( int i = 0 ; i < levels . length ; i + + ) {
zoomLevel . addItem ( levels [ i ] ) ;
}
zoomLevel . setModel ( new DefaultComboBoxModel ( levels ) ) ;
}