Changeset 171
- Timestamp:
- 08/30/11 12:06:07 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 1 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/domain/interface/com/ether/AxeTypeForFixedPlateform.java
r133 r171 3 3 public enum AxeTypeForFixedPlateform 4 4 { 5 TIME, 5 TIME_LINE, 6 TIME_POINTS, 6 7 } -
ether_megapoli/trunk/domain/interface/com/ether/AxeTypeForMobilePlateform.java
r133 r171 3 3 public enum AxeTypeForMobilePlateform 4 4 { 5 LATITUDE, 5 D2_POINTS, 6 D2_CONTOUR, 6 7 } -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/ValueDAOImpl.java
r134 r171 1 1 package com.ether.dao; 2 2 3 import com.ether. Pair;3 import com.ether.Data; 4 4 import com.ether.PersistenceException; 5 5 import com.medias.database.objects.Valeur; … … 11 11 import org.jetbrains.annotations.Nullable; 12 12 13 import java.util.ArrayList;14 13 import java.util.Date; 15 14 import java.util.List; … … 29 28 30 29 @NotNull 31 public List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )30 public <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodForTimeSerie( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 32 31 throws PersistenceException 33 {34 final DetachedCriteria criteria = createCriteriaForValuesByPlateformByParameterByPeriod( plateformId, parameterId, dateBegin, dateEnd );35 final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria );36 37 final List<Pair<Double, Date>> result = new ArrayList<Pair<Double, Date>>();38 for( final Object[] value : objects )39 {40 final Pair<Double, Date> item = new Pair<Double, Date>();41 item.setFirstValue( (Double) value[0] );42 item.setSecondValue( (Date) value[1] );43 result.add( item );44 }45 46 return result;47 }48 49 @NotNull50 public <T1, T2> Pair<T1[], T2[]> getValuesListsByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )51 throws PersistenceException52 {53 final DetachedCriteria criteria = createCriteriaForValuesByPlateformByParameterByPeriod( plateformId, parameterId, dateBegin, dateEnd );54 // final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria );55 // TODO : remove maxResults to 1056 final List<Object[]> objects = selectPage( null, 10, criteria );57 58 final Object[] object1 = objects.get( 0 );59 60 if( object1[0] instanceof Double && object1[1] instanceof Date )61 {62 final double[] firstValues = new double[objects.size()];63 final Date[] secondValues = new Date[objects.size()];64 65 int i = 0;66 for( final Object[] value : objects )67 {68 firstValues[i] = (Double) value[0];69 secondValues[i] = ( (Date) value[1] );70 i++;71 }72 73 return new Pair( firstValues, secondValues );74 }75 else76 return new Pair();77 }78 79 @NotNull80 private DetachedCriteria createCriteriaForValuesByPlateformByParameterByPeriod( final Integer plateformId, final Integer parameterId, final Date dateBegin, final Date dateEnd )81 32 { 82 33 final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) … … 93 44 .add( Projections.property( "value.valeurVal" ) ) 94 45 .add( Projections.property( "measure.mesureDate" ) ) ) ); 46 criteria.addOrder( Order.asc( "measure.mesureDate" ) ); 95 47 96 criteria.addOrder( Order.asc( "measure.mesureDate" ) ); 97 return criteria; 48 // final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria ); 49 // TODO : remove maxResults to 10 50 final List<Object[]> objects = selectPage( null, 10, criteria ); 51 52 final double[] values = new double[objects.size()]; 53 final Date[] dates = new Date[objects.size()]; 54 55 int i = 0; 56 for( final Object[] value : objects ) 57 { 58 values[i] = (Double) value[0]; 59 dates[i] = (Date) value[1]; 60 i++; 61 } 62 63 return new Data( values, dates ); 64 } 65 66 @NotNull 67 public <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 68 throws PersistenceException 69 { 70 final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) 71 .add( Restrictions.eq( "value.parametre.id", parameterId ) ) 72 .createCriteria( "mesure", "measure" ) 73 .add( Restrictions.eq( "measure.plateforme.id", plateformId ) ); 74 75 if( null != dateBegin ) 76 criteria.add( Restrictions.ge( "measure.mesureDate", dateBegin ) ); 77 if( null != dateEnd ) 78 criteria.add( Restrictions.le( "measure.mesureDate", dateEnd ) ); 79 80 criteria.createCriteria( "localisation", "localisation" ); 81 82 criteria.setProjection( Projections.distinct( Projections.projectionList() 83 .add( Projections.property( "value.valeurVal" ) ) 84 .add( Projections.property( "localisation.localisationLat" ) ) 85 .add( Projections.property( "localisation.localisationLon" ) ) ) ); 86 87 criteria.addOrder( Order.asc( "localisation.localisationLon" ) ); 88 89 // final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria ); 90 // TODO : remove maxResults to 10 91 final List<Object[]> objects = selectPage( null, 10, criteria ); 92 93 final double[] latitudeValues = new double[objects.size()]; 94 final double[] longitudeValues = new double[objects.size()]; 95 final double[] parameterValues = new double[objects.size()]; 96 97 int i = 0; 98 for( final Object[] value : objects ) 99 { 100 parameterValues[i] = (Double) value[0]; 101 latitudeValues[i] = Double.valueOf( (Integer) value[1] ); 102 longitudeValues[i] = Double.valueOf( (Integer) value[2] ); 103 i++; 104 } 105 106 return new Data( parameterValues, latitudeValues, longitudeValues ); 98 107 } 99 108 } -
ether_megapoli/trunk/persistence/implementation/hibernate.properties
r170 r171 1 #hibernate.connection.driver_class = org.postgresql.Driver2 #hibernate.connection.url=jdbc:postgresql://darkstar.ipslnet:5432/MEGAPOLI_VM33 #hibernate.connection.username=postgres1 hibernate.connection.driver_class = org.postgresql.Driver 2 hibernate.connection.url=jdbc:postgresql://darkstar.ipslnet:5432/MEGAPOLI_VM3 3 hibernate.connection.username=postgres 4 4 #hibernate.c3p0.min_size=5 5 5 #hibernate.c3p0.max_size=10 -
ether_megapoli/trunk/persistence/interface/com/ether/dao/ValueDAO.java
r133 r171 1 1 package com.ether.dao; 2 2 3 import com.ether.Data; 3 4 import com.ether.Pair; 4 5 import com.ether.PersistenceException; … … 8 9 9 10 import java.util.Date; 10 import java.util.List;11 11 12 12 /** … … 18 18 { 19 19 @NotNull 20 List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )20 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodForTimeSerie( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 21 21 throws PersistenceException; 22 22 23 23 @NotNull 24 <T1, T2 > Pair<T1[], T2[]> getValuesListsByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )24 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 25 25 throws PersistenceException; 26 26 } -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java
r154 r171 1 1 package com.ether; 2 2 3 import com.medias.megapoli.utils.MegapoliInitialisation; 4 import gov.noaa.pmel.sgt.ColorMap; 5 import gov.noaa.pmel.sgt.ContourLevels; 6 import gov.noaa.pmel.sgt.GridAttribute; 7 import gov.noaa.pmel.sgt.IndexedColorMap; 3 8 import gov.noaa.pmel.sgt.JPane; 4 import gov.noaa.pmel.util.Dimension2D; 5 import gov.noaa.pmel.util.Point2D; 9 import gov.noaa.pmel.sgt.LinearTransform; 10 import gov.noaa.pmel.sgt.demo.TestData; 11 import gov.noaa.pmel.sgt.dm.SGTData; 12 import gov.noaa.pmel.sgt.dm.SGTMetaData; 13 import gov.noaa.pmel.sgt.dm.SimpleGrid; 14 import gov.noaa.pmel.sgt.dm.SimpleLine; 15 import gov.noaa.pmel.sgt.swing.JPlotLayout; 16 import gov.noaa.pmel.util.GeoDateArray; 17 import gov.noaa.pmel.util.Range2D; 6 18 import org.apache.commons.logging.Log; 7 19 import org.apache.commons.logging.LogFactory; 8 20 import org.jetbrains.annotations.NotNull; 9 21 import org.jetbrains.annotations.Nullable; 10 import com.medias.megapoli.utils.MegapoliInitialisation;11 22 12 23 import javax.swing.*; … … 14 25 import java.awt.image.BufferedImage; 15 26 import java.util.Calendar; 27 import java.util.Date; 16 28 import java.util.Locale; 17 29 import java.util.ResourceBundle; … … 58 70 jPane.add( jPaneTop, BorderLayout.NORTH ); 59 71 60 final Integer valuesNumber = megapoliPlot.get Data().getYArray().length;72 final Integer valuesNumber = megapoliPlot.getValuesNumber(); 61 73 62 74 // Bottom Pane … … 68 80 final JPane jPaneCenter; 69 81 if( valuesNumber > 0 ) 70 jPaneCenter = createCenterPane( megapoliPlot, maxWidth, centerHeight );82 jPaneCenter = createCenterPane( megapoliPlot, maxWidth, centerHeight, locale ); 71 83 else 72 84 jPaneCenter = createEmptyCenterPane( locale ); … … 124 136 */ 125 137 @NotNull 126 public JPane createCenterPane( @NotNull final MegapoliPlot megapoliPlot, @NotNull final Integer maxWidth, @NotNull final Integer maxHeight )138 public JPane createCenterPane( @NotNull final MegapoliPlot megapoliPlot, @NotNull final Integer maxWidth, @NotNull final Integer maxHeight, @Nullable final Locale locale ) 127 139 { 128 140 final Integer plotWidth = Math.min( maxWidth - MARGIN_LEFT_RIGHT, maxWidth ); 129 141 final Integer plotHeight = Math.min( maxHeight - MARGIN_LEFT_RIGHT, maxHeight ); 130 142 131 // Graph 132 final JPlotLayoutEther jPlotLayout = new JPlotLayoutEther( false, megapoliPlot.isXTime(), false, "Trajectory data", null, megapoliPlot.isLegendToHide() ); 133 jPlotLayout.setTitles( "", "", "" ); 134 135 // Replace legend 136 final String legend = megapoliPlot.getData().getTitle(); 137 final Dimension2D layerSizeP = jPlotLayout.getLayerSizeP(); 138 final double factorForPlotWidthInPhysicalUnits = layerSizeP.getWidth() / Double.valueOf( plotWidth ); 139 final double legendSizeInPhysicalUnits = legend.length() * factorForPlotWidthInPhysicalUnits * 7; 140 jPlotLayout.setKeyLocationP( new Point2D.Double( layerSizeP.getWidth() - legendSizeInPhysicalUnits, layerSizeP.getHeight() - 0.1 ) ); 141 142 // Add data and legend 143 jPlotLayout.addData( megapoliPlot.getData(), legend ); 144 jPlotLayout.setSize( plotWidth, plotHeight ); 145 jPlotLayout.setVisible( true ); 146 147 jPlotLayout.addNotify(); 148 jPlotLayout.validate(); 149 jPlotLayout.setOpaque( true ); 150 151 // TODO : remove this change to bufferedImage to insert directly the jPlotLayout !!!! 152 final BufferedImage bufferedImage = new BufferedImage( jPlotLayout.getWidth(), jPlotLayout.getHeight(), BufferedImage.TYPE_INT_RGB ); 153 final Graphics2D graphics2D = bufferedImage.createGraphics(); 154 jPlotLayout.draw( graphics2D ); 143 final JPlotLayout jPlotLayout; 144 final BufferedImage bufferedImage; 145 if( megapoliPlot.isTimeSerie() ) 146 { 147 jPlotLayout = createJPlotLayoutForTimeSerie( megapoliPlot, plotWidth, plotHeight ); 148 149 // TODO : remove this change to bufferedImage to insert directly the jPlotLayout !!!! 150 bufferedImage = new BufferedImage( jPlotLayout.getWidth(), jPlotLayout.getHeight(), BufferedImage.TYPE_INT_RGB ); 151 final Graphics2D graphics2D = bufferedImage.createGraphics(); 152 jPlotLayout.draw( graphics2D ); 153 } 154 else 155 { 156 jPlotLayout = createJPlotLayoutFor2D( megapoliPlot, plotWidth, plotHeight, locale ); 157 158 final JPanelToImageManager jPanelToImageManager = new JPanelToImageManager( jPlotLayout ); 159 bufferedImage = jPanelToImageManager.saveAsImage(); 160 } 155 161 156 162 final ImageIcon imageIcon = new ImageIcon( bufferedImage ); … … 170 176 171 177 /** 172 * Create the center JPane with no graph (if no value)173 *174 * @param locale175 * @return176 */177 public JPane createEmptyCenterPane( @Nullable final Locale locale )178 {179 final ResourceBundle bundle = WebHelper.getBundle( locale );180 final String messageData = bundle.getString( "plot.noData" );181 182 final JPane jPaneCenter = new JPane();183 jPaneCenter.setLayout( new BorderLayout() );184 185 final JLabel jLabelData = new JLabel( messageData, JLabel.CENTER );186 final Font police = new Font( "Arial", Font.BOLD, FONT_SIZE );187 jLabelData.setFont( police );188 189 jPaneCenter.add( jLabelData, BorderLayout.CENTER );190 return jPaneCenter;191 }192 193 /**194 178 * Create the bottom JPane with the text "published .. (date)" 195 179 * … … 265 249 } 266 250 251 /** 252 * Create the center JPane with no graph (if no value) 253 * 254 * @param locale 255 * @return 256 */ 257 public JPane createEmptyCenterPane( @Nullable final Locale locale ) 258 { 259 final ResourceBundle bundle = WebHelper.getBundle( locale ); 260 final String messageData = bundle.getString( "plot.noData" ); 261 262 final JPane jPaneCenter = new JPane(); 263 jPaneCenter.setLayout( new BorderLayout() ); 264 265 final JLabel jLabelData = new JLabel( messageData, JLabel.CENTER ); 266 final Font police = new Font( "Arial", Font.BOLD, FONT_SIZE ); 267 jLabelData.setFont( police ); 268 269 jPaneCenter.add( jLabelData, BorderLayout.CENTER ); 270 return jPaneCenter; 271 } 272 273 @NotNull 274 private JPlotLayout createJPlotLayoutForTimeSerie( final MegapoliPlot megapoliPlot, final Integer plotWidth, final Integer plotHeight ) 275 { 276 final double[] dataArray = (double[]) megapoliPlot.getData().getFirstArray(); 277 final Date[] dateValues = (Date[]) megapoliPlot.getData().getSecondArray(); 278 279 final SimpleLine data = new SimpleLine( new GeoDateArray( dateValues ), dataArray, "legend" ); 280 SGTMetaData meta = new SGTMetaData( null, null, false, false ); 281 data.setXMetaData( meta ); 282 283 meta = new SGTMetaData( megapoliPlot.getParameterName(), megapoliPlot.getParameterUnitCode(), false, false ); 284 data.setYMetaData( meta ); 285 286 // Graph 287 // final JPlotLayoutEther jPlotLayout = new JPlotLayoutEther( false, true, false, "Trajectory data", null, megapoliPlot.isLegendToHide() ); 288 final JPlotLayout jPlotLayout = new JPlotLayout( data, "Profile Demo", null, false ); 289 jPlotLayout.setTitles( "", "", "" ); 290 291 // Replace legend 292 // final String legend = megapoliPlot.getData().getTitle(); 293 // final Dimension2D layerSizeP = jPlotLayout.getLayerSizeP(); 294 // final double factorForPlotWidthInPhysicalUnits = layerSizeP.getWidth() / Double.valueOf( plotWidth ); 295 // final double legendSizeInPhysicalUnits = legend.length() * factorForPlotWidthInPhysicalUnits * 7; 296 // jPlotLayout.setKeyLocationP( new Point2D.Double( layerSizeP.getWidth() - legendSizeInPhysicalUnits, layerSizeP.getHeight() - 0.1 ) ); 297 298 // Add data and legend 299 jPlotLayout.addData( data, "" ); 300 jPlotLayout.setSize( plotWidth, plotHeight ); 301 jPlotLayout.setVisible( true ); 302 303 jPlotLayout.addNotify(); 304 jPlotLayout.validate(); 305 jPlotLayout.setOpaque( true ); 306 return jPlotLayout; 307 } 308 309 @NotNull 310 private JPlotLayout createJPlotLayoutFor2D( final MegapoliPlot megapoliPlot, final Integer plotWidth, final Integer plotHeight, @Nullable final Locale locale ) 311 { 312 SGTData newData; 313 TestData td; 314 JPlotLayout rpl; 315 ContourLevels clevels; 316 /* 317 * Create a test grid with sinasoidal-ramp data. 318 */ 319 Range2D xr = new Range2D( 190.0f, 250.0f, 1.0f ); 320 Range2D yr = new Range2D( 0.0f, 45.0f, 1.0f ); 321 td = new TestData( TestData.XY_GRID, xr, yr, 322 TestData.SINE_RAMP, 12.0f, 30.f, 5.0f ); 323 newData = td.getSGTData(); 324 /* 325 * Create the layout without a Logo image and with the 326 * ColorKey on a separate Pane object. 327 */ 328 rpl = new JPlotLayout( true, false, false, "JGridDemo Pane", null, true ); 329 rpl.setEditClasses( false ); 330 /* 331 * Create a GridAttribute for CONTOUR style. 332 */ 333 Range2D datar = new Range2D( -20.0f, 45.0f, 5.0f ); 334 clevels = ContourLevels.getDefault( datar ); 335 final GridAttribute gridAttr_ = new GridAttribute( clevels ); 336 /* 337 * Create a ColorMap and change the style to RASTER_CONTOUR. 338 */ 339 ColorMap cmap = createColorMap( datar ); 340 gridAttr_.setColorMap( cmap ); 341 gridAttr_.setStyle( GridAttribute.RASTER_CONTOUR ); 342 /* 343 * Add the grid to the layout and give a label for 344 * the ColorKey. 345 */ 346 rpl.addData( newData, gridAttr_, "First Data" ); 347 /* 348 * Change the layout's three title lines. 349 */ 350 rpl.setTitles( "Raster Plot Demo", "using a JPlotLayout", "" ); 351 /* 352 * Resize the graph and place in the "Center" of the frame. 353 */ 354 rpl.setSize( new Dimension( 600, 400 ) ); 355 /* 356 * Resize the key Pane, both the device size and the physical 357 * size. Set the size of the key in physical units and place 358 * the key pane at the "South" of the frame. 359 */ 360 // rpl.setKeyLayerSizeP(new Dimension2D(6.0, 1.02)); 361 // rpl.setKeyBoundsP(new Rectangle2D.Double(0.01, 1.01, 5.98, 1.0)); 362 363 return rpl; 364 } 365 366 367 @NotNull 368 private JPlotLayout createJPlotLayoutFor2DOrig( final MegapoliPlot megapoliPlot, final Integer plotWidth, final Integer plotHeight, @Nullable final Locale locale ) 369 { 370 final ResourceBundle bundle = WebHelper.getBundle( locale ); 371 372 final double[] parameterArray = (double[]) megapoliPlot.getData().getFirstArray(); 373 final double[] latitudeArray = (double[]) megapoliPlot.getData().getSecondArray(); 374 final double[] longitudeValues = (double[]) megapoliPlot.getData().getThirdArray(); 375 376 // final SimpleLine data = new SimpleLine( longitudeValues, latitudeArray, "legend" ); 377 final SimpleGrid data = new SimpleGrid( parameterArray, longitudeValues, latitudeArray, "Test Series" ); 378 SGTMetaData meta = new SGTMetaData( bundle.getString( "plot.longitude" ), bundle.getString( "plot.degres" ), false, true ); 379 // TODO : vérifier modulo = 360 380 // meta.setModuloValue( 360 ); 381 data.setXMetaData( meta ); 382 383 meta = new SGTMetaData( bundle.getString( "plot.latitude" ), bundle.getString( "plot.degres" ), false, true ); 384 // TODO : vérifier modulo = 360 385 // meta.setModuloValue( 360 ); 386 data.setYMetaData( meta ); 387 388 // Graph 389 final JPlotLayout jPlotLayout = new JPlotLayout( true, false, false, "JGridDemo Pane", null, true ); 390 jPlotLayout.setEditClasses( false ); 391 /* 392 * Create a GridAttribute for CONTOUR style. 393 */ 394 final Range2D datar = new Range2D( -20.0f, 45.0f, 5.0f ); 395 final ContourLevels clevels = ContourLevels.getDefault( datar ); 396 final GridAttribute gridAttr = new GridAttribute( clevels ); 397 /* 398 * Create a ColorMap and change the style to RASTER_CONTOUR. 399 */ 400 final ColorMap cmap = createColorMap( datar ); 401 gridAttr.setColorMap( cmap ); 402 gridAttr.setStyle( GridAttribute.RASTER_CONTOUR ); 403 /* 404 * Add the grid to the layout and give a label for 405 * the ColorKey. 406 */ 407 jPlotLayout.addData( data, gridAttr, "First Data" ); 408 409 // final JPlotLayoutEther jPlotLayout = new JPlotLayoutEther( false, megapoliPlot.isXTime(), false, "Trajectory data", null, megapoliPlot.isLegendToHide() ); 410 // jPlotLayout.setTitles( "", "", "" ); 411 412 // Replace legend 413 // final String legend = megapoliPlot.getData().getTitle(); 414 // final Dimension2D layerSizeP = jPlotLayout.getLayerSizeP(); 415 // final double factorForPlotWidthInPhysicalUnits = layerSizeP.getWidth() / Double.valueOf( plotWidth ); 416 // final double legendSizeInPhysicalUnits = legend.length() * factorForPlotWidthInPhysicalUnits * 7; 417 // jPlotLayout.setKeyLocationP( new Point2D.Double( layerSizeP.getWidth() - legendSizeInPhysicalUnits, layerSizeP.getHeight() - 0.1 ) ); 418 419 // Add data and legend 420 // jPlotLayout.addData( megapoliPlot.getData(), legend ); 421 jPlotLayout.setSize( plotWidth, plotHeight ); 422 jPlotLayout.setVisible( true ); 423 424 jPlotLayout.addNotify(); 425 jPlotLayout.validate(); 426 jPlotLayout.setOpaque( true ); 427 return jPlotLayout; 428 } 429 267 430 @NotNull 268 431 private String formatTitle( @Nullable final String title ) … … 277 440 } 278 441 442 @NotNull 443 private ColorMap createColorMap( final Range2D datar ) 444 { 445 final int[] red = 446 {0, 0, 0, 0, 0, 0, 0, 0, 447 0, 0, 0, 0, 0, 0, 0, 0, 448 0, 0, 0, 0, 0, 0, 0, 0, 449 0, 7, 23, 39, 55, 71, 87, 103, 450 119, 135, 151, 167, 183, 199, 215, 231, 451 247, 255, 255, 255, 255, 255, 255, 255, 452 255, 255, 255, 255, 255, 255, 255, 255, 453 255, 246, 228, 211, 193, 175, 158, 140}; 454 final int[] green = 455 {0, 0, 0, 0, 0, 0, 0, 0, 456 0, 11, 27, 43, 59, 75, 91, 107, 457 123, 139, 155, 171, 187, 203, 219, 235, 458 251, 255, 255, 255, 255, 255, 255, 255, 459 255, 255, 255, 255, 255, 255, 255, 255, 460 255, 247, 231, 215, 199, 183, 167, 151, 461 135, 119, 103, 87, 71, 55, 39, 23, 462 7, 0, 0, 0, 0, 0, 0, 0}; 463 final int[] blue = 464 {0, 143, 159, 175, 191, 207, 223, 239, 465 255, 255, 255, 255, 255, 255, 255, 255, 466 255, 255, 255, 255, 255, 255, 255, 255, 467 255, 247, 231, 215, 199, 183, 167, 151, 468 135, 119, 103, 87, 71, 55, 39, 23, 469 7, 0, 0, 0, 0, 0, 0, 0, 470 0, 0, 0, 0, 0, 0, 0, 0, 471 0, 0, 0, 0, 0, 0, 0, 0}; 472 473 final IndexedColorMap cmap = new IndexedColorMap( red, green, blue ); 474 cmap.setTransform( new LinearTransform( 0.0, (double) red.length, datar.start, datar.end ) ); 475 return cmap; 476 } 477 279 478 private static final Log LOGGER = LogFactory.getLog( EtherPlotServiceImpl.class ); 280 479 -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r133 r171 25 25 @Nullable 26 26 @Transactional(readOnly = true) 27 public List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId )28 throws ServiceException29 {30 try31 {32 return _parameterDAO.getParametersByPlateformId( plateformId );33 }34 catch( PersistenceException e )35 {36 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e );37 }38 }39 40 @Nullable41 @Transactional(readOnly = true)42 27 public List<Plateforme> getAllPlateforms() 43 28 throws ServiceException … … 50 35 { 51 36 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e ); 52 }53 }54 55 @NotNull56 @Transactional(readOnly = true)57 public List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )58 throws ServiceException59 {60 try61 {62 return _valueDAO.getValuesByPlateformByParameterByPeriod( plateformId, parameterId, dateBegin, dateEnd );63 }64 catch( PersistenceException e )65 {66 throw new ServiceException( ServiceException.ServiceCode.VALUE_NOT_FOUND, e );67 }68 }69 70 @NotNull71 @Transactional(readOnly = true)72 public <T1, T2> Pair<T1[], T2[]> getValuesListsByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd )73 throws ServiceException74 {75 try76 {77 return _valueDAO.getValuesListsByPlateformByParameterByPeriod( plateformId, parameterId, dateBegin, dateEnd );78 }79 catch( PersistenceException e )80 {81 throw new ServiceException( ServiceException.ServiceCode.VALUE_NOT_FOUND, e );82 37 } 83 38 } … … 117 72 } 118 73 74 @Nullable 75 @Transactional(readOnly = true) 76 public List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId ) 77 throws ServiceException 78 { 79 try 80 { 81 return _parameterDAO.getParametersByPlateformId( plateformId ); 82 } 83 catch( PersistenceException e ) 84 { 85 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e ); 86 } 87 } 88 89 @NotNull 90 @Transactional(readOnly = true) 91 public <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodForTimeSerie( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 92 throws ServiceException 93 { 94 try 95 { 96 return _valueDAO.getListsByPlateformByParameterByPeriodForTimeSerie( plateformId, parameterId, dateBegin, dateEnd ); 97 } 98 catch( PersistenceException e ) 99 { 100 throw new ServiceException( ServiceException.ServiceCode.VALUE_NOT_FOUND, e ); 101 } 102 } 103 104 @NotNull 105 @Transactional(readOnly = true) 106 public <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 107 throws ServiceException 108 { 109 try 110 { 111 return _valueDAO.getListsByPlateformByParameterByPeriodFor2D( plateformId, parameterId, dateBegin, dateEnd ); 112 } 113 catch( PersistenceException e ) 114 { 115 throw new ServiceException( ServiceException.ServiceCode.VALUE_NOT_FOUND, e ); 116 } 117 } 118 119 119 @Required 120 120 public void setPlateformDAO( final PlateformDAO plateformDAO ) -
ether_megapoli/trunk/service/implementation/com/ether/JPanelToImageManager.java
r130 r171 2 2 3 3 import gov.noaa.pmel.sgt.JPane; 4 import gov.noaa.pmel.sgt.swing.JPlotLayout;5 4 import org.jetbrains.annotations.NotNull; 6 5 … … 43 42 final BufferedImage bufferedImage = new BufferedImage( component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_RGB ); 44 43 45 if( component instanceof JPlotLayout )46 {47 final Graphics2D graphics2D = bufferedImage.createGraphics();48 graphics2D.setBackground( Color.red );49 ( (JPlotLayout) component ).draw( graphics2D );50 }51 else52 {53 54 55 56 }44 // if( component instanceof JPlotLayout ) 45 // { 46 // final Graphics2D graphics2D = bufferedImage.createGraphics(); 47 // graphics2D.setBackground( Color.red ); 48 // ( (JPlotLayout) component ).draw( graphics2D ); 49 // } 50 // else 51 // { 52 final CellRendererPane crp = new CellRendererPane(); 53 crp.add( component ); 54 crp.paintComponent( bufferedImage.createGraphics(), component, crp, component.getBounds() ); 55 // } 57 56 return bufferedImage; 58 57 } -
ether_megapoli/trunk/service/implementation/com/ether/MegapoliPlot.java
r155 r171 1 1 package com.ether; 2 2 3 import gov.noaa.pmel.sgt.dm.SimpleLine;3 import com.medias.megapoli.utils.MegapoliInitialisation; 4 4 import org.jetbrains.annotations.NotNull; 5 5 import org.jetbrains.annotations.Nullable; 6 import com.medias.megapoli.utils.MegapoliInitialisation;7 6 8 7 /** … … 46 45 47 46 @NotNull 48 public SimpleLinegetData()47 public Data getData() 49 48 { 50 49 return _data; 51 50 } 52 51 53 public void setData( @NotNull final SimpleLinedata )52 public void setData( @NotNull final Data data ) 54 53 { 55 54 _data = data; … … 66 65 } 67 66 68 public boolean is XTime()67 public boolean isTimeSerie() 69 68 { 70 return _is XTime;69 return _isTimeSerie; 71 70 } 72 71 73 public void set XTime( final boolean xTime )72 public void setTimeSerie( final boolean timeSerie ) 74 73 { 75 _isXTime = xTime; 74 _isTimeSerie = timeSerie; 75 } 76 77 @Nullable 78 public String getParameterName() 79 { 80 return _parameterName; 81 } 82 83 public void setParameterName( @Nullable final String parameterName ) 84 { 85 _parameterName = parameterName; 86 } 87 88 @Nullable 89 public String getParameterUnitCode() 90 { 91 return _parameterUnitCode; 92 } 93 94 public void setParameterUnitCode( @Nullable final String parameterUnitCode ) 95 { 96 _parameterUnitCode = parameterUnitCode; 97 } 98 99 @NotNull 100 public Integer getValuesNumber() 101 { 102 return _valuesNumber; 103 } 104 105 public void setValuesNumber( @NotNull final Integer valuesNumber ) 106 { 107 _valuesNumber = valuesNumber; 108 } 109 110 @NotNull 111 public String getAxeType() 112 { 113 return _axeType; 114 } 115 116 public void setAxeType( @NotNull final String axeType ) 117 { 118 _axeType = axeType; 76 119 } 77 120 … … 79 122 private String _title; 80 123 @NotNull 81 private SimpleLine_data;124 private Data _data; 82 125 @NotNull 83 126 private String _logoMegapoli = MegapoliInitialisation.pathImages + "/logo_Megapoli.png"; … … 85 128 private String _logoEther = MegapoliInitialisation.pathImages + "/logo_Ether.jpg"; 86 129 private boolean _legendToHide = true; 87 private boolean _isXTime = true; 130 private boolean _isTimeSerie = true; 131 @Nullable 132 private String _parameterName; 133 @Nullable 134 private String _parameterUnitCode; 135 @NotNull 136 private Integer _valuesNumber; 137 @NotNull 138 private String _axeType; 88 139 } -
ether_megapoli/trunk/service/interface/com/ether/EtherPlotService.java
r132 r171 23 23 24 24 @NotNull 25 public JPane createCenterPane( @NotNull final MegapoliPlot megapoliPlot, @NotNull final Integer maxWidth, @NotNull final Integer maxHeight );25 public JPane createCenterPane( @NotNull final MegapoliPlot megapoliPlot, @NotNull final Integer maxWidth, @NotNull final Integer maxHeight, @Nullable final Locale locale ); 26 26 27 27 @NotNull -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r133 r171 1 1 package com.ether; 2 3 import java.util.Date;4 import java.util.List;5 2 6 3 import com.medias.database.objects.Parametre; … … 9 6 import org.jetbrains.annotations.Nullable; 10 7 8 import java.util.Date; 9 import java.util.List; 10 11 11 /** 12 12 * @author vmipsl 13 * @date 07 mar 2011 13 * @date 07 mar 2011 14 14 */ 15 public interface EtherService extends Service 15 public interface EtherService 16 extends Service 16 17 { 17 @Nullable 18 List<Parametre> getParametersByPlateformId(@NotNull final Integer plateformId) throws ServiceException; 19 20 @Nullable 21 List<Plateforme> getAllPlateforms() throws ServiceException; 18 @Nullable 19 List<Plateforme> getAllPlateforms() 20 throws ServiceException; 22 21 23 @NotNull 24 List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod(@NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd) throws ServiceException; 22 @Nullable 23 Plateforme getPlateformById( @Nullable final Integer plateformId ) 24 throws ServiceException; 25 26 @Nullable 27 Parametre getParameterById( @Nullable final Integer parameterId ) 28 throws ServiceException; 29 30 @Nullable 31 List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId ) 32 throws ServiceException; 25 33 26 34 @NotNull 27 <T1, T2> Pair<T1[], T2[]> getValuesListsByPlateformByParameterByPeriod(@NotNull final Integer plateformId, @NotNull final Integer parameterId,@Nullable final Date dateBegin, @Nullable final Date dateEnd ) throws ServiceException; 35 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodForTimeSerie( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 36 throws ServiceException; 28 37 29 @Nullable 30 Plateforme getPlateformById( @Nullable final Integer plateformId ) throws ServiceException; 31 32 @Nullable 33 Parametre getParameterById( @Nullable final Integer parameterId ) throws ServiceException; 38 @NotNull 39 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 40 throws ServiceException; 34 41 } -
ether_megapoli/trunk/service/test/com/ether/OtherTest.java
r134 r171 57 57 /** 58 58 * Test transform List<Pair> en Pair<List, List> 59 * Method used in get ValuesListsByPlateformByParameterByPeriod59 * Method used in getListsByPlateformByParameterByPeriodForTimeSerie 60 60 */ 61 61 @Test -
ether_megapoli/trunk/service/test/com/ether/SGTTest.java
r133 r171 195 195 timeSeriesPlot.setTitle( "Keroppi title" ); 196 196 timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 197 timeSeriesPlot.setData( data );197 // timeSeriesPlot.setData( data ); 198 198 // timeSeriesPlot.setLineAttribute( lineAttribute ); 199 199 … … 421 421 timeSeriesPlot.setTitle( "Keroppi title" ); 422 422 timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 423 timeSeriesPlot.setData( data );423 // timeSeriesPlot.setData( data ); 424 424 // timeSeriesPlot.setLineAttribute( lineAttribute ); 425 425 -
ether_megapoli/trunk/web/resources/css/visu_parameter_by_pf.css
r130 r171 53 53 54 54 .errorAndButtons { 55 55 /*margin: 0px 22px;*/ 56 56 margin-left: auto; 57 57 margin-right: auto; -
ether_megapoli/trunk/web/resources/templates/templateEther.jsp
r170 r171 49 49 50 50 <%-- VARIABLES A NE PAS TOUCHER !!! --%> 51 <bean:define type="java.lang.String" id="today" value="<%=Context.getSimpleDate()%>"/>52 51 <bean:define type="java.lang.String" id="lastModified" value="<%=Context.getLastModified(request, application)%>"/> 53 <bean:define type="java.lang.String" id="racine" value="<%=Context.getWebroot(request)%>"/>54 <bean:define type="java.lang.String" id="relativePageUri" value="<%=Context.getRelativePageURI(request)%>"/>55 52 <bean:define type="java.lang.String" id="lang" value="<%=Context.getLangue(request)%>"/> 56 53 <bean:define type="java.lang.String" id="webmaster" value="<%=Context.getWebmaster(request)%>"/> 57 54 <bean:define type="java.lang.String" id="chemin" value="<%=request.getContextPath()%>"/> 55 <bean:define type="java.lang.String" id="relativePageUri"><%=Context.getRelativePath( request )%>?<%=request.getQueryString()%></bean:define> 58 56 59 57 <div id="container"> … … 81 79 </html:link> 82 80 83 <%--html:link page="/sitemap/sitemap.jsp">84 <html:img page="/resources/images/utils/sitemap.png" titleKey="app.sitemap" altKey="app.sitemap"/>85 </html:link--%>86 81 <%-- Internationalisation --%> 87 82 <logic:notEqual name="lang" value="en"> … … 245 240 <table width="100%" style="color:white;font-size: 12px"> 246 241 <tr> 247 <td align="left">© 2010-2011 <html:link href="http://www.sedoo.fr" target="help" titleKey="app.linksedoo">Sedoo</html:link> / CNRS </td> 242 <td align="left">© 2010-2011 <html:link href="http://www.sedoo.fr" target="help" 243 titleKey="app.linksedoo">Sedoo</html:link> / CNRS 244 </td> 248 245 <td align="center"><bean:message key="app.infonavig"/></td> 249 246 <td align="right"><i><bean:message key="app.lastModified"/> : <bean:write name="lastModified"/></i></td> -
ether_megapoli/trunk/web/src/ApplicationResources.properties
r170 r171 431 431 data.visualization=Des donn\u00E9es 432 432 data.visualization.2D=2D 433 data.visualization.title=Visualisation corr\u00E9latives des observations 434 data.visualization.parameter_pf.title=Visualisation corr\u00E9latives des observations d'un type de mesure \u00E0 une plateforme 435 data.visualization.parameter_pfs.title=Visualisation corr\u00E9latives des observations d'un type de mesure \u00E0 plusieurs plateformes 436 data.visualization.parameters_pf.title=Visualisation corr\u00E9latives des observations de diff\u00E9rents types de mesure \u00E0 une plateforme 437 data.visualization.2D.title=Visualisation corr\u00E9latives des observations en 2D des mesures \u00E0 partir des plateformes mobiles 433 data.visualization.title=Visualisation des observations 438 434 data.visualization.noPf=Pas de plateforme 439 435 data.visualization.selectPf=Plateformes … … 460 456 data.visualization.quicklook=Quicklook 461 457 462 data.visualization.axeType.Time=S\u00E9rie temporelle 463 data.visualization.axeType.Latitude=Latitude / Longitude 458 data.visualization.axeType.TimeLine=S\u00E9rie temporelle (ligne) 459 data.visualization.axeType.TimePoints=S\u00E9rie temporelle (points) 460 data.visualization.axeType.2DContour=2D (contour) 461 data.visualization.axeType.2DPoints=2D (points) 464 462 465 463 simulation.visualization=Des simulations -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r170 r171 431 431 data.visualization.2D=2D 432 432 data.visualization.title=Observations visualisation 433 data.visualization.parameter_pf.title=Observations visualisation for a parameter by a plateform434 data.visualization.parameter_pfs.title=Observations visualisation for a parameter by plateforms435 data.visualization.parameters_pf.title=Observations visualisation for parameters by a plateform436 data.visualization.2D.title=2D observations visualisation from mobile plateforms437 433 data.visualization.noPf=No plateform 438 434 data.visualization.selectPf=Plateforms … … 459 455 data.visualization.quicklook=Quicklook 460 456 461 data.visualization.axeType.Time=Time serie 462 data.visualization.axeType.Latitude=Latitude / Longitude 457 data.visualization.axeType.TimeLine=Time serie (ligne) 458 data.visualization.axeType.TimePoints=Time serie (dots) 459 data.visualization.axeType.2DContour=2D (contour) 460 data.visualization.axeType.2DPoints=2D (dots) 463 461 464 462 simulation.visualization=Simulations -
ether_megapoli/trunk/web/src/com/ether/ControllerPlot.java
r134 r171 3 3 import com.medias.Context; 4 4 import com.medias.database.objects.Parametre; 5 import com.medias.database.objects.Unite;6 import gov.noaa.pmel.sgt.dm.SGTMetaData;7 import gov.noaa.pmel.sgt.dm.SimpleLine;8 import gov.noaa.pmel.util.GeoDateArray;9 5 import org.apache.commons.logging.Log; 10 6 import org.apache.commons.logging.LogFactory; … … 24 20 import java.util.Calendar; 25 21 import java.util.Date; 26 import java.util.Locale;27 import java.util.ResourceBundle;28 22 29 23 /** … … 91 85 92 86 // Parameter 93 //final Parametre parametre = _etherService.getParameterById( parameterId );94 final Parametre parametre = new Parametre();95 parametre.setParametreNom( "Ozone" );96 final Unite unit = new Unite();97 unit.setUniteCode( "ppb" );98 parametre.setUnite( unit );87 final Parametre parametre = _etherService.getParameterById( parameterId ); 88 // final Parametre parametre = new Parametre(); 89 // parametre.setParametreNom( "Ozone" ); 90 // final Unite unit = new Unite(); 91 // unit.setUniteCode( "ppb" ); 92 // parametre.setUnite( unit ); 99 93 if( null == parametre ) 100 94 { … … 105 99 106 100 // Create plot 107 final SimpleLine data; 108 if( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) ) 101 final MegapoliPlot megapoliPlot = new MegapoliPlot(); 102 megapoliPlot.setTitle( title ); 103 megapoliPlot.setAxeType( axeType ); 104 megapoliPlot.setParameterName( parametre.getParametreNom() ); 105 if( null != parametre.getUnite() && null != parametre.getUnite().getUniteCode() ) 106 megapoliPlot.setParameterUnitCode( parametre.getUnite().getUniteCode() ); 107 108 109 if( AxeTypeForFixedPlateform.TIME_LINE.name().equals( axeType ) || AxeTypeForFixedPlateform.TIME_POINTS.name().equals( axeType ) ) 109 110 { 110 final Pair valuesLists = _etherService.getValuesListsByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 111 final Data valuesLists = _etherService.getListsByPlateformByParameterByPeriodForTimeSerie( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 112 megapoliPlot.setData( valuesLists ); 111 113 112 final double[] dataArray = (double[]) valuesLists.getFirstValue(); 113 final Date[] dateValues = (Date[]) valuesLists.getSecondValue(); 114 115 data = createTimeSerie( new GeoDateArray( dateValues ), dataArray, parametre.getParametreNom(), parametre.getUnite() ); 114 megapoliPlot.setTimeSerie( true ); 115 megapoliPlot.setLegendToHide( true ); 116 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 116 117 } 117 118 else 118 119 { 119 // final Pair valuesLists = _etherService.getValuesListsByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 120 final double[] latitudeArray = {2.1, 2.2, 2.3}; 121 final double[] longitudeValues = {112.1, 12.2, 22.3}; 122 // final double[] latitudeArray = (double[]) valuesLists.getFirstValue(); 123 // final double[] longitudeValues = (double[]) valuesLists.getFirstValue(); 120 final Data valuesLists = _etherService.getListsByPlateformByParameterByPeriodFor2D( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 121 megapoliPlot.setData( valuesLists ); 122 // final double[] latitudeArray = {2.1, 2.2, 2.3}; 123 // final double[] longitudeValues = {112.1, 12.2, 22.3}; 124 124 125 data = createLatitudeSerie( longitudeValues, latitudeArray, parametre.getParametreNom(), Context.getLocale( request ) ); 125 megapoliPlot.setTimeSerie( false ); 126 megapoliPlot.setLegendToHide( false ); 127 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 126 128 } 127 128 129 // MegapoliPlot130 final MegapoliPlot megapoliPlot = new MegapoliPlot();131 megapoliPlot.setTitle( title );132 megapoliPlot.setData( data );133 megapoliPlot.setLegendToHide( null == data.getTitle() );134 megapoliPlot.setXTime( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) );135 129 136 130 final BufferedImage bufferedImage = _etherPlotService.createMainPane( megapoliPlot, Context.getLocale( request ) ); … … 149 143 } 150 144 } 151 }152 153 @NotNull154 private SimpleLine createTimeSerie( @NotNull final GeoDateArray dateArray, @NotNull final double[] dataArray, @Nullable final String parameterName, @Nullable final Unite unit )155 {156 final SimpleLine data = new SimpleLine( dateArray, dataArray, null );157 SGTMetaData meta = new SGTMetaData( null, null, false, false );158 data.setXMetaData( meta );159 160 meta = new SGTMetaData( parameterName, unit.getUniteCode(), false, false );161 data.setYMetaData( meta );162 return data;163 }164 165 @NotNull166 private SimpleLine createLatitudeSerie( @NotNull final double[] dateArray, @NotNull final double[] dataArray, @Nullable final String legend, @Nullable final Locale locale )167 {168 final ResourceBundle bundle = WebHelper.getBundle( locale );169 170 final SimpleLine data = new SimpleLine( dateArray, dataArray, legend );171 SGTMetaData meta = new SGTMetaData( bundle.getString( "plot.longitude" ), bundle.getString( "plot.degres" ), false, true );172 // TODO : vérifier modulo = 360173 // meta.setModuloValue( 360 );174 data.setXMetaData( meta );175 176 meta = new SGTMetaData( bundle.getString( "plot.latitude" ), bundle.getString( "plot.degres" ), false, true );177 // TODO : vérifier modulo = 360178 // meta.setModuloValue( 360 );179 data.setYMetaData( meta );180 return data;181 145 } 182 146 -
ether_megapoli/trunk/web/src/json/serializers/ParameterJsonSerializer.java
r89 r171 13 13 serialize( result, "id", parameter.getParametreId(), jsonConfig ); 14 14 serialize( result, "name", parameter.getParametreNom(), jsonConfig ); 15 serialize( result, "code", parameter.getParametreCode(), jsonConfig ); 15 16 16 17 return result; -
ether_megapoli/trunk/web/visualization/visu.jsp
r170 r171 22 22 23 23 <tiles:put name="bodytitle" type="string"> 24 <bean:message key=" data.visualization.title"/>24 <bean:message key="all.visualization"/> 25 25 </tiles:put> 26 26 -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-classes.jsp
r89 r171 1 1 <script type="text/javascript"> 2 /* ************************************************** */3 /* ****************** LISTS ************************* */4 /* ************************************************** */2 /* ************************************************** */ 3 /* ****************** LISTS ************************* */ 4 /* ************************************************** */ 5 5 6 var ListPlatforms = Class.create(ListItem, {6 var ListPlatforms = Class.create( ListItem, { 7 7 8 createItemDiv: function( itemHash, objectParameter )9 {10 return new Plateform(itemHash, objectParameter);11 }12 });8 createItemDiv: function( itemHash, objectParameter ) 9 { 10 return new Plateform( itemHash, objectParameter ); 11 } 12 } ); 13 13 14 var ListParameters = Class.create(ListItem, {14 var ListParameters = Class.create( ListItem, { 15 15 16 createItemDiv: function( itemHash, objectParameter )17 {18 return new Parameter(itemHash, objectParameter);19 }20 });16 createItemDiv: function( itemHash, objectParameter ) 17 { 18 return new Parameter( itemHash, objectParameter ); 19 } 20 } ); 21 21 22 22 23 /* ***************************************************** */24 /* ****************** ELEMENTS ************************* */25 /* ***************************************************** */26 var Plateform = Class.create(Item, {23 /* ***************************************************** */ 24 /* ****************** ELEMENTS ************************* */ 25 /* ***************************************************** */ 26 var Plateform = Class.create( Item, { 27 27 28 display : function( parentNode, className )29 {30 this.createContainer("containerPlateform","containerPlateform "+className);31 this.addName("plateform_name");32 this.appendContainer(parentNode);33 this.addObservers();34 },28 display : function( parentNode, className ) 29 { 30 this.createContainer( "containerPlateform", "containerPlateform " + className ); 31 this.addName( "plateform_name" ); 32 this.appendContainer( parentNode ); 33 this.addObservers(); 34 }, 35 35 36 select: function()37 {38 this.selectWithParameter("plateform_selected");39 },36 select: function() 37 { 38 this.selectWithParameter( "plateform_selected" ); 39 }, 40 40 41 unselect: function()42 {43 this.unselectWithParameter("plateform_selected");44 }45 });41 unselect: function() 42 { 43 this.unselectWithParameter( "plateform_selected" ); 44 } 45 } ); 46 46 47 var Parameter = Class.create(Item, {47 var Parameter = Class.create( Item, { 48 48 49 display : function( parentNode, className ) 50 { 51 this.createContainer("containerParameter","containerParameter "+className); 52 this.addName("parameter_name"); 53 this.appendContainer(parentNode); 54 this.addObservers(); 55 }, 49 display : function( parentNode, className ) 50 { 51 this.createContainer( "containerParameter", "containerParameter " + className ); 52 this.addName( "parameter_name" ); 53 // this.addCode( "parameter_code" ); 54 this.appendContainer( parentNode ); 55 this.addObservers(); 56 }, 56 57 57 select: function()58 {59 this.selectWithParameter("parameter_selected");60 },58 select: function() 59 { 60 this.selectWithParameter( "parameter_selected" ); 61 }, 61 62 62 unselect: function() 63 { 64 this.unselectWithParameter("parameter_selected"); 65 } 66 }); 63 unselect: function() 64 { 65 this.unselectWithParameter( "parameter_selected" ); 66 } 67 68 // addCode: function ( classNameValue ) 69 // { 70 // if( !this.divContainer ) 71 // return; 72 // 73 // this.divName = $( document.createElement( "div" ) ); 74 // this.divName.className = classNameValue; 75 // this.divName.innerHTML = " (" + this.jsonElement.code + ")"; 76 // 77 // this.divContainer.appendChild( this.divName ); 78 // } 79 } ); 67 80 </script> -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r134 r171 210 210 // this.plotWindow.getContent().innerHTML = '<div class="loadingPlot"><img src="/Megapoli/resources/icons/loading_datas.gif"/></div>'; 211 211 212 // var url = "visualization/plotEther?plateformId=" + this.selectedPlateform.getId() 213 // + "¶meterId=" + this.selectedParameter.getId() 212 var url = "visualization/plotEther?plateformId=" + this.selectedPlateform.getId() 213 + "¶meterId=" + this.selectedParameter.getId() 214 + "&dateBegin=" + this.beginDate 215 + "&dateEnd=" + this.endDate 216 + "&title=" + encodeURIComponent( $( "textareaTitle" ).value ) 217 + "&axeType=" + this.selectAxes.getValue(); 218 219 // var url = "visualization/plotEther?plateformId=14" 220 // + "¶meterId=90" 214 221 // + "&dateBegin=" + this.beginDate 215 222 // + "&dateEnd=" + this.endDate 216 223 // + "&title=" + encodeURIComponent( $( "textareaTitle" ).value ) 217 224 // + "&axeType=" + this.selectAxes.getValue(); 218 219 var url = "visualization/plotEther?plateformId=14"220 + "¶meterId=125"221 + "&dateBegin=" + this.beginDate222 + "&dateEnd=" + this.endDate223 + "&title=" + encodeURIComponent( $( "textareaTitle" ).value )224 + "&axeType=" + this.selectAxes.getValue();225 225 226 226 this.plotWindow.getContent().innerHTML = '<img src=' + url + ' />'; -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf.jsp
r170 r171 55 55 56 56 <tiles:put name="bodytitle" type="string"> 57 <bean:message key="data.visualization. parameter_pf.title"/>57 <bean:message key="data.visualization.title"/> 58 58 </tiles:put> 59 59 … … 120 120 interfaceTexts["data.visualization.selectMinute"] = "<bean:message key="data.visualization.selectMinute"/>"; 121 121 122 interfaceTexts["<%=AxeTypeForFixedPlateform.TIME%>"] = "<bean:message key="data.visualization.axeType.Time"/>"; 123 interfaceTexts["<%=AxeTypeForMobilePlateform.LATITUDE%>"] = "<bean:message key="data.visualization.axeType.Latitude"/>"; 122 interfaceTexts["<%=AxeTypeForFixedPlateform.TIME_LINE%>"] = "<bean:message key="data.visualization.axeType.TimeLine"/>"; 123 interfaceTexts["<%=AxeTypeForFixedPlateform.TIME_POINTS%>"] = "<bean:message key="data.visualization.axeType.TimePoints"/>"; 124 interfaceTexts["<%=AxeTypeForMobilePlateform.D2_POINTS%>"] = "<bean:message key="data.visualization.axeType.2DPoints"/>"; 125 interfaceTexts["<%=AxeTypeForMobilePlateform.D2_CONTOUR%>"] = "<bean:message key="data.visualization.axeType.2DContour"/>"; 124 126 125 127 var interfaceVisualization = new InterfaceVisualization( ${plateforms}, ${axeTypesForFixedPlateforms}, ${axeTypesForMobilePlateforms} );
Note: See TracChangeset
for help on using the changeset viewer.