示例#1
0
        public void checkDeselection(int minBlockX, int maxBlockX, int minBlockY, int maxBlockY)
        {
            GeoCell cell = FrameMain.getInstance().getSelectedGeoCell();
            //
            GeoBlock block;

            for (GeoBlockEntry e = getHead(), p; (e = e.getNext()) != getTail();)
            {
                block = e.getKey();
                if (block.getBlockX() < minBlockX || block.getBlockX() >= maxBlockX || block.getBlockY() < minBlockY || block.getBlockY() >= maxBlockY)
                {
                    if (cell != null && cell.getBlock() == block)
                    {
                        cell = null;
                        FrameMain.getInstance().setSelectedGeoCell(null);
                    }
                    //
                    setStateOf(block.getCells(), SelectionState.NORMAL);
                    p = e.getPrev();
                    e.remove();
                    e = p;
                }
            }
            //
            if (cell == null && hasSelected())
            {
                FrameMain.getInstance().setSelectedGeoCell(getTail().getPrev().getValue().getLastUnsafe());
            }
        }
示例#2
0
 public override void setNswe(short nswe)
 {
     if (FrameMain.getInstance().isSelectedGeoCell(this))
     {
         FrameMain.getInstance().setSelectedGeoCell(this);
     }
 }
示例#3
0
 public override void setNswe(short nswe)
 {
     _heightAndNSWE = GeoEngine.updateNSWEOfHeightAndNSWE(_heightAndNSWE, nswe);
     //
     if (FrameMain.getInstance().isSelectedGeoCell(this))
     {
         FrameMain.getInstance().setSelectedGeoCell(this);
     }
 }
示例#4
0
        public override void addHeight(short height)
        {
            short oldHeight = getHeight();

            _height = GeoEngine.getGeoHeightOfHeight((short)(_height + height));
            getBlock().updateMinMaxHeight(_height, oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
示例#5
0
        public override void setHeightAndNSWE(short heightAndNSWE)
        {
            short oldHeight = getHeight();

            _height = GeoEngine.getHeight(heightAndNSWE);
            //
            getBlock().updateMinMaxHeight(_height, oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
示例#6
0
        public override void setHeightAndNSWE(short heightAndNSWE)
        {
            short oldHeight = getHeight();

            _heightAndNSWE = heightAndNSWE;
            getBlock().updateLayerFor(this);
            getBlock().updateMinMaxHeight(getHeight(), oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
示例#7
0
        public override void addHeight(short height)
        {
            short oldHeight = getHeight();

            _heightAndNSWE = GeoEngine.updateHeightOfHeightAndNSWE(_heightAndNSWE, (short)(getHeight() + height));
            getBlock().updateLayerFor(this);
            getBlock().updateMinMaxHeight(getHeight(), oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
示例#8
0
        public void unload()
        {
            for (GeoBlockEntry e = getHead(), p; (e = e.getNext()) != getTail();)
            {
                p = e.getPrev();
                e.remove();
                e = p;
            }
            //
            FrameMain f = FrameMain.getInstance();

            if (f != null)
            {
                f.setSelectedGeoCell(null);
            }
        }
示例#9
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());
         }
     }
 }