Changeset 30500 in osm for applications/editors/josm


Ignore:
Timestamp:
2014-06-30T13:17:57+02:00 (10 years ago)
Author:
beata.jancso
Message:
  • fixed MapdustHelpPanel
  • updated gson library -> the classes from the "service" package were changed
Location:
applications/editors/josm/plugins/mapdust
Files:
2 added
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapdust/build.xml

    r30416 r30500  
    6969        </copy>
    7070        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    71             <zipfileset src="lib/gson-1.5.jar" includes="**/*.class"/>
     71                <zipfileset src="lib/gson-2.2.4.jar"/>
    7272            <manifest>
    7373                <attribute name="Author" value="Beata Jancso"/>
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java

    r28630 r30500  
    4949/**
    5050 * Defines the JPanel which displays the Help.
    51  *
     51 * 
    5252 * @author Bea
    5353 */
    5454public class MapdustHelpPanel extends JPanel implements HyperlinkListener {
    55 
     55   
    5656    /** The serial version UID */
    5757    private static final long serialVersionUID = 8366853437915060878L;
    58 
     58   
    5959    /**
    6060     * Builds a <code>MapdustDescriptionPanel</code> object
     
    7070        txtHelp.setText(txt);
    7171        txtHelp.addHyperlinkListener(this);
    72         JScrollPane cmpDescription = ComponentUtil.createJScrollPane(txtHelp,
    73                 null, Color.white, true, true);
     72        JScrollPane cmpDescription =
     73                ComponentUtil.createJScrollPane(txtHelp, null, Color.white,
     74                        true, true);
    7475        cmpDescription.setPreferredSize(new Dimension(100, 100));
    7576        add(cmpDescription, BorderLayout.CENTER);
    7677    }
    77 
     78   
    7879    @Override
    7980    public void hyperlinkUpdate(HyperlinkEvent event) {
     
    8990        }
    9091    }
    91 
     92   
    9293    /**
    9394     * Builds the text of the Help panel. This text contains general information
    9495     * related to the MapDust plugin.
    95      *
     96     * 
    9697     * @return a string containing the text which will be displayed on the Help
    9798     * tab
    9899     */
    99100    private String buildText() {
    100         Integer version = Integer.decode(Main.pref.get("mapdust.version"));
    101         Integer localVersion = Integer.decode(Main.pref.get("mapdust.localVersion"));
    102         String txt = "<html>";
    103         txt += "<font style='font-size:10px' face='Times New Roman'>";
    104         txt += "<b>You are using MapDust version ";
    105         txt += "<i style='color:red;font-size:10px'>";
    106         if (version <= localVersion) {
    107             txt += version + "</i>.</b><br>";
     101        String version = Main.pref.get("mapdust.version");
     102        String localVersion = Main.pref.get("mapdust.localVersion");
     103        StringBuilder sb = new StringBuilder("<html>");
     104        sb.append("<font style='font-size:10px' face='Times New Roman'>");
     105        sb.append("<b>You are using MapDust version ");
     106        sb.append("<i style='color:red;font-size:10px'>");
     107        if (version.equals(localVersion)) {
     108            sb.append(version).append("</i>.</b><br>");
    108109        } else {
    109             txt += localVersion + "</i>. There is an update available. ";
    110             txt += "Please update to version ";
    111             txt += "<i style='color:red;font-size:10px'>" + version;
    112             txt += "</i> to benefit from the latest improvements.</b><br>";
     110            sb.append(localVersion);
     111            sb.append("</i>. There is an update available. ");
     112            sb.append("Please update to version ");
     113            sb.append("<i style='color:red;font-size:10px'>");
     114            sb.append(version);
     115            sb.append("</i> to benefit from the latest improvements.</b><br>");
    113116        }
    114         txt += "<b>To add bugs on the map you need to activate ";
    115         txt += "the MapDust layer in the Layer List Dialog.";
    116         txt += "Click <a href='' target='_blank'>here</a> for more help.";
    117         txt += "</b></font></html>";
    118         return txt;
     117        sb.append("<b>To add bugs on the map you need to activate ");
     118        sb.append("the MapDust layer in the Layer List Dialog.");
     119        sb.append("Click <a href='' target='_blank'>here</a> for more help.");
     120        sb.append("</b></font></html>");
     121        return sb.toString();
    119122    }
    120 
    121123}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandler.java

    r25591 r30500  
    3535import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugsResponse;
    3636import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustPostResponse;
    37 import org.openstreetmap.josm.plugins.mapdust.service.converter.MapdustConverter;
    3837import org.openstreetmap.josm.plugins.mapdust.service.value.BoundingBox;
    3938import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnector.java

    r25828 r30500  
    3535import java.util.List;
    3636import java.util.Map;
    37 import org.openstreetmap.josm.plugins.mapdust.service.connector.parser.MapdustParser;
    38 import org.openstreetmap.josm.plugins.mapdust.service.connector.parser.MapdustParserException;
    3937import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugResponse;
    4038import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugsResponse;
     
    5048import org.openstreetmap.josm.plugins.mapdust.util.http.HttpResponse;
    5149import org.openstreetmap.josm.plugins.mapdust.util.retry.RetrySetup;
     50import com.google.gson.FieldNamingPolicy;
     51import com.google.gson.Gson;
     52import com.google.gson.GsonBuilder;
     53import com.google.gson.JsonSyntaxException;
    5254
    5355
     
    5658 * and executes the following Mapdust service methods: getBug, getBugs, addBug,
    5759 * commentBug and changeBugStatus.
    58  *
     60 * 
    5961 * @author Bea
    6062 */
    6163public class MapdustConnector {
    62 
     64   
    6365    /** The <code>HttpConnector</code> object */
    6466    private final HttpConnector httpConnector;
    65 
    66     /** The <code>MapdustParser</code> object */
    67     private final MapdustParser parser;
    68 
     67   
     68    private Gson gson;
     69   
    6970    /**
    7071     * Builds a <code>MapdustConnector</code> object with the default settings.
     
    7273    public MapdustConnector() {
    7374        httpConnector = new HttpConnector(RetrySetup.DEFAULT);
    74         parser = new MapdustParser();
    75     }
    76 
    77     /**
    78      * Builds a <code>MapdustConnector</code> object based on the given
    79      * arguments.
    80      *
    81      * @param httpConnector The <code>HttpConnector</code> object.
    82      * @param parser The <code>MapdustParser</code> object.
    83      */
    84     public MapdustConnector(HttpConnector httpConnector, MapdustParser parser) {
    85         this.httpConnector = httpConnector;
    86         this.parser = parser;
    87     }
    88 
     75        gson = buildGson();
     76    }
     77   
     78    private Gson buildGson() {
     79        GsonBuilder builder = new GsonBuilder();
     80        builder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
     81        builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
     82        return builder.create();
     83    }
     84   
    8985    /**
    9086     * Searches for the OSM MapDust bugs in the given bounding box. The method
     
    9490     * if the response code is not 200,201 or 204, a corresponding exception
    9591     * will be thrown.
    96      *
     92     * 
    9793     * @param bBox The bounding box where the bugs are searched.
    9894     * @param filter The MapDust bug filter. The bugs can be filtered based on
     
    109105        try {
    110106            httpResponse = executeGetBugs(bBox, filter);
    111         } catch (MalformedURLException e) {
    112             throw new MapdustConnectorException(e.getMessage(), e);
    113         } catch (IOException e) {
    114             throw new MapdustConnectorException(e.getMessage(), e);
    115107        } catch (Exception e) {
    116108            throw new MapdustConnectorException(e.getMessage(), e);
     
    121113            /* verify status codes */
    122114            handleStatusCode(httpResponse);
    123             result = (MapdustGetBugsResponse) getParser().parseResponse(
    124                     httpResponse.getContent(),MapdustGetBugsResponse.class);
     115            result = parseResponse(httpResponse.getContent(),
     116                    MapdustGetBugsResponse.class);
    125117        } catch (MapdustConnectorException e) {
    126118            throw new MapdustConnectorException(e.getMessage(), e);
    127         } catch (MapdustParserException e) {
    128             throw new MapdustConnectorException(e.getMessage(), e);
    129119        }
    130120        return result;
    131121    }
    132 
    133 
     122   
     123   
    134124    /**
    135125     * Returns the OSM bug with the given id. If the <code>Paging</code> object
     
    138128     * response object and return a <code>MapdustGetBugResponse</code> object.
    139129     * In the case if the response code is not 2
    140      *
     130     * 
    141131     * @param id The id of the object
    142132     * @param paging The <code>Paging</code> object
    143133     * @return A <code>MapdustGetBugResponse</code> object.
    144      *
     134     * 
    145135     * @throws MapdustConnectorException In the case of an error.
    146136     */
     
    150140        try {
    151141            httpResponse = executeGetBug(id, paging);
    152         } catch (MalformedURLException e) {
    153             throw new MapdustConnectorException(e.getMessage(), e);
    154         } catch (IOException e) {
    155             throw new MapdustConnectorException(e.getMessage(), e);
    156142        } catch (Exception e) {
    157143            throw new MapdustConnectorException(e.getMessage(), e);
     
    161147        try {
    162148            handleStatusCode(httpResponse);
    163             result = (MapdustGetBugResponse) getParser().parseResponse(
    164                     httpResponse.getContent(), MapdustGetBugResponse.class);
     149            result = parseResponse(httpResponse.getContent(),
     150                    MapdustGetBugResponse.class);
    165151        } catch (MapdustConnectorException e) {
    166152            throw new MapdustConnectorException(e.getMessage(), e);
    167         } catch (MapdustParserException e) {
    168             throw new MapdustConnectorException(e.getMessage(), e);
    169153        }
    170154        return result;
    171155    }
    172 
     156   
    173157    /**
    174158     * Creates a new OSM bug with the specified arguments. The method executes
     
    177161     * the created comment. In the case if the response code is not 200,201 or
    178162     * 204, a corresponding exception will be thrown.
    179      *
     163     * 
    180164     * @param bug A <code>MapdustBug</code> object
    181165     * @return A <code>MapdustPostResponse</code> object which contains the id
    182166     * of the created object.
    183      *
     167     * 
    184168     * @throws MapdustConnectorException In the case of an error
    185169     */
     
    189173        try {
    190174            httpResponse = executeAddBug(bug);
    191         } catch (MalformedURLException e) {
    192             throw new MapdustConnectorException(e.getMessage(), e);
    193         } catch (IOException e) {
    194             throw new MapdustConnectorException(e.getMessage(), e);
    195175        } catch (Exception e) {
    196176            throw new MapdustConnectorException(e.getMessage(), e);
    197177        }
    198 
     178       
    199179        /* parse result */
    200180        MapdustPostResponse result = null;
    201181        try {
    202182            handleStatusCode(httpResponse);
    203             result = (MapdustPostResponse) getParser().parseResponse(
    204                     httpResponse.getContent(), MapdustPostResponse.class);
     183            result = parseResponse(httpResponse.getContent(),
     184                    MapdustPostResponse.class);
    205185        } catch (MapdustConnectorException e) {
    206186            throw new MapdustConnectorException(e.getMessage(), e);
    207         } catch (MapdustParserException e) {
    208             throw new MapdustConnectorException(e.getMessage(), e);
    209187        }
    210188        return result;
    211189    }
    212 
     190   
    213191    /**
    214192     * Creates a new comment for the given bug. The method executes the
     
    217195     * the created comment. In the case if the response code is not 200,201 or
    218196     * 204, a corresponding exception will be thrown.
    219      *
     197     * 
    220198     * @param comment A <code>MapdustComment</code> object
    221199     * @return A <code>MapdustPostResponse</code> object which contains the id
     
    228206        try {
    229207            httpResponse = executeCommentBug(comment);
    230         } catch (MalformedURLException e) {
    231             throw new MapdustConnectorException(e.getMessage(), e);
    232         } catch (IOException e) {
    233             throw new MapdustConnectorException(e.getMessage(), e);
    234208        } catch (Exception e) {
    235209            throw new MapdustConnectorException(e.getMessage(), e);
     
    239213        try {
    240214            handleStatusCode(httpResponse);
    241             result = (MapdustPostResponse) getParser().parseResponse(
    242                     httpResponse.getContent(), MapdustPostResponse.class);
     215            result = parseResponse(httpResponse.getContent(),
     216                    MapdustPostResponse.class);
    243217        } catch (MapdustConnectorException e) {
    244218            throw new MapdustConnectorException(e.getMessage(), e);
    245         } catch (MapdustParserException e) {
    246             throw new MapdustConnectorException(e.getMessage(), e);
    247219        }
    248220        return result;
    249221    }
    250 
     222   
    251223    /**
    252224     * Changes the status of a given bug. The method executes the
     
    255227     * the id of the created comment. In the case if the response code is not
    256228     * 200,201 or 204, a corresponding exception will be thrown.
    257      *
     229     * 
    258230     * @param statusId The new value for the status. Possible values are: 1, 2
    259231     * or 3.
     
    268240        try {
    269241            httpResponse = executeChangeBugStatus(statusId, comment);
    270         } catch (MalformedURLException e) {
    271             throw new MapdustConnectorException(e.getMessage(), e);
    272         } catch (IOException e) {
    273             throw new MapdustConnectorException(e.getMessage(), e);
    274242        } catch (Exception e) {
    275243            throw new MapdustConnectorException(e.getMessage(), e);
     
    279247        try {
    280248            handleStatusCode(httpResponse);
    281             result = (MapdustPostResponse) getParser().parseResponse(
    282                     httpResponse.getContent(), MapdustPostResponse.class);
     249            result = parseResponse(httpResponse.getContent(),
     250                    MapdustPostResponse.class);
    283251        } catch (MapdustConnectorException e) {
    284252            throw new MapdustConnectorException(e.getMessage(), e);
    285         } catch (MapdustParserException e) {
    286             throw new MapdustConnectorException(e.getMessage(), e);
    287253        }
    288254        return result;
    289255    }
    290 
     256   
    291257    /**
    292258     * Executes the 'getBugs' MapDust service method.
    293      *
     259     * 
    294260     * @param bBox The bounding box where the bugs are searched. This parameter
    295261     * it is a required parameter.
     
    333299                }
    334300                if (filter.getMinRelevance() != null) {
    335                     int min=filter.getMinRelevance().getRange().getLowerValue();
     301                    int min = filter.getMinRelevance().getRange().getLowerValue();
    336302                    urlString += "&minr=" + min;
    337303                }
    338304                if (filter.getMaxRelevance() != null) {
    339                     int max= filter.getMaxRelevance().getRange().getUpperValue();
     305                    int max = filter.getMaxRelevance().getRange().getUpperValue();
    340306                    urlString += "&maxr=" + max;
    341307                }
     
    345311        if (urlString != null) {
    346312            url = new URL(urlString);
    347             httpResponse = getHttpConnector().executeGET(url);
     313            httpResponse = httpConnector.executeGET(url);
    348314        }
    349315        return httpResponse;
    350316    }
    351 
     317   
    352318    /**
    353319     * Executes the 'getBug' MapDust service method.
    354      *
     320     * 
    355321     * @param id The id of the object
    356322     * @param paging The <code>Paging</code> object
    357323     * @return A <code>HttpResponse</code> containing the JSON response of the
    358324     * Mapdust method.
    359      *
     325     * 
    360326     * @throws MalformedURLException In the case if the format of the URL is
    361327     * invalid
     
    384350        if (urlString != null) {
    385351            url = new URL(urlString);
    386             httpResponse = getHttpConnector().executeGET(url);
     352            httpResponse = httpConnector.executeGET(url);
    387353        }
    388354        return httpResponse;
    389355    }
    390 
     356   
    391357    /**
    392358     * Executes the 'addBug' MapDust service method.
    393      *
     359     * 
    394360     * @param bug A <code>MapdustBug</code> object
    395361     * @return A <code>HttpResponse</code> containing the JSON response of the
    396362     * MapDust method.
    397      *
     363     * 
    398364     * @throws MalformedURLException In the case if the format of the URL is
    399365     * invalid
     
    421387        if (urlString != null) {
    422388            url = new URL(urlString);
    423             httpResponse = getHttpConnector().executePOST(url, null,
    424                     requestParameters);
     389            httpResponse =
     390                    httpConnector.executePOST(url, null, requestParameters);
    425391        }
    426392        return httpResponse;
    427393    }
    428 
     394   
    429395    /**
    430396     * Executes the 'commentBug' MapDust service method.
    431      *
     397     * 
    432398     * @param comment The <code>MapdustComment</code> object
    433399     * @return A <code>HttpResponse</code> containing the JSON response of the
     
    455421        if (urlString != null) {
    456422            url = new URL(urlString);
    457             httpResponse = getHttpConnector().executePOST(url, null,
    458                     requestParameters);
     423            httpResponse =
     424                    httpConnector.executePOST(url, null, requestParameters);
    459425        }
    460426        return httpResponse;
    461427    }
    462 
     428   
    463429    /**
    464430     * Executes the 'changeBugStatus' MapDust service method.
    465      *
     431     * 
    466432     * @param statusId The id of the status.
    467433     * @param comment A <code>MapdustComment</code> object.
    468434     * @return A <code>HttpResponse</code> containing the JSON response of the
    469435     * MapDust method.
    470      *
     436     * 
    471437     * @throws MalformedURLException In the case if the format of the URL is
    472438     * invalid
     
    492458        if (urlString != null) {
    493459            url = new URL(urlString);
    494             httpResponse = getHttpConnector().executePOST(url, null,
    495                     requestParameters);
     460            httpResponse =
     461                    httpConnector.executePOST(url, null, requestParameters);
    496462        }
    497463        return httpResponse;
    498464    }
    499 
     465   
    500466    /**
    501467     * Builds a string containing the elements of the given list. The elements
    502468     * will be separated by a comma. If the list does not contains any element
    503469     * the returned result will be an empty string.
    504      *
     470     * 
    505471     * @param list The list of objects.
    506472     * @return a string
     
    515481        return sb.substring(0, sb.length() - 1);
    516482    }
    517 
     483   
    518484    /**
    519485     * Handles the response codes of the given <code>HttpResponse</code> object.
     
    521487     * exception. Otherwise a <code>MapdustConnectorException</code> will be
    522488     * thrown with an appropriate message.
    523      *
     489     * 
    524490     * @param httpResponse The <code>HttpResponse</code> method.
    525491     * @throws MapdustConnectorException In the case if the status code is not
     
    578544        }
    579545    }
    580 
    581     /**
    582      * Returns the <code>HttpConnector</code>
    583      *
    584      * @return the httpConnector
    585      */
    586     public HttpConnector getHttpConnector() {
    587         return httpConnector;
    588     }
    589 
    590     /**
    591      * Sets the <code>MapdustParser</code>
    592      *
    593      * @return the parser
    594      */
    595     public MapdustParser getParser() {
    596         return parser;
    597     }
    598 
     546   
     547   
     548    private <T> T parseResponse(String httpResponse, Class<T> responseType)
     549            throws MapdustConnectorException {
     550        T result;
     551        try {
     552            result = gson.fromJson(httpResponse, responseType);
     553        } catch (JsonSyntaxException e) {
     554            throw new MapdustConnectorException(e.getMessage(), e);
     555        }
     556        return result;
     557    }
    599558}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/GeneralContent.java

    r24514 r30500  
    3131/**
    3232 * Defines a general content, containing a given id.
    33  *
     33 * 
    3434 * @author Bea
    35  *
     35 * 
    3636 */
    3737public class GeneralContent {
    38 
     38   
    3939    /** The id */
    4040    private Long id;
    41 
     41   
    4242    /**
    4343     * Builds a <code>GeneralContent</code> object.
    4444     */
    4545    public GeneralContent() {}
    46 
     46   
    4747    /**
    4848     * Builds a <code>GeneralContent</code> object.
    49      *
     49     * 
    5050     * @param id The id of the object
    5151     */
     
    5353        this.id = id;
    5454    }
    55 
    56     /**
    57      * Returns the id
    58      * @return the id
    59      */
     55   
     56   
    6057    public Long getId() {
    6158        return id;
    6259    }
    63 
    64     /**
    65      * Sets the id
    66      *
    67      * @param id the id to set
    68      */
    69     public void setId(Long id) {
    70         this.id = id;
    71     }
    72 
    7360}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/Geometry.java

    r24514 r30500  
    3131/**
    3232 * Defines the attributes of the geometry object.
    33  *
     33 * 
    3434 * @author Bea
    35  *
     35 * 
    3636 */
    3737public class Geometry {
    38 
     38   
    3939    /** The array of coordinates */
    4040    private Double coordinates[];
    41 
     41   
    4242    /**
    4343     * Builds a <code>Geometry</code> object
    4444     */
    4545    public Geometry() {}
    46 
     46   
    4747    /**
    4848     * Builds a <code>Geometry</code> object
    49      *
     49     * 
    5050     * @param coordinates An array of coordinates.
    5151     */
     
    5353        this.coordinates = coordinates;
    5454    }
    55 
    56     /**
    57      * Returns the coordinates
    58      *
    59      * @return the coordinates
    60      */
     55   
     56   
    6157    public Double[] getCoordinates() {
    6258        return coordinates;
    6359    }
    64 
    65     /**
    66      * Returns the coordinates
    67      *
    68      * @param coordinates the coordinates to set
    69      */
    70     public void setCoordinates(Double[] coordinates) {
    71         this.coordinates = coordinates;
    72     }
    73 
     60   
    7461}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugContent.java

    r24514 r30500  
    3131/**
    3232 * Defines the attributes of the <code>MapdustBugContent</code> object.
    33  *
     33 * 
    3434 * @author Bea
    35  *
     35 * 
    3636 */
    3737public class MapdustBugContent extends GeneralContent {
    38 
     38   
    3939    /** The <code>Geometry</code> object */
    4040    private Geometry geometry;
    41 
     41   
    4242    /** The <code>MapdustBugProperties</code> object */
    4343    private MapdustBugProperties properties;
    44 
     44   
    4545    /**
    4646     * Builds a <code>MapdustBugContent</code> object.
    47      *
     47     * 
    4848     */
    4949    public MapdustBugContent() {}
    50 
     50   
    5151    /**
    5252     * Builds a <code>MapdustBugContent</code> object based on the given
    5353     * arguments.
    54      *
     54     * 
    5555     * @param geometry A <code>Geometry</code> object
    5656     * @param properties A <code>MapdustBugProperties</code> object
     
    6060        this.properties = properties;
    6161    }
    62 
    63     /**
    64      * Returns the geometry
    65      *
    66      * @return the geometry
    67      */
     62   
     63   
    6864    public Geometry getGeometry() {
    6965        return geometry;
    7066    }
    71 
    72     /**
    73      * Sets the geometry
    74      *
    75      * @param geometry the geometry to set
    76      */
    77     public void setGeometry(Geometry geometry) {
    78         this.geometry = geometry;
    79     }
    80 
    81     /**
    82      * Returns the MapDust bug properties
    83      *
    84      * @return the properties
    85      */
     67   
    8668    public MapdustBugProperties getProperties() {
    8769        return properties;
    8870    }
    89 
    90     /**
    91      * Sets the MapDust bug properties
    92      *
    93      * @param properties the properties to set
    94      */
    95     public void setProperties(MapdustBugProperties properties) {
    96         this.properties = properties;
    97     }
    98 
    9971}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugProperties.java

    r25828 r30500  
    3535/**
    3636 * Defines the attributes of the <code>MapdustBugProperties</code> object.
    37  *
     37 * 
    3838 * @author Bea
    39  *
     39 * 
    4040 */
    4141public class MapdustBugProperties {
    42 
     42   
    4343    /** The creation date */
    4444    private Date dateCreated;
    45 
     45   
    4646    /** The update date */
    4747    private Date dateUpdated;
    48 
     48   
    4949    /** The status of the bug */
    5050    private Integer status;
    51 
     51   
    5252    /** The type of the bug */
    5353    private String type;
    54 
     54   
    5555    /** The relevance value */
    5656    private Integer relevance;
    57 
     57   
    5858    /** The description of the bug */
    5959    private String description;
    60 
     60   
    6161    /** Flag indicating if the description is default or not */
    62     private boolean isDefaultDescription;
    63 
     62    private byte isDefaultDescription;
     63   
    6464    /** The nickname of the bug */
    6565    private String nickname;
    66 
     66   
    6767    /** The skobbler user id */
    6868    private String skoUid;
    69 
     69   
    7070    /** The external user id */
    7171    private String extUid;
    72 
     72   
    7373    /** The source of the bug */
    7474    private String source;
    75 
     75   
    7676    /** The url of the kml */
    7777    private String kmlUrl;
    78 
     78   
    7979    /** The address of the bug */
    8080    private Address address;
    81 
     81   
    8282    /** The number of comments */
    8383    private Integer numberOfComments;
    84 
     84   
    8585    /** The bug comments */
    8686    private MapdustCommentProperties[] comments;
    87 
     87   
    8888    /**
    8989     * Builds a <code>MapdustBugProperties</code> object.
    9090     */
    9191    public MapdustBugProperties() {}
    92 
     92   
    9393    /**
    9494     * Builds a <code>MapdustBugProperties</code> object.
    95      *
     95     * 
    9696     * @param dateCreated The creation date
    9797     * @param dateUpdated The update date
     
    113113    public MapdustBugProperties(Date dateCreated, Date dateUpdated,
    114114            Integer status, String type, Integer relevance, String description,
    115             boolean isDefaultDescription, String nickname, String skoUid,
     115            byte isDefaultDescription, String nickname, String skoUid,
    116116            String extUid, String source, String kmlUrl, Address address,
    117117            Integer numberOfComments, MapdustCommentProperties[] comments) {
     
    132132        this.comments = comments;
    133133    }
    134 
    135     /**
    136      * Returns the date created
    137      *
    138      * @return the dateCreated
    139      */
     134   
     135   
    140136    public Date getDateCreated() {
    141137        return dateCreated;
    142138    }
    143 
    144     /**
    145      * Sets the date created
    146      *
    147      * @param dateCreated the dateCreated to set
    148      */
    149     public void setDateCreated(Date dateCreated) {
    150         this.dateCreated = dateCreated;
    151     }
    152 
    153     /**
    154      * Returns the date updated
    155      *
    156      * @return the dateUpdated
    157      */
     139   
    158140    public Date getDateUpdated() {
    159141        return dateUpdated;
    160142    }
    161 
    162     /**
    163      * Sets the date updated
    164      *
    165      * @param dateUpdated the dateUpdated to set
    166      */
    167     public void setDateUpdated(Date dateUpdated) {
    168         this.dateUpdated = dateUpdated;
    169     }
    170 
    171     /**
    172      * Returns the status id
    173      *
    174      * @return the status
    175      */
     143   
    176144    public Integer getStatus() {
    177145        return status;
    178146    }
    179 
    180     /**
    181      * Sets the status id
    182      *
    183      * @param status the status to set
    184      */
    185     public void setStatus(Integer status) {
    186         this.status = status;
    187     }
    188 
    189     /**
    190      * Returns the type
    191      *
    192      * @return the type
    193      */
     147   
    194148    public String getType() {
    195149        return type;
    196150    }
    197 
    198     /**
    199      * Sets the type
    200      *
    201      * @param type the type to set
    202      */
    203     public void setType(String type) {
    204         this.type = type;
    205     }
    206 
    207     /**
    208      * Returns the relevance
    209      *
    210      * @return the relevance
    211      */
     151   
    212152    public Integer getRelevance() {
    213153        return relevance;
    214154    }
    215 
    216     /**
    217      * Sets the relevance
    218      *
    219      * @param relevance the relevance to set
    220      */
    221     public void setRelevance(Integer relevance) {
    222         this.relevance = relevance;
    223     }
    224 
    225     /**
    226      * @param isDefaultDescription the isDefaultDescription to set
    227      */
    228     public void setDefaultDescription(boolean isDefaultDescription) {
    229         this.isDefaultDescription = isDefaultDescription;
    230     }
    231 
    232     /**
    233      * Returns the description
    234      *
    235      * @return the description
    236      */
     155 
    237156    public String getDescription() {
    238157        return description;
    239158    }
    240 
    241     /**
    242      * Sets the description
    243      *
    244      * @param description the description to set
    245      */
    246     public void setDescription(String description) {
    247         this.description = description;
    248     }
    249 
    250     /**
    251      * Returns the isDefaultDescription flag
    252      *
    253      * @return the isDefaultDescription
    254      */
    255     public boolean getIsDefaultDescription() {
     159   
     160    public byte getIsDefaultDescription() {
    256161        return isDefaultDescription;
    257162    }
    258 
    259     /**
    260      * Sets the isDefaultDescription flag
    261      *
    262      * @param isDefaultDescription the isDefaultDescription to set
    263      */
    264     public void setIsDefaultDescription(boolean isDefaultDescription) {
    265         this.isDefaultDescription = isDefaultDescription;
    266     }
    267 
    268     /**
    269      * Returns the nickname
    270      *
    271      * @return the nickname
    272      */
     163   
    273164    public String getNickname() {
    274165        return nickname;
    275166    }
    276 
    277     /**
    278      * Sets the nickname
    279      *
    280      * @param nickname the nickname to set
    281      */
    282     public void setNickname(String nickname) {
    283         this.nickname = nickname;
    284     }
    285 
    286     /**
    287      * Returns the skobbler user id
    288      *
    289      * @return the skoUid
    290      */
     167   
    291168    public String getSkoUid() {
    292169        return skoUid;
    293170    }
    294 
    295     /**
    296      * Sets the skobbler user id
    297      *
    298      * @param skoUid the skoUid to set
    299      */
    300     public void setSkoUid(String skoUid) {
    301         this.skoUid = skoUid;
    302     }
    303 
    304     /**
    305      * Returns the external user id
    306      *
    307      * @return the extUid
    308      */
     171   
    309172    public String getExtUid() {
    310173        return extUid;
    311174    }
    312 
    313     /**
    314      * Sets the external user id
    315      *
    316      * @param extUid the erxtUid to set
    317      */
    318     public void setExtUid(String extUid) {
    319         this.extUid = extUid;
    320     }
    321 
    322     /**
    323      * Returns the source
    324      *
    325      * @return the source
    326      */
     175   
    327176    public String getSource() {
    328177        return source;
    329178    }
    330 
    331     /**
    332      * Sets the source
    333      *
    334      * @param source the source to set
    335      */
    336     public void setSource(String source) {
    337         this.source = source;
    338     }
    339 
    340     /**
    341      * Returns the kml URL
    342      *
    343      * @return the kmlUrl
    344      */
     179   
    345180    public String getKmlUrl() {
    346181        return kmlUrl;
    347182    }
    348 
    349     /**
    350      * Sets the kml URL
    351      *
    352      * @param kmlUrl the kmlUrl to set
    353      */
    354     public void setKmlUrl(String kmlUrl) {
    355         this.kmlUrl = kmlUrl;
    356     }
    357 
    358     /**
    359      * Returns the address
    360      *
    361      * @return the address
    362      */
     183   
    363184    public Address getAddress() {
    364185        return address;
    365186    }
    366 
    367     /**
    368      * Sets the address
    369      *
    370      * @param address the address to set
    371      */
    372     public void setAddress(Address address) {
    373         this.address = address;
    374     }
    375 
    376     /**
    377      * Returns the number of the comments
    378      *
    379      * @return the numberOfComments
    380      */
     187   
    381188    public Integer getNumberOfComments() {
    382189        return numberOfComments;
    383190    }
    384 
    385     /**
    386      * Sets the number of the comments
    387      *
    388      * @param numberOfComments the numberOfComments to set
    389      */
    390     public void setNumberOfComments(Integer numberOfComments) {
    391         this.numberOfComments = numberOfComments;
    392     }
    393 
    394     /**
    395      * Returns the comments
    396      *
    397      * @return the comments
    398      */
     191   
    399192    public MapdustCommentProperties[] getComments() {
    400193        return comments;
    401194    }
    402 
    403     /**
    404      * Sets the comments
    405      *
    406      * @param comments the comments to set
    407      */
    408     public void setComments(MapdustCommentProperties[] comments) {
    409         this.comments = comments;
    410     }
    411 
    412195}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustCommentProperties.java

    r25591 r30500  
    8383    }
    8484
    85     /**
    86      * Returns the date created
    87      *
    88      * @return the dateCreated
    89      */
     85   
    9086    public Date getDateCreated() {
    9187        return dateCreated;
    9288    }
    93 
    94     /**
    95      * Sets the date created
    96      *
    97      * @param dateCreated the dateCreated to set
    98      */
    99     public void setDateCreated(Date dateCreated) {
    100         this.dateCreated = dateCreated;
    101     }
    102 
    103     /**
    104      * Returns the comment text
    105      *
    106      * @return the comment
    107      */
     89   
    10890    public String getComment() {
    10991        return comment;
    11092    }
    11193
    112     /**
    113      * Sets the comment text
    114      *
    115      * @param comment the comment to set
    116      */
    117     public void setComment(String comment) {
    118         this.comment = comment;
    119     }
    12094
    121     /**
    122      * Returns the nickname
    123      *
    124      * @return the nickname
    125      */
    12695    public String getNickname() {
    12796        return nickname;
    12897    }
    12998
    130     /**
    131      * Sets the nickname
    132      *
    133      * @param nickname the nickname to set
    134      */
    135     public void setNickname(String nickname) {
    136         this.nickname = nickname;
    137     }
    138 
    139     /**
    140      * Returns the skobbler user id
    141      *
    142      * @return the skoUid
    143      */
    14499    public String getSkoUid() {
    145100        return skoUid;
    146101    }
    147102
    148     /**
    149      * Sets the skobbler user id
    150      *
    151      * @param skoUid the skoUid to set
    152      */
    153     public void setSkoUid(String skoUid) {
    154         this.skoUid = skoUid;
    155     }
    156 
    157     /**
    158      * Returns the external user id
    159      *
    160      * @return the extUid
    161      */
    162103    public String getExtUid() {
    163104        return extUid;
    164105    }
    165106
    166     /**
    167      * Sets the external user id
    168      *
    169      * @param extUid the extUid to set
    170      */
    171     public void setExtUid(String extUid) {
    172         this.extUid = extUid;
    173     }
    174 
    175     /**
    176      * Returns the source
    177      *
    178      * @return the source
    179      */
    180107    public String getSource() {
    181108        return source;
    182109    }
    183 
    184     /**
    185      * Sets the source
    186      *
    187      * @param source the source to set
    188      */
    189     public void setSource(String source) {
    190         this.source = source;
    191     }
    192 
    193110}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugResponse.java

    r24514 r30500  
    6666    }
    6767
    68     /**
    69      * Returns the <code>Geometry</code> object
    70      *
    71      * @return the geometry
    72      */
     68   
    7369    public Geometry getGeometry() {
    7470        return geometry;
    7571    }
    76 
    77     /**
    78      * Sets the <code>Geometry</code> object
    79      *
    80      * @param geometry the geometry to set
    81      */
    82     public void setGeometry(Geometry geometry) {
    83         this.geometry = geometry;
    84     }
    85 
    86     /**
    87      * Returns the id
    88      *
    89      * @return the id
    90      */
     72   
    9173    public Long getId() {
    9274        return id;
    9375    }
    9476
    95     /**
    96      * Sets the id
    97      *
    98      * @param id the id to set
    99      */
    100     public void setId(Long id) {
    101         this.id = id;
    102     }
    103 
    104     /**
    105      * Returns the <code>MapdustBugProperties</code> properties
    106      *
    107      * @return the properties
    108      */
    10977    public MapdustBugProperties getProperties() {
    11078        return properties;
    11179    }
    112 
    113     /**
    114      * Sets the <code>MapdustBugProperties</code> object
    115      *
    116      * @param properties the properties to set
    117      */
    118     public void setProperties(MapdustBugProperties properties) {
    119         this.properties = properties;
    120     }
    121 
    12280}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugsResponse.java

    r25591 r30500  
    5555    }
    5656
    57     /**
    58      * Returns the array of <code>MapdustBugContent</code> objects
    59      *
    60      * @return the features
    61      */
     57   
    6258    public MapdustBugContent[] getFeatures() {
    6359        return features;
    6460    }
    6561
    66     /**
    67      * Sets the array of <code>MapdustBugContent</code> objects
    68      *
    69      * @param features the features to set
    70      */
    71     public void setFeatures(MapdustBugContent[] features) {
    72         this.features = features;
    73     }
    74 
    7562}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetResponse.java

    r25591 r30500  
    5959    }
    6060
    61     /**
    62      * Returns the <code>Paging</code> object
    63      *
    64      * @return the paging
    65      */
     61   
    6662    public Paging getPaging() {
    6763        return paging;
    6864    }
    6965
    70     /**
    71      * Sets the <code>Paging</code> object
    72      *
    73      * @param paging the paging to set
    74      */
    75     public void setPaging(Paging paging) {
    76         this.paging = paging;
    77     }
    78 
    7966}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustPostResponse.java

    r25591 r30500  
    5656    }
    5757
    58     /**
    59      * Returns the id
    60      *
    61      * @return the id
    62      */
     58   
    6359    public Long getId() {
    6460        return id;
    6561    }
    66 
    67     /**
    68      * Sets the id
    69      *
    70      * @param id the id to set
    71      */
    72     public void setId(Long id) {
    73         this.id = id;
    74     }
    75 
    7662}
Note: See TracChangeset for help on using the changeset viewer.