Exemplo n.º 1
0
        public void unselectGeoCell(GeoCell cell)
        {
            GeoBlock                block    = cell.getBlock();
            GeoBlockEntry           entry    = getEntry(block);
            FastArrayList <GeoCell> selected = entry.getValue();

            if (selected != null && selected.remove(cell))
            {
                if (selected.isEmpty())
                {
                    setStateOf(block.getCells(), SelectionState.NORMAL);
                    entry.remove();
                    updateGUI(null);
                }
                else
                {
                    cell.setSelectionState(SelectionState.HIGHLIGHTED);
                    updateGUI(selected.getLastUnsafe());
                }
            }
        }
Exemplo n.º 2
0
 private void updateGUI(GeoCell cell)
 {
     if (!hasSelected())
     {
         FrameMain.getInstance().setSelectedGeoCell(null);
     }
     else
     {
         FastArrayList <GeoCell> selected = cell == null ? null : getEntry(cell.getBlock()).getValue();
         if (selected == null)
         {
             selected = getTail().getPrev().getValue();
         }
         //
         if (cell != null && selected.contains(cell))
         {
             FrameMain.getInstance().setSelectedGeoCell(cell);
         }
         else
         {
             FrameMain.getInstance().setSelectedGeoCell(selected.getLastUnsafe());
         }
     }
 }