Author: sletellier Date: 2008-12-18 15:59:28 +0000 (Thu, 18 Dec 2008) New Revision: 1692 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx Log: Debug final ! Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-18 15:29:52 UTC (rev 1691) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-18 15:59:28 UTC (rev 1692) @@ -56,7 +56,7 @@ import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.topia.TopiaException; - protected IsisMapBean portMap = new IsisMapBean(); + protected IsisMapBean portMap = null; protected OpenMapToolPanel toolMap = new OpenMapToolPanel(); protected OMToolSet toolSet = new OMToolSet(); protected OpenMapEvents mapListener = null; @@ -93,15 +93,17 @@ } - portMap = new IsisMapBean(); - portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION); - portMap.setActiveMouseMode(new SelectMouseMode()); - portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion()); - toolSet.setupListeners(portMap); - toolMap.add((Component)toolSet); - setMapListener(); - portMapPanel.add(toolMap, BorderLayout.NORTH); - portMapPanel.add(portMap, BorderLayout.CENTER); + if(portMap == null){ + portMap = new IsisMapBean(); + portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION); + portMap.setActiveMouseMode(new SelectMouseMode()); + portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion()); + toolSet.setupListeners(portMap); + toolMap.add((Component)toolSet); + setMapListener(); + portMapPanel.add(toolMap, BorderLayout.NORTH); + portMapPanel.add(portMap, BorderLayout.CENTER); + } refreshMap(); } protected void refreshMap(){ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-18 15:29:52 UTC (rev 1691) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-18 15:59:28 UTC (rev 1692) @@ -77,7 +77,7 @@ zoneCells.setModel(zoneCellsModel); java.util.List<Cell> cellsSelected = z.getCell(); if (cellsSelected != null){ - int[] indexs = new int[zoneCellsModel.size()]; + int[] indexs = new int[cellsSelected.size()]; int i = 0; for (Cell c : cellsSelected){ indexs[i] = zoneCellsModel.indexOf(c); @@ -129,6 +129,7 @@ return false; } }; + zoneMap.addMapMouseListener(mapListener); } } protected void refreshMap(){
participants (1)
-
sletellier@users.labs.libre-entreprise.org