예제 #1
0
  /*
   * (non-Javadoc)
   *
   * @see maptool.client.Tool#attachTo(maptool.client.ZoneRenderer)
   */
  @Override
  protected void attachTo(ZoneRenderer renderer) {
    oldShowGrid = AppState.isShowGrid();
    AppState.setShowGrid(true);

    Grid grid = renderer.getZone().getGrid();

    boolean showSecond =
        grid.getCapabilities().isSecondDimensionAdjustmentSupported() ? true : false;
    gridSecondDimension.setVisible(showSecond);
    gridSecondDimensionLabel.setVisible(showSecond);

    MapTool.getFrame().showControlPanel(controlPanel);
    renderer.repaint();

    super.attachTo(renderer);

    copyGridToControlPanel();
  }
예제 #2
0
  /*
   * (non-Javadoc)
   *
   * @see maptool.client.Tool#detachFrom(maptool.client.ZoneRenderer)
   */
  @Override
  protected void detachFrom(ZoneRenderer renderer) {
    AppState.setShowGrid(oldShowGrid);
    MapTool.getFrame().hideControlPanel();
    renderer.repaint();

    // Commit the grid size change
    Zone zone = renderer.getZone();
    MapTool.serverCommand()
        .setZoneGridSize(
            zone.getId(),
            zone.getGrid().getOffsetX(),
            zone.getGrid().getOffsetY(),
            zone.getGrid().getSize(),
            zone.getGridColor());

    super.detachFrom(renderer);
  }