/** _more_ */ private void setPointSize() { try { stationProbes.setPointSize(DEFAULT_POINT_SIZE); selectedStation.setPointSize(DEFAULT_POINT_SIZE * 2); } catch (Exception exc) { logException("Set point size ", exc); } }
/** * Creates the display and control buttons from a {@link ucar.unidata.data.DataChoice}. * * @param dataChoice The data for this instance. * @return <code>true</code> if and only if this instance was correctly initialized. * @throws VisADException couldn't create a VisAD object needed * @throws RemoteException couldn't create a remote object needed */ public boolean init(DataChoice dataChoice) throws VisADException, RemoteException { /* * Initialize the superclass. */ if (!super.init()) { return false; } setSpatialLoci(track); setSpatialLoci(stationProbes); if (!setData(dataChoice)) { return false; } List<DataSource> dsList = new ArrayList(); dataChoice.getDataSources(dsList); TrackDataSource ds = (TrackDataSource) dsList.get(0); List adapters = ds.getAdapters(); try { initDataChoice(adapters); } catch (Exception e) { } initSounding(dataList.get(0)); stationProbes.setData(Util.indexedField(latLons, false)); stationProbes.addAction( new ActionImpl("Station Probe Action") { private boolean first = true; public void doAction() { if (first) { first = false; } else { Misc.run( new Runnable() { public void run() { try { int i = stationProbes.getCloseIndex(); if ((i >= 0) && (stationMenue != null)) { ignoreStationMenuEvent = true; selectedStation.setPoint((RealTuple) latLons[i]); stationMenue.setSelectedIndex(i); setStation(i); } } catch (Exception ex) { logException(ex); } finally { ignoreStationMenuEvent = false; } } }); } } }); setPointSize(); addDisplayable(stationProbes, FLAG_COLOR); addDisplayable(selectedStation, FLAG_COLOR); if (getSelectedStationIndex() >= 0) { selectedStation.setPoint((RealTuple) latLons[getSelectedStationIndex()]); } updateHeaderLabel(); return true; }