Exemple #1
0
  /**
   * Paints the layer.
   *
   * @param g the Graphics context for painting
   */
  public void paint(java.awt.Graphics g) {
    Debug.message("dted", getName() + "|DTEDLayer.paint()");

    super.paint(g);

    if (location != null) location.render(g);
    location = null;
  }
Exemple #2
0
  @Override
  public void setVisible(boolean show) {
    super.setVisible(show);

    notifyVisibilityListeners();

    for (EPDLayerCommon layer : visibilityMangedLayers) {
      layer.setVisible(show);
    }
  }
Exemple #3
0
  /**
   * Called when a bean is removed from the bean context
   *
   * @param obj the bean being removed
   */
  @Override
  public void findAndUndo(Object obj) {
    // Important notice:
    // The mechanism for adding and removing beans has been used in
    // a wrong way in epd-shore, which has multiple ChartPanels.
    // When the "global" beans are added to a new ChartPanel, they
    // will be removed from the other ChartPanels using findAndUndo.
    // Hence, we do not reset the references to mapBean and mainFrame

    super.findAndUndo(obj);
  }
Exemple #4
0
 /** {@inheritDoc} */
 @Override
 public void dispose() {
   synchronized (graphics) {
     graphics.clear();
   }
   synchronized (this) {
     if (timer != null) {
       timer.stop();
     }
   }
   super.dispose();
 }
Exemple #5
0
  /**
   * Called when a bean is added to the bean context
   *
   * @param obj the bean being added
   */
  @Override
  public void findAndInit(Object obj) {
    super.findAndInit(obj);

    if (obj instanceof MapBean) {
      mapBean = (MapBean) obj;
    } else if (obj instanceof MainFrameCommon) {
      mainFrame = (MainFrameCommon) obj;
    } else if (obj instanceof MapMenuCommon) {
      mapMenu = (MapMenuCommon) obj;
    }

    // For EPDShip the IMapFrame is the MainFrame
    // For EPDShore the IMapFrame is the JMapFrame
    if (obj instanceof IMapFrame) {
      mapFrame = (IMapFrame) obj;
      addInfoPanelsToGlassPane();
    }
  }
Exemple #6
0
  /** Set all the DTED properties from a properties object. */
  public void setProperties(String prefix, java.util.Properties properties) {

    super.setProperties(prefix, properties);
    prefix = PropUtils.getScopedPropertyPrefix(this);

    paths = PropUtils.initPathsFromProperties(properties, prefix + DTEDPathsProperty, paths);
    setOpaqueness(
        PropUtils.intFromProperties(properties, prefix + OpaquenessProperty, getOpaqueness()));

    setNumColors(
        PropUtils.intFromProperties(properties, prefix + NumColorsProperty, getNumColors()));

    setDtedLevel(
        PropUtils.intFromProperties(properties, prefix + DTEDLevelProperty, getDtedLevel()));

    setViewType(
        PropUtils.intFromProperties(properties, prefix + DTEDViewTypeProperty, getViewType()));

    setSlopeAdjust(
        PropUtils.intFromProperties(
            properties, prefix + DTEDSlopeAdjustProperty, getSlopeAdjust()));

    setBandHeight(
        PropUtils.intFromProperties(properties, prefix + DTEDBandHeightProperty, getBandHeight()));

    // The Layer maxScale is talking the place of the DTEDLayer minScale
    // property.
    setMaxScale(
        PropUtils.floatFromProperties(properties, prefix + DTEDMinScaleProperty, getMaxScale()));

    setCacheSize(
        (int)
            PropUtils.intFromProperties(
                properties, prefix + DTEDFrameCacheSizeProperty, getCacheSize()));

    setKillCache(
        PropUtils.booleanFromProperties(
            properties, prefix + DTEDKillCacheProperty, getKillCache()));
  }
 public void workerComplete(OMGraphicList aList) {
   if (layer != null) {
     layer.setList(aList);
   }
 }
 public void projectionChanged(ProjectionEvent pe) {
   Projection proj = layer.setProjection(pe);
 }
 /**
  * Add a layer to the Group, at a specific height.
  *
  * @param bg The feature to be added to the Content attribute
  * @param layer The feature to be added to the Content attribute
  * @param baselineHeight The feature to be added to the Content attribute
  */
 protected void addContent(Group bg, OMGraphicHandlerLayer layer, double baselineHeight) {
   Debug.message(
       "3d", "LayerMapContent: putting layer " + layer.getName() + " graphics on the map.");
   addTo(bg, OMGraphicUtil.createShape3D(layer.getList(), baselineHeight));
 }