Changeset 133 for ether_megapoli


Ignore:
Timestamp:
08/24/11 14:10:53 (13 years ago)
Author:
vmipsl
Message:

[Visualization] latitude/longitude axeType

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  
    44{ 
    55    TIME, 
    6     FIXE, 
    76} 
  • ether_megapoli/trunk/domain/interface/com/ether/AxeTypeForMobilePlateform.java

    r132 r133  
    44{ 
    55    LATITUDE, 
    6     MOBILE, 
    76} 
  • ether_megapoli/trunk/persistence/implementation/com/ether/dao/ValueDAOImpl.java

    r129 r133  
    11package com.ether.dao; 
    22 
    3 import com.ether.Data; 
    43import com.ether.Pair; 
    54import com.ether.PersistenceException; 
     
    2928    } 
    3029 
    31     @Nullable 
     30    @NotNull 
    3231    public List<Pair<Double, Date>> getValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 
    3332            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 ) 
    3471    { 
    3572        final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) 
     
    4885 
    4986        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; 
    6288    } 
    6389} 
  • ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml

    r130 r133  
    77        <session-factory> 
    88 
    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"/> 
    3535 
    3636        </session-factory> 
  • ether_megapoli/trunk/persistence/interface/com/ether/dao/ValueDAO.java

    r129 r133  
    11package com.ether.dao; 
    22 
    3 import java.util.Date; 
    4 import java.util.List; 
    5  
    63import com.ether.Pair; 
     4import com.ether.PersistenceException; 
    75import com.medias.database.objects.Valeur; 
    86import org.jetbrains.annotations.NotNull; 
    97import org.jetbrains.annotations.Nullable; 
    108 
    11 import com.ether.Data; 
    12 import com.ether.PersistenceException; 
     9import java.util.Date; 
     10import java.util.List; 
    1311 
    1412/** 
     
    1614 * @date 07 apr 2011 
    1715 */ 
    18 public interface ValueDAO  
    19         extends DomainAccessObject<Valeur, Integer> 
     16public interface ValueDAO 
     17        extends DomainAccessObject<Valeur, Integer> 
    2018{ 
    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; 
    2326} 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java

    r132 r133  
    129129 
    130130        // 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() ); 
    132132        jPlotLayout.setTitles( "", "", "" ); 
    133133        // Add data and legend 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java

    r129 r133  
    11package com.ether; 
    22 
    3 import java.util.Date; 
    4 import java.util.List; 
    5  
     3import com.ether.dao.ParameterDAO; 
     4import com.ether.dao.PlateformDAO; 
     5import com.ether.dao.ValueDAO; 
    66import com.medias.database.objects.Parametre; 
    77import com.medias.database.objects.Plateforme; 
     
    1313import org.springframework.transaction.annotation.Transactional; 
    1414 
    15 import com.ether.dao.ParameterDAO; 
    16 import com.ether.dao.PlateformDAO; 
    17 import com.ether.dao.ValueDAO; 
     15import java.util.Date; 
     16import java.util.List; 
    1817 
    1918/** 
    2019 * @author vmipsl 
    21  * @date 07 mar 2011  
     20 * @date 07 mar 2011 
    2221 */ 
    23 public class EtherServiceImpl implements EtherService 
     22public class EtherServiceImpl 
     23        implements EtherService 
    2424{ 
    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    } 
    7339 
    7440    @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) 
    7687    public Plateforme getPlateformById( @Nullable final Integer plateformId ) 
    7788            throws ServiceException 
    7889    { 
    79         if(null == plateformId) 
     90        if( null == plateformId ) 
    8091            return null; 
    8192        try 
     
    8394            return _plateformDAO.getPlateformById( plateformId ); 
    8495        } 
    85         catch (PersistenceException e) 
     96        catch( PersistenceException e ) 
    8697        { 
    87             throw new ServiceException(ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e); 
     98            throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e ); 
    8899        } 
    89100    } 
     
    94105            throws ServiceException 
    95106    { 
    96         if(null == parameterId) 
     107        if( null == parameterId ) 
    97108            return null; 
    98109        try 
     
    100111            return _parameterDAO.getParameterById( parameterId ); 
    101112        } 
    102         catch (PersistenceException e) 
     113        catch( PersistenceException e ) 
    103114        { 
    104             throw new ServiceException(ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e); 
     115            throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e ); 
    105116        } 
    106117    } 
    107118 
    108119    @Required 
    109     public void setPlateformDAO(final PlateformDAO plateformDAO) 
     120    public void setPlateformDAO( final PlateformDAO plateformDAO ) 
    110121    { 
    111         _plateformDAO = plateformDAO; 
     122        _plateformDAO = plateformDAO; 
    112123    } 
    113124 
    114125    @Required 
    115     public void setParameterDAO(final ParameterDAO parameterDAO) 
     126    public void setParameterDAO( final ParameterDAO parameterDAO ) 
    116127    { 
    117         _parameterDAO = parameterDAO; 
     128        _parameterDAO = parameterDAO; 
    118129    } 
    119130 
    120131    @Required 
    121     public void setValueDAO(final ValueDAO valueDAO) 
     132    public void setValueDAO( final ValueDAO valueDAO ) 
    122133    { 
    123         _valueDAO = valueDAO; 
     134        _valueDAO = valueDAO; 
    124135    } 
    125136 
    126137    private static final Log LOGGER = LogFactory.getLog( EtherServiceImpl.class ); 
    127      
    128      
     138 
    129139    private PlateformDAO _plateformDAO; 
    130140    private ParameterDAO _parameterDAO; 
    131     private ValueDAO _valueDAO;     
     141    private ValueDAO _valueDAO; 
    132142} 
  • ether_megapoli/trunk/service/implementation/com/ether/MegapoliPlot.java

    r132 r133  
    6666    } 
    6767 
     68    public boolean isXTime() 
     69    { 
     70        return _isXTime; 
     71    } 
     72 
     73    public void setXTime( final boolean xTime ) 
     74    { 
     75        _isXTime = xTime; 
     76    } 
     77 
    6878    @Nullable 
    6979    private String _title; 
     
    7181    private SimpleLine _data; 
    7282    @NotNull 
    73     private String _logoMegapoli  = MegapoliInitialisation.pathImages + "/logo_Megapoli.png"; 
     83    private String _logoMegapoli = MegapoliInitialisation.pathImages + "/logo_Megapoli.png"; 
    7484    @NotNull 
    7585    private String _logoEther = MegapoliInitialisation.pathImages + "/logo_Ether.jpg"; 
    7686    private boolean _legendToHide = true; 
     87    private boolean _isXTime = true; 
    7788} 
  • ether_megapoli/trunk/service/interface/com/ether/EtherService.java

    r129 r133  
    2121        List<Plateforme> getAllPlateforms() throws ServiceException; 
    2222 
    23         @Nullable 
     23        @NotNull 
    2424    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; 
    2528 
    2629    @Nullable 
  • ether_megapoli/trunk/service/test/com/ether/EtherTest.java

    r89 r133  
    2626     * @param day : jour au format yyyy-MM-dd 
    2727     */ 
    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     } 
     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//    } 
    4949 
    5050    /** 
  • ether_megapoli/trunk/service/test/com/ether/SGTTest.java

    r130 r133  
    1212import gov.noaa.pmel.sgt.JPane; 
    1313import gov.noaa.pmel.sgt.LineAttribute; 
     14import gov.noaa.pmel.sgt.beans.*; 
    1415import gov.noaa.pmel.sgt.dm.SGTMetaData; 
    1516import gov.noaa.pmel.sgt.dm.SimpleLine; 
     
    3233import java.text.ParseException; 
    3334import java.util.Date; 
     35import java.util.Map; 
    3436 
    3537/** 
     
    190192        final LineAttribute lineAttribute = createLineAttribute( markPoint ); 
    191193 
    192         final TimeSeriesPlot timeSeriesPlot = new TimeSeriesPlot(); 
     194        final MegapoliPlot timeSeriesPlot = new MegapoliPlot(); 
    193195        timeSeriesPlot.setTitle( "Keroppi title" ); 
    194196        timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 
    195197        timeSeriesPlot.setData( data ); 
    196         timeSeriesPlot.setLineAttribute( lineAttribute ); 
     198//        timeSeriesPlot.setLineAttribute( lineAttribute ); 
    197199 
    198200//        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// 
    205207        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 ); 
    209211 
    210212//        BufferedImage bufferedImage = toBufferedImage( image ); 
     
    213215 
    214216        PngEncoder pngEncoder = new PngEncoder(); 
    215         pngEncoder.setImage( image ); 
     217//        pngEncoder.setImage( image ); 
    216218        byte[] bytes = pngEncoder.pngEncode(); 
    217219    } 
     
    396398    } 
    397399 
    398     private TimeSeriesPlot createPlot() 
     400    private MegapoliPlot createPlot() 
    399401            throws ParseException, ServiceException 
    400402    { 
     
    416418        final LineAttribute lineAttribute = new LineAttribute( LineAttribute.SOLID, Color.red ); 
    417419 
    418         final TimeSeriesPlot timeSeriesPlot = new TimeSeriesPlot(); 
     420        final MegapoliPlot timeSeriesPlot = new MegapoliPlot(); 
    419421        timeSeriesPlot.setTitle( "Keroppi title" ); 
    420422        timeSeriesPlot.setLogoMegapoli( "keroppi1.jpg" ); 
    421423        timeSeriesPlot.setData( data ); 
    422         timeSeriesPlot.setLineAttribute( lineAttribute ); 
    423  
    424         timeSeriesPlot.createTimeSeriesPlot(); 
     424//        timeSeriesPlot.setLineAttribute( lineAttribute ); 
     425 
     426        createTimeSeriesPlot(); 
    425427        return timeSeriesPlot; 
    426428    } 
     
    498500 
    499501        //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 ); 
    502504 
    503505//        BufferedImage bufferedImage = toBufferedImage( image ); 
     
    506508 
    507509        PngEncoder pngEncoder = new PngEncoder(); 
    508         pngEncoder.setImage( image ); 
     510//        pngEncoder.setImage( image ); 
    509511        byte[] bytes = pngEncoder.pngEncode(); 
    510512 
     
    512514        final BufferedImage bufferedImage = new BufferedImage( 400, 400, BufferedImage.TYPE_INT_RGB ); 
    513515        final Graphics2D g2 = bufferedImage.createGraphics(); 
    514         timeSeriesPlot.paint( g2 ); 
     516//        timeSeriesPlot.paint( g2 ); 
    515517        g2.dispose(); 
    516518 
     
    785787 
    786788 
     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 
    787865    // Dimensions of the jPanes 
    788866    private static final int MAIN_WIDTH = 1000; 
  • ether_megapoli/trunk/web/resources/css/blueprint-css/blueprint/src/grid.css

    r89 r133  
    161161  margin-right: 25px; 
    162162  border-right: 1px solid #ddd; 
    163   min-height: 28em; 
     163  /*min-height: 28em; */ 
    164164} 
    165165 
  • ether_megapoli/trunk/web/src/com/ether/Controller.java

    r132 r133  
    66import com.medias.database.objects.Parametre; 
    77import com.medias.database.objects.Plateforme; 
    8 import com.medias.database.objects.TypePlateforme; 
    98import net.sf.json.JSONObject; 
    109import org.apache.commons.logging.Log; 
     
    3029    /** *********************************************************** **/ 
    3130    /** *********************** VIEWS ***************************** **/ 
    32     /** 
    33      * ********************************************************** * 
    34      */ 
     31    /** *********************************************************** **/ 
    3532    // Default view if methodName is unknown 
    3633    public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 
     
    5148            throws ServiceException 
    5249    { 
    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(); 
    7051 
    7152        final Map<String, Object> model = new HashMap<String, Object>(); 
     
    7859    /** *********************************************************** **/ 
    7960    /** *********************** CALLS ***************************** **/ 
    80     /** 
    81      * ********************************************************* * 
    82      */ 
     61    /** *********************************************************** **/ 
    8362    @ControllerMethod(jsonResult = true) 
    8463    public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 
  • ether_megapoli/trunk/web/src/com/ether/ControllerPlot.java

    r132 r133  
    9696            // TODO : replace List<Data> by List<value> and List<double> 
    9797            //** ******************************************************************** **// 
    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(); 
    110110 
    111111            final GeoDateArray dateArray = new GeoDateArray( dateValues ); 
     
    127127            } 
    128128 
    129  
    130129            final SimpleLine data; 
    131130            if( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) ) 
     
    138137            megapoliPlot.setData( data ); 
    139138            megapoliPlot.setLegendToHide( null == data.getTitle() ); 
     139            megapoliPlot.setXTime( AxeTypeForFixedPlateform.TIME.name().equals( axeType ) ); 
     140 
    140141 
    141142            final BufferedImage bufferedImage = _etherPlotService.createMainPane( megapoliPlot, Context.getLocale( request ) ); 
  • ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp

    r132 r133  
    210210//        this.plotWindow.getContent().innerHTML = '<div class="loadingPlot"><img src="/Megapoli/resources/icons/loading_datas.gif"/></div>'; 
    211211 
    212 //        var url = "visualization/plotEther?plateformId=" + this.selectedPlateform.getId() 
    213 //                + "&parameterId=" + this.selectedParameter.getId() 
     212        var url = "visualization/plotEther?plateformId=" + this.selectedPlateform.getId() 
     213                + "&parameterId=" + 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//                + "&parameterId=125" 
    214221//                + "&dateBegin=" + this.beginDate 
    215222//                + "&dateEnd=" + this.endDate 
     
    217224//                + "&axeType=" + this.selectAxes.getValue(); 
    218225 
    219         var url = "visualization/plotEther?plateformId=14" 
    220                 + "&parameterId=125" 
    221                 + "&dateBegin=" + this.beginDate 
    222                 + "&dateEnd=" + this.endDate 
    223                 + "&title=" + encodeURIComponent( $( "textareaTitle" ).value ) 
    224                 + "&axeType=" + this.selectAxes.getValue(); 
    225  
    226226        this.plotWindow.getContent().innerHTML = '<img src=' + url + ' />'; 
    227227        this.plotWindow.setSize( <%=EtherPlotServiceImpl.getMaxWidth()%>, <%=EtherPlotServiceImpl.getMaxHeight()%> ); 
     
    238238 
    239239    // OTHERS ******************************************************** 
    240     // TODO : resize !!! 
    241240    resizeContainers: function() 
    242241    { 
    243         var titleSize = 85; 
     242        var titleSize = document.getElementById( "nav" ).offsetHeight + document.getElementById( "title" ).offsetHeight + 30; 
    244243        var parentHeight = this.superParent.offsetHeight - titleSize; 
    245244        var containerPlateformsHeight = this.generalContainerParameters.offsetHeight; 
     
    252251        var maxHeight = Math.max( containerPlateforms, containerParameters, containerOptionsHeight ); 
    253252 
    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"; 
    265256    }, 
    266257 
Note: See TracChangeset for help on using the changeset viewer.