Ignore:
Timestamp:
10/09/12 14:50:26 (12 years ago)
Author:
vmipsl
Message:

clean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/service/test/com/ether/EtherTest.java

    r569 r572  
    11package com.ether; 
    22 
    3 import gov.noaa.pmel.sgt.LineAttribute; 
    4 import gov.noaa.pmel.util.GeoDateArray; 
    53import org.jetbrains.annotations.NotNull; 
    6 import org.jetbrains.annotations.Nullable; 
    7 import org.junit.Test; 
    84 
    9 import javax.imageio.ImageIO; 
    10 import javax.swing.*; 
    11 import java.awt.*; 
    12 import java.awt.image.BufferedImage; 
    13 import java.io.File; 
    145import java.io.Serializable; 
    15 import java.text.ParseException; 
    16 import java.util.Date; 
    176 
    187/** 
     
    4736//    } 
    4837 
    49     /** 
    50      * @param day : jour au format yyyy-MM-dd 
    51      */ 
    52     @NotNull 
    53     protected GeoDateArray createTimeArray( @NotNull final Integer size, @Nullable String day ) 
    54             throws ParseException 
    55     { 
    56         if( null == day ) 
    57             day = "2009-07-13"; 
    58  
    59         final Date[] dates = new Date[size]; 
    60         for( int i = 0; i < size; i++ ) 
    61         { 
    62             final String dateString = day + ' ' + i + ":32"; 
    63             final Date date = DateHelper.parseDate( dateString, DateHelper.ENGLISH_DATE_PATTERN ); 
    64             dates[i] = date; 
    65         } 
    66         return new GeoDateArray( dates ); 
    67     } 
    68  
    69     @NotNull 
    70     protected double[] createDataArray( @NotNull final Integer size, @NotNull final Integer begin ) 
    71             throws ParseException 
    72     { 
    73         final double[] datas = new double[size]; 
    74         for( int i = 0; i < size; i++ ) 
    75         { 
    76             datas[i] = Double.valueOf( i + begin ); 
    77         } 
    78         return datas; 
    79     } 
    80  
    81     protected void copyToFile( @NotNull final JFrame frame, @NotNull final String fileName ) 
    82     { 
    83         final BufferedImage image = new BufferedImage( frame.getWidth(), frame.getHeight(), BufferedImage.TYPE_INT_RGB ); 
    84  
    85         final Graphics2D g2 = image.createGraphics(); 
    86         frame.paint( g2 ); 
    87         g2.dispose(); 
    88  
    89         try 
    90         { 
    91             final File out = new File( fileName ); 
    92             ImageIO.write( image, "JPEG", out ); 
    93         } 
    94         catch( Exception e ) 
    95         { 
    96         } 
    97     } 
    98  
    9938    protected <T extends Serializable> void displayArray( @NotNull final T[] objectsArray ) 
    10039    { 
Note: See TracChangeset for help on using the changeset viewer.