Changeset 133 for ether_megapoli
- Timestamp:
- 08/24/11 14:10:53 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 1 added
- 7 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/domain/interface/com/ether/AxeTypeForFixedPlateform.java
r132 r133 4 4 { 5 5 TIME, 6 FIXE,7 6 } -
ether_megapoli/trunk/domain/interface/com/ether/AxeTypeForMobilePlateform.java
r132 r133 4 4 { 5 5 LATITUDE, 6 MOBILE,7 6 } -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/ValueDAOImpl.java
r129 r133 1 1 package com.ether.dao; 2 2 3 import com.ether.Data;4 3 import com.ether.Pair; 5 4 import com.ether.PersistenceException; … … 29 28 } 30 29 31 @N ullable30 @NotNull 32 31 public List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 33 32 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 @NotNull 50 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 PersistenceException 52 { 53 final DetachedCriteria criteria = createCriteriaForValuesByPlateformByParameterByPeriod( plateformId, parameterId, dateBegin, dateEnd ); 54 final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria ); 55 56 final T1[] firstValues = null; 57 final T2[] secondValues = null; 58 int i = 0; 59 for( final Object[] value : objects ) 60 { 61 firstValues[i] = (T1) value[0]; 62 secondValues[i] = ( (T2) value[1] ); 63 i++; 64 } 65 66 return new Pair( firstValues, secondValues ); 67 } 68 69 @NotNull 70 private DetachedCriteria createCriteriaForValuesByPlateformByParameterByPeriod( final Integer plateformId, final Integer parameterId, final Date dateBegin, final Date dateEnd ) 34 71 { 35 72 final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) … … 48 85 49 86 criteria.addOrder( Order.asc( "measure.mesureDate" ) ); 50 51 final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria ); 52 final List<Pair<Double, Date>> result = new ArrayList<Pair<Double, Date>>(); 53 for( final Object[] value : objects ) 54 { 55 final Pair<Double, Date> item = new Pair<Double, Date>(); 56 item.setFirstValue( (Double) value[0] ); 57 item.setSecondValue( (Date) value[1] ); 58 result.add( item ); 59 } 60 61 return result; 87 return criteria; 62 88 } 63 89 } -
ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml
r130 r133 7 7 <session-factory> 8 8 9 < !--<mapping resource="com/medias/objects/Adresse.hbm.xml"/>-->10 < !--<mapping resource="com/medias/objects/Bilan.hbm.xml"/>-->11 < !--<mapping resource="com/medias/objects/Capteur.hbm.xml"/>-->12 < !--<mapping resource="com/medias/objects/Categorie.hbm.xml"/>-->13 < !--<mapping resource="com/medias/objects/CategorieParam.hbm.xml"/>-->14 < !--<mapping resource="com/medias/objects/Commentaire.hbm.xml"/>-->15 < !--<mapping resource="com/medias/objects/DeltaMesure.hbm.xml"/>-->16 < !--<mapping resource="com/medias/objects/Fabriquant.hbm.xml"/>-->17 < !--<mapping resource="com/medias/objects/Fichier.hbm.xml"/>-->18 < !--<mapping resource="com/medias/objects/Flag.hbm.xml"/>-->19 < !--<mapping resource="com/medias/objects/Jeu.hbm.xml"/>-->20 < !--<mapping resource="com/medias/objects/Langue.hbm.xml"/>-->21 < !--<mapping resource="com/medias/objects/Localisation.hbm.xml"/>-->22 < !--<mapping resource="com/medias/objects/Mesure.hbm.xml"/>-->23 < !--<mapping resource="com/medias/objects/Organisme.hbm.xml"/>-->24 < !--<mapping resource="com/medias/objects/Parametre.hbm.xml"/>-->25 < !--<mapping resource="com/medias/objects/Personne.hbm.xml"/>-->26 < !--<mapping resource="com/medias/objects/Plateforme.hbm.xml"/>-->27 < !--<mapping resource="com/medias/objects/RequeteNbvalsJeu.hbm.xml"/>-->28 < !--<mapping resource="com/medias/objects/RequetePlatLoc.hbm.xml"/>-->29 < !--<mapping resource="com/medias/objects/Sequence.hbm.xml"/>-->30 < !--<mapping resource="com/medias/objects/TypeCapteur.hbm.xml"/>-->31 < !--<mapping resource="com/medias/objects/TypePlateforme.hbm.xml"/>-->32 < !--<mapping resource="com/medias/objects/Unite.hbm.xml"/>-->33 < !--<mapping resource="com/medias/objects/Valeur.hbm.xml"/>-->34 < !--<mapping resource="com/medias/objects/Zone.hbm.xml"/>-->9 <mapping resource="com/medias/objects/Adresse.hbm.xml"/> 10 <mapping resource="com/medias/objects/Bilan.hbm.xml"/> 11 <mapping resource="com/medias/objects/Capteur.hbm.xml"/> 12 <mapping resource="com/medias/objects/Categorie.hbm.xml"/> 13 <mapping resource="com/medias/objects/CategorieParam.hbm.xml"/> 14 <mapping resource="com/medias/objects/Commentaire.hbm.xml"/> 15 <mapping resource="com/medias/objects/DeltaMesure.hbm.xml"/> 16 <mapping resource="com/medias/objects/Fabriquant.hbm.xml"/> 17 <mapping resource="com/medias/objects/Fichier.hbm.xml"/> 18 <mapping resource="com/medias/objects/Flag.hbm.xml"/> 19 <mapping resource="com/medias/objects/Jeu.hbm.xml"/> 20 <mapping resource="com/medias/objects/Langue.hbm.xml"/> 21 <mapping resource="com/medias/objects/Localisation.hbm.xml"/> 22 <mapping resource="com/medias/objects/Mesure.hbm.xml"/> 23 <mapping resource="com/medias/objects/Organisme.hbm.xml"/> 24 <mapping resource="com/medias/objects/Parametre.hbm.xml"/> 25 <mapping resource="com/medias/objects/Personne.hbm.xml"/> 26 <mapping resource="com/medias/objects/Plateforme.hbm.xml"/> 27 <mapping resource="com/medias/objects/RequeteNbvalsJeu.hbm.xml"/> 28 <mapping resource="com/medias/objects/RequetePlatLoc.hbm.xml"/> 29 <mapping resource="com/medias/objects/Sequence.hbm.xml"/> 30 <mapping resource="com/medias/objects/TypeCapteur.hbm.xml"/> 31 <mapping resource="com/medias/objects/TypePlateforme.hbm.xml"/> 32 <mapping resource="com/medias/objects/Unite.hbm.xml"/> 33 <mapping resource="com/medias/objects/Valeur.hbm.xml"/> 34 <mapping resource="com/medias/objects/Zone.hbm.xml"/> 35 35 36 36 </session-factory> -
ether_megapoli/trunk/persistence/interface/com/ether/dao/ValueDAO.java
r129 r133 1 1 package com.ether.dao; 2 2 3 import java.util.Date;4 import java.util.List;5 6 3 import com.ether.Pair; 4 import com.ether.PersistenceException; 7 5 import com.medias.database.objects.Valeur; 8 6 import org.jetbrains.annotations.NotNull; 9 7 import org.jetbrains.annotations.Nullable; 10 8 11 import com.ether.Data;12 import com.ether.PersistenceException;9 import java.util.Date; 10 import java.util.List; 13 11 14 12 /** … … 16 14 * @date 07 apr 2011 17 15 */ 18 public interface ValueDAO 19 16 public interface ValueDAO 17 extends DomainAccessObject<Valeur, Integer> 20 18 { 21 @Nullable 22 List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod(@NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd) throws PersistenceException; 19 @NotNull 20 List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 21 throws PersistenceException; 22 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 ) 25 throws PersistenceException; 23 26 } -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java
r132 r133 129 129 130 130 // Graph 131 final JPlotLayout jPlotLayout = new JPlotLayout( false, true, false, "Trajectory data", null, megapoliPlot.isLegendToHide() );131 final JPlotLayout jPlotLayout = new JPlotLayout( false, megapoliPlot.isXTime(), false, "Trajectory data", null, megapoliPlot.isLegendToHide() ); 132 132 jPlotLayout.setTitles( "", "", "" ); 133 133 // Add data and legend -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r129 r133 1 1 package com.ether; 2 2 3 import java.util.Date;4 import java.util.List;5 3 import com.ether.dao.ParameterDAO; 4 import com.ether.dao.PlateformDAO; 5 import com.ether.dao.ValueDAO; 6 6 import com.medias.database.objects.Parametre; 7 7 import com.medias.database.objects.Plateforme; … … 13 13 import org.springframework.transaction.annotation.Transactional; 14 14 15 import com.ether.dao.ParameterDAO; 16 import com.ether.dao.PlateformDAO; 17 import com.ether.dao.ValueDAO; 15 import java.util.Date; 16 import java.util.List; 18 17 19 18 /** 20 19 * @author vmipsl 21 * @date 07 mar 2011 20 * @date 07 mar 2011 22 21 */ 23 public class EtherServiceImpl implements EtherService 22 public class EtherServiceImpl 23 implements EtherService 24 24 { 25 @Nullable 26 @Transactional(readOnly = true) 27 public List<Parametre> getParametersByPlateformId(@NotNull final Integer plateformId) 28 throws ServiceException 29 { 30 try 31 { 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 @Nullable 41 @Transactional(readOnly = true) 42 public List<Plateforme> getAllPlateforms() 43 throws ServiceException 44 { 45 try 46 { 47 return _plateformDAO.getAllPlateforms(); 48 } 49 catch (PersistenceException e) 50 { 51 throw new ServiceException(ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e); 52 } 53 } 54 55 @Nullable 56 @Transactional(readOnly = true) 57 public List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( 58 @NotNull final Integer plateformId, 59 @NotNull final Integer parameterId, 60 @Nullable final Date dateBegin, 61 @Nullable final Date dateEnd) 62 throws ServiceException 63 { 64 try 65 { 66 return _valueDAO.getValuesByPlateformByParameterByPeriod(plateformId, parameterId, dateBegin, dateEnd); 67 } 68 catch (PersistenceException e) 69 { 70 throw new ServiceException(ServiceException.ServiceCode.VALUE_NOT_FOUND, e); 71 } 72 } 25 @Nullable 26 @Transactional(readOnly = true) 27 public List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId ) 28 throws ServiceException 29 { 30 try 31 { 32 return _parameterDAO.getParametersByPlateformId( plateformId ); 33 } 34 catch( PersistenceException e ) 35 { 36 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e ); 37 } 38 } 73 39 74 40 @Nullable 75 @Transactional(readOnly = true) 41 @Transactional(readOnly = true) 42 public List<Plateforme> getAllPlateforms() 43 throws ServiceException 44 { 45 try 46 { 47 return _plateformDAO.getAllPlateforms(); 48 } 49 catch( PersistenceException e ) 50 { 51 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e ); 52 } 53 } 54 55 @NotNull 56 @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 ServiceException 59 { 60 try 61 { 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 @NotNull 71 @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 ServiceException 74 { 75 try 76 { 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 } 83 } 84 85 @Nullable 86 @Transactional(readOnly = true) 76 87 public Plateforme getPlateformById( @Nullable final Integer plateformId ) 77 88 throws ServiceException 78 89 { 79 if( null == plateformId)90 if( null == plateformId ) 80 91 return null; 81 92 try … … 83 94 return _plateformDAO.getPlateformById( plateformId ); 84 95 } 85 catch (PersistenceException e)96 catch( PersistenceException e ) 86 97 { 87 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e);98 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e ); 88 99 } 89 100 } … … 94 105 throws ServiceException 95 106 { 96 if( null == parameterId)107 if( null == parameterId ) 97 108 return null; 98 109 try … … 100 111 return _parameterDAO.getParameterById( parameterId ); 101 112 } 102 catch (PersistenceException e)113 catch( PersistenceException e ) 103 114 { 104 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e);115 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e ); 105 116 } 106 117 } 107 118 108 119 @Required 109 public void setPlateformDAO( final PlateformDAO plateformDAO)120 public void setPlateformDAO( final PlateformDAO plateformDAO ) 110 121 { 111 122 _plateformDAO = plateformDAO; 112 123 } 113 124 114 125 @Required 115 public void setParameterDAO( final ParameterDAO parameterDAO)126 public void setParameterDAO( final ParameterDAO parameterDAO ) 116 127 { 117 128 _parameterDAO = parameterDAO; 118 129 } 119 130 120 131 @Required 121 public void setValueDAO( final ValueDAO valueDAO)132 public void setValueDAO( final ValueDAO valueDAO ) 122 133 { 123 134 _valueDAO = valueDAO; 124 135 } 125 136 126 137 private static final Log LOGGER = LogFactory.getLog( EtherServiceImpl.class ); 127 128 138 129 139 private PlateformDAO _plateformDAO; 130 140 private ParameterDAO _parameterDAO; 131 private ValueDAO _valueDAO; 141 private ValueDAO _valueDAO; 132 142 } -
ether_megapoli/trunk/service/implementation/com/ether/MegapoliPlot.java
r132 r133 66 66 } 67 67 68 public boolean isXTime() 69 { 70 return _isXTime; 71 } 72 73 public void setXTime( final boolean xTime ) 74 { 75 _isXTime = xTime; 76 } 77 68 78 @Nullable 69 79 private String _title; … … 71 81 private SimpleLine _data; 72 82 @NotNull 73 private String _logoMegapoli 83 private String _logoMegapoli = MegapoliInitialisation.pathImages + "/logo_Megapoli.png"; 74 84 @NotNull 75 85 private String _logoEther = MegapoliInitialisation.pathImages + "/logo_Ether.jpg"; 76 86 private boolean _legendToHide = true; 87 private boolean _isXTime = true; 77 88 } -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r129 r133 21 21 List<Plateforme> getAllPlateforms() throws ServiceException; 22 22 23 @N ullable23 @NotNull 24 24 List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod(@NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd) throws ServiceException; 25 26 @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; 25 28 26 29 @Nullable -
ether_megapoli/trunk/service/test/com/ether/EtherTest.java
r89 r133 26 26 * @param day : jour au format yyyy-MM-dd 27 27 */ 28 @NotNull29 protected List<Data> createDataList( @NotNull final Integer sizeList, @Nullable String day )30 throws ParseException31 {32 if( null == day )33 day = "2009-07-13";34 35 final List<Data> dataList = new ArrayList<Data>();36 for( int i = 0; i < sizeList; i++ )37 {38 final String dateString = day + " " + i + ":32";39 final Date date = DateHelper.parseDate( dateString, DateHelper.ENGLISH_DATE_PATTERN );40 41 final Data data = new Data();42 data.setDate( date );43 data.setValue( i );44 45 dataList.add( data );46 }47 return dataList;48 }28 // @NotNull 29 // protected List<Data> createDataList( @NotNull final Integer sizeList, @Nullable String day ) 30 // throws ParseException 31 // { 32 // if( null == day ) 33 // day = "2009-07-13"; 34 // 35 // final List<Data> dataList = new ArrayList<Data>(); 36 // for( int i = 0; i < sizeList; i++ ) 37 // { 38 // final String dateString = day + " " + i + ":32"; 39 // final Date date = DateHelper.parseDate( dateString, DateHelper.ENGLISH_DATE_PATTERN ); 40 // 41 // final Data data = new Data(); 42 // data.setDate( date ); 43 // data.setValue( i ); 44 // 45 // dataList.add( data ); 46 // } 47 // return dataList; 48 // } 49 49 50 50 /** -
ether_megapoli/trunk/service/test/com/ether/SGTTest.java
r130 r133 12 12 import gov.noaa.pmel.sgt.JPane; 13 13 import gov.noaa.pmel.sgt.LineAttribute; 14 import gov.noaa.pmel.sgt.beans.*; 14 15 import gov.noaa.pmel.sgt.dm.SGTMetaData; 15 16 import gov.noaa.pmel.sgt.dm.SimpleLine; … … 32 33 import java.text.ParseException; 33 34 import java.util.Date; 35 import java.util.Map; 34 36 35 37 /** … … 190 192 final LineAttribute lineAttribute = createLineAttribute( markPoint ); 191 193 192 final TimeSeriesPlot timeSeriesPlot = new TimeSeriesPlot();194 final MegapoliPlot timeSeriesPlot = new MegapoliPlot(); 193 195 timeSeriesPlot.setTitle( "Keroppi title" ); 194 196 timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 195 197 timeSeriesPlot.setData( data ); 196 timeSeriesPlot.setLineAttribute( lineAttribute );198 // timeSeriesPlot.setLineAttribute( lineAttribute ); 197 199 198 200 // getEtherPlotService().createTimeSeriesPlot( timeSeriesPlot ); 199 timeSeriesPlot.createTimeSeriesPlot();200 201 timeSeriesPlot.pack();202 timeSeriesPlot.setResizable( false );203 timeSeriesPlot.setVisible( true );204 201 // timeSeriesPlot.createTimeSeriesPlot(); 202 // 203 // timeSeriesPlot.pack(); 204 // timeSeriesPlot.setResizable( false ); 205 // timeSeriesPlot.setVisible( true ); 206 // 205 207 Thread.sleep( 100 ); 206 copyToFile( timeSeriesPlot, "service/test/test_TimeSeriesFrameeee.jpg" );207 208 final Image image = timeSeriesPlot.createImage( 400, 400 );208 // copyToFile( timeSeriesPlot, "service/test/test_TimeSeriesFrameeee.jpg" ); 209 // 210 // final Image image = timeSeriesPlot.createImage( 400, 400 ); 209 211 210 212 // BufferedImage bufferedImage = toBufferedImage( image ); … … 213 215 214 216 PngEncoder pngEncoder = new PngEncoder(); 215 pngEncoder.setImage( image );217 // pngEncoder.setImage( image ); 216 218 byte[] bytes = pngEncoder.pngEncode(); 217 219 } … … 396 398 } 397 399 398 private TimeSeriesPlot createPlot()400 private MegapoliPlot createPlot() 399 401 throws ParseException, ServiceException 400 402 { … … 416 418 final LineAttribute lineAttribute = new LineAttribute( LineAttribute.SOLID, Color.red ); 417 419 418 final TimeSeriesPlot timeSeriesPlot = new TimeSeriesPlot();420 final MegapoliPlot timeSeriesPlot = new MegapoliPlot(); 419 421 timeSeriesPlot.setTitle( "Keroppi title" ); 420 422 timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 421 423 timeSeriesPlot.setData( data ); 422 timeSeriesPlot.setLineAttribute( lineAttribute );423 424 timeSeriesPlot.createTimeSeriesPlot();424 // timeSeriesPlot.setLineAttribute( lineAttribute ); 425 426 createTimeSeriesPlot(); 425 427 return timeSeriesPlot; 426 428 } … … 498 500 499 501 //JPlotLayout layout = createLayout( plateform.getPlateformeNom(), parameter.getParametreNom() ); 500 final TimeSeriesPlot timeSeriesPlot = createPlot();501 final Image image = timeSeriesPlot.createImage( 400, 400 );502 // final TimeSeriesPlot timeSeriesPlot = createPlot(); 503 // final Image image = timeSeriesPlot.createImage( 400, 400 ); 502 504 503 505 // BufferedImage bufferedImage = toBufferedImage( image ); … … 506 508 507 509 PngEncoder pngEncoder = new PngEncoder(); 508 pngEncoder.setImage( image );510 // pngEncoder.setImage( image ); 509 511 byte[] bytes = pngEncoder.pngEncode(); 510 512 … … 512 514 final BufferedImage bufferedImage = new BufferedImage( 400, 400, BufferedImage.TYPE_INT_RGB ); 513 515 final Graphics2D g2 = bufferedImage.createGraphics(); 514 timeSeriesPlot.paint( g2 );516 // timeSeriesPlot.paint( g2 ); 515 517 g2.dispose(); 516 518 … … 785 787 786 788 789 public void createTimeSeriesPlot() 790 throws ServiceException 791 { 792 // Enable WindowEvents. Set the layout of the content pane to a BorderLayout. 793 // enableEvents( AWTEvent.WINDOW_EVENT_MASK ); 794 // getContentPane().setLayout( new BorderLayout() ); 795 // 796 // // Add the page object to graphicPanel 797 // getjPanel().add( getPage(), BorderLayout.CENTER ); 798 // 799 // // DATA MODEL 800 // getPage().setDataModel( getDataModel() ); 801 // 802 // // PANEL MODEL 803 // final PanelModel panelModel = extractPanelModel(); 804 // setPanelModel( panelModel ); 805 // getPage().setPanelModel( getPanelModel() ); 806 // 807 // // PANEL HOLDER 808 // final PanelHolder panelHolder = panelModel.findPanelHolder( PANEL_GRAPH ); 809 // if( null != panelHolder ) 810 // { 811 // changeTitle( getTitle(), panelHolder.getLabels() ); 812 // changeLogos( panelHolder.getLabels() ); 813 // 814 // 815 // final DataGroup dataGroup = panelHolder.findDataGroup( DATA_GROUP ); 816 // final Legend timeLegend = panelHolder.findLegend( LEGEND ); 817 // getDataModel().addData( getData(), getLineAttribute(), panelHolder, dataGroup, timeLegend ); 818 // } 819 // else 820 // getDataModel().addData( getData(), getLineAttribute(), panelHolder, null, null ); 821 // 822 //// final PanelHolder panelHolderImage = panelModel.findPanelHolder( PANEL_IMAGE ); 823 //// getDataModel().addData( getData(), getLineAttribute(), panelHolderImage, null, null); 824 // 825 // // Add the graphic to the content pane of the JFrame. 826 // getContentPane().add( getjPanel(), BorderLayout.CENTER ); 827 } 828 829 // private void changeTitle( @Nullable final String title, @Nullable final Map panelHolderLabels ) 830 // { 831 //// if( null != title && null != panelHolderLabels && null != panelHolderLabels.get( LABEL_TITLE ) ) 832 //// { 833 //// final gov.noaa.pmel.sgt.beans.Label labelTitle = (gov.noaa.pmel.sgt.beans.Label) panelHolderLabels.get( LABEL_TITLE ); 834 //// labelTitle.setText( title ); 835 //// } 836 // } 837 // 838 // 839 // private void changeLogos( @Nullable final Map panelHolderLabels ) 840 // { 841 // if( null != getLogoMegapoli() && null != panelHolderLabels && null != panelHolderLabels.get( LABEL_LOGO_MEGAPOLI ) ) 842 // { 843 // final gov.noaa.pmel.sgt.beans.Label labelLogoMegapoli = (gov.noaa.pmel.sgt.beans.Label) panelHolderLabels.get( LABEL_LOGO_MEGAPOLI ); 844 // labelLogoMegapoli.setText( getLogoMegapoli() ); 845 // } 846 // } 847 // 848 // /** 849 // * Create panelModel by de-serializing an existing PanelModel. 850 // * The file megapoli.xml was created using gov.noaa.pmel.sgt.beans.PanelModelEditor. 851 // */ 852 // private PanelModel extractPanelModel() 853 // throws ServiceException 854 // { 855 // try 856 // { 857 // return PanelModel.loadFromXML( getClass().getResource( FILE_NAME ).openStream() ); 858 // } 859 // catch( Exception e ) 860 // { 861 // throw new ServiceException( ServiceException.ServiceCode.PANEL_MODEL_NOT_FOUND, e ); 862 // } 863 // } 864 787 865 // Dimensions of the jPanes 788 866 private static final int MAIN_WIDTH = 1000; -
ether_megapoli/trunk/web/resources/css/blueprint-css/blueprint/src/grid.css
r89 r133 161 161 margin-right: 25px; 162 162 border-right: 1px solid #ddd; 163 min-height: 28em;163 /*min-height: 28em; */ 164 164 } 165 165 -
ether_megapoli/trunk/web/src/com/ether/Controller.java
r132 r133 6 6 import com.medias.database.objects.Parametre; 7 7 import com.medias.database.objects.Plateforme; 8 import com.medias.database.objects.TypePlateforme;9 8 import net.sf.json.JSONObject; 10 9 import org.apache.commons.logging.Log; … … 30 29 /** *********************************************************** **/ 31 30 /** *********************** VIEWS ***************************** **/ 32 /** 33 * ********************************************************** * 34 */ 31 /** *********************************************************** **/ 35 32 // Default view if methodName is unknown 36 33 public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) … … 51 48 throws ServiceException 52 49 { 53 // final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 54 final List<Plateforme> plateforms = new ArrayList<Plateforme>(); 55 final Plateforme pf = new Plateforme(); 56 pf.setPlateformeId( 1 ); 57 pf.setPlateformeNom( "LHVP" ); 58 final TypePlateforme type = new TypePlateforme( ); 59 type.setTypePlateformeNom( "MOBILE" ); 60 pf.setTypePlateforme( type ); 61 plateforms.add( pf ); 62 63 final Plateforme pf2 = new Plateforme(); 64 pf2.setPlateformeId( 2 ); 65 pf2.setPlateformeNom( "SIRTA" ); 66 final TypePlateforme type2 = new TypePlateforme( ); 67 type2.setTypePlateformeNom( "FIXED" ); 68 pf2.setTypePlateforme( type2 ); 69 plateforms.add( pf2 ); 50 final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 70 51 71 52 final Map<String, Object> model = new HashMap<String, Object>(); … … 78 59 /** *********************************************************** **/ 79 60 /** *********************** CALLS ***************************** **/ 80 /** 81 * ********************************************************* * 82 */ 61 /** *********************************************************** **/ 83 62 @ControllerMethod(jsonResult = true) 84 63 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) -
ether_megapoli/trunk/web/src/com/ether/ControllerPlot.java
r132 r133 96 96 // TODO : replace List<Data> by List<value> and List<double> 97 97 //** ******************************************************************** **// 98 // final List<Pair<Double, Date>> values = _etherService.getValuesByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd );99 final List<Pair<Double, Date>> values = new ArrayList<Pair<Double, Date>>();100 final Pair<Double, Date> p1 = new Pair<Double, Date>( Double.valueOf( 23 ), new Date() );101 final Pair<Double, Date> p2 = new Pair<Double, Date>( Double.valueOf( 24 ), new Date() );102 final Pair<Double, Date> p3 = new Pair<Double, Date>( Double.valueOf( 25 ), new Date() );103 final Pair<Double, Date> p4 = new Pair<Double, Date>( Double.valueOf( 26 ), new Date() );104 values.add( p1 );105 values.add( p2 );106 values.add( p3 );107 values.add( p4 );108 final double[] dataArray = extractDoubles( values);109 final Date[] dateValues = extractDates( values);98 final Pair valuesLists = _etherService.getValuesListsByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 99 // final List<Pair<Double, Date>> values = new ArrayList<Pair<Double, Date>>(); 100 // final Pair<Double, Date> p1 = new Pair<Double, Date>( Double.valueOf( 23 ), new Date() ); 101 // final Pair<Double, Date> p2 = new Pair<Double, Date>( Double.valueOf( 24 ), new Date() ); 102 // final Pair<Double, Date> p3 = new Pair<Double, Date>( Double.valueOf( 25 ), new Date() ); 103 // final Pair<Double, Date> p4 = new Pair<Double, Date>( Double.valueOf( 26 ), new Date() ); 104 // values.add( p1 ); 105 // values.add( p2 ); 106 // values.add( p3 ); 107 // values.add( p4 ); 108 final double[] dataArray = (double[]) valuesLists.getFirstValue(); 109 final Date[] dateValues = (Date[]) valuesLists.getSecondValue(); 110 110 111 111 final GeoDateArray dateArray = new GeoDateArray( dateValues ); … … 127 127 } 128 128 129 130 129 final SimpleLine data; 131 130 if( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) ) … … 138 137 megapoliPlot.setData( data ); 139 138 megapoliPlot.setLegendToHide( null == data.getTitle() ); 139 megapoliPlot.setXTime( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) ); 140 140 141 141 142 final BufferedImage bufferedImage = _etherPlotService.createMainPane( megapoliPlot, Context.getLocale( request ) ); -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r132 r133 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=125" 214 221 // + "&dateBegin=" + this.beginDate 215 222 // + "&dateEnd=" + this.endDate … … 217 224 // + "&axeType=" + this.selectAxes.getValue(); 218 225 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 226 226 this.plotWindow.getContent().innerHTML = '<img src=' + url + ' />'; 227 227 this.plotWindow.setSize( <%=EtherPlotServiceImpl.getMaxWidth()%>, <%=EtherPlotServiceImpl.getMaxHeight()%> ); … … 238 238 239 239 // OTHERS ******************************************************** 240 // TODO : resize !!!241 240 resizeContainers: function() 242 241 { 243 var titleSize = 85;242 var titleSize = document.getElementById( "nav" ).offsetHeight + document.getElementById( "title" ).offsetHeight + 30; 244 243 var parentHeight = this.superParent.offsetHeight - titleSize; 245 244 var containerPlateformsHeight = this.generalContainerParameters.offsetHeight; … … 252 251 var maxHeight = Math.max( containerPlateforms, containerParameters, containerOptionsHeight ); 253 252 254 if( maxHeight > parentHeight ) 255 { 256 this.superParent.style.height = maxHeight + 110 + "px"; 257 this.generalContainerPlateforms.style.height = maxHeight + 10 + "px"; 258 this.generalContainerParameters.style.height = maxHeight + 10 + "px"; 259 } else if( maxHeight == containerOptionsHeight ) 260 { 261 // this.superParent.style.height = containerOptionsHeight + titleSize + 25 + "px"; 262 this.generalContainerPlateforms.style.height = containerOptionsHeight + "px"; 263 this.generalContainerParameters.style.height = containerOptionsHeight + "px"; 264 } 253 this.superParent.style.height = maxHeight + titleSize + 35 + "px"; 254 this.generalContainerPlateforms.style.height = maxHeight + "px"; 255 this.generalContainerParameters.style.height = maxHeight + "px"; 265 256 }, 266 257
Note: See TracChangeset
for help on using the changeset viewer.