Changeset 23191 in osm


Ignore:
Timestamp:
2010-09-15T18:56:19+02:00 (14 years ago)
Author:
stoecker
Message:

remove tabs

Location:
applications/editors/josm/plugins
Files:
112 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationAction.java

    r17762 r23191  
    2222SelectionChangedListener {
    2323
    24         public AddrInterpolationAction(){
    25                 super(tr("Address Interpolation"), "AddrInterpolation", tr("Handy Address Interpolation Functions"),
    26                                 Shortcut.registerShortcut("tools:AddressInterpolation", tr("Tool: {0}", tr("Address Interpolation")),
    27                                                 KeyEvent.VK_A, Shortcut.GROUP_MENU,
    28                                                 InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK), false);
    29                 setEnabled(false);
    30                 DataSet.selListeners.add(this);
    31         }
     24    public AddrInterpolationAction(){
     25        super(tr("Address Interpolation"), "AddrInterpolation", tr("Handy Address Interpolation Functions"),
     26                Shortcut.registerShortcut("tools:AddressInterpolation", tr("Tool: {0}", tr("Address Interpolation")),
     27                        KeyEvent.VK_A, Shortcut.GROUP_MENU,
     28                        InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK), false);
     29        setEnabled(false);
     30        DataSet.selListeners.add(this);
     31    }
    3232
    33         public void actionPerformed(ActionEvent e) {
    34                 AddrInterpolationDialog addrDialog = new AddrInterpolationDialog(tr("Define Address Interpolation"));
     33    public void actionPerformed(ActionEvent e) {
     34        AddrInterpolationDialog addrDialog = new AddrInterpolationDialog(tr("Define Address Interpolation"));
    3535
    3636
    37         }
     37    }
    3838
    39         public void selectionChanged(
    40                         Collection<? extends OsmPrimitive> newSelection) {
     39    public void selectionChanged(
     40            Collection<? extends OsmPrimitive> newSelection) {
    4141
    42                 for (OsmPrimitive osm : newSelection) {
    43                         if (osm instanceof Way) {
    44                                 setEnabled(true);
    45                                 return;
    46                         }
    47                 }
    48                 setEnabled(false);
     42        for (OsmPrimitive osm : newSelection) {
     43            if (osm instanceof Way) {
     44                setEnabled(true);
     45                return;
     46            }
     47        }
     48        setEnabled(false);
    4949
    50         }
     50    }
    5151
    5252}
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java

    r23102 r23191  
    6969public class AddrInterpolationDialog extends JDialog implements ActionListener  {
    7070
    71         private Way selectedStreet = null;
    72         private Way addrInterpolationWay = null;
    73         private Relation associatedStreetRelation = null;
    74         private ArrayList<Node> houseNumberNodes = null;  // Additional nodes with addr:housenumber
    75 
    76         private static String lastIncrement = "";
    77         private static int lastAccuracyIndex = 0;
    78         private static String lastCity = "";
    79         private static String lastState = "";
    80         private static String lastPostCode = "";
    81         private static String lastCountry = "";
    82         private static String lastFullAddress = "";
    83         private static boolean lastConvertToHousenumber = false;
    84 
    85         // Edit controls
    86         private EscapeDialog dialog=null;
    87         private JRadioButton streetNameButton = null;
    88         private JRadioButton streetRelationButton  = null;
    89         private JTextField startTextField = null;
    90         private JTextField endTextField = null;
    91         private JTextField incrementTextField = null;
    92         private JTextField cityTextField = null;
    93         private JTextField stateTextField = null;
    94         private JTextField postCodeTextField = null;
    95         private JTextField countryTextField = null;
    96         private JTextField fullTextField = null;
    97         private Checkbox cbConvertToHouseNumbers = null;
    98 
    99         private boolean relationChanged = false; // Whether to re-trigger data changed for relation
    100         // Track whether interpolation method is known so that auto detect doesn't override a previous choice.
    101         private boolean interpolationMethodSet = false;
    102 
    103 
    104         // NOTE: The following 2 arrays must match in number of elements and position
    105         // Tag values for map (Except that 'Numeric' is replaced by actual # on map)
    106         String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", "Numeric" };
    107         String[] addrInterpolationStrings = { tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display
    108         private final int NumericIndex = 4;
    109         private JComboBox addrInterpolationList = null;
    110 
    111         // NOTE: The following 2 arrays must match in number of elements and position
    112         String[] addrInclusionTags = { "actual", "estimate", "potential" }; // Tag values for map
    113         String[] addrInclusionStrings = { tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display
    114         private JComboBox addrInclusionList = null;
    115 
    116 
    117 
    118         // For tracking edit changes as group for undo
    119         private Collection<Command> commandGroup = null;
    120         private Relation editedRelation = null;
    121 
    122         public AddrInterpolationDialog(String name) {
    123 
    124                 if (!FindAndSaveSelections()) {
    125                         return;
    126                 }
    127 
    128                 JPanel editControlsPane = CreateEditControls();
    129 
    130                 ShowDialog(editControlsPane, name);
    131 
    132         }
    133 
    134 
    135 
    136         private void ShowDialog(JPanel editControlsPane, String name) {
    137                 dialog = new EscapeDialog((Frame) Main.parent, name, true);
    138 
    139                 dialog.add(editControlsPane);
    140                 dialog.setSize(new Dimension(300,500));
    141                 dialog.setLocation(new Point(100,300));
    142 
    143                 // Listen for windowOpened event to set focus
    144                 dialog.addWindowListener( new WindowAdapter()
    145                 {
    146                         @Override
    147                         public void windowOpened( WindowEvent e )
    148                         {
    149                                 if (addrInterpolationWay != null) {
    150                                         startTextField.requestFocus();
    151                                 }
    152                                 else {
    153                                         cityTextField.requestFocus();
    154                                 }
    155                         }
    156                 });
    157 
    158                 dialog.setVisible(true);
    159 
    160                 lastIncrement = incrementTextField.getText();
    161                 lastCity = cityTextField.getText();
    162                 lastState = stateTextField.getText();
    163                 lastPostCode = postCodeTextField.getText();
    164                 lastCountry = countryTextField.getText();
    165                 lastFullAddress = fullTextField.getText();
    166                 lastConvertToHousenumber = cbConvertToHouseNumbers.getState();
    167 
    168         }
    169 
    170 
    171 
    172         // Create edit control items and return JPanel on which they reside
    173         private JPanel CreateEditControls() {
    174 
    175                 JPanel editControlsPane = new JPanel();
    176                 GridBagLayout gridbag = new GridBagLayout();
    177                 GridBagConstraints c = new GridBagConstraints();
    178 
    179                 editControlsPane.setLayout(gridbag);
    180 
    181                 editControlsPane.setBorder(BorderFactory.createEmptyBorder(15,15,15,15));
    182 
    183 
    184                 String streetName = selectedStreet.get("name");
    185                 String streetRelation = FindRelation();
    186                 if (streetRelation.equals("")) {
    187                         streetRelation = " (Create new)";
    188                 }
    189                 streetNameButton = new JRadioButton(tr("Name: {0}", streetName));
    190                 streetRelationButton = new JRadioButton(tr("Relation: {0}", streetRelation));
    191                 if (associatedStreetRelation == null) {
    192                         streetNameButton.setSelected(true);
    193                 }else {
    194                         streetRelationButton.setSelected(true);
    195                 }
    196 
    197                 // Create edit controls for street / relation radio buttons
    198                 ButtonGroup group = new ButtonGroup();
    199                 group.add(streetNameButton);
    200                 group.add(streetRelationButton);
    201                 JPanel radioButtonPanel = new JPanel(new BorderLayout());
    202                 radioButtonPanel.setBorder(BorderFactory.createTitledBorder(tr("Associate with street using:")));
    203                 radioButtonPanel.add(streetNameButton, BorderLayout.NORTH);
    204                 radioButtonPanel.add(streetRelationButton, BorderLayout.SOUTH);
    205 
    206                 // Add to edit panel
    207                 c.gridx = 0;
    208                 c.gridwidth = 2; // # of columns to span
    209                 c.fill = GridBagConstraints.HORIZONTAL;      // Full width
    210                 c.gridwidth = GridBagConstraints.REMAINDER;     //end row
    211                 editControlsPane.add(radioButtonPanel, c);
    212 
    213                 JLabel numberingLabel = new JLabel(tr("Numbering Scheme:"));
    214                 addrInterpolationList = new JComboBox(addrInterpolationStrings);
    215 
    216                 JLabel incrementLabel = new JLabel(tr("Increment:"));
    217                 incrementTextField = new JTextField(lastIncrement, 100);
    218                 incrementTextField.setEnabled(false);
    219 
    220                 JLabel startLabel = new JLabel(tr("Starting #:"));
    221                 JLabel endLabel = new JLabel(tr("Ending #:"));
    222 
    223                 startTextField = new JTextField(10);
    224                 endTextField = new JTextField(10);
    225 
    226                 JLabel inclusionLabel = new JLabel(tr("Accuracy:"));
    227                 addrInclusionList = new JComboBox(addrInclusionStrings);
    228                 addrInclusionList.setSelectedIndex(lastAccuracyIndex);
    229 
    230                 // Preload any values already set in map
    231                 GetExistingMapKeys();
    232 
    233 
    234                 JLabel[] textLabels = {startLabel, endLabel, numberingLabel, incrementLabel, inclusionLabel};
    235                 Component[] editFields = {startTextField, endTextField, addrInterpolationList, incrementTextField, addrInclusionList};
    236                 AddEditControlRows(textLabels, editFields,      editControlsPane);
    237 
    238                 cbConvertToHouseNumbers = new Checkbox(tr("Convert way to individual house numbers."), null, lastConvertToHousenumber);
    239                 // cbConvertToHouseNumbers.setSelected(lastConvertToHousenumber);
    240 
    241                 // Address interpolation fields not valid if Way not selected
    242                 if (addrInterpolationWay == null) {
    243                         addrInterpolationList.setEnabled(false);
    244                         startTextField.setEnabled(false);
    245                         endTextField.setEnabled(false);
    246                         cbConvertToHouseNumbers.setEnabled(false);
    247                 }
    248 
    249 
    250 
    251                 JPanel optionPanel = CreateOptionalFields();
    252                 c.gridx = 0;
    253                 c.gridwidth = 2; // # of columns to span
    254                 c.fill = GridBagConstraints.BOTH;      // Full width
    255                 c.gridwidth = GridBagConstraints.REMAINDER;     //end row
    256 
    257                 editControlsPane.add(optionPanel, c);
    258 
    259 
    260                 KeyAdapter enterProcessor = new KeyAdapter() {
    261                         @Override
    262                         public void keyPressed(KeyEvent e) {
    263                                 if (e.getKeyCode() == KeyEvent.VK_ENTER) {
    264                                         if (ValidateAndSave()) {
    265                                                 dialog.dispose();
    266                                         }
    267 
    268                                 }
    269                         }
    270                 };
    271 
    272                 // Make Enter == OK click on fields using this adapter
    273                 endTextField.addKeyListener(enterProcessor);
    274                 cityTextField.addKeyListener(enterProcessor);
    275                 addrInterpolationList.addKeyListener(enterProcessor);
    276                 incrementTextField.addKeyListener(enterProcessor);
    277 
    278 
    279                 // Watch when Interpolation Method combo box is selected so that
    280                 // it can auto-detect method based on entered numbers.
    281                 addrInterpolationList.addFocusListener(new FocusAdapter() {
    282                         @Override
    283                         public void focusGained(FocusEvent fe){
    284                                 if (!interpolationMethodSet) {
    285                                         if (AutoDetectInterpolationMethod()) {
    286                                                 interpolationMethodSet = true;  // Don't auto detect over a previous choice
    287                                         }
    288                                 }
    289                         }
    290                 });
    291 
    292 
    293                 // Watch when Interpolation Method combo box is changed so that
    294                 // Numeric increment box can be enabled or disabled.
    295                 addrInterpolationList.addActionListener(new ActionListener() {
    296                         public void actionPerformed(ActionEvent e){
    297                                 int selectedIndex = addrInterpolationList.getSelectedIndex();
    298                                 incrementTextField.setEnabled(selectedIndex == NumericIndex); // Enable or disable numeric field
    299                         }
    300                 });
    301 
    302 
    303                 editControlsPane.add(cbConvertToHouseNumbers, c);
    304 
    305 
    306 
    307                 if (houseNumberNodes.size() > 0) {
    308                         JLabel houseNumberNodeNote = new JLabel(tr("Will associate {0} additional house number nodes",
    309                                         houseNumberNodes.size() ));
    310                         editControlsPane.add(houseNumberNodeNote, c);
    311                 }
    312 
    313                 editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation",
    314                                 tr("More information about this feature")), c);
    315 
    316 
    317                 c.gridx = 0;
    318                 c.gridwidth = 1; //next-to-last
    319                 c.fill = GridBagConstraints.NONE;      //reset to default
    320                 c.weightx = 0.0;
    321                 c.insets = new Insets(15, 0, 0, 0);
    322                 c.anchor = GridBagConstraints.LINE_END;
    323                 JButton okButton = new JButton(tr("OK"), ImageProvider.get("ok"));
    324                 editControlsPane.add(okButton, c);
    325 
    326                 c.gridx = 1;
    327                 c.gridwidth = GridBagConstraints.REMAINDER;     //end row
    328                 c.weightx = 1.0;
    329                 c.anchor = GridBagConstraints.LINE_START;
    330 
    331                 JButton cancelButton = new JButton(tr("Cancel"), ImageProvider.get("cancel"));
    332                 editControlsPane.add(cancelButton, c);
    333 
    334                 okButton.setActionCommand("ok");
    335                 okButton.addActionListener(this);
    336                 cancelButton.setActionCommand("cancel");
    337                 cancelButton.addActionListener(this);
    338 
    339                 return editControlsPane;
    340         }
    341 
    342 
    343 
    344         // Call after both starting and ending housenumbers have been entered - usually when
    345         // combo box gets focus.
    346         // Return true if a method was detected
    347         private boolean AutoDetectInterpolationMethod() {
    348 
    349                 String startValueString = ReadTextField(startTextField);
    350                 String endValueString = ReadTextField(endTextField);
    351                 if ( (startValueString == null) || (endValueString== null) ) {
    352                         // Not all values entered yet
    353                         return false;
    354                 }
    355 
    356                 // String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", ### };  // Tag values for map
    357 
    358                 if (isLong(startValueString) && isLong(endValueString)) {
    359                         // Have 2 numeric values
    360                         long startValue = Long.parseLong( startValueString );
    361                         long endValue = Long.parseLong( endValueString );
    362 
    363                         if (isEven(startValue)) {
    364                                 if (isEven(endValue)) {
    365                                         SelectInterpolationMethod("even");
    366                                 }
    367                                 else {
    368                                         SelectInterpolationMethod("all");
    369                                 }
    370                         } else {
    371                                 if (!isEven(endValue)) {
    372                                         SelectInterpolationMethod("odd");
    373                                 }
    374                                 else {
    375                                         SelectInterpolationMethod("all");
    376                                 }
    377                         }
    378 
    379 
    380                 } else {
    381                         // Test for possible alpha
    382                         char startingChar = startValueString.charAt(startValueString.length()-1);
    383                         char endingChar = endValueString.charAt(endValueString.length()-1);
    384 
    385                         if ( (!IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
    386                                 // Both end with alpha
    387                                 SelectInterpolationMethod("alphabetic");
    388                                 return true;
    389                         }
    390 
    391                         if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
    392                                 endingChar = Character.toUpperCase(endingChar);
    393                                 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
    394                                         // First is a number, last is Latin alpha
    395                                         SelectInterpolationMethod("alphabetic");
    396                                         return true;
    397                                 }
    398                         }
    399                        
    400                         // Did not detect alpha
    401                         return false;
    402 
    403                 }
    404                
    405                 return true;
    406 
    407         }
    408 
    409 
    410 
    411         // Set Interpolation Method combo box to method specified by 'currentMethod' (an OSM key value)
    412         private void SelectInterpolationMethod(String currentMethod) {
    413                 int currentIndex = 0;
    414                 if (isLong(currentMethod)) {
    415                         // Valid number: Numeric increment method
    416                         currentIndex = addrInterpolationTags.length-1;
    417                         incrementTextField.setText(currentMethod);
    418                         incrementTextField.setEnabled(true);
    419                 }
    420                 else {
    421                         // Must scan OSM key values because combo box is already loaded with translated strings
    422                         for (int i=0; i<addrInterpolationTags.length; i++) {
    423                                 if (addrInterpolationTags[i].equals(currentMethod)) {
    424                                         currentIndex = i;
    425                                         break;
    426                                 }
    427                         }
    428                 }
    429                 addrInterpolationList.setSelectedIndex(currentIndex);
    430 
    431         }
    432 
    433 
    434         // Set Inclusion Method combo box to method specified by 'currentMethod' (an OSM key value)
    435         private void SelectInclusion(String currentMethod) {
    436                 int currentIndex = 0;
    437                 // Must scan OSM key values because combo box is already loaded with translated strings
    438                 for (int i=0; i<addrInclusionTags.length; i++) {
    439                         if (addrInclusionTags[i].equals(currentMethod)) {
    440                                 currentIndex = i;
    441                                 break;
    442                         }
    443                 }
    444                 addrInclusionList.setSelectedIndex(currentIndex);
    445 
    446         }
    447 
    448 
    449 
    450         // Create optional control fields in a group box
    451         private JPanel CreateOptionalFields() {
    452 
    453                 JPanel editControlsPane = new JPanel();
    454                 GridBagLayout gridbag = new GridBagLayout();
    455 
    456                 editControlsPane.setLayout(gridbag);
    457 
    458                 editControlsPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    459 
    460                 JLabel[] optionalTextLabels = {new JLabel(tr("City:")),
    461                                 new JLabel(tr("State:")),
    462                                 new JLabel(tr("Post Code:")),
    463                                 new JLabel(tr("Country:")),
    464                                 new JLabel(tr("Full Address:"))};
    465                 cityTextField = new JTextField(lastCity, 100);
    466                 stateTextField = new JTextField(lastState, 100);
    467                 postCodeTextField = new JTextField(lastPostCode, 20);
    468                 countryTextField = new JTextField(lastCountry, 2);
    469                 fullTextField = new JTextField(lastFullAddress, 300);
    470 
    471                 // Special processing for addr:country code, max length and uppercase
    472                 countryTextField.addKeyListener(new KeyAdapter() {
    473                         @Override
    474                         public void keyTyped(KeyEvent e) {
    475                                 JTextField jtextfield = (JTextField)e.getSource();
    476                                 String text = jtextfield.getText();
    477                                 int length = text.length();
    478                                 if (length == jtextfield.getColumns()) {
    479                                         e.consume();
    480                                 } else if (length > jtextfield.getColumns()) {
    481                                         // show error message ??
    482                                         e.consume();
    483                                 } else {
    484                                         // Accept key; convert to upper case
    485                                         if (!e.isActionKey()) {
    486                                                 e.setKeyChar(Character.toUpperCase(e.getKeyChar()) );
    487                                         }
    488                                 }
    489                         }
    490                 });
    491 
    492                 Component[] optionalEditFields = {cityTextField, stateTextField, postCodeTextField, countryTextField, fullTextField};
    493                 AddEditControlRows(optionalTextLabels, optionalEditFields,      editControlsPane);
    494 
    495 
    496 
    497                 JPanel optionPanel = new JPanel(new BorderLayout());
    498                 Border groupBox = BorderFactory.createEtchedBorder();
    499                 TitledBorder titleBorder = BorderFactory.createTitledBorder(groupBox, tr("Optional Information:"),
    500                                 TitledBorder.LEFT, TitledBorder.TOP);
    501 
    502                 optionPanel.setBorder(titleBorder);
    503                 optionPanel.add(editControlsPane, BorderLayout.CENTER);
    504 
    505                 return optionPanel;
    506         }
    507 
    508 
    509 
    510         // Populate dialog for any possible existing settings if editing an existing Address interpolation way
    511         private void GetExistingMapKeys() {
    512 
    513 
    514                 // Check all nodes for optional addressing data
    515                 //    Address interpolation nodes will overwrite these value if they contain optional data
    516                 for (Node node : houseNumberNodes) {
    517                         CheckNodeForAddressTags(node);
    518                 }
    519 
    520                 if (addrInterpolationWay != null) {
    521                         String currentMethod = addrInterpolationWay.get("addr:interpolation");
    522                         if (currentMethod != null) {
    523 
    524                                 SelectInterpolationMethod(currentMethod);
    525                                 interpolationMethodSet = true;  // Don't auto detect over a previous choice
    526                         }
    527 
    528                         String currentInclusion = addrInterpolationWay.get("addr:inclusion");
    529                         if (currentInclusion != null) {
    530                                 SelectInclusion(currentInclusion);
    531                         }
    532 
    533                         Node firstNode = addrInterpolationWay.getNode(0);
    534                         Node lastNode = addrInterpolationWay.getNode(addrInterpolationWay.getNodesCount()-1);
    535 
    536                         // Get any existing start / end # values
    537                         String value = firstNode.get("addr:housenumber");
    538                         if (value != null) {
    539                                 startTextField.setText(value);
    540                         }
    541 
    542                         value = lastNode.get("addr:housenumber");
    543                         if (value != null) {
    544                                 endTextField.setText(value);
    545                         }
    546                         CheckNodeForAddressTags(firstNode);
    547                         CheckNodeForAddressTags(lastNode);
    548 
    549                 }
    550 
    551 
    552 
    553         }
    554 
    555 
    556         // Check for any existing address data.   If found,
    557         // overwrite any previous data
    558         private void CheckNodeForAddressTags(Node checkNode) {
    559 
    560                 // Interrogate possible existing optional values
    561                 String value = checkNode.get("addr:city");
    562                 if (value != null) {
    563                         lastCity = value;
    564                 }
    565                 value = checkNode.get("addr:state");
    566                 if (value != null) {
    567                         lastState = value;
    568                 }
    569                 value = checkNode.get("addr:postcode");
    570                 if (value != null) {
    571                         lastPostCode = value;
    572                 }
    573                 value = checkNode.get("addr:country");
    574                 if (value != null) {
    575                         lastCountry = value;
    576                 }
    577                 value = checkNode.get("addr:full");
    578                 if (value != null) {
    579                         lastFullAddress = value;
    580                 }
    581 
    582         }
    583 
    584 
    585 
    586         // Look for a possible 'associatedStreet' type of relation for selected street
    587         // Returns relation description, or an empty string
    588         private String FindRelation() {
    589                 String relationDescription = null;
    590                 DataSet currentDataSet = Main.main.getCurrentDataSet();
    591                 if (currentDataSet != null) {
    592                         for (Relation relation : currentDataSet.getRelations()) {
    593 
    594                                 String relationType = relation.get("type");
    595                                 if (relationType != null) {
    596                                         if (relationType.equals("associatedStreet")) {
    597                                                 for (RelationMember relationMember : relation.getMembers()) {
    598                                                         if (relationMember.isWay()){
    599                                                                 Way way = (Way) relationMember.getMember();
    600                                                                 // System.out.println("Name: " + way.get("name") );
    601                                                                 if (way == selectedStreet) {
    602                                                                         associatedStreetRelation = relation;
    603                                                                         relationDescription = Long.toString(way.getId());
    604 
    605                                                                         String streetName = "";
    606                                                                         if (relation.getKeys().containsKey("name")) {
    607                                                                                 streetName =  relation.get("name");
    608                                                                         } else {
    609                                                                                 // Relation is unnamed - use street name
    610                                                                                 streetName =  selectedStreet.get("name");
    611                                                                         }
    612                                                                         relationDescription += " (" + streetName + ")";
    613                                                                         return relationDescription;
    614                                                                 }
    615                                                         }
    616 
    617                                                 }
    618                                         }
    619 
    620                                 }
    621                         }
    622 
    623                 }
    624 
    625                 return "";
    626         }
    627 
    628 
    629         // We can proceed only if there is both a named way (the 'street') and
    630         // one un-named way (the address interpolation way ) selected.
    631         //    The plugin menu item is enabled after a single way is selected to display a more meaningful
    632         //    message (a new user may not realize that they need to select both the street and
    633         //    address interpolation way first).
    634         // Also, selected street and working address interpolation ways are saved.
    635         private boolean FindAndSaveSelections() {
    636 
    637                 boolean isValid = false;
    638 
    639                 int namedWayCount = 0;
    640                 int unNamedWayCount = 0;
    641                 DataSet currentDataSet = Main.main.getCurrentDataSet();
    642                 if (currentDataSet != null) {
    643                         for (OsmPrimitive osm : currentDataSet.getSelectedWays()) {
    644                                 Way way = (Way) osm;
    645                                 if (way.getKeys().containsKey("name")) {
    646                                         namedWayCount++;
    647                                         this.selectedStreet = way;
    648                                 }
    649                                 else {
    650                                         unNamedWayCount++;
    651                                         this.addrInterpolationWay = way;
    652                                 }
    653                         }
    654 
    655                         // Get additional nodes with addr:housenumber tags:
    656                         //   Either selected or in the middle of the Address Interpolation way
    657                         //     Do not include end points of Address Interpolation way in this set yet.
    658                         houseNumberNodes  = new ArrayList<Node>();
    659                         // Check selected nodes
    660                         for (OsmPrimitive osm : currentDataSet.getSelectedNodes()) {
    661                                 Node node = (Node) osm;
    662                                 if (node.getKeys().containsKey("addr:housenumber")) {
    663                                         houseNumberNodes.add(node);
    664                                 }
    665                         }
    666 
    667                         if (addrInterpolationWay != null) {
    668                                 // Check nodes in middle of address interpolation way
    669                                 if (addrInterpolationWay.getNodesCount() > 2) {
    670                                         for (int i=1; i<(addrInterpolationWay.getNodesCount()-2); i++) {
    671                                                 Node testNode = addrInterpolationWay.getNode(i);
    672                                                 if (testNode.getKeys().containsKey("addr:housenumber")) {
    673                                                         houseNumberNodes.add(testNode);
    674                                                 }
    675                                         }
    676                                 }
    677                         }
    678 
    679                 }
    680 
    681                 if (namedWayCount != 1) {
    682                         JOptionPane.showMessageDialog(
    683                                         Main.parent,
    684                                         tr("Please select a street to associate with address interpolation way"),
    685                                         tr("Error"),
    686                                         JOptionPane.ERROR_MESSAGE
    687                         );
    688                 } else {
    689                         // Avoid 2 error dialogs if both conditions don't match
    690                         if (unNamedWayCount != 1) {
    691                                 // Allow for street + house number nodes only to be selected (no address interpolation way).
    692                                 if (houseNumberNodes.size() > 0) {
    693                                         isValid = true;
    694                                 } else {
    695                                         JOptionPane.showMessageDialog(
    696                                                         Main.parent,
    697                                                         tr("Please select address interpolation way for this street"),
    698                                                         tr("Error"),
    699                                                         JOptionPane.ERROR_MESSAGE
    700                                         );
    701                                 }
    702                         } else {
    703                                 isValid = true;
    704                         }
    705                 }
    706 
    707 
    708                 return isValid;
    709         }
    710 
    711 
    712         /**
    713         * Add rows of edit controls - with labels in the left column, and controls in the right
    714         * column on the gridbag of the specified container.
    715         */
    716         private void AddEditControlRows(JLabel[] labels,
    717                         Component[] editFields,
    718                         Container container) {
    719                 GridBagConstraints c = new GridBagConstraints();
    720                 c.anchor = GridBagConstraints.EAST;
    721                 int numLabels = labels.length;
    722 
    723                 for (int i = 0; i < numLabels; i++) {
    724                         c.gridx = 0;
    725                         c.gridwidth = 1; //next-to-last
    726                         c.fill = GridBagConstraints.NONE;      //reset to default
    727                         c.weightx = 0.0;                       //reset to default
    728                         container.add(labels[i], c);
    729 
    730                         c.gridx = 1;
    731                         c.gridwidth = GridBagConstraints.REMAINDER;     //end row
    732                         c.fill = GridBagConstraints.HORIZONTAL;
    733                         c.weightx = 1.0;
    734                         container.add(editFields[i], c);
    735                 }
    736         }
    737 
    738 
    739 
    740         public void actionPerformed(ActionEvent e) {
    741                 if ("ok".equals(e.getActionCommand())) {
    742                         if (ValidateAndSave()) {
    743                                 dialog.dispose();
    744                         }
    745 
    746                 } else  if ("cancel".equals(e.getActionCommand())) {
    747                         dialog.dispose();
    748 
    749                 }
    750         }
    751 
    752 
    753 
    754         // For Alpha interpolation, return base string
    755         //   For example: "22A" -> "22"
    756         //   For example: "A" -> ""
    757         //    Input string must not be empty
    758         private String BaseAlpha(String strValue) {
    759                 if (strValue.length() > 0) {
    760                         return strValue.substring(0, strValue.length()-1);
    761                 }
    762                 else {
    763                         return "";
    764                 }
    765         }
    766 
    767 
    768         private char LastChar(String strValue) {
    769                 if (strValue.length() > 0) {
    770                         return strValue.charAt(strValue.length()-1);
    771                 }
    772                 else {
    773                         return 0;
    774                 }
    775         }
    776 
    777 
    778         // Test for valid positive long int
    779         private boolean isLong( String input )
    780         {
    781                 try
    782                 {
    783                         Long val = Long.parseLong( input );
    784                         return (val > 0);
    785                 }
    786                 catch( Exception e)
    787                 {
    788                         return false;
    789                 }
    790         }
    791 
    792         private boolean isEven( Long input )
    793         {
    794                 return ((input %2) == 0);
    795         }
    796 
    797         private static Pattern p = Pattern.compile("^[0-9]+$");
    798         private static boolean IsNumeric(String s) {
    799                 return p.matcher(s).matches();
    800         }
    801 
    802 
    803         private void InterpolateAlphaSection(int startNodeIndex, int endNodeIndex, String endValueString,
    804                         char startingChar, char endingChar) {
    805 
    806 
    807                 String baseAlpha = BaseAlpha(endValueString);
    808                 int nSegments  =endNodeIndex - startNodeIndex;
    809 
    810                 double[] segmentLengths = new double[nSegments];
    811                 // Total length of address interpolation way section
    812                 double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
    813 
    814 
    815                 int nHouses = endingChar - startingChar-1;  // # of house number nodes to create
    816                 if (nHouses > 0) {
    817 
    818                         double houseSpacing = totalLength / (nHouses+1);
    819 
    820                         Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex);
    821                         int currentSegment = 0; // Segment being used to place new house # node
    822                         char currentChar= startingChar;
    823                         while (nHouses > 0) {
    824                                 double distanceNeeded = houseSpacing;
    825 
    826                                 // Move along segments until we can place the new house number
    827                                 while (distanceNeeded > segmentLengths[currentSegment]) {
    828                                         distanceNeeded -= segmentLengths[currentSegment];
    829                                         currentSegment++;
    830                                         lastHouseNode = addrInterpolationWay.getNode(startNodeIndex + currentSegment);
    831                                 }
    832 
    833                                 // House number is to be positioned in current segment.
    834                                 double proportion = distanceNeeded / segmentLengths[currentSegment];
    835                                 Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + currentSegment);
    836                                 LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion);
    837 
    838 
    839 
    840                                 Node newHouseNumberNode = new Node(newHouseNumberPosition);
    841                                 currentChar++;
    842                                 if ( (currentChar >'Z') && (currentChar <'a')) {
    843                                         // Wraparound past uppercase Z: go directly to lower case a
    844                                         currentChar = 'a';
    845 
    846                                 }
    847                                 String newHouseNumber = baseAlpha + currentChar;
    848                                 newHouseNumberNode.put("addr:housenumber", newHouseNumber);
    849 
    850                                 commandGroup.add(new AddCommand(newHouseNumberNode));
    851                                 houseNumberNodes.add(newHouseNumberNode);   // Street, etc information to be added later
    852 
    853                                 lastHouseNode = newHouseNumberNode;
    854 
    855 
    856                                 segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
    857                                 nHouses -- ;
    858                         }
    859                 }
    860 
    861 
    862         }
    863 
    864 
    865         private void CreateAlphaInterpolation(String startValueString, String endValueString) {
    866                 char startingChar = LastChar(startValueString);
    867                 char endingChar = LastChar(endValueString);
    868 
    869                 if (isLong(startValueString)) {
    870                         // Special case of numeric first value, followed by 'A'
    871                         startingChar = 'A'-1;
    872                 }
    873 
    874                 // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
    875                 int startIndex = 0; // Index into first interpolation zone of address interpolation way
    876                 for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
    877                         Node testNode = addrInterpolationWay.getNode(i);
    878                         String endNodeNumber = testNode.get("addr:housenumber");
    879                         if (endNodeNumber != null) {
    880                                 // This is a potential anchor node
    881                                 if (endNodeNumber != "") {
    882                                         char anchorChar = LastChar(endNodeNumber);
    883                                         if ( (anchorChar >startingChar) && (anchorChar < endingChar) ) {
    884                                                 // Lies within the expected range
    885                                                 InterpolateAlphaSection(startIndex, i, endNodeNumber, startingChar, anchorChar);
    886 
    887                                                 // For next interpolation section
    888                                                 startingChar = anchorChar;
    889                                                 startValueString = endNodeNumber;
    890                                                 startIndex = i;
    891                                         }
    892                                 }
    893 
    894                         }
    895                 }
    896 
    897                 // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value
    898                 InterpolateAlphaSection(startIndex, addrInterpolationWay.getNodesCount()-1, endValueString, startingChar, endingChar);
    899 
    900         }
    901 
    902 
    903         private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) {
    904                 Node fromNode = addrInterpolationWay.getNode(startNodeIndex);
    905                 double totalLength = 0.0;
    906                 int nSegments = segmentLengths.length;
    907                 for (int segment = 0; segment < nSegments; segment++) {
    908                         Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + segment);
    909                         segmentLengths[segment]= fromNode.getCoor().greatCircleDistance(toNode.getCoor());
    910                         totalLength += segmentLengths[segment];
    911 
    912                         fromNode = toNode;
    913                 }
    914                 return totalLength;
    915 
    916         }
    917 
    918 
    919         private void InterpolateNumericSection(int startNodeIndex, int endNodeIndex,
    920                         long startingAddr, long endingAddr,
    921                         long increment) {
    922 
    923 
    924                 int nSegments  =endNodeIndex - startNodeIndex;
    925 
    926                 double[] segmentLengths = new double[nSegments];
    927 
    928                 // Total length of address interpolation way section
    929                 double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
    930 
    931 
    932                 int nHouses = (int)((endingAddr - startingAddr) / increment) -1;
    933                 if (nHouses > 0) {
    934 
    935                         double houseSpacing = totalLength / (nHouses+1);
    936 
    937                         Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex);
    938                         int currentSegment = 0; // Segment being used to place new house # node
    939                         long currentHouseNumber = startingAddr;
    940                         while (nHouses > 0) {
    941                                 double distanceNeeded = houseSpacing;
    942 
    943                                 // Move along segments until we can place the new house number
    944                                 while (distanceNeeded > segmentLengths[currentSegment]) {
    945                                         distanceNeeded -= segmentLengths[currentSegment];
    946                                         currentSegment++;
    947                                         lastHouseNode = addrInterpolationWay.getNode(startNodeIndex + currentSegment);
    948                                 }
    949 
    950                                 // House number is to be positioned in current segment.
    951                                 double proportion = distanceNeeded / segmentLengths[currentSegment];
    952                                 Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + currentSegment);
    953                                 LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion);
    954 
    955 
    956                                 Node newHouseNumberNode = new Node(newHouseNumberPosition);
    957                                 currentHouseNumber += increment;
    958                                 String newHouseNumber = Long.toString(currentHouseNumber);
    959                                 newHouseNumberNode.put("addr:housenumber", newHouseNumber);
    960 
    961                                 commandGroup.add(new AddCommand(newHouseNumberNode));
    962                                 houseNumberNodes.add(newHouseNumberNode);   // Street, etc information to be added later
    963 
    964                                 lastHouseNode = newHouseNumberNode;
    965 
    966 
    967                                 segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
    968                                 nHouses -- ;
    969                         }
    970                 }
    971 
    972 
    973         }
    974 
    975 
    976         private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) {
    977 
    978                 long startingAddr = Long.parseLong( startValueString );
    979                 long endingAddr = Long.parseLong( endValueString );
    980 
    981 
    982                 // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
    983                 int startIndex = 0; // Index into first interpolation zone of address interpolation way
    984                 for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
    985                         Node testNode = addrInterpolationWay.getNode(i);
    986                         String strEndNodeNumber = testNode.get("addr:housenumber");
    987                         if (strEndNodeNumber != null) {
    988                                 // This is a potential anchor node
    989                                 if (isLong(strEndNodeNumber)) {
    990 
    991                                         long anchorAddrNumber = Long.parseLong( strEndNodeNumber );
    992                                         if ( (anchorAddrNumber >startingAddr) && (anchorAddrNumber < endingAddr) ) {
    993                                                 // Lies within the expected range
    994                                                 InterpolateNumericSection(startIndex, i, startingAddr, anchorAddrNumber, increment);
    995 
    996                                                 // For next interpolation section
    997                                                 startingAddr = anchorAddrNumber;
    998                                                 startValueString = strEndNodeNumber;
    999                                                 startIndex = i;
    1000                                         }
    1001                                 }
    1002 
    1003                         }
    1004                 }
    1005 
    1006                 // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value
    1007                 InterpolateNumericSection(startIndex, addrInterpolationWay.getNodesCount()-1, startingAddr, endingAddr, increment);
    1008         }
    1009 
    1010 
    1011         // Called if user has checked "Convert to House Numbers" checkbox.
    1012         private void ConvertWayToHousenumbers(String selectedMethod, String startValueString, String endValueString,
    1013                         String incrementString) {
    1014                 // - Use nodes labeled with 'same type' as interim anchors in the middle of the way to identify unequal spacing.
    1015                 // - Ignore nodes of different type; for example '25b' is ignored in sequence 5..15
    1016 
    1017                 // Calculate required number of house numbers to create
    1018                 if (selectedMethod.equals("alphabetic")) {
    1019 
    1020                         CreateAlphaInterpolation(startValueString, endValueString);
    1021 
    1022 
    1023                 } else {
    1024                         long increment = 1;
    1025                         if (selectedMethod.equals("odd") || selectedMethod.equals("even")) {
    1026                                 increment = 2;
    1027                         } else if (selectedMethod.equals("Numeric")) {
    1028                                 increment = Long.parseLong(incrementString);
    1029                         }
    1030                         CreateNumericInterpolation(startValueString, endValueString, increment);
    1031 
    1032                 }
    1033 
    1034 
    1035                 RemoveAddressInterpolationWay();
    1036 
    1037         }
    1038 
    1039 
    1040         private void RemoveAddressInterpolationWay() {
    1041 
    1042                 // Remove untagged nodes
    1043                 for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
    1044                         Node testNode = addrInterpolationWay.getNode(i);
    1045                         if (!testNode.hasKeys()) {
    1046                                 commandGroup.add(new DeleteCommand(testNode));
    1047                         }
    1048                 }
    1049 
    1050                 // Remove way
    1051                 commandGroup.add(new DeleteCommand(addrInterpolationWay));
    1052                 addrInterpolationWay = null;
    1053 
    1054         }
    1055 
    1056 
    1057 
    1058         private boolean ValidateAndSave() {
    1059 
    1060                 String startValueString = ReadTextField(startTextField);
    1061                 String endValueString = ReadTextField(endTextField);
    1062                 String incrementString = ReadTextField(incrementTextField);
    1063                 String city = ReadTextField(cityTextField);
    1064                 String state = ReadTextField(stateTextField);
    1065                 String postCode = ReadTextField(postCodeTextField);
    1066                 String country = ReadTextField(countryTextField);
    1067                 String fullAddress = ReadTextField(fullTextField);
    1068 
    1069                 String selectedMethod = GetInterpolationMethod();
    1070                 if (addrInterpolationWay != null) {
    1071                         Long startAddr=0L, endAddr=0L;
    1072                         if (!selectedMethod.equals("alphabetic")) {
    1073                                 Long[] addrArray = {startAddr, endAddr};
    1074                                 if (!ValidAddressNumbers(startValueString, endValueString, addrArray )) {
    1075                                         return false;
    1076                                 }
    1077                                 startAddr = addrArray[0];
    1078                                 endAddr = addrArray[1];
    1079                         }
    1080 
    1081                         String errorMessage = "";
    1082                         if (selectedMethod.equals("odd")) {
    1083                                 if (isEven(startAddr) || isEven(endAddr)) {
    1084                                         errorMessage = tr("Expected odd numbers for addresses");
    1085                                 }
    1086 
    1087                         } else if (selectedMethod.equals("even")) {
    1088                                 if (!isEven(startAddr) || !isEven(endAddr)) {
    1089                                         errorMessage = tr("Expected even numbers for addresses");
    1090                                 }
    1091                         } else if (selectedMethod.equals("all")) {
    1092 
    1093                         }else if (selectedMethod.equals("alphabetic")) {
    1094                                 errorMessage = ValidateAlphaAddress(startValueString, endValueString);
    1095 
    1096                         }else if (selectedMethod.equals("Numeric")) {
    1097 
    1098                                 if (!ValidNumericIncrementString(incrementString, startAddr, endAddr)) {
    1099                                         errorMessage = tr("Expected valid number for address increment");
    1100                                 }
    1101 
    1102                         }
    1103                         if (!errorMessage.equals("")) {
    1104                                 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
    1105                                 return false;
    1106                         }
    1107                 }
    1108 
    1109                 if (country != null) {
    1110                         if (country.length() != 2) {
    1111                                 JOptionPane.showMessageDialog(Main.parent,
    1112                                                 tr("Country code must be 2 letters"), tr("Error"),      JOptionPane.ERROR_MESSAGE);
    1113                                 return false;
    1114                         }
    1115                 }
    1116 
    1117                 // Entries are valid ... save in map
    1118 
    1119                 commandGroup = new LinkedList<Command>();
    1120 
    1121                 String streetName = selectedStreet.get("name");
    1122 
    1123                 if (addrInterpolationWay != null) {
    1124 
    1125                         Node firstNode = addrInterpolationWay.getNode(0);
    1126                         Node lastNode = addrInterpolationWay.getNode(addrInterpolationWay.getNodesCount()-1);
    1127 
    1128                         // De-select address interpolation way; leave street selected
    1129                         DataSet currentDataSet = Main.main.getCurrentDataSet();
    1130                         if (currentDataSet != null) {
    1131                                 currentDataSet.clearSelection(addrInterpolationWay);
    1132                                 currentDataSet.clearSelection(lastNode);  // Workaround for JOSM Bug #3838
    1133                         }
    1134 
    1135 
    1136                         String interpolationTagValue = selectedMethod;
    1137                         if (selectedMethod.equals("Numeric")) {
    1138                                 // The interpolation method is the number for 'Numeric' case
    1139                                 interpolationTagValue = incrementString;
    1140                         }
    1141 
    1142                         if (cbConvertToHouseNumbers.getState()) {
    1143                                 // Convert way to house numbers is checked.
    1144                                 //  Create individual nodes and delete interpolation way
    1145                                 ConvertWayToHousenumbers(selectedMethod, startValueString, endValueString, incrementString);
    1146                         } else {
    1147                                 // Address interpolation way will remain
    1148                                 commandGroup.add(new ChangePropertyCommand(addrInterpolationWay, "addr:interpolation", interpolationTagValue));
    1149                                 commandGroup.add(new ChangePropertyCommand(addrInterpolationWay, "addr:inclusion", GetInclusionMethod()));
    1150                         }
    1151 
    1152                         commandGroup.add(new ChangePropertyCommand(firstNode, "addr:housenumber", startValueString));
    1153                         commandGroup.add(new ChangePropertyCommand(lastNode, "addr:housenumber", endValueString));
    1154                         // Add address interpolation house number nodes to main house number node list for common processing
    1155                         houseNumberNodes.add(firstNode);
    1156                         houseNumberNodes.add(lastNode);
    1157 
    1158                 }
    1159 
    1160 
    1161 
    1162                 if (streetRelationButton.isSelected()) {
    1163 
    1164                         // Relation button was selected
    1165                         if (associatedStreetRelation == null) {
    1166                                 CreateRelation(streetName);
    1167                                 // relationChanged = true;   (not changed since it was created)
    1168                         }
    1169                         // Make any additional changes only to the copy
    1170                         editedRelation = new Relation(associatedStreetRelation);
    1171 
    1172                         if (addrInterpolationWay != null) {
    1173                                 AddToRelation(associatedStreetRelation, addrInterpolationWay, "house");
    1174                         }
    1175                 }
    1176 
    1177 
    1178                 // For all nodes, add to relation and
    1179                 //   Add optional text fields to all nodes if specified
    1180                 for (Node node : houseNumberNodes) {
    1181 
    1182                         if (streetRelationButton.isSelected()) {
    1183                                 AddToRelation(associatedStreetRelation, node, "house");
    1184                         }
    1185                         if ((city != null) || (streetNameButton.isSelected()) ) {
    1186                                 // Include street unconditionally if adding nodes only or city name specified
    1187                                 commandGroup.add(new ChangePropertyCommand(node, "addr:street", streetName));
    1188                         }
    1189                         // Set or remove remaining optional fields
    1190                         commandGroup.add(new ChangePropertyCommand(node, "addr:city", city));
    1191                         commandGroup.add(new ChangePropertyCommand(node, "addr:state", state));
    1192                         commandGroup.add(new ChangePropertyCommand(node, "addr:postcode", postCode));
    1193                         commandGroup.add(new ChangePropertyCommand(node, "addr:country", country));
    1194                         commandGroup.add(new ChangePropertyCommand(node, "addr:full", fullAddress));
    1195                 }
    1196 
    1197                 if (relationChanged) {
    1198                         commandGroup.add(new ChangeCommand(associatedStreetRelation, editedRelation));
    1199                 }
    1200 
    1201 
    1202                 Main.main.undoRedo.add(new SequenceCommand(tr("Address Interpolation"), commandGroup));
    1203                 Main.map.repaint();
    1204 
    1205                 return true;
    1206         }
    1207 
    1208 
    1209         private boolean ValidNumericIncrementString(String incrementString, long startingAddr, long endingAddr) {
    1210 
    1211                 if (!isLong(incrementString)) {
    1212                         return false;
    1213                 }
    1214                 long testIncrement = Long.parseLong(incrementString);
    1215                 if ( (testIncrement <=0) || (testIncrement > endingAddr ) ) {
    1216                         return false;
    1217                 }
    1218 
    1219                 if ( ((endingAddr - startingAddr) % testIncrement) != 0) {
    1220                         return false;
    1221                 }
    1222                 return true;
    1223         }
    1224 
    1225 
    1226 
    1227         // Create Associated Street relation, add street, and add to list of commands to perform
    1228         private void CreateRelation(String streetName) {
    1229                 associatedStreetRelation = new Relation();
    1230                 associatedStreetRelation.put("name", streetName);
    1231                 associatedStreetRelation.put("type", "associatedStreet");
    1232                 RelationMember newStreetMember = new RelationMember("street", selectedStreet);
    1233                 associatedStreetRelation.addMember(newStreetMember);
    1234                 commandGroup.add(new AddCommand(associatedStreetRelation));
    1235         }
    1236 
    1237 
    1238 
    1239         // Read from dialog text box, removing leading and trailing spaces
    1240         // Return the string, or null for a zero length string
    1241         private String ReadTextField(JTextField field) {
    1242                 String value = field.getText();
    1243                 if (value != null) {
    1244                         value = value.trim();
    1245                         if (value.equals("")) {
    1246                                 value = null;
    1247                         }
    1248                 }
    1249                 return value;
    1250         }
    1251 
    1252 
    1253         // Test if relation contains specified member
    1254         //   If not already present, it is added
    1255         private void AddToRelation(Relation relation,   OsmPrimitive testMember, String role) {
    1256                 boolean isFound = false;
    1257                 for (RelationMember relationMember : relation.getMembers()) {
    1258 
    1259                         if (testMember == relationMember.getMember()) {
    1260                                 isFound = true;
    1261                                 break;
    1262                         }
    1263                 }
    1264 
    1265                 if (!isFound) {
    1266                         RelationMember newMember = new RelationMember(role, testMember);
    1267                         editedRelation.addMember(newMember);
    1268 
    1269                         relationChanged = true;
    1270                 }
    1271         }
    1272 
    1273 
    1274 
    1275         // Check alphabetic style address
    1276         //   Last character of both must be alpha
    1277         //   Last character of ending must be greater than starting
    1278         //   Return empty error message if OK
    1279         private String ValidateAlphaAddress(String startValueString,
    1280                         String endValueString) {
    1281                 String errorMessage="";
    1282 
    1283                 if (startValueString.equals("") || endValueString.equals("")) {
    1284                         errorMessage = tr("Please enter valid number for starting and ending address");
    1285                 } else {
    1286                         char startingChar = LastChar(startValueString);
    1287                         char endingChar = LastChar(endValueString);
    1288 
    1289 
    1290                         boolean isOk = false;
    1291                         if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
    1292                                 endingChar = Character.toUpperCase(endingChar);
    1293                                 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
    1294                                         // First is a number, last is Latin alpha
    1295                                         isOk = true;
    1296                                 }
    1297                         } else if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) {
    1298                                 // Both are alpha
    1299                                 isOk = true;
    1300                         }
    1301                         if (!isOk) {
    1302                                 errorMessage = tr("Alphabetic address must end with a letter");
    1303                         }
    1304 
    1305 
    1306                         // if a number is included, validate that it is the same number
    1307                         if (endValueString.length() > 1) {
    1308 
    1309                                 // Get number portion of first item: may or may not have letter suffix
    1310                                 String numStart = BaseAlpha(startValueString);
    1311                                 if (IsNumeric(startValueString)) {
    1312                                         numStart = startValueString;
    1313                                 }
    1314 
    1315                                 String numEnd = BaseAlpha(endValueString);
    1316                                 if (!numStart.equals(numEnd)) {
    1317                                         errorMessage = tr("Starting and ending numbers must be the same for alphabetic addresses");
    1318                                 }
    1319                         }
    1320 
    1321                         // ?? Character collation in all languages ??
    1322                         if (startingChar >= endingChar) {
    1323                                 errorMessage = tr("Starting address letter must be less than ending address letter");
    1324                         }
    1325 
    1326                 }
    1327 
    1328                 return errorMessage;
    1329         }
    1330 
    1331 
    1332 
    1333         // Convert string addresses to numeric, with error check
    1334         private boolean ValidAddressNumbers(String startValueString,
    1335                         String endValueString, Long[] addrArray) {
    1336                 String errorMessage = "";
    1337 
    1338                 if (!isLong(startValueString)) {
    1339                         errorMessage = tr("Please enter valid number for starting address");
    1340                 }
    1341                 if (!isLong(endValueString)) {
    1342                         errorMessage = tr("Please enter valid number for ending address");
    1343                 }
    1344                 if (errorMessage.equals("")) {
    1345                         addrArray[0] = Long.parseLong( startValueString );
    1346                         addrArray[1] = Long.parseLong( endValueString );
    1347 
    1348                         if (addrArray[1] <= addrArray[0]) {
    1349                                 errorMessage = tr("Starting address number must be less than ending address number");
    1350                         }
    1351                 }
    1352 
    1353                 if (errorMessage.equals("")) {
    1354                         return true;
    1355 
    1356                 } else {
    1357                         JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
    1358                         return false;
    1359                 }
    1360         }
    1361 
    1362 
    1363 
    1364         private String GetInterpolationMethod() {
    1365                 int selectedIndex = addrInterpolationList.getSelectedIndex();
    1366                 return addrInterpolationTags[selectedIndex];
    1367         }
    1368 
    1369 
    1370         private String GetInclusionMethod() {
    1371                 int selectedIndex = addrInclusionList.getSelectedIndex();
    1372                 lastAccuracyIndex = selectedIndex;
    1373                 return addrInclusionTags[selectedIndex];
    1374         }
     71    private Way selectedStreet = null;
     72    private Way addrInterpolationWay = null;
     73    private Relation associatedStreetRelation = null;
     74    private ArrayList<Node> houseNumberNodes = null;  // Additional nodes with addr:housenumber
     75
     76    private static String lastIncrement = "";
     77    private static int lastAccuracyIndex = 0;
     78    private static String lastCity = "";
     79    private static String lastState = "";
     80    private static String lastPostCode = "";
     81    private static String lastCountry = "";
     82    private static String lastFullAddress = "";
     83    private static boolean lastConvertToHousenumber = false;
     84
     85    // Edit controls
     86    private EscapeDialog dialog=null;
     87    private JRadioButton streetNameButton = null;
     88    private JRadioButton streetRelationButton  = null;
     89    private JTextField startTextField = null;
     90    private JTextField endTextField = null;
     91    private JTextField incrementTextField = null;
     92    private JTextField cityTextField = null;
     93    private JTextField stateTextField = null;
     94    private JTextField postCodeTextField = null;
     95    private JTextField countryTextField = null;
     96    private JTextField fullTextField = null;
     97    private Checkbox cbConvertToHouseNumbers = null;
     98
     99    private boolean relationChanged = false; // Whether to re-trigger data changed for relation
     100    // Track whether interpolation method is known so that auto detect doesn't override a previous choice.
     101    private boolean interpolationMethodSet = false;
     102
     103
     104    // NOTE: The following 2 arrays must match in number of elements and position
     105    // Tag values for map (Except that 'Numeric' is replaced by actual # on map)
     106    String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", "Numeric" };
     107    String[] addrInterpolationStrings = { tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display
     108    private final int NumericIndex = 4;
     109    private JComboBox addrInterpolationList = null;
     110
     111    // NOTE: The following 2 arrays must match in number of elements and position
     112    String[] addrInclusionTags = { "actual", "estimate", "potential" }; // Tag values for map
     113    String[] addrInclusionStrings = { tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display
     114    private JComboBox addrInclusionList = null;
     115
     116
     117
     118    // For tracking edit changes as group for undo
     119    private Collection<Command> commandGroup = null;
     120    private Relation editedRelation = null;
     121
     122    public AddrInterpolationDialog(String name) {
     123
     124        if (!FindAndSaveSelections()) {
     125            return;
     126        }
     127
     128        JPanel editControlsPane = CreateEditControls();
     129
     130        ShowDialog(editControlsPane, name);
     131
     132    }
     133
     134
     135
     136    private void ShowDialog(JPanel editControlsPane, String name) {
     137        dialog = new EscapeDialog((Frame) Main.parent, name, true);
     138
     139        dialog.add(editControlsPane);
     140        dialog.setSize(new Dimension(300,500));
     141        dialog.setLocation(new Point(100,300));
     142
     143        // Listen for windowOpened event to set focus
     144        dialog.addWindowListener( new WindowAdapter()
     145        {
     146            @Override
     147            public void windowOpened( WindowEvent e )
     148            {
     149                if (addrInterpolationWay != null) {
     150                    startTextField.requestFocus();
     151                }
     152                else {
     153                    cityTextField.requestFocus();
     154                }
     155            }
     156        });
     157
     158        dialog.setVisible(true);
     159
     160        lastIncrement = incrementTextField.getText();
     161        lastCity = cityTextField.getText();
     162        lastState = stateTextField.getText();
     163        lastPostCode = postCodeTextField.getText();
     164        lastCountry = countryTextField.getText();
     165        lastFullAddress = fullTextField.getText();
     166        lastConvertToHousenumber = cbConvertToHouseNumbers.getState();
     167
     168    }
     169
     170
     171
     172    // Create edit control items and return JPanel on which they reside
     173    private JPanel CreateEditControls() {
     174
     175        JPanel editControlsPane = new JPanel();
     176        GridBagLayout gridbag = new GridBagLayout();
     177        GridBagConstraints c = new GridBagConstraints();
     178
     179        editControlsPane.setLayout(gridbag);
     180
     181        editControlsPane.setBorder(BorderFactory.createEmptyBorder(15,15,15,15));
     182
     183
     184        String streetName = selectedStreet.get("name");
     185        String streetRelation = FindRelation();
     186        if (streetRelation.equals("")) {
     187            streetRelation = " (Create new)";
     188        }
     189        streetNameButton = new JRadioButton(tr("Name: {0}", streetName));
     190        streetRelationButton = new JRadioButton(tr("Relation: {0}", streetRelation));
     191        if (associatedStreetRelation == null) {
     192            streetNameButton.setSelected(true);
     193        }else {
     194            streetRelationButton.setSelected(true);
     195        }
     196
     197        // Create edit controls for street / relation radio buttons
     198        ButtonGroup group = new ButtonGroup();
     199        group.add(streetNameButton);
     200        group.add(streetRelationButton);
     201        JPanel radioButtonPanel = new JPanel(new BorderLayout());
     202        radioButtonPanel.setBorder(BorderFactory.createTitledBorder(tr("Associate with street using:")));
     203        radioButtonPanel.add(streetNameButton, BorderLayout.NORTH);
     204        radioButtonPanel.add(streetRelationButton, BorderLayout.SOUTH);
     205
     206        // Add to edit panel
     207        c.gridx = 0;
     208        c.gridwidth = 2; // # of columns to span
     209        c.fill = GridBagConstraints.HORIZONTAL;      // Full width
     210        c.gridwidth = GridBagConstraints.REMAINDER;     //end row
     211        editControlsPane.add(radioButtonPanel, c);
     212
     213        JLabel numberingLabel = new JLabel(tr("Numbering Scheme:"));
     214        addrInterpolationList = new JComboBox(addrInterpolationStrings);
     215
     216        JLabel incrementLabel = new JLabel(tr("Increment:"));
     217        incrementTextField = new JTextField(lastIncrement, 100);
     218        incrementTextField.setEnabled(false);
     219
     220        JLabel startLabel = new JLabel(tr("Starting #:"));
     221        JLabel endLabel = new JLabel(tr("Ending #:"));
     222
     223        startTextField = new JTextField(10);
     224        endTextField = new JTextField(10);
     225
     226        JLabel inclusionLabel = new JLabel(tr("Accuracy:"));
     227        addrInclusionList = new JComboBox(addrInclusionStrings);
     228        addrInclusionList.setSelectedIndex(lastAccuracyIndex);
     229
     230        // Preload any values already set in map
     231        GetExistingMapKeys();
     232
     233
     234        JLabel[] textLabels = {startLabel, endLabel, numberingLabel, incrementLabel, inclusionLabel};
     235        Component[] editFields = {startTextField, endTextField, addrInterpolationList, incrementTextField, addrInclusionList};
     236        AddEditControlRows(textLabels, editFields,  editControlsPane);
     237
     238        cbConvertToHouseNumbers = new Checkbox(tr("Convert way to individual house numbers."), null, lastConvertToHousenumber);
     239        // cbConvertToHouseNumbers.setSelected(lastConvertToHousenumber);
     240
     241        // Address interpolation fields not valid if Way not selected
     242        if (addrInterpolationWay == null) {
     243            addrInterpolationList.setEnabled(false);
     244            startTextField.setEnabled(false);
     245            endTextField.setEnabled(false);
     246            cbConvertToHouseNumbers.setEnabled(false);
     247        }
     248
     249
     250
     251        JPanel optionPanel = CreateOptionalFields();
     252        c.gridx = 0;
     253        c.gridwidth = 2; // # of columns to span
     254        c.fill = GridBagConstraints.BOTH;      // Full width
     255        c.gridwidth = GridBagConstraints.REMAINDER;     //end row
     256
     257        editControlsPane.add(optionPanel, c);
     258
     259
     260        KeyAdapter enterProcessor = new KeyAdapter() {
     261            @Override
     262            public void keyPressed(KeyEvent e) {
     263                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
     264                    if (ValidateAndSave()) {
     265                        dialog.dispose();
     266                    }
     267
     268                }
     269            }
     270        };
     271
     272        // Make Enter == OK click on fields using this adapter
     273        endTextField.addKeyListener(enterProcessor);
     274        cityTextField.addKeyListener(enterProcessor);
     275        addrInterpolationList.addKeyListener(enterProcessor);
     276        incrementTextField.addKeyListener(enterProcessor);
     277
     278
     279        // Watch when Interpolation Method combo box is selected so that
     280        // it can auto-detect method based on entered numbers.
     281        addrInterpolationList.addFocusListener(new FocusAdapter() {
     282            @Override
     283            public void focusGained(FocusEvent fe){
     284                if (!interpolationMethodSet) {
     285                    if (AutoDetectInterpolationMethod()) {
     286                        interpolationMethodSet = true;  // Don't auto detect over a previous choice
     287                    }
     288                }
     289            }
     290        });
     291
     292
     293        // Watch when Interpolation Method combo box is changed so that
     294        // Numeric increment box can be enabled or disabled.
     295        addrInterpolationList.addActionListener(new ActionListener() {
     296            public void actionPerformed(ActionEvent e){
     297                int selectedIndex = addrInterpolationList.getSelectedIndex();
     298                incrementTextField.setEnabled(selectedIndex == NumericIndex); // Enable or disable numeric field
     299            }
     300        });
     301
     302
     303        editControlsPane.add(cbConvertToHouseNumbers, c);
     304
     305
     306
     307        if (houseNumberNodes.size() > 0) {
     308            JLabel houseNumberNodeNote = new JLabel(tr("Will associate {0} additional house number nodes",
     309                    houseNumberNodes.size() ));
     310            editControlsPane.add(houseNumberNodeNote, c);
     311        }
     312
     313        editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation",
     314                tr("More information about this feature")), c);
     315
     316
     317        c.gridx = 0;
     318        c.gridwidth = 1; //next-to-last
     319        c.fill = GridBagConstraints.NONE;      //reset to default
     320        c.weightx = 0.0;
     321        c.insets = new Insets(15, 0, 0, 0);
     322        c.anchor = GridBagConstraints.LINE_END;
     323        JButton okButton = new JButton(tr("OK"), ImageProvider.get("ok"));
     324        editControlsPane.add(okButton, c);
     325
     326        c.gridx = 1;
     327        c.gridwidth = GridBagConstraints.REMAINDER;     //end row
     328        c.weightx = 1.0;
     329        c.anchor = GridBagConstraints.LINE_START;
     330
     331        JButton cancelButton = new JButton(tr("Cancel"), ImageProvider.get("cancel"));
     332        editControlsPane.add(cancelButton, c);
     333
     334        okButton.setActionCommand("ok");
     335        okButton.addActionListener(this);
     336        cancelButton.setActionCommand("cancel");
     337        cancelButton.addActionListener(this);
     338
     339        return editControlsPane;
     340    }
     341
     342
     343
     344    // Call after both starting and ending housenumbers have been entered - usually when
     345    // combo box gets focus.
     346    // Return true if a method was detected
     347    private boolean AutoDetectInterpolationMethod() {
     348
     349        String startValueString = ReadTextField(startTextField);
     350        String endValueString = ReadTextField(endTextField);
     351        if ( (startValueString == null) || (endValueString== null) ) {
     352            // Not all values entered yet
     353            return false;
     354        }
     355
     356        // String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", ### };  // Tag values for map
     357
     358        if (isLong(startValueString) && isLong(endValueString)) {
     359            // Have 2 numeric values
     360            long startValue = Long.parseLong( startValueString );
     361            long endValue = Long.parseLong( endValueString );
     362
     363            if (isEven(startValue)) {
     364                if (isEven(endValue)) {
     365                    SelectInterpolationMethod("even");
     366                }
     367                else {
     368                    SelectInterpolationMethod("all");
     369                }
     370            } else {
     371                if (!isEven(endValue)) {
     372                    SelectInterpolationMethod("odd");
     373                }
     374                else {
     375                    SelectInterpolationMethod("all");
     376                }
     377            }
     378
     379
     380        } else {
     381            // Test for possible alpha
     382            char startingChar = startValueString.charAt(startValueString.length()-1);
     383            char endingChar = endValueString.charAt(endValueString.length()-1);
     384
     385            if ( (!IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     386                // Both end with alpha
     387                SelectInterpolationMethod("alphabetic");
     388                return true;
     389            }
     390
     391            if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     392                endingChar = Character.toUpperCase(endingChar);
     393                if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
     394                    // First is a number, last is Latin alpha
     395                    SelectInterpolationMethod("alphabetic");
     396                    return true;
     397                }
     398            }
     399           
     400            // Did not detect alpha
     401            return false;
     402
     403        }
     404       
     405        return true;
     406
     407    }
     408
     409
     410
     411    // Set Interpolation Method combo box to method specified by 'currentMethod' (an OSM key value)
     412    private void SelectInterpolationMethod(String currentMethod) {
     413        int currentIndex = 0;
     414        if (isLong(currentMethod)) {
     415            // Valid number: Numeric increment method
     416            currentIndex = addrInterpolationTags.length-1;
     417            incrementTextField.setText(currentMethod);
     418            incrementTextField.setEnabled(true);
     419        }
     420        else {
     421            // Must scan OSM key values because combo box is already loaded with translated strings
     422            for (int i=0; i<addrInterpolationTags.length; i++) {
     423                if (addrInterpolationTags[i].equals(currentMethod)) {
     424                    currentIndex = i;
     425                    break;
     426                }
     427            }
     428        }
     429        addrInterpolationList.setSelectedIndex(currentIndex);
     430
     431    }
     432
     433
     434    // Set Inclusion Method combo box to method specified by 'currentMethod' (an OSM key value)
     435    private void SelectInclusion(String currentMethod) {
     436        int currentIndex = 0;
     437        // Must scan OSM key values because combo box is already loaded with translated strings
     438        for (int i=0; i<addrInclusionTags.length; i++) {
     439            if (addrInclusionTags[i].equals(currentMethod)) {
     440                currentIndex = i;
     441                break;
     442            }
     443        }
     444        addrInclusionList.setSelectedIndex(currentIndex);
     445
     446    }
     447
     448
     449
     450    // Create optional control fields in a group box
     451    private JPanel CreateOptionalFields() {
     452
     453        JPanel editControlsPane = new JPanel();
     454        GridBagLayout gridbag = new GridBagLayout();
     455
     456        editControlsPane.setLayout(gridbag);
     457
     458        editControlsPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     459
     460        JLabel[] optionalTextLabels = {new JLabel(tr("City:")),
     461                new JLabel(tr("State:")),
     462                new JLabel(tr("Post Code:")),
     463                new JLabel(tr("Country:")),
     464                new JLabel(tr("Full Address:"))};
     465        cityTextField = new JTextField(lastCity, 100);
     466        stateTextField = new JTextField(lastState, 100);
     467        postCodeTextField = new JTextField(lastPostCode, 20);
     468        countryTextField = new JTextField(lastCountry, 2);
     469        fullTextField = new JTextField(lastFullAddress, 300);
     470
     471        // Special processing for addr:country code, max length and uppercase
     472        countryTextField.addKeyListener(new KeyAdapter() {
     473            @Override
     474            public void keyTyped(KeyEvent e) {
     475                JTextField jtextfield = (JTextField)e.getSource();
     476                String text = jtextfield.getText();
     477                int length = text.length();
     478                if (length == jtextfield.getColumns()) {
     479                    e.consume();
     480                } else if (length > jtextfield.getColumns()) {
     481                    // show error message ??
     482                    e.consume();
     483                } else {
     484                    // Accept key; convert to upper case
     485                    if (!e.isActionKey()) {
     486                        e.setKeyChar(Character.toUpperCase(e.getKeyChar()) );
     487                    }
     488                }
     489            }
     490        });
     491
     492        Component[] optionalEditFields = {cityTextField, stateTextField, postCodeTextField, countryTextField, fullTextField};
     493        AddEditControlRows(optionalTextLabels, optionalEditFields,  editControlsPane);
     494
     495
     496
     497        JPanel optionPanel = new JPanel(new BorderLayout());
     498        Border groupBox = BorderFactory.createEtchedBorder();
     499        TitledBorder titleBorder = BorderFactory.createTitledBorder(groupBox, tr("Optional Information:"),
     500                TitledBorder.LEFT, TitledBorder.TOP);
     501
     502        optionPanel.setBorder(titleBorder);
     503        optionPanel.add(editControlsPane, BorderLayout.CENTER);
     504
     505        return optionPanel;
     506    }
     507
     508
     509
     510    // Populate dialog for any possible existing settings if editing an existing Address interpolation way
     511    private void GetExistingMapKeys() {
     512
     513
     514        // Check all nodes for optional addressing data
     515        //    Address interpolation nodes will overwrite these value if they contain optional data
     516        for (Node node : houseNumberNodes) {
     517            CheckNodeForAddressTags(node);
     518        }
     519
     520        if (addrInterpolationWay != null) {
     521            String currentMethod = addrInterpolationWay.get("addr:interpolation");
     522            if (currentMethod != null) {
     523
     524                SelectInterpolationMethod(currentMethod);
     525                interpolationMethodSet = true;  // Don't auto detect over a previous choice
     526            }
     527
     528            String currentInclusion = addrInterpolationWay.get("addr:inclusion");
     529            if (currentInclusion != null) {
     530                SelectInclusion(currentInclusion);
     531            }
     532
     533            Node firstNode = addrInterpolationWay.getNode(0);
     534            Node lastNode = addrInterpolationWay.getNode(addrInterpolationWay.getNodesCount()-1);
     535
     536            // Get any existing start / end # values
     537            String value = firstNode.get("addr:housenumber");
     538            if (value != null) {
     539                startTextField.setText(value);
     540            }
     541
     542            value = lastNode.get("addr:housenumber");
     543            if (value != null) {
     544                endTextField.setText(value);
     545            }
     546            CheckNodeForAddressTags(firstNode);
     547            CheckNodeForAddressTags(lastNode);
     548
     549        }
     550
     551
     552
     553    }
     554
     555
     556    // Check for any existing address data.   If found,
     557    // overwrite any previous data
     558    private void CheckNodeForAddressTags(Node checkNode) {
     559
     560        // Interrogate possible existing optional values
     561        String value = checkNode.get("addr:city");
     562        if (value != null) {
     563            lastCity = value;
     564        }
     565        value = checkNode.get("addr:state");
     566        if (value != null) {
     567            lastState = value;
     568        }
     569        value = checkNode.get("addr:postcode");
     570        if (value != null) {
     571            lastPostCode = value;
     572        }
     573        value = checkNode.get("addr:country");
     574        if (value != null) {
     575            lastCountry = value;
     576        }
     577        value = checkNode.get("addr:full");
     578        if (value != null) {
     579            lastFullAddress = value;
     580        }
     581
     582    }
     583
     584
     585
     586    // Look for a possible 'associatedStreet' type of relation for selected street
     587    // Returns relation description, or an empty string
     588    private String FindRelation() {
     589        String relationDescription = null;
     590        DataSet currentDataSet = Main.main.getCurrentDataSet();
     591        if (currentDataSet != null) {
     592            for (Relation relation : currentDataSet.getRelations()) {
     593
     594                String relationType = relation.get("type");
     595                if (relationType != null) {
     596                    if (relationType.equals("associatedStreet")) {
     597                        for (RelationMember relationMember : relation.getMembers()) {
     598                            if (relationMember.isWay()){
     599                                Way way = (Way) relationMember.getMember();
     600                                // System.out.println("Name: " + way.get("name") );
     601                                if (way == selectedStreet) {
     602                                    associatedStreetRelation = relation;
     603                                    relationDescription = Long.toString(way.getId());
     604
     605                                    String streetName = "";
     606                                    if (relation.getKeys().containsKey("name")) {
     607                                        streetName =  relation.get("name");
     608                                    } else {
     609                                        // Relation is unnamed - use street name
     610                                        streetName =  selectedStreet.get("name");
     611                                    }
     612                                    relationDescription += " (" + streetName + ")";
     613                                    return relationDescription;
     614                                }
     615                            }
     616
     617                        }
     618                    }
     619
     620                }
     621            }
     622
     623        }
     624
     625        return "";
     626    }
     627
     628
     629    // We can proceed only if there is both a named way (the 'street') and
     630    // one un-named way (the address interpolation way ) selected.
     631    //    The plugin menu item is enabled after a single way is selected to display a more meaningful
     632    //    message (a new user may not realize that they need to select both the street and
     633    //    address interpolation way first).
     634    // Also, selected street and working address interpolation ways are saved.
     635    private boolean FindAndSaveSelections() {
     636
     637        boolean isValid = false;
     638
     639        int namedWayCount = 0;
     640        int unNamedWayCount = 0;
     641        DataSet currentDataSet = Main.main.getCurrentDataSet();
     642        if (currentDataSet != null) {
     643            for (OsmPrimitive osm : currentDataSet.getSelectedWays()) {
     644                Way way = (Way) osm;
     645                if (way.getKeys().containsKey("name")) {
     646                    namedWayCount++;
     647                    this.selectedStreet = way;
     648                }
     649                else {
     650                    unNamedWayCount++;
     651                    this.addrInterpolationWay = way;
     652                }
     653            }
     654
     655            // Get additional nodes with addr:housenumber tags:
     656            //   Either selected or in the middle of the Address Interpolation way
     657            //     Do not include end points of Address Interpolation way in this set yet.
     658            houseNumberNodes  = new ArrayList<Node>();
     659            // Check selected nodes
     660            for (OsmPrimitive osm : currentDataSet.getSelectedNodes()) {
     661                Node node = (Node) osm;
     662                if (node.getKeys().containsKey("addr:housenumber")) {
     663                    houseNumberNodes.add(node);
     664                }
     665            }
     666
     667            if (addrInterpolationWay != null) {
     668                // Check nodes in middle of address interpolation way
     669                if (addrInterpolationWay.getNodesCount() > 2) {
     670                    for (int i=1; i<(addrInterpolationWay.getNodesCount()-2); i++) {
     671                        Node testNode = addrInterpolationWay.getNode(i);
     672                        if (testNode.getKeys().containsKey("addr:housenumber")) {
     673                            houseNumberNodes.add(testNode);
     674                        }
     675                    }
     676                }
     677            }
     678
     679        }
     680
     681        if (namedWayCount != 1) {
     682            JOptionPane.showMessageDialog(
     683                    Main.parent,
     684                    tr("Please select a street to associate with address interpolation way"),
     685                    tr("Error"),
     686                    JOptionPane.ERROR_MESSAGE
     687            );
     688        } else {
     689            // Avoid 2 error dialogs if both conditions don't match
     690            if (unNamedWayCount != 1) {
     691                // Allow for street + house number nodes only to be selected (no address interpolation way).
     692                if (houseNumberNodes.size() > 0) {
     693                    isValid = true;
     694                } else {
     695                    JOptionPane.showMessageDialog(
     696                            Main.parent,
     697                            tr("Please select address interpolation way for this street"),
     698                            tr("Error"),
     699                            JOptionPane.ERROR_MESSAGE
     700                    );
     701                }
     702            } else {
     703                isValid = true;
     704            }
     705        }
     706
     707
     708        return isValid;
     709    }
     710
     711
     712    /**
     713    * Add rows of edit controls - with labels in the left column, and controls in the right
     714    * column on the gridbag of the specified container.
     715    */
     716    private void AddEditControlRows(JLabel[] labels,
     717            Component[] editFields,
     718            Container container) {
     719        GridBagConstraints c = new GridBagConstraints();
     720        c.anchor = GridBagConstraints.EAST;
     721        int numLabels = labels.length;
     722
     723        for (int i = 0; i < numLabels; i++) {
     724            c.gridx = 0;
     725            c.gridwidth = 1; //next-to-last
     726            c.fill = GridBagConstraints.NONE;      //reset to default
     727            c.weightx = 0.0;                       //reset to default
     728            container.add(labels[i], c);
     729
     730            c.gridx = 1;
     731            c.gridwidth = GridBagConstraints.REMAINDER;     //end row
     732            c.fill = GridBagConstraints.HORIZONTAL;
     733            c.weightx = 1.0;
     734            container.add(editFields[i], c);
     735        }
     736    }
     737
     738
     739
     740    public void actionPerformed(ActionEvent e) {
     741        if ("ok".equals(e.getActionCommand())) {
     742            if (ValidateAndSave()) {
     743                dialog.dispose();
     744            }
     745
     746        } else  if ("cancel".equals(e.getActionCommand())) {
     747            dialog.dispose();
     748
     749        }
     750    }
     751
     752
     753
     754    // For Alpha interpolation, return base string
     755    //   For example: "22A" -> "22"
     756    //   For example: "A" -> ""
     757    //    Input string must not be empty
     758    private String BaseAlpha(String strValue) {
     759        if (strValue.length() > 0) {
     760            return strValue.substring(0, strValue.length()-1);
     761        }
     762        else {
     763            return "";
     764        }
     765    }
     766
     767
     768    private char LastChar(String strValue) {
     769        if (strValue.length() > 0) {
     770            return strValue.charAt(strValue.length()-1);
     771        }
     772        else {
     773            return 0;
     774        }
     775    }
     776
     777
     778    // Test for valid positive long int
     779    private boolean isLong( String input )
     780    {
     781        try
     782        {
     783            Long val = Long.parseLong( input );
     784            return (val > 0);
     785        }
     786        catch( Exception e)
     787        {
     788            return false;
     789        }
     790    }
     791
     792    private boolean isEven( Long input )
     793    {
     794        return ((input %2) == 0);
     795    }
     796
     797    private static Pattern p = Pattern.compile("^[0-9]+$");
     798    private static boolean IsNumeric(String s) {
     799        return p.matcher(s).matches();
     800    }
     801
     802
     803    private void InterpolateAlphaSection(int startNodeIndex, int endNodeIndex, String endValueString,
     804            char startingChar, char endingChar) {
     805
     806
     807        String baseAlpha = BaseAlpha(endValueString);
     808        int nSegments  =endNodeIndex - startNodeIndex;
     809
     810        double[] segmentLengths = new double[nSegments];
     811        // Total length of address interpolation way section
     812        double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
     813
     814
     815        int nHouses = endingChar - startingChar-1;  // # of house number nodes to create
     816        if (nHouses > 0) {
     817
     818            double houseSpacing = totalLength / (nHouses+1);
     819
     820            Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex);
     821            int currentSegment = 0; // Segment being used to place new house # node
     822            char currentChar= startingChar;
     823            while (nHouses > 0) {
     824                double distanceNeeded = houseSpacing;
     825
     826                // Move along segments until we can place the new house number
     827                while (distanceNeeded > segmentLengths[currentSegment]) {
     828                    distanceNeeded -= segmentLengths[currentSegment];
     829                    currentSegment++;
     830                    lastHouseNode = addrInterpolationWay.getNode(startNodeIndex + currentSegment);
     831                }
     832
     833                // House number is to be positioned in current segment.
     834                double proportion = distanceNeeded / segmentLengths[currentSegment];
     835                Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + currentSegment);
     836                LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion);
     837
     838
     839
     840                Node newHouseNumberNode = new Node(newHouseNumberPosition);
     841                currentChar++;
     842                if ( (currentChar >'Z') && (currentChar <'a')) {
     843                    // Wraparound past uppercase Z: go directly to lower case a
     844                    currentChar = 'a';
     845
     846                }
     847                String newHouseNumber = baseAlpha + currentChar;
     848                newHouseNumberNode.put("addr:housenumber", newHouseNumber);
     849
     850                commandGroup.add(new AddCommand(newHouseNumberNode));
     851                houseNumberNodes.add(newHouseNumberNode);   // Street, etc information to be added later
     852
     853                lastHouseNode = newHouseNumberNode;
     854
     855
     856                segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
     857                nHouses -- ;
     858            }
     859        }
     860
     861
     862    }
     863
     864
     865    private void CreateAlphaInterpolation(String startValueString, String endValueString) {
     866        char startingChar = LastChar(startValueString);
     867        char endingChar = LastChar(endValueString);
     868
     869        if (isLong(startValueString)) {
     870            // Special case of numeric first value, followed by 'A'
     871            startingChar = 'A'-1;
     872        }
     873
     874        // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
     875        int startIndex = 0; // Index into first interpolation zone of address interpolation way
     876        for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     877            Node testNode = addrInterpolationWay.getNode(i);
     878            String endNodeNumber = testNode.get("addr:housenumber");
     879            if (endNodeNumber != null) {
     880                // This is a potential anchor node
     881                if (endNodeNumber != "") {
     882                    char anchorChar = LastChar(endNodeNumber);
     883                    if ( (anchorChar >startingChar) && (anchorChar < endingChar) ) {
     884                        // Lies within the expected range
     885                        InterpolateAlphaSection(startIndex, i, endNodeNumber, startingChar, anchorChar);
     886
     887                        // For next interpolation section
     888                        startingChar = anchorChar;
     889                        startValueString = endNodeNumber;
     890                        startIndex = i;
     891                    }
     892                }
     893
     894            }
     895        }
     896
     897        // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value
     898        InterpolateAlphaSection(startIndex, addrInterpolationWay.getNodesCount()-1, endValueString, startingChar, endingChar);
     899
     900    }
     901
     902
     903    private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) {
     904        Node fromNode = addrInterpolationWay.getNode(startNodeIndex);
     905        double totalLength = 0.0;
     906        int nSegments = segmentLengths.length;
     907        for (int segment = 0; segment < nSegments; segment++) {
     908            Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + segment);
     909            segmentLengths[segment]= fromNode.getCoor().greatCircleDistance(toNode.getCoor());
     910            totalLength += segmentLengths[segment];
     911
     912            fromNode = toNode;
     913        }
     914        return totalLength;
     915
     916    }
     917
     918
     919    private void InterpolateNumericSection(int startNodeIndex, int endNodeIndex,
     920            long startingAddr, long endingAddr,
     921            long increment) {
     922
     923
     924        int nSegments  =endNodeIndex - startNodeIndex;
     925
     926        double[] segmentLengths = new double[nSegments];
     927
     928        // Total length of address interpolation way section
     929        double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
     930
     931
     932        int nHouses = (int)((endingAddr - startingAddr) / increment) -1;
     933        if (nHouses > 0) {
     934
     935            double houseSpacing = totalLength / (nHouses+1);
     936
     937            Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex);
     938            int currentSegment = 0; // Segment being used to place new house # node
     939            long currentHouseNumber = startingAddr;
     940            while (nHouses > 0) {
     941                double distanceNeeded = houseSpacing;
     942
     943                // Move along segments until we can place the new house number
     944                while (distanceNeeded > segmentLengths[currentSegment]) {
     945                    distanceNeeded -= segmentLengths[currentSegment];
     946                    currentSegment++;
     947                    lastHouseNode = addrInterpolationWay.getNode(startNodeIndex + currentSegment);
     948                }
     949
     950                // House number is to be positioned in current segment.
     951                double proportion = distanceNeeded / segmentLengths[currentSegment];
     952                Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + currentSegment);
     953                LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion);
     954
     955
     956                Node newHouseNumberNode = new Node(newHouseNumberPosition);
     957                currentHouseNumber += increment;
     958                String newHouseNumber = Long.toString(currentHouseNumber);
     959                newHouseNumberNode.put("addr:housenumber", newHouseNumber);
     960
     961                commandGroup.add(new AddCommand(newHouseNumberNode));
     962                houseNumberNodes.add(newHouseNumberNode);   // Street, etc information to be added later
     963
     964                lastHouseNode = newHouseNumberNode;
     965
     966
     967                segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
     968                nHouses -- ;
     969            }
     970        }
     971
     972
     973    }
     974
     975
     976    private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) {
     977
     978        long startingAddr = Long.parseLong( startValueString );
     979        long endingAddr = Long.parseLong( endValueString );
     980
     981
     982        // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
     983        int startIndex = 0; // Index into first interpolation zone of address interpolation way
     984        for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     985            Node testNode = addrInterpolationWay.getNode(i);
     986            String strEndNodeNumber = testNode.get("addr:housenumber");
     987            if (strEndNodeNumber != null) {
     988                // This is a potential anchor node
     989                if (isLong(strEndNodeNumber)) {
     990
     991                    long anchorAddrNumber = Long.parseLong( strEndNodeNumber );
     992                    if ( (anchorAddrNumber >startingAddr) && (anchorAddrNumber < endingAddr) ) {
     993                        // Lies within the expected range
     994                        InterpolateNumericSection(startIndex, i, startingAddr, anchorAddrNumber, increment);
     995
     996                        // For next interpolation section
     997                        startingAddr = anchorAddrNumber;
     998                        startValueString = strEndNodeNumber;
     999                        startIndex = i;
     1000                    }
     1001                }
     1002
     1003            }
     1004        }
     1005
     1006        // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value
     1007        InterpolateNumericSection(startIndex, addrInterpolationWay.getNodesCount()-1, startingAddr, endingAddr, increment);
     1008    }
     1009
     1010
     1011    // Called if user has checked "Convert to House Numbers" checkbox.
     1012    private void ConvertWayToHousenumbers(String selectedMethod, String startValueString, String endValueString,
     1013            String incrementString) {
     1014        // - Use nodes labeled with 'same type' as interim anchors in the middle of the way to identify unequal spacing.
     1015        // - Ignore nodes of different type; for example '25b' is ignored in sequence 5..15
     1016
     1017        // Calculate required number of house numbers to create
     1018        if (selectedMethod.equals("alphabetic")) {
     1019
     1020            CreateAlphaInterpolation(startValueString, endValueString);
     1021
     1022
     1023        } else {
     1024            long increment = 1;
     1025            if (selectedMethod.equals("odd") || selectedMethod.equals("even")) {
     1026                increment = 2;
     1027            } else if (selectedMethod.equals("Numeric")) {
     1028                increment = Long.parseLong(incrementString);
     1029            }
     1030            CreateNumericInterpolation(startValueString, endValueString, increment);
     1031
     1032        }
     1033
     1034
     1035        RemoveAddressInterpolationWay();
     1036
     1037    }
     1038
     1039
     1040    private void RemoveAddressInterpolationWay() {
     1041
     1042        // Remove untagged nodes
     1043        for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     1044            Node testNode = addrInterpolationWay.getNode(i);
     1045            if (!testNode.hasKeys()) {
     1046                commandGroup.add(new DeleteCommand(testNode));
     1047            }
     1048        }
     1049
     1050        // Remove way
     1051        commandGroup.add(new DeleteCommand(addrInterpolationWay));
     1052        addrInterpolationWay = null;
     1053
     1054    }
     1055
     1056
     1057
     1058    private boolean ValidateAndSave() {
     1059
     1060        String startValueString = ReadTextField(startTextField);
     1061        String endValueString = ReadTextField(endTextField);
     1062        String incrementString = ReadTextField(incrementTextField);
     1063        String city = ReadTextField(cityTextField);
     1064        String state = ReadTextField(stateTextField);
     1065        String postCode = ReadTextField(postCodeTextField);
     1066        String country = ReadTextField(countryTextField);
     1067        String fullAddress = ReadTextField(fullTextField);
     1068
     1069        String selectedMethod = GetInterpolationMethod();
     1070        if (addrInterpolationWay != null) {
     1071            Long startAddr=0L, endAddr=0L;
     1072            if (!selectedMethod.equals("alphabetic")) {
     1073                Long[] addrArray = {startAddr, endAddr};
     1074                if (!ValidAddressNumbers(startValueString, endValueString, addrArray )) {
     1075                    return false;
     1076                }
     1077                startAddr = addrArray[0];
     1078                endAddr = addrArray[1];
     1079            }
     1080
     1081            String errorMessage = "";
     1082            if (selectedMethod.equals("odd")) {
     1083                if (isEven(startAddr) || isEven(endAddr)) {
     1084                    errorMessage = tr("Expected odd numbers for addresses");
     1085                }
     1086
     1087            } else if (selectedMethod.equals("even")) {
     1088                if (!isEven(startAddr) || !isEven(endAddr)) {
     1089                    errorMessage = tr("Expected even numbers for addresses");
     1090                }
     1091            } else if (selectedMethod.equals("all")) {
     1092
     1093            }else if (selectedMethod.equals("alphabetic")) {
     1094                errorMessage = ValidateAlphaAddress(startValueString, endValueString);
     1095
     1096            }else if (selectedMethod.equals("Numeric")) {
     1097
     1098                if (!ValidNumericIncrementString(incrementString, startAddr, endAddr)) {
     1099                    errorMessage = tr("Expected valid number for address increment");
     1100                }
     1101
     1102            }
     1103            if (!errorMessage.equals("")) {
     1104                JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
     1105                return false;
     1106            }
     1107        }
     1108
     1109        if (country != null) {
     1110            if (country.length() != 2) {
     1111                JOptionPane.showMessageDialog(Main.parent,
     1112                        tr("Country code must be 2 letters"), tr("Error"),  JOptionPane.ERROR_MESSAGE);
     1113                return false;
     1114            }
     1115        }
     1116
     1117        // Entries are valid ... save in map
     1118
     1119        commandGroup = new LinkedList<Command>();
     1120
     1121        String streetName = selectedStreet.get("name");
     1122
     1123        if (addrInterpolationWay != null) {
     1124
     1125            Node firstNode = addrInterpolationWay.getNode(0);
     1126            Node lastNode = addrInterpolationWay.getNode(addrInterpolationWay.getNodesCount()-1);
     1127
     1128            // De-select address interpolation way; leave street selected
     1129            DataSet currentDataSet = Main.main.getCurrentDataSet();
     1130            if (currentDataSet != null) {
     1131                currentDataSet.clearSelection(addrInterpolationWay);
     1132                currentDataSet.clearSelection(lastNode);  // Workaround for JOSM Bug #3838
     1133            }
     1134
     1135
     1136            String interpolationTagValue = selectedMethod;
     1137            if (selectedMethod.equals("Numeric")) {
     1138                // The interpolation method is the number for 'Numeric' case
     1139                interpolationTagValue = incrementString;
     1140            }
     1141
     1142            if (cbConvertToHouseNumbers.getState()) {
     1143                // Convert way to house numbers is checked.
     1144                //  Create individual nodes and delete interpolation way
     1145                ConvertWayToHousenumbers(selectedMethod, startValueString, endValueString, incrementString);
     1146            } else {
     1147                // Address interpolation way will remain
     1148                commandGroup.add(new ChangePropertyCommand(addrInterpolationWay, "addr:interpolation", interpolationTagValue));
     1149                commandGroup.add(new ChangePropertyCommand(addrInterpolationWay, "addr:inclusion", GetInclusionMethod()));
     1150            }
     1151
     1152            commandGroup.add(new ChangePropertyCommand(firstNode, "addr:housenumber", startValueString));
     1153            commandGroup.add(new ChangePropertyCommand(lastNode, "addr:housenumber", endValueString));
     1154            // Add address interpolation house number nodes to main house number node list for common processing
     1155            houseNumberNodes.add(firstNode);
     1156            houseNumberNodes.add(lastNode);
     1157
     1158        }
     1159
     1160
     1161
     1162        if (streetRelationButton.isSelected()) {
     1163
     1164            // Relation button was selected
     1165            if (associatedStreetRelation == null) {
     1166                CreateRelation(streetName);
     1167                // relationChanged = true;   (not changed since it was created)
     1168            }
     1169            // Make any additional changes only to the copy
     1170            editedRelation = new Relation(associatedStreetRelation);
     1171
     1172            if (addrInterpolationWay != null) {
     1173                AddToRelation(associatedStreetRelation, addrInterpolationWay, "house");
     1174            }
     1175        }
     1176
     1177
     1178        // For all nodes, add to relation and
     1179        //   Add optional text fields to all nodes if specified
     1180        for (Node node : houseNumberNodes) {
     1181
     1182            if (streetRelationButton.isSelected()) {
     1183                AddToRelation(associatedStreetRelation, node, "house");
     1184            }
     1185            if ((city != null) || (streetNameButton.isSelected()) ) {
     1186                // Include street unconditionally if adding nodes only or city name specified
     1187                commandGroup.add(new ChangePropertyCommand(node, "addr:street", streetName));
     1188            }
     1189            // Set or remove remaining optional fields
     1190            commandGroup.add(new ChangePropertyCommand(node, "addr:city", city));
     1191            commandGroup.add(new ChangePropertyCommand(node, "addr:state", state));
     1192            commandGroup.add(new ChangePropertyCommand(node, "addr:postcode", postCode));
     1193            commandGroup.add(new ChangePropertyCommand(node, "addr:country", country));
     1194            commandGroup.add(new ChangePropertyCommand(node, "addr:full", fullAddress));
     1195        }
     1196
     1197        if (relationChanged) {
     1198            commandGroup.add(new ChangeCommand(associatedStreetRelation, editedRelation));
     1199        }
     1200
     1201
     1202        Main.main.undoRedo.add(new SequenceCommand(tr("Address Interpolation"), commandGroup));
     1203        Main.map.repaint();
     1204
     1205        return true;
     1206    }
     1207
     1208
     1209    private boolean ValidNumericIncrementString(String incrementString, long startingAddr, long endingAddr) {
     1210
     1211        if (!isLong(incrementString)) {
     1212            return false;
     1213        }
     1214        long testIncrement = Long.parseLong(incrementString);
     1215        if ( (testIncrement <=0) || (testIncrement > endingAddr ) ) {
     1216            return false;
     1217        }
     1218
     1219        if ( ((endingAddr - startingAddr) % testIncrement) != 0) {
     1220            return false;
     1221        }
     1222        return true;
     1223    }
     1224
     1225
     1226
     1227    // Create Associated Street relation, add street, and add to list of commands to perform
     1228    private void CreateRelation(String streetName) {
     1229        associatedStreetRelation = new Relation();
     1230        associatedStreetRelation.put("name", streetName);
     1231        associatedStreetRelation.put("type", "associatedStreet");
     1232        RelationMember newStreetMember = new RelationMember("street", selectedStreet);
     1233        associatedStreetRelation.addMember(newStreetMember);
     1234        commandGroup.add(new AddCommand(associatedStreetRelation));
     1235    }
     1236
     1237
     1238
     1239    // Read from dialog text box, removing leading and trailing spaces
     1240    // Return the string, or null for a zero length string
     1241    private String ReadTextField(JTextField field) {
     1242        String value = field.getText();
     1243        if (value != null) {
     1244            value = value.trim();
     1245            if (value.equals("")) {
     1246                value = null;
     1247            }
     1248        }
     1249        return value;
     1250    }
     1251
     1252
     1253    // Test if relation contains specified member
     1254    //   If not already present, it is added
     1255    private void AddToRelation(Relation relation,   OsmPrimitive testMember, String role) {
     1256        boolean isFound = false;
     1257        for (RelationMember relationMember : relation.getMembers()) {
     1258
     1259            if (testMember == relationMember.getMember()) {
     1260                isFound = true;
     1261                break;
     1262            }
     1263        }
     1264
     1265        if (!isFound) {
     1266            RelationMember newMember = new RelationMember(role, testMember);
     1267            editedRelation.addMember(newMember);
     1268
     1269            relationChanged = true;
     1270        }
     1271    }
     1272
     1273
     1274
     1275    // Check alphabetic style address
     1276    //   Last character of both must be alpha
     1277    //   Last character of ending must be greater than starting
     1278    //   Return empty error message if OK
     1279    private String ValidateAlphaAddress(String startValueString,
     1280            String endValueString) {
     1281        String errorMessage="";
     1282
     1283        if (startValueString.equals("") || endValueString.equals("")) {
     1284            errorMessage = tr("Please enter valid number for starting and ending address");
     1285        } else {
     1286            char startingChar = LastChar(startValueString);
     1287            char endingChar = LastChar(endValueString);
     1288
     1289
     1290            boolean isOk = false;
     1291            if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     1292                endingChar = Character.toUpperCase(endingChar);
     1293                if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
     1294                    // First is a number, last is Latin alpha
     1295                    isOk = true;
     1296                }
     1297            } else if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) {
     1298                // Both are alpha
     1299                isOk = true;
     1300            }
     1301            if (!isOk) {
     1302                errorMessage = tr("Alphabetic address must end with a letter");
     1303            }
     1304
     1305
     1306            // if a number is included, validate that it is the same number
     1307            if (endValueString.length() > 1) {
     1308
     1309                // Get number portion of first item: may or may not have letter suffix
     1310                String numStart = BaseAlpha(startValueString);
     1311                if (IsNumeric(startValueString)) {
     1312                    numStart = startValueString;
     1313                }
     1314
     1315                String numEnd = BaseAlpha(endValueString);
     1316                if (!numStart.equals(numEnd)) {
     1317                    errorMessage = tr("Starting and ending numbers must be the same for alphabetic addresses");
     1318                }
     1319            }
     1320
     1321            // ?? Character collation in all languages ??
     1322            if (startingChar >= endingChar) {
     1323                errorMessage = tr("Starting address letter must be less than ending address letter");
     1324            }
     1325
     1326        }
     1327
     1328        return errorMessage;
     1329    }
     1330
     1331
     1332
     1333    // Convert string addresses to numeric, with error check
     1334    private boolean ValidAddressNumbers(String startValueString,
     1335            String endValueString, Long[] addrArray) {
     1336        String errorMessage = "";
     1337
     1338        if (!isLong(startValueString)) {
     1339            errorMessage = tr("Please enter valid number for starting address");
     1340        }
     1341        if (!isLong(endValueString)) {
     1342            errorMessage = tr("Please enter valid number for ending address");
     1343        }
     1344        if (errorMessage.equals("")) {
     1345            addrArray[0] = Long.parseLong( startValueString );
     1346            addrArray[1] = Long.parseLong( endValueString );
     1347
     1348            if (addrArray[1] <= addrArray[0]) {
     1349                errorMessage = tr("Starting address number must be less than ending address number");
     1350            }
     1351        }
     1352
     1353        if (errorMessage.equals("")) {
     1354            return true;
     1355
     1356        } else {
     1357            JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
     1358            return false;
     1359        }
     1360    }
     1361
     1362
     1363
     1364    private String GetInterpolationMethod() {
     1365        int selectedIndex = addrInterpolationList.getSelectedIndex();
     1366        return addrInterpolationTags[selectedIndex];
     1367    }
     1368
     1369
     1370    private String GetInclusionMethod() {
     1371        int selectedIndex = addrInclusionList.getSelectedIndex();
     1372        lastAccuracyIndex = selectedIndex;
     1373        return addrInclusionTags[selectedIndex];
     1374    }
    13751375
    13761376
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationPlugin.java

    r19422 r23191  
    99public class AddrInterpolationPlugin extends Plugin {
    1010
    11         AddrInterpolationAction action = null;
     11    AddrInterpolationAction action = null;
    1212
    13         /**
    14         * constructor
    15         */
    16         public AddrInterpolationPlugin(PluginInformation info) {
    17                 super(info);
    18                 action = new AddrInterpolationAction();
    19                 Main.main.menu.toolsMenu.add(action);
    20         }
     13    /**
     14    * constructor
     15    */
     16    public AddrInterpolationPlugin(PluginInformation info) {
     17        super(info);
     18        action = new AddrInterpolationAction();
     19        Main.main.menu.toolsMenu.add(action);
     20    }
    2121}
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/EscapeDialog.java

    r17721 r23191  
    1515
    1616public class EscapeDialog extends JDialog {
    17         public EscapeDialog() {
    18                 this((Frame)null, false);
    19         }
    20         public EscapeDialog(Frame owner) {
    21                 this(owner, false);
    22         }
    23         public EscapeDialog(Frame owner, boolean modal) {
    24                 this(owner, null, modal);
    25         }
    26         public EscapeDialog(Frame owner, String title) {
    27                 this(owner, title, false);
    28         }
    29         public EscapeDialog(Frame owner, String title, boolean modal) {
    30                 super(owner, title, modal);
    31         }
    32         public EscapeDialog(Dialog owner) {
    33                 this(owner, false);
    34         }
    35         public EscapeDialog(Dialog owner, boolean modal) {
    36                 this(owner, null, modal);
    37         }
    38         public EscapeDialog(Dialog owner, String title) {
    39                 this(owner, title, false);
    40         }
    41         public EscapeDialog(Dialog owner, String title, boolean modal) {
    42                 super(owner, title, modal);
    43         }
     17    public EscapeDialog() {
     18        this((Frame)null, false);
     19    }
     20    public EscapeDialog(Frame owner) {
     21        this(owner, false);
     22    }
     23    public EscapeDialog(Frame owner, boolean modal) {
     24        this(owner, null, modal);
     25    }
     26    public EscapeDialog(Frame owner, String title) {
     27        this(owner, title, false);
     28    }
     29    public EscapeDialog(Frame owner, String title, boolean modal) {
     30        super(owner, title, modal);
     31    }
     32    public EscapeDialog(Dialog owner) {
     33        this(owner, false);
     34    }
     35    public EscapeDialog(Dialog owner, boolean modal) {
     36        this(owner, null, modal);
     37    }
     38    public EscapeDialog(Dialog owner, String title) {
     39        this(owner, title, false);
     40    }
     41    public EscapeDialog(Dialog owner, String title, boolean modal) {
     42        super(owner, title, modal);
     43    }
    4444
    4545
    46         @Override
    47         protected JRootPane createRootPane() {
    48                 ActionListener escapeActionListener = new ActionListener() {
    49                         public void actionPerformed(ActionEvent actionEvent) {
    50                                 dispose();
    51                                 // setVisible(false);
    52                         }
    53                 };
    54                 JRootPane rootPane = new JRootPane();
    55                 KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    56                 rootPane.registerKeyboardAction(escapeActionListener, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
     46    @Override
     47    protected JRootPane createRootPane() {
     48        ActionListener escapeActionListener = new ActionListener() {
     49            public void actionPerformed(ActionEvent actionEvent) {
     50                dispose();
     51                // setVisible(false);
     52            }
     53        };
     54        JRootPane rootPane = new JRootPane();
     55        KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
     56        rootPane.registerKeyboardAction(escapeActionListener, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
    5757
    58                 return rootPane;
    59         }
     58        return rootPane;
     59    }
    6060}
    6161
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/SingleSegmentGpxTrack.java

    r20431 r23191  
    1111public class SingleSegmentGpxTrack implements GpxTrack {
    1212
    13         private final Map<String, Object> attributes;
    14         private final GpxTrackSegment trackSegment;
     13    private final Map<String, Object> attributes;
     14    private final GpxTrackSegment trackSegment;
    1515
    16         public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
    17                 this.attributes = Collections.unmodifiableMap(attributes);
    18                 this.trackSegment = trackSegment;
    19         }
     16    public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
     17        this.attributes = Collections.unmodifiableMap(attributes);
     18        this.trackSegment = trackSegment;
     19    }
    2020
    2121
    22         public Map<String, Object> getAttributes() {
    23                 return attributes;
    24         }
     22    public Map<String, Object> getAttributes() {
     23        return attributes;
     24    }
    2525
    26         public Bounds getBounds() {
    27                 return trackSegment.getBounds();
    28         }
     26    public Bounds getBounds() {
     27        return trackSegment.getBounds();
     28    }
    2929
    30         public Collection<GpxTrackSegment> getSegments() {
    31                 return Collections.singleton(trackSegment);
    32         }
     30    public Collection<GpxTrackSegment> getSegments() {
     31        return Collections.singleton(trackSegment);
     32    }
    3333
    34         public double length() {
    35                 return trackSegment.length();
    36         }
     34    public double length() {
     35        return trackSegment.length();
     36    }
    3737
    38         @Override
    39         public int getUpdateCount() {
    40                 return trackSegment.getUpdateCount();
    41         }
     38    @Override
     39    public int getUpdateCount() {
     40        return trackSegment.getUpdateCount();
     41    }
    4242
    4343}
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/TangoGPS.java

    r22542 r23191  
    3434public class TangoGPS extends FileImporter {
    3535
    36         public TangoGPS() {
    37                 super(new ExtensionFileFilter("log", "log",tr("TangoGPS Files (*.log)")));
    38         }
     36    public TangoGPS() {
     37        super(new ExtensionFileFilter("log", "log",tr("TangoGPS Files (*.log)")));
     38    }
    3939
    40         /**
    41         * @author cbrill
    42         * This function imports data from file and adds trackpoints
    43         *         to a layer.
    44         * Read a log file from TangoGPS. These are simple text files in the
    45         * form: <lat>,<lon>,<elevation>,<speed>,<course>,<hdop>,<datetime>
    46         */
    47         @Override
    48         public void importData(File file, ProgressMonitor progressMonitor) throws IOException {
    49                 // create the data tree
    50                 List<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
     40    /**
     41    * @author cbrill
     42    * This function imports data from file and adds trackpoints
     43    *         to a layer.
     44    * Read a log file from TangoGPS. These are simple text files in the
     45    * form: <lat>,<lon>,<elevation>,<speed>,<course>,<hdop>,<datetime>
     46    */
     47    @Override
     48    public void importData(File file, ProgressMonitor progressMonitor) throws IOException {
     49        // create the data tree
     50        List<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
    5151
    52                 int imported = 0;
    53                 int failure = 0;
     52        int imported = 0;
     53        int failure = 0;
    5454
    55                 BufferedReader rd = null;
    56                 try {
    57                         InputStream source = new FileInputStream(file);
    58                         rd = new BufferedReader(new InputStreamReader(source));
     55        BufferedReader rd = null;
     56        try {
     57            InputStream source = new FileInputStream(file);
     58            rd = new BufferedReader(new InputStreamReader(source));
    5959
    60                         String line;
    61                         while ((line = rd.readLine()) != null) {
    62                                 failure++;
    63                                 String[] lineElements = line.split(",");
    64                                 if (lineElements.length >= 7) {
    65                                         try {
    66                                                 WayPoint currentWayPoint = new WayPoint(
    67                                                                 parseLatLon(lineElements));
    68                                                 currentWayPoint.attr.put("ele", lineElements[2]);
    69                                                 currentWayPoint.attr.put("time", lineElements[6]);
    70                                                 currentWayPoint.setTime();
    71                                                 currentTrackSeg.add(currentWayPoint);
    72                                                 imported++;
    73                                         } catch (NumberFormatException e) {
    74                                                 e.printStackTrace();
    75                                         }
    76                                 }
    77                         }
    78                         failure = failure - imported;
    79                         if(imported > 0) {
    80                                 GpxData data = new GpxData();
    81                                 data.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(currentTrackSeg), Collections.<String, Object>emptyMap()));
    82                                 data.recalculateBounds();
    83                                 data.storageFile = file;
    84                                 GpxLayer gpxLayer = new GpxLayer(data, file.getName());
    85                                 Main.main.addLayer(gpxLayer);
    86                                 if (Main.pref.getBoolean("marker.makeautomarkers", true)) {
    87                                         MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", file.getName()), file, gpxLayer);
    88                                         if (ml.data.size() > 0) {
    89                                                 Main.main.addLayer(ml);
    90                                         }
    91                                 }
    92                         }
    93                         showInfobox(imported,failure);
    94                 } finally {
    95                         if (rd != null) {
    96                                 rd.close();
    97                         }
    98                 }
    99         }
     60            String line;
     61            while ((line = rd.readLine()) != null) {
     62                failure++;
     63                String[] lineElements = line.split(",");
     64                if (lineElements.length >= 7) {
     65                    try {
     66                        WayPoint currentWayPoint = new WayPoint(
     67                                parseLatLon(lineElements));
     68                        currentWayPoint.attr.put("ele", lineElements[2]);
     69                        currentWayPoint.attr.put("time", lineElements[6]);
     70                        currentWayPoint.setTime();
     71                        currentTrackSeg.add(currentWayPoint);
     72                        imported++;
     73                    } catch (NumberFormatException e) {
     74                        e.printStackTrace();
     75                    }
     76                }
     77            }
     78            failure = failure - imported;
     79            if(imported > 0) {
     80                GpxData data = new GpxData();
     81                data.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(currentTrackSeg), Collections.<String, Object>emptyMap()));
     82                data.recalculateBounds();
     83                data.storageFile = file;
     84                GpxLayer gpxLayer = new GpxLayer(data, file.getName());
     85                Main.main.addLayer(gpxLayer);
     86                if (Main.pref.getBoolean("marker.makeautomarkers", true)) {
     87                    MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", file.getName()), file, gpxLayer);
     88                    if (ml.data.size() > 0) {
     89                        Main.main.addLayer(ml);
     90                    }
     91                }
     92            }
     93            showInfobox(imported,failure);
     94        } finally {
     95            if (rd != null) {
     96                rd.close();
     97            }
     98        }
     99    }
    100100
    101         private double parseCoord(String s) {
    102                 return Double.parseDouble(s);
    103         }
     101    private double parseCoord(String s) {
     102        return Double.parseDouble(s);
     103    }
    104104
    105         private LatLon parseLatLon(String[] lineElements) {
    106                 if (lineElements.length < 2)
    107                         return null;
    108                 return new LatLon(parseCoord(lineElements[0]),
    109                                 parseCoord(lineElements[1]));
    110         }
     105    private LatLon parseLatLon(String[] lineElements) {
     106        if (lineElements.length < 2)
     107            return null;
     108        return new LatLon(parseCoord(lineElements[0]),
     109                parseCoord(lineElements[1]));
     110    }
    111111
    112112    private void showInfobox(int success,int failure) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/Tcx.java

    r19681 r23191  
    119119
    120120    /** Convert a TrackpointT to a WayPoint.
    121      * @param tp        TrackpointT to convert
    122      * @return          tp converted to WayPoint, or null
     121     * @param tp    TrackpointT to convert
     122     * @return      tp converted to WayPoint, or null
    123123     */
    124124    private static WayPoint convertPoint(TrackpointT tp) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/AbstractSourceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for AbstractSource_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="AbstractSource_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    5353    /**
    5454     * Gets the value of the name property.
    55      * 
     55     *
    5656     * @return
    5757     *     possible object is
    5858     *     {@link String }
    59      *     
     59     *
    6060     */
    6161    public String getName() {
     
    6565    /**
    6666     * Sets the value of the name property.
    67      * 
     67     *
    6868     * @param value
    6969     *     allowed object is
    7070     *     {@link String }
    71      *     
     71     *
    7272     */
    7373    public void setName(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/AbstractStepT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for AbstractStep_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="AbstractStep_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    5050    /**
    5151     * Gets the value of the stepId property.
    52      * 
     52     *
    5353     */
    5454    public int getStepId() {
     
    5858    /**
    5959     * Sets the value of the stepId property.
    60      * 
     60     *
    6161     */
    6262    public void setStepId(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ActivityLapT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2222/**
    2323 * <p>Java class for ActivityLap_t complex type.
    24  * 
     24 *
    2525 * <p>The following schema fragment specifies the expected content contained within this class.
    26  * 
     26 *
    2727 * <pre>
    2828 * &lt;complexType name="ActivityLap_t">
     
    4848 * &lt;/complexType>
    4949 * </pre>
    50  * 
    51  * 
     50 *
     51 *
    5252 */
    5353@XmlAccessorType(XmlAccessType.FIELD)
     
    9999    /**
    100100     * Gets the value of the totalTimeSeconds property.
    101      * 
     101     *
    102102     */
    103103    public double getTotalTimeSeconds() {
     
    107107    /**
    108108     * Sets the value of the totalTimeSeconds property.
    109      * 
     109     *
    110110     */
    111111    public void setTotalTimeSeconds(double value) {
     
    115115    /**
    116116     * Gets the value of the distanceMeters property.
    117      * 
     117     *
    118118     */
    119119    public double getDistanceMeters() {
     
    123123    /**
    124124     * Sets the value of the distanceMeters property.
    125      * 
     125     *
    126126     */
    127127    public void setDistanceMeters(double value) {
     
    131131    /**
    132132     * Gets the value of the maximumSpeed property.
    133      * 
     133     *
    134134     * @return
    135135     *     possible object is
    136136     *     {@link Double }
    137      *     
     137     *
    138138     */
    139139    public Double getMaximumSpeed() {
     
    143143    /**
    144144     * Sets the value of the maximumSpeed property.
    145      * 
     145     *
    146146     * @param value
    147147     *     allowed object is
    148148     *     {@link Double }
    149      *     
     149     *
    150150     */
    151151    public void setMaximumSpeed(Double value) {
     
    155155    /**
    156156     * Gets the value of the calories property.
    157      * 
     157     *
    158158     */
    159159    public int getCalories() {
     
    163163    /**
    164164     * Sets the value of the calories property.
    165      * 
     165     *
    166166     */
    167167    public void setCalories(int value) {
     
    171171    /**
    172172     * Gets the value of the averageHeartRateBpm property.
    173      * 
     173     *
    174174     * @return
    175175     *     possible object is
    176176     *     {@link HeartRateInBeatsPerMinuteT }
    177      *     
     177     *
    178178     */
    179179    public HeartRateInBeatsPerMinuteT getAverageHeartRateBpm() {
     
    183183    /**
    184184     * Sets the value of the averageHeartRateBpm property.
    185      * 
     185     *
    186186     * @param value
    187187     *     allowed object is
    188188     *     {@link HeartRateInBeatsPerMinuteT }
    189      *     
     189     *
    190190     */
    191191    public void setAverageHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
     
    195195    /**
    196196     * Gets the value of the maximumHeartRateBpm property.
    197      * 
     197     *
    198198     * @return
    199199     *     possible object is
    200200     *     {@link HeartRateInBeatsPerMinuteT }
    201      *     
     201     *
    202202     */
    203203    public HeartRateInBeatsPerMinuteT getMaximumHeartRateBpm() {
     
    207207    /**
    208208     * Sets the value of the maximumHeartRateBpm property.
    209      * 
     209     *
    210210     * @param value
    211211     *     allowed object is
    212212     *     {@link HeartRateInBeatsPerMinuteT }
    213      *     
     213     *
    214214     */
    215215    public void setMaximumHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
     
    219219    /**
    220220     * Gets the value of the intensity property.
    221      * 
     221     *
    222222     * @return
    223223     *     possible object is
    224224     *     {@link IntensityT }
    225      *     
     225     *
    226226     */
    227227    public IntensityT getIntensity() {
     
    231231    /**
    232232     * Sets the value of the intensity property.
    233      * 
     233     *
    234234     * @param value
    235235     *     allowed object is
    236236     *     {@link IntensityT }
    237      *     
     237     *
    238238     */
    239239    public void setIntensity(IntensityT value) {
     
    243243    /**
    244244     * Gets the value of the cadence property.
    245      * 
     245     *
    246246     * @return
    247247     *     possible object is
    248248     *     {@link Short }
    249      *     
     249     *
    250250     */
    251251    public Short getCadence() {
     
    255255    /**
    256256     * Sets the value of the cadence property.
    257      * 
     257     *
    258258     * @param value
    259259     *     allowed object is
    260260     *     {@link Short }
    261      *     
     261     *
    262262     */
    263263    public void setCadence(Short value) {
     
    267267    /**
    268268     * Gets the value of the triggerMethod property.
    269      * 
     269     *
    270270     * @return
    271271     *     possible object is
    272272     *     {@link TriggerMethodT }
    273      *     
     273     *
    274274     */
    275275    public TriggerMethodT getTriggerMethod() {
     
    279279    /**
    280280     * Sets the value of the triggerMethod property.
    281      * 
     281     *
    282282     * @param value
    283283     *     allowed object is
    284284     *     {@link TriggerMethodT }
    285      *     
     285     *
    286286     */
    287287    public void setTriggerMethod(TriggerMethodT value) {
     
    291291    /**
    292292     * Gets the value of the track property.
    293      * 
     293     *
    294294     * <p>
    295295     * This accessor method returns a reference to the live list,
     
    297297     * returned list will be present inside the JAXB object.
    298298     * This is why there is not a <CODE>set</CODE> method for the track property.
    299      * 
     299     *
    300300     * <p>
    301301     * For example, to add a new item, do as follows:
     
    303303     *    getTrack().add(newItem);
    304304     * </pre>
    305      * 
    306      * 
     305     *
     306     *
    307307     * <p>
    308308     * Objects of the following type(s) are allowed in the list
    309309     * {@link TrackT }
    310      * 
    311      * 
     310     *
     311     *
    312312     */
    313313    public List<TrackT> getTrack() {
     
    320320    /**
    321321     * Gets the value of the notes property.
    322      * 
     322     *
    323323     * @return
    324324     *     possible object is
    325325     *     {@link String }
    326      *     
     326     *
    327327     */
    328328    public String getNotes() {
     
    332332    /**
    333333     * Sets the value of the notes property.
    334      * 
     334     *
    335335     * @param value
    336336     *     allowed object is
    337337     *     {@link String }
    338      *     
     338     *
    339339     */
    340340    public void setNotes(String value) {
     
    344344    /**
    345345     * Gets the value of the extensions property.
    346      * 
     346     *
    347347     * @return
    348348     *     possible object is
    349349     *     {@link ExtensionsT }
    350      *     
     350     *
    351351     */
    352352    public ExtensionsT getExtensions() {
     
    356356    /**
    357357     * Sets the value of the extensions property.
    358      * 
     358     *
    359359     * @param value
    360360     *     allowed object is
    361361     *     {@link ExtensionsT }
    362      *     
     362     *
    363363     */
    364364    public void setExtensions(ExtensionsT value) {
     
    368368    /**
    369369     * Gets the value of the startTime property.
    370      * 
     370     *
    371371     * @return
    372372     *     possible object is
    373373     *     {@link XMLGregorianCalendar }
    374      *     
     374     *
    375375     */
    376376    public XMLGregorianCalendar getStartTime() {
     
    380380    /**
    381381     * Sets the value of the startTime property.
    382      * 
     382     *
    383383     * @param value
    384384     *     allowed object is
    385385     *     {@link XMLGregorianCalendar }
    386      *     
     386     *
    387387     */
    388388    public void setStartTime(XMLGregorianCalendar value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ActivityListT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for ActivityList_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="ActivityList_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    5151    /**
    5252     * Gets the value of the activity property.
    53      * 
     53     *
    5454     * <p>
    5555     * This accessor method returns a reference to the live list,
     
    5757     * returned list will be present inside the JAXB object.
    5858     * This is why there is not a <CODE>set</CODE> method for the activity property.
    59      * 
     59     *
    6060     * <p>
    6161     * For example, to add a new item, do as follows:
     
    6363     *    getActivity().add(newItem);
    6464     * </pre>
    65      * 
    66      * 
     65     *
     66     *
    6767     * <p>
    6868     * Objects of the following type(s) are allowed in the list
    6969     * {@link ActivityT }
    70      * 
    71      * 
     70     *
     71     *
    7272     */
    7373    public List<ActivityT> getActivity() {
     
    8080    /**
    8181     * Gets the value of the multiSportSession property.
    82      * 
     82     *
    8383     * <p>
    8484     * This accessor method returns a reference to the live list,
     
    8686     * returned list will be present inside the JAXB object.
    8787     * This is why there is not a <CODE>set</CODE> method for the multiSportSession property.
    88      * 
     88     *
    8989     * <p>
    9090     * For example, to add a new item, do as follows:
     
    9292     *    getMultiSportSession().add(newItem);
    9393     * </pre>
    94      * 
    95      * 
     94     *
     95     *
    9696     * <p>
    9797     * Objects of the following type(s) are allowed in the list
    9898     * {@link MultiSportSessionT }
    99      * 
    100      * 
     99     *
     100     *
    101101     */
    102102    public List<MultiSportSessionT> getMultiSportSession() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ActivityReferenceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for ActivityReference_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="ActivityReference_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    4848    /**
    4949     * Gets the value of the id property.
    50      * 
     50     *
    5151     * @return
    5252     *     possible object is
    5353     *     {@link XMLGregorianCalendar }
    54      *     
     54     *
    5555     */
    5656    public XMLGregorianCalendar getId() {
     
    6060    /**
    6161     * Sets the value of the id property.
    62      * 
     62     *
    6363     * @param value
    6464     *     allowed object is
    6565     *     {@link XMLGregorianCalendar }
    66      *     
     66     *
    6767     */
    6868    public void setId(XMLGregorianCalendar value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ActivityT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2222/**
    2323 * <p>Java class for Activity_t complex type.
    24  * 
     24 *
    2525 * <p>The following schema fragment specifies the expected content contained within this class.
    26  * 
     26 *
    2727 * <pre>
    2828 * &lt;complexType name="Activity_t">
     
    4242 * &lt;/complexType>
    4343 * </pre>
    44  * 
    45  * 
     44 *
     45 *
    4646 */
    4747@XmlAccessorType(XmlAccessType.FIELD)
     
    7474    /**
    7575     * Gets the value of the id property.
    76      * 
     76     *
    7777     * @return
    7878     *     possible object is
    7979     *     {@link XMLGregorianCalendar }
    80      *     
     80     *
    8181     */
    8282    public XMLGregorianCalendar getId() {
     
    8686    /**
    8787     * Sets the value of the id property.
    88      * 
     88     *
    8989     * @param value
    9090     *     allowed object is
    9191     *     {@link XMLGregorianCalendar }
    92      *     
     92     *
    9393     */
    9494    public void setId(XMLGregorianCalendar value) {
     
    9898    /**
    9999     * Gets the value of the lap property.
    100      * 
     100     *
    101101     * <p>
    102102     * This accessor method returns a reference to the live list,
     
    104104     * returned list will be present inside the JAXB object.
    105105     * This is why there is not a <CODE>set</CODE> method for the lap property.
    106      * 
     106     *
    107107     * <p>
    108108     * For example, to add a new item, do as follows:
     
    110110     *    getLap().add(newItem);
    111111     * </pre>
    112      * 
    113      * 
     112     *
     113     *
    114114     * <p>
    115115     * Objects of the following type(s) are allowed in the list
    116116     * {@link ActivityLapT }
    117      * 
    118      * 
     117     *
     118     *
    119119     */
    120120    public List<ActivityLapT> getLap() {
     
    127127    /**
    128128     * Gets the value of the notes property.
    129      * 
     129     *
    130130     * @return
    131131     *     possible object is
    132132     *     {@link String }
    133      *     
     133     *
    134134     */
    135135    public String getNotes() {
     
    139139    /**
    140140     * Sets the value of the notes property.
    141      * 
     141     *
    142142     * @param value
    143143     *     allowed object is
    144144     *     {@link String }
    145      *     
     145     *
    146146     */
    147147    public void setNotes(String value) {
     
    151151    /**
    152152     * Gets the value of the training property.
    153      * 
     153     *
    154154     * @return
    155155     *     possible object is
    156156     *     {@link TrainingT }
    157      *     
     157     *
    158158     */
    159159    public TrainingT getTraining() {
     
    163163    /**
    164164     * Sets the value of the training property.
    165      * 
     165     *
    166166     * @param value
    167167     *     allowed object is
    168168     *     {@link TrainingT }
    169      *     
     169     *
    170170     */
    171171    public void setTraining(TrainingT value) {
     
    175175    /**
    176176     * Gets the value of the creator property.
    177      * 
     177     *
    178178     * @return
    179179     *     possible object is
    180180     *     {@link AbstractSourceT }
    181      *     
     181     *
    182182     */
    183183    public AbstractSourceT getCreator() {
     
    187187    /**
    188188     * Sets the value of the creator property.
    189      * 
     189     *
    190190     * @param value
    191191     *     allowed object is
    192192     *     {@link AbstractSourceT }
    193      *     
     193     *
    194194     */
    195195    public void setCreator(AbstractSourceT value) {
     
    199199    /**
    200200     * Gets the value of the extensions property.
    201      * 
     201     *
    202202     * @return
    203203     *     possible object is
    204204     *     {@link ExtensionsT }
    205      *     
     205     *
    206206     */
    207207    public ExtensionsT getExtensions() {
     
    211211    /**
    212212     * Sets the value of the extensions property.
    213      * 
     213     *
    214214     * @param value
    215215     *     allowed object is
    216216     *     {@link ExtensionsT }
    217      *     
     217     *
    218218     */
    219219    public void setExtensions(ExtensionsT value) {
     
    223223    /**
    224224     * Gets the value of the sport property.
    225      * 
     225     *
    226226     * @return
    227227     *     possible object is
    228228     *     {@link SportT }
    229      *     
     229     *
    230230     */
    231231    public SportT getSport() {
     
    235235    /**
    236236     * Sets the value of the sport property.
    237      * 
     237     *
    238238     * @param value
    239239     *     allowed object is
    240240     *     {@link SportT }
    241      *     
     241     *
    242242     */
    243243    public void setSport(SportT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ApplicationT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * Identifies a PC software application.
    21  * 
     21 *
    2222 * <p>Java class for Application_t complex type.
    23  * 
     23 *
    2424 * <p>The following schema fragment specifies the expected content contained within this class.
    25  * 
     25 *
    2626 * <pre>
    2727 * &lt;complexType name="Application_t">
     
    3737 * &lt;/complexType>
    3838 * </pre>
    39  * 
    40  * 
     39 *
     40 *
    4141 */
    4242@XmlAccessorType(XmlAccessType.FIELD)
     
    6161    /**
    6262     * Gets the value of the build property.
    63      * 
     63     *
    6464     * @return
    6565     *     possible object is
    6666     *     {@link BuildT }
    67      *     
     67     *
    6868     */
    6969    public BuildT getBuild() {
     
    7373    /**
    7474     * Sets the value of the build property.
    75      * 
     75     *
    7676     * @param value
    7777     *     allowed object is
    7878     *     {@link BuildT }
    79      *     
     79     *
    8080     */
    8181    public void setBuild(BuildT value) {
     
    8585    /**
    8686     * Gets the value of the langID property.
    87      * 
     87     *
    8888     * @return
    8989     *     possible object is
    9090     *     {@link String }
    91      *     
     91     *
    9292     */
    9393    public String getLangID() {
     
    9797    /**
    9898     * Sets the value of the langID property.
    99      * 
     99     *
    100100     * @param value
    101101     *     allowed object is
    102102     *     {@link String }
    103      *     
     103     *
    104104     */
    105105    public void setLangID(String value) {
     
    109109    /**
    110110     * Gets the value of the partNumber property.
    111      * 
     111     *
    112112     * @return
    113113     *     possible object is
    114114     *     {@link String }
    115      *     
     115     *
    116116     */
    117117    public String getPartNumber() {
     
    121121    /**
    122122     * Sets the value of the partNumber property.
    123      * 
     123     *
    124124     * @param value
    125125     *     allowed object is
    126126     *     {@link String }
    127      *     
     127     *
    128128     */
    129129    public void setPartNumber(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/BuildT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for Build_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="Build_t">
     
    3636 * &lt;/complexType>
    3737 * </pre>
    38  * 
    39  * 
     38 *
     39 *
    4040 */
    4141@XmlAccessorType(XmlAccessType.FIELD)
     
    6161    /**
    6262     * Gets the value of the version property.
    63      * 
     63     *
    6464     * @return
    6565     *     possible object is
    6666     *     {@link VersionT }
    67      *     
     67     *
    6868     */
    6969    public VersionT getVersion() {
     
    7373    /**
    7474     * Sets the value of the version property.
    75      * 
     75     *
    7676     * @param value
    7777     *     allowed object is
    7878     *     {@link VersionT }
    79      *     
     79     *
    8080     */
    8181    public void setVersion(VersionT value) {
     
    8585    /**
    8686     * Gets the value of the type property.
    87      * 
     87     *
    8888     * @return
    8989     *     possible object is
    9090     *     {@link BuildTypeT }
    91      *     
     91     *
    9292     */
    9393    public BuildTypeT getType() {
     
    9797    /**
    9898     * Sets the value of the type property.
    99      * 
     99     *
    100100     * @param value
    101101     *     allowed object is
    102102     *     {@link BuildTypeT }
    103      *     
     103     *
    104104     */
    105105    public void setType(BuildTypeT value) {
     
    109109    /**
    110110     * Gets the value of the time property.
    111      * 
     111     *
    112112     * @return
    113113     *     possible object is
    114114     *     {@link String }
    115      *     
     115     *
    116116     */
    117117    public String getTime() {
     
    121121    /**
    122122     * Sets the value of the time property.
    123      * 
     123     *
    124124     * @param value
    125125     *     allowed object is
    126126     *     {@link String }
    127      *     
     127     *
    128128     */
    129129    public void setTime(String value) {
     
    133133    /**
    134134     * Gets the value of the builder property.
    135      * 
     135     *
    136136     * @return
    137137     *     possible object is
    138138     *     {@link String }
    139      *     
     139     *
    140140     */
    141141    public String getBuilder() {
     
    145145    /**
    146146     * Sets the value of the builder property.
    147      * 
     147     *
    148148     * @param value
    149149     *     allowed object is
    150150     *     {@link String }
    151      *     
     151     *
    152152     */
    153153    public void setBuilder(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/BuildTypeT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for BuildType_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2929 * &lt;/simpleType>
    3030 * </pre>
    31  * 
     31 *
    3232 */
    3333@XmlType(name = "BuildType_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CadenceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Cadence_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Cadence_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    5151    /**
    5252     * Gets the value of the low property.
    53      * 
     53     *
    5454     */
    5555    public double getLow() {
     
    5959    /**
    6060     * Sets the value of the low property.
    61      * 
     61     *
    6262     */
    6363    public void setLow(double value) {
     
    6767    /**
    6868     * Gets the value of the high property.
    69      * 
     69     *
    7070     */
    7171    public double getHigh() {
     
    7575    /**
    7676     * Sets the value of the high property.
    77      * 
     77     *
    7878     */
    7979    public void setHigh(double value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CaloriesBurnedT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for CaloriesBurned_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="CaloriesBurned_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the calories property.
    51      * 
     51     *
    5252     */
    5353    public int getCalories() {
     
    5757    /**
    5858     * Sets the value of the calories property.
    59      * 
     59     *
    6060     */
    6161    public void setCalories(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CourseFolderT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for CourseFolder_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="CourseFolder_t">
     
    3838 * &lt;/complexType>
    3939 * </pre>
    40  * 
    41  * 
     40 *
     41 *
    4242 */
    4343@XmlAccessorType(XmlAccessType.FIELD)
     
    6363    /**
    6464     * Gets the value of the folder property.
    65      * 
     65     *
    6666     * <p>
    6767     * This accessor method returns a reference to the live list,
     
    6969     * returned list will be present inside the JAXB object.
    7070     * This is why there is not a <CODE>set</CODE> method for the folder property.
    71      * 
     71     *
    7272     * <p>
    7373     * For example, to add a new item, do as follows:
     
    7575     *    getFolder().add(newItem);
    7676     * </pre>
    77      * 
    78      * 
     77     *
     78     *
    7979     * <p>
    8080     * Objects of the following type(s) are allowed in the list
    8181     * {@link CourseFolderT }
    82      * 
    83      * 
     82     *
     83     *
    8484     */
    8585    public List<CourseFolderT> getFolder() {
     
    9292    /**
    9393     * Gets the value of the courseNameRef property.
    94      * 
     94     *
    9595     * <p>
    9696     * This accessor method returns a reference to the live list,
     
    9898     * returned list will be present inside the JAXB object.
    9999     * This is why there is not a <CODE>set</CODE> method for the courseNameRef property.
    100      * 
     100     *
    101101     * <p>
    102102     * For example, to add a new item, do as follows:
     
    104104     *    getCourseNameRef().add(newItem);
    105105     * </pre>
    106      * 
    107      * 
     106     *
     107     *
    108108     * <p>
    109109     * Objects of the following type(s) are allowed in the list
    110110     * {@link NameKeyReferenceT }
    111      * 
    112      * 
     111     *
     112     *
    113113     */
    114114    public List<NameKeyReferenceT> getCourseNameRef() {
     
    121121    /**
    122122     * Gets the value of the notes property.
    123      * 
     123     *
    124124     * @return
    125125     *     possible object is
    126126     *     {@link String }
    127      *     
     127     *
    128128     */
    129129    public String getNotes() {
     
    133133    /**
    134134     * Sets the value of the notes property.
    135      * 
     135     *
    136136     * @param value
    137137     *     allowed object is
    138138     *     {@link String }
    139      *     
     139     *
    140140     */
    141141    public void setNotes(String value) {
     
    145145    /**
    146146     * Gets the value of the extensions property.
    147      * 
     147     *
    148148     * @return
    149149     *     possible object is
    150150     *     {@link ExtensionsT }
    151      *     
     151     *
    152152     */
    153153    public ExtensionsT getExtensions() {
     
    157157    /**
    158158     * Sets the value of the extensions property.
    159      * 
     159     *
    160160     * @param value
    161161     *     allowed object is
    162162     *     {@link ExtensionsT }
    163      *     
     163     *
    164164     */
    165165    public void setExtensions(ExtensionsT value) {
     
    169169    /**
    170170     * Gets the value of the name property.
    171      * 
     171     *
    172172     * @return
    173173     *     possible object is
    174174     *     {@link String }
    175      *     
     175     *
    176176     */
    177177    public String getName() {
     
    181181    /**
    182182     * Sets the value of the name property.
    183      * 
     183     *
    184184     * @param value
    185185     *     allowed object is
    186186     *     {@link String }
    187      *     
     187     *
    188188     */
    189189    public void setName(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CourseLapT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for CourseLap_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="CourseLap_t">
     
    4141 * &lt;/complexType>
    4242 * </pre>
    43  * 
    44  * 
     43 *
     44 *
    4545 */
    4646@XmlAccessorType(XmlAccessType.FIELD)
     
    8585    /**
    8686     * Gets the value of the totalTimeSeconds property.
    87      * 
     87     *
    8888     */
    8989    public double getTotalTimeSeconds() {
     
    9393    /**
    9494     * Sets the value of the totalTimeSeconds property.
    95      * 
     95     *
    9696     */
    9797    public void setTotalTimeSeconds(double value) {
     
    101101    /**
    102102     * Gets the value of the distanceMeters property.
    103      * 
     103     *
    104104     */
    105105    public double getDistanceMeters() {
     
    109109    /**
    110110     * Sets the value of the distanceMeters property.
    111      * 
     111     *
    112112     */
    113113    public void setDistanceMeters(double value) {
     
    117117    /**
    118118     * Gets the value of the beginPosition property.
    119      * 
     119     *
    120120     * @return
    121121     *     possible object is
    122122     *     {@link PositionT }
    123      *     
     123     *
    124124     */
    125125    public PositionT getBeginPosition() {
     
    129129    /**
    130130     * Sets the value of the beginPosition property.
    131      * 
     131     *
    132132     * @param value
    133133     *     allowed object is
    134134     *     {@link PositionT }
    135      *     
     135     *
    136136     */
    137137    public void setBeginPosition(PositionT value) {
     
    141141    /**
    142142     * Gets the value of the beginAltitudeMeters property.
    143      * 
     143     *
    144144     * @return
    145145     *     possible object is
    146146     *     {@link Double }
    147      *     
     147     *
    148148     */
    149149    public Double getBeginAltitudeMeters() {
     
    153153    /**
    154154     * Sets the value of the beginAltitudeMeters property.
    155      * 
     155     *
    156156     * @param value
    157157     *     allowed object is
    158158     *     {@link Double }
    159      *     
     159     *
    160160     */
    161161    public void setBeginAltitudeMeters(Double value) {
     
    165165    /**
    166166     * Gets the value of the endPosition property.
    167      * 
     167     *
    168168     * @return
    169169     *     possible object is
    170170     *     {@link PositionT }
    171      *     
     171     *
    172172     */
    173173    public PositionT getEndPosition() {
     
    177177    /**
    178178     * Sets the value of the endPosition property.
    179      * 
     179     *
    180180     * @param value
    181181     *     allowed object is
    182182     *     {@link PositionT }
    183      *     
     183     *
    184184     */
    185185    public void setEndPosition(PositionT value) {
     
    189189    /**
    190190     * Gets the value of the endAltitudeMeters property.
    191      * 
     191     *
    192192     * @return
    193193     *     possible object is
    194194     *     {@link Double }
    195      *     
     195     *
    196196     */
    197197    public Double getEndAltitudeMeters() {
     
    201201    /**
    202202     * Sets the value of the endAltitudeMeters property.
    203      * 
     203     *
    204204     * @param value
    205205     *     allowed object is
    206206     *     {@link Double }
    207      *     
     207     *
    208208     */
    209209    public void setEndAltitudeMeters(Double value) {
     
    213213    /**
    214214     * Gets the value of the averageHeartRateBpm property.
    215      * 
     215     *
    216216     * @return
    217217     *     possible object is
    218218     *     {@link HeartRateInBeatsPerMinuteT }
    219      *     
     219     *
    220220     */
    221221    public HeartRateInBeatsPerMinuteT getAverageHeartRateBpm() {
     
    225225    /**
    226226     * Sets the value of the averageHeartRateBpm property.
    227      * 
     227     *
    228228     * @param value
    229229     *     allowed object is
    230230     *     {@link HeartRateInBeatsPerMinuteT }
    231      *     
     231     *
    232232     */
    233233    public void setAverageHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
     
    237237    /**
    238238     * Gets the value of the maximumHeartRateBpm property.
    239      * 
     239     *
    240240     * @return
    241241     *     possible object is
    242242     *     {@link HeartRateInBeatsPerMinuteT }
    243      *     
     243     *
    244244     */
    245245    public HeartRateInBeatsPerMinuteT getMaximumHeartRateBpm() {
     
    249249    /**
    250250     * Sets the value of the maximumHeartRateBpm property.
    251      * 
     251     *
    252252     * @param value
    253253     *     allowed object is
    254254     *     {@link HeartRateInBeatsPerMinuteT }
    255      *     
     255     *
    256256     */
    257257    public void setMaximumHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
     
    261261    /**
    262262     * Gets the value of the intensity property.
    263      * 
     263     *
    264264     * @return
    265265     *     possible object is
    266266     *     {@link IntensityT }
    267      *     
     267     *
    268268     */
    269269    public IntensityT getIntensity() {
     
    273273    /**
    274274     * Sets the value of the intensity property.
    275      * 
     275     *
    276276     * @param value
    277277     *     allowed object is
    278278     *     {@link IntensityT }
    279      *     
     279     *
    280280     */
    281281    public void setIntensity(IntensityT value) {
     
    285285    /**
    286286     * Gets the value of the cadence property.
    287      * 
     287     *
    288288     * @return
    289289     *     possible object is
    290290     *     {@link Short }
    291      *     
     291     *
    292292     */
    293293    public Short getCadence() {
     
    297297    /**
    298298     * Sets the value of the cadence property.
    299      * 
     299     *
    300300     * @param value
    301301     *     allowed object is
    302302     *     {@link Short }
    303      *     
     303     *
    304304     */
    305305    public void setCadence(Short value) {
     
    309309    /**
    310310     * Gets the value of the extensions property.
    311      * 
     311     *
    312312     * @return
    313313     *     possible object is
    314314     *     {@link ExtensionsT }
    315      *     
     315     *
    316316     */
    317317    public ExtensionsT getExtensions() {
     
    321321    /**
    322322     * Sets the value of the extensions property.
    323      * 
     323     *
    324324     * @param value
    325325     *     allowed object is
    326326     *     {@link ExtensionsT }
    327      *     
     327     *
    328328     */
    329329    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CourseListT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for CourseList_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="CourseList_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the course property.
    49      * 
     49     *
    5050     * <p>
    5151     * This accessor method returns a reference to the live list,
     
    5353     * returned list will be present inside the JAXB object.
    5454     * This is why there is not a <CODE>set</CODE> method for the course property.
    55      * 
     55     *
    5656     * <p>
    5757     * For example, to add a new item, do as follows:
     
    5959     *    getCourse().add(newItem);
    6060     * </pre>
    61      * 
    62      * 
     61     *
     62     *
    6363     * <p>
    6464     * Objects of the following type(s) are allowed in the list
    6565     * {@link CourseT }
    66      * 
    67      * 
     66     *
     67     *
    6868     */
    6969    public List<CourseT> getCourse() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CoursePointT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2121/**
    2222 * <p>Java class for CoursePoint_t complex type.
    23  * 
     23 *
    2424 * <p>The following schema fragment specifies the expected content contained within this class.
    25  * 
     25 *
    2626 * <pre>
    2727 * &lt;complexType name="CoursePoint_t">
     
    4141 * &lt;/complexType>
    4242 * </pre>
    43  * 
    44  * 
     43 *
     44 *
    4545 */
    4646@XmlAccessorType(XmlAccessType.FIELD)
     
    7676    /**
    7777     * Gets the value of the name property.
    78      * 
    79      * @return
    80      *     possible object is
    81      *     {@link String }
    82      *     
     78     *
     79     * @return
     80     *     possible object is
     81     *     {@link String }
     82     *
    8383     */
    8484    public String getName() {
     
    8888    /**
    8989     * Sets the value of the name property.
    90      * 
    91      * @param value
    92      *     allowed object is
    93      *     {@link String }
    94      *     
     90     *
     91     * @param value
     92     *     allowed object is
     93     *     {@link String }
     94     *
    9595     */
    9696    public void setName(String value) {
     
    100100    /**
    101101     * Gets the value of the time property.
    102      * 
     102     *
    103103     * @return
    104104     *     possible object is
    105105     *     {@link XMLGregorianCalendar }
    106      *     
     106     *
    107107     */
    108108    public XMLGregorianCalendar getTime() {
     
    112112    /**
    113113     * Sets the value of the time property.
    114      * 
     114     *
    115115     * @param value
    116116     *     allowed object is
    117117     *     {@link XMLGregorianCalendar }
    118      *     
     118     *
    119119     */
    120120    public void setTime(XMLGregorianCalendar value) {
     
    124124    /**
    125125     * Gets the value of the position property.
    126      * 
     126     *
    127127     * @return
    128128     *     possible object is
    129129     *     {@link PositionT }
    130      *     
     130     *
    131131     */
    132132    public PositionT getPosition() {
     
    136136    /**
    137137     * Sets the value of the position property.
    138      * 
     138     *
    139139     * @param value
    140140     *     allowed object is
    141141     *     {@link PositionT }
    142      *     
     142     *
    143143     */
    144144    public void setPosition(PositionT value) {
     
    148148    /**
    149149     * Gets the value of the altitudeMeters property.
    150      * 
     150     *
    151151     * @return
    152152     *     possible object is
    153153     *     {@link Double }
    154      *     
     154     *
    155155     */
    156156    public Double getAltitudeMeters() {
     
    160160    /**
    161161     * Sets the value of the altitudeMeters property.
    162      * 
     162     *
    163163     * @param value
    164164     *     allowed object is
    165165     *     {@link Double }
    166      *     
     166     *
    167167     */
    168168    public void setAltitudeMeters(Double value) {
     
    172172    /**
    173173     * Gets the value of the pointType property.
    174      * 
    175      * @return
    176      *     possible object is
    177      *     {@link String }
    178      *     
     174     *
     175     * @return
     176     *     possible object is
     177     *     {@link String }
     178     *
    179179     */
    180180    public String getPointType() {
     
    184184    /**
    185185     * Sets the value of the pointType property.
    186      * 
    187      * @param value
    188      *     allowed object is
    189      *     {@link String }
    190      *     
     186     *
     187     * @param value
     188     *     allowed object is
     189     *     {@link String }
     190     *
    191191     */
    192192    public void setPointType(String value) {
     
    196196    /**
    197197     * Gets the value of the notes property.
    198      * 
    199      * @return
    200      *     possible object is
    201      *     {@link String }
    202      *     
     198     *
     199     * @return
     200     *     possible object is
     201     *     {@link String }
     202     *
    203203     */
    204204    public String getNotes() {
     
    208208    /**
    209209     * Sets the value of the notes property.
    210      * 
    211      * @param value
    212      *     allowed object is
    213      *     {@link String }
    214      *     
     210     *
     211     * @param value
     212     *     allowed object is
     213     *     {@link String }
     214     *
    215215     */
    216216    public void setNotes(String value) {
     
    220220    /**
    221221     * Gets the value of the extensions property.
    222      * 
     222     *
    223223     * @return
    224224     *     possible object is
    225225     *     {@link ExtensionsT }
    226      *     
     226     *
    227227     */
    228228    public ExtensionsT getExtensions() {
     
    232232    /**
    233233     * Sets the value of the extensions property.
    234      * 
     234     *
    235235     * @param value
    236236     *     allowed object is
    237237     *     {@link ExtensionsT }
    238      *     
     238     *
    239239     */
    240240    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CourseT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2121/**
    2222 * <p>Java class for Course_t complex type.
    23  * 
     23 *
    2424 * <p>The following schema fragment specifies the expected content contained within this class.
    25  * 
     25 *
    2626 * <pre>
    2727 * &lt;complexType name="Course_t">
     
    4141 * &lt;/complexType>
    4242 * </pre>
    43  * 
    44  * 
     43 *
     44 *
    4545 */
    4646@XmlAccessorType(XmlAccessType.FIELD)
     
    7474    /**
    7575     * Gets the value of the name property.
    76      * 
    77      * @return
    78      *     possible object is
    79      *     {@link String }
    80      *     
     76     *
     77     * @return
     78     *     possible object is
     79     *     {@link String }
     80     *
    8181     */
    8282    public String getName() {
     
    8686    /**
    8787     * Sets the value of the name property.
    88      * 
    89      * @param value
    90      *     allowed object is
    91      *     {@link String }
    92      *     
     88     *
     89     * @param value
     90     *     allowed object is
     91     *     {@link String }
     92     *
    9393     */
    9494    public void setName(String value) {
     
    9898    /**
    9999     * Gets the value of the lap property.
    100      * 
     100     *
    101101     * <p>
    102102     * This accessor method returns a reference to the live list,
     
    104104     * returned list will be present inside the JAXB object.
    105105     * This is why there is not a <CODE>set</CODE> method for the lap property.
    106      * 
     106     *
    107107     * <p>
    108108     * For example, to add a new item, do as follows:
     
    110110     *    getLap().add(newItem);
    111111     * </pre>
    112      * 
    113      * 
     112     *
     113     *
    114114     * <p>
    115115     * Objects of the following type(s) are allowed in the list
    116116     * {@link CourseLapT }
    117      * 
    118      * 
     117     *
     118     *
    119119     */
    120120    public List<CourseLapT> getLap() {
     
    127127    /**
    128128     * Gets the value of the track property.
    129      * 
     129     *
    130130     * <p>
    131131     * This accessor method returns a reference to the live list,
     
    133133     * returned list will be present inside the JAXB object.
    134134     * This is why there is not a <CODE>set</CODE> method for the track property.
    135      * 
     135     *
    136136     * <p>
    137137     * For example, to add a new item, do as follows:
     
    139139     *    getTrack().add(newItem);
    140140     * </pre>
    141      * 
    142      * 
     141     *
     142     *
    143143     * <p>
    144144     * Objects of the following type(s) are allowed in the list
    145145     * {@link TrackT }
    146      * 
    147      * 
     146     *
     147     *
    148148     */
    149149    public List<TrackT> getTrack() {
     
    156156    /**
    157157     * Gets the value of the notes property.
    158      * 
    159      * @return
    160      *     possible object is
    161      *     {@link String }
    162      *     
     158     *
     159     * @return
     160     *     possible object is
     161     *     {@link String }
     162     *
    163163     */
    164164    public String getNotes() {
     
    168168    /**
    169169     * Sets the value of the notes property.
    170      * 
    171      * @param value
    172      *     allowed object is
    173      *     {@link String }
    174      *     
     170     *
     171     * @param value
     172     *     allowed object is
     173     *     {@link String }
     174     *
    175175     */
    176176    public void setNotes(String value) {
     
    180180    /**
    181181     * Gets the value of the coursePoint property.
    182      * 
     182     *
    183183     * <p>
    184184     * This accessor method returns a reference to the live list,
     
    186186     * returned list will be present inside the JAXB object.
    187187     * This is why there is not a <CODE>set</CODE> method for the coursePoint property.
    188      * 
     188     *
    189189     * <p>
    190190     * For example, to add a new item, do as follows:
     
    192192     *    getCoursePoint().add(newItem);
    193193     * </pre>
    194      * 
    195      * 
     194     *
     195     *
    196196     * <p>
    197197     * Objects of the following type(s) are allowed in the list
    198198     * {@link CoursePointT }
    199      * 
    200      * 
     199     *
     200     *
    201201     */
    202202    public List<CoursePointT> getCoursePoint() {
     
    209209    /**
    210210     * Gets the value of the creator property.
    211      * 
     211     *
    212212     * @return
    213213     *     possible object is
    214214     *     {@link AbstractSourceT }
    215      *     
     215     *
    216216     */
    217217    public AbstractSourceT getCreator() {
     
    221221    /**
    222222     * Sets the value of the creator property.
    223      * 
     223     *
    224224     * @param value
    225225     *     allowed object is
    226226     *     {@link AbstractSourceT }
    227      *     
     227     *
    228228     */
    229229    public void setCreator(AbstractSourceT value) {
     
    233233    /**
    234234     * Gets the value of the extensions property.
    235      * 
     235     *
    236236     * @return
    237237     *     possible object is
    238238     *     {@link ExtensionsT }
    239      *     
     239     *
    240240     */
    241241    public ExtensionsT getExtensions() {
     
    245245    /**
    246246     * Sets the value of the extensions property.
    247      * 
     247     *
    248248     * @param value
    249249     *     allowed object is
    250250     *     {@link ExtensionsT }
    251      *     
     251     *
    252252     */
    253253    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CoursesT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Courses_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Courses_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the courseFolder property.
    51      * 
     51     *
    5252     * @return
    5353     *     possible object is
    5454     *     {@link CourseFolderT }
    55      *     
     55     *
    5656     */
    5757    public CourseFolderT getCourseFolder() {
     
    6161    /**
    6262     * Sets the value of the courseFolder property.
    63      * 
     63     *
    6464     * @param value
    6565     *     allowed object is
    6666     *     {@link CourseFolderT }
    67      *     
     67     *
    6868     */
    6969    public void setCourseFolder(CourseFolderT value) {
     
    7373    /**
    7474     * Gets the value of the extensions property.
    75      * 
     75     *
    7676     * @return
    7777     *     possible object is
    7878     *     {@link ExtensionsT }
    79      *     
     79     *
    8080     */
    8181    public ExtensionsT getExtensions() {
     
    8585    /**
    8686     * Sets the value of the extensions property.
    87      * 
     87     *
    8888     * @param value
    8989     *     allowed object is
    9090     *     {@link ExtensionsT }
    91      *     
     91     *
    9292     */
    9393    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CustomHeartRateZoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for CustomHeartRateZone_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="CustomHeartRateZone_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    5151    /**
    5252     * Gets the value of the low property.
    53      * 
     53     *
    5454     * @return
    5555     *     possible object is
    5656     *     {@link HeartRateValueT }
    57      *     
     57     *
    5858     */
    5959    public HeartRateValueT getLow() {
     
    6363    /**
    6464     * Sets the value of the low property.
    65      * 
     65     *
    6666     * @param value
    6767     *     allowed object is
    6868     *     {@link HeartRateValueT }
    69      *     
     69     *
    7070     */
    7171    public void setLow(HeartRateValueT value) {
     
    7575    /**
    7676     * Gets the value of the high property.
    77      * 
     77     *
    7878     * @return
    7979     *     possible object is
    8080     *     {@link HeartRateValueT }
    81      *     
     81     *
    8282     */
    8383    public HeartRateValueT getHigh() {
     
    8787    /**
    8888     * Sets the value of the high property.
    89      * 
     89     *
    9090     * @param value
    9191     *     allowed object is
    9292     *     {@link HeartRateValueT }
    93      *     
     93     *
    9494     */
    9595    public void setHigh(HeartRateValueT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/CustomSpeedZoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for CustomSpeedZone_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="CustomSpeedZone_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    5555    /**
    5656     * Gets the value of the viewAs property.
    57      * 
     57     *
    5858     * @return
    5959     *     possible object is
    6060     *     {@link SpeedTypeT }
    61      *     
     61     *
    6262     */
    6363    public SpeedTypeT getViewAs() {
     
    6767    /**
    6868     * Sets the value of the viewAs property.
    69      * 
     69     *
    7070     * @param value
    7171     *     allowed object is
    7272     *     {@link SpeedTypeT }
    73      *     
     73     *
    7474     */
    7575    public void setViewAs(SpeedTypeT value) {
     
    7979    /**
    8080     * Gets the value of the lowInMetersPerSecond property.
    81      * 
     81     *
    8282     */
    8383    public double getLowInMetersPerSecond() {
     
    8787    /**
    8888     * Sets the value of the lowInMetersPerSecond property.
    89      * 
     89     *
    9090     */
    9191    public void setLowInMetersPerSecond(double value) {
     
    9595    /**
    9696     * Gets the value of the highInMetersPerSecond property.
    97      * 
     97     *
    9898     */
    9999    public double getHighInMetersPerSecond() {
     
    103103    /**
    104104     * Sets the value of the highInMetersPerSecond property.
    105      * 
     105     *
    106106     */
    107107    public void setHighInMetersPerSecond(double value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/DeviceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020 *                                used to identify the type of device capable of handling
    2121 *                                the data for loading.
    22  * 
     22 *
    2323 * <p>Java class for Device_t complex type.
    24  * 
     24 *
    2525 * <p>The following schema fragment specifies the expected content contained within this class.
    26  * 
     26 *
    2727 * <pre>
    2828 * &lt;complexType name="Device_t">
     
    3838 * &lt;/complexType>
    3939 * </pre>
    40  * 
    41  * 
     40 *
     41 *
    4242 */
    4343@XmlAccessorType(XmlAccessType.FIELD)
     
    6262    /**
    6363     * Gets the value of the unitId property.
    64      * 
     64     *
    6565     */
    6666    public long getUnitId() {
     
    7070    /**
    7171     * Sets the value of the unitId property.
    72      * 
     72     *
    7373     */
    7474    public void setUnitId(long value) {
     
    7878    /**
    7979     * Gets the value of the productID property.
    80      * 
     80     *
    8181     */
    8282    public int getProductID() {
     
    8686    /**
    8787     * Sets the value of the productID property.
    88      * 
     88     *
    8989     */
    9090    public void setProductID(int value) {
     
    9494    /**
    9595     * Gets the value of the version property.
    96      * 
     96     *
    9797     * @return
    9898     *     possible object is
    9999     *     {@link VersionT }
    100      *     
     100     *
    101101     */
    102102    public VersionT getVersion() {
     
    106106    /**
    107107     * Sets the value of the version property.
    108      * 
     108     *
    109109     * @param value
    110110     *     allowed object is
    111111     *     {@link VersionT }
    112      *     
     112     *
    113113     */
    114114    public void setVersion(VersionT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/DistanceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for Distance_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="Distance_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the meters property.
    51      * 
     51     *
    5252     */
    5353    public int getMeters() {
     
    5757    /**
    5858     * Sets the value of the meters property.
    59      * 
     59     *
    6060     */
    6161    public void setMeters(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/DurationT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Duration_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Duration_t">
     
    2828 * &lt;/complexType>
    2929 * </pre>
    30  * 
    31  * 
     30 *
     31 *
    3232 */
    3333@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ExtensionsT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for Extensions_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="Extensions_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    4848    /**
    4949     * Gets the value of the any property.
    50      * 
     50     *
    5151     * <p>
    5252     * This accessor method returns a reference to the live list,
     
    5454     * returned list will be present inside the JAXB object.
    5555     * This is why there is not a <CODE>set</CODE> method for the any property.
    56      * 
     56     *
    5757     * <p>
    5858     * For example, to add a new item, do as follows:
     
    6060     *    getAny().add(newItem);
    6161     * </pre>
    62      * 
    63      * 
     62     *
     63     *
    6464     * <p>
    6565     * Objects of the following type(s) are allowed in the list
    6666     * {@link Object }
    6767     * {@link Element }
    68      * 
    69      * 
     68     *
     69     *
    7070     */
    7171    public List<Object> getAny() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/FirstSportT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for FirstSport_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="FirstSport_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4545    /**
    4646     * Gets the value of the activity property.
    47      * 
     47     *
    4848     * @return
    4949     *     possible object is
    5050     *     {@link ActivityT }
    51      *     
     51     *
    5252     */
    5353    public ActivityT getActivity() {
     
    5757    /**
    5858     * Sets the value of the activity property.
    59      * 
     59     *
    6060     * @param value
    6161     *     allowed object is
    6262     *     {@link ActivityT }
    63      *     
     63     *
    6464     */
    6565    public void setActivity(ActivityT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/FoldersT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Folders_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Folders_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    5353    /**
    5454     * Gets the value of the history property.
    55      * 
     55     *
    5656     * @return
    5757     *     possible object is
    5858     *     {@link HistoryT }
    59      *     
     59     *
    6060     */
    6161    public HistoryT getHistory() {
     
    6565    /**
    6666     * Sets the value of the history property.
    67      * 
     67     *
    6868     * @param value
    6969     *     allowed object is
    7070     *     {@link HistoryT }
    71      *     
     71     *
    7272     */
    7373    public void setHistory(HistoryT value) {
     
    7777    /**
    7878     * Gets the value of the workouts property.
    79      * 
     79     *
    8080     * @return
    8181     *     possible object is
    8282     *     {@link WorkoutsT }
    83      *     
     83     *
    8484     */
    8585    public WorkoutsT getWorkouts() {
     
    8989    /**
    9090     * Sets the value of the workouts property.
    91      * 
     91     *
    9292     * @param value
    9393     *     allowed object is
    9494     *     {@link WorkoutsT }
    95      *     
     95     *
    9696     */
    9797    public void setWorkouts(WorkoutsT value) {
     
    101101    /**
    102102     * Gets the value of the courses property.
    103      * 
     103     *
    104104     * @return
    105105     *     possible object is
    106106     *     {@link CoursesT }
    107      *     
     107     *
    108108     */
    109109    public CoursesT getCourses() {
     
    113113    /**
    114114     * Sets the value of the courses property.
    115      * 
     115     *
    116116     * @param value
    117117     *     allowed object is
    118118     *     {@link CoursesT }
    119      *     
     119     *
    120120     */
    121121    public void setCourses(CoursesT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/GenderT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for Gender_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2727 * &lt;/simpleType>
    2828 * </pre>
    29  * 
     29 *
    3030 */
    3131@XmlType(name = "Gender_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateAboveT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRateAbove_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRateAbove_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the heartRate property.
    49      * 
     49     *
    5050     * @return
    5151     *     possible object is
    5252     *     {@link HeartRateValueT }
    53      *     
     53     *
    5454     */
    5555    public HeartRateValueT getHeartRate() {
     
    5959    /**
    6060     * Sets the value of the heartRate property.
    61      * 
     61     *
    6262     * @param value
    6363     *     allowed object is
    6464     *     {@link HeartRateValueT }
    65      *     
     65     *
    6666     */
    6767    public void setHeartRate(HeartRateValueT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateAsPercentOfMaxT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRateAsPercentOfMax_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRateAsPercentOfMax_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the value property.
    49      * 
     49     *
    5050     */
    5151    public short getValue() {
     
    5555    /**
    5656     * Sets the value of the value property.
    57      * 
     57     *
    5858     */
    5959    public void setValue(short value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateBelowT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRateBelow_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRateBelow_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the heartRate property.
    49      * 
     49     *
    5050     * @return
    5151     *     possible object is
    5252     *     {@link HeartRateValueT }
    53      *     
     53     *
    5454     */
    5555    public HeartRateValueT getHeartRate() {
     
    5959    /**
    6060     * Sets the value of the heartRate property.
    61      * 
     61     *
    6262     * @param value
    6363     *     allowed object is
    6464     *     {@link HeartRateValueT }
    65      *     
     65     *
    6666     */
    6767    public void setHeartRate(HeartRateValueT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateInBeatsPerMinuteT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRateInBeatsPerMinute_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRateInBeatsPerMinute_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the value property.
    49      * 
     49     *
    5050     */
    5151    public short getValue() {
     
    5555    /**
    5656     * Sets the value of the value property.
    57      * 
     57     *
    5858     */
    5959    public void setValue(short value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRate_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRate_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the heartRateZone property.
    49      * 
     49     *
    5050     * @return
    5151     *     possible object is
    5252     *     {@link ZoneT }
    53      *     
     53     *
    5454     */
    5555    public ZoneT getHeartRateZone() {
     
    5959    /**
    6060     * Sets the value of the heartRateZone property.
    61      * 
     61     *
    6262     * @param value
    6363     *     allowed object is
    6464     *     {@link ZoneT }
    65      *     
     65     *
    6666     */
    6767    public void setHeartRateZone(ZoneT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HeartRateValueT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for HeartRateValue_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="HeartRateValue_t">
     
    2828 * &lt;/complexType>
    2929 * </pre>
    30  * 
    31  * 
     30 *
     31 *
    3232 */
    3333@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HistoryFolderT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for HistoryFolder_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="HistoryFolder_t">
     
    3939 * &lt;/complexType>
    4040 * </pre>
    41  * 
    42  * 
     41 *
     42 *
    4343 */
    4444@XmlAccessorType(XmlAccessType.FIELD)
     
    6767    /**
    6868     * Gets the value of the folder property.
    69      * 
     69     *
    7070     * <p>
    7171     * This accessor method returns a reference to the live list,
     
    7373     * returned list will be present inside the JAXB object.
    7474     * This is why there is not a <CODE>set</CODE> method for the folder property.
    75      * 
     75     *
    7676     * <p>
    7777     * For example, to add a new item, do as follows:
     
    7979     *    getFolder().add(newItem);
    8080     * </pre>
    81      * 
    82      * 
     81     *
     82     *
    8383     * <p>
    8484     * Objects of the following type(s) are allowed in the list
    8585     * {@link HistoryFolderT }
    86      * 
    87      * 
     86     *
     87     *
    8888     */
    8989    public List<HistoryFolderT> getFolder() {
     
    9696    /**
    9797     * Gets the value of the activityRef property.
    98      * 
     98     *
    9999     * <p>
    100100     * This accessor method returns a reference to the live list,
     
    102102     * returned list will be present inside the JAXB object.
    103103     * This is why there is not a <CODE>set</CODE> method for the activityRef property.
    104      * 
     104     *
    105105     * <p>
    106106     * For example, to add a new item, do as follows:
     
    108108     *    getActivityRef().add(newItem);
    109109     * </pre>
    110      * 
    111      * 
     110     *
     111     *
    112112     * <p>
    113113     * Objects of the following type(s) are allowed in the list
    114114     * {@link ActivityReferenceT }
    115      * 
    116      * 
     115     *
     116     *
    117117     */
    118118    public List<ActivityReferenceT> getActivityRef() {
     
    125125    /**
    126126     * Gets the value of the week property.
    127      * 
     127     *
    128128     * <p>
    129129     * This accessor method returns a reference to the live list,
     
    131131     * returned list will be present inside the JAXB object.
    132132     * This is why there is not a <CODE>set</CODE> method for the week property.
    133      * 
     133     *
    134134     * <p>
    135135     * For example, to add a new item, do as follows:
     
    137137     *    getWeek().add(newItem);
    138138     * </pre>
    139      * 
    140      * 
     139     *
     140     *
    141141     * <p>
    142142     * Objects of the following type(s) are allowed in the list
    143143     * {@link WeekT }
    144      * 
    145      * 
     144     *
     145     *
    146146     */
    147147    public List<WeekT> getWeek() {
     
    154154    /**
    155155     * Gets the value of the notes property.
    156      * 
     156     *
    157157     * @return
    158158     *     possible object is
    159159     *     {@link String }
    160      *     
     160     *
    161161     */
    162162    public String getNotes() {
     
    166166    /**
    167167     * Sets the value of the notes property.
    168      * 
     168     *
    169169     * @param value
    170170     *     allowed object is
    171171     *     {@link String }
    172      *     
     172     *
    173173     */
    174174    public void setNotes(String value) {
     
    178178    /**
    179179     * Gets the value of the extensions property.
    180      * 
     180     *
    181181     * @return
    182182     *     possible object is
    183183     *     {@link ExtensionsT }
    184      *     
     184     *
    185185     */
    186186    public ExtensionsT getExtensions() {
     
    190190    /**
    191191     * Sets the value of the extensions property.
    192      * 
     192     *
    193193     * @param value
    194194     *     allowed object is
    195195     *     {@link ExtensionsT }
    196      *     
     196     *
    197197     */
    198198    public void setExtensions(ExtensionsT value) {
     
    202202    /**
    203203     * Gets the value of the name property.
    204      * 
     204     *
    205205     * @return
    206206     *     possible object is
    207207     *     {@link String }
    208      *     
     208     *
    209209     */
    210210    public String getName() {
     
    214214    /**
    215215     * Sets the value of the name property.
    216      * 
     216     *
    217217     * @param value
    218218     *     allowed object is
    219219     *     {@link String }
    220      *     
     220     *
    221221     */
    222222    public void setName(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/HistoryT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for History_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="History_t">
     
    3535 * &lt;/complexType>
    3636 * </pre>
    37  * 
    38  * 
     37 *
     38 *
    3939 */
    4040@XmlAccessorType(XmlAccessType.FIELD)
     
    6161    /**
    6262     * Gets the value of the running property.
    63      * 
     63     *
    6464     * @return
    6565     *     possible object is
    6666     *     {@link HistoryFolderT }
    67      *     
     67     *
    6868     */
    6969    public HistoryFolderT getRunning() {
     
    7373    /**
    7474     * Sets the value of the running property.
    75      * 
     75     *
    7676     * @param value
    7777     *     allowed object is
    7878     *     {@link HistoryFolderT }
    79      *     
     79     *
    8080     */
    8181    public void setRunning(HistoryFolderT value) {
     
    8585    /**
    8686     * Gets the value of the biking property.
    87      * 
     87     *
    8888     * @return
    8989     *     possible object is
    9090     *     {@link HistoryFolderT }
    91      *     
     91     *
    9292     */
    9393    public HistoryFolderT getBiking() {
     
    9797    /**
    9898     * Sets the value of the biking property.
    99      * 
     99     *
    100100     * @param value
    101101     *     allowed object is
    102102     *     {@link HistoryFolderT }
    103      *     
     103     *
    104104     */
    105105    public void setBiking(HistoryFolderT value) {
     
    109109    /**
    110110     * Gets the value of the other property.
    111      * 
     111     *
    112112     * @return
    113113     *     possible object is
    114114     *     {@link HistoryFolderT }
    115      *     
     115     *
    116116     */
    117117    public HistoryFolderT getOther() {
     
    121121    /**
    122122     * Sets the value of the other property.
    123      * 
     123     *
    124124     * @param value
    125125     *     allowed object is
    126126     *     {@link HistoryFolderT }
    127      *     
     127     *
    128128     */
    129129    public void setOther(HistoryFolderT value) {
     
    133133    /**
    134134     * Gets the value of the multiSport property.
    135      * 
     135     *
    136136     * @return
    137137     *     possible object is
    138138     *     {@link MultiSportFolderT }
    139      *     
     139     *
    140140     */
    141141    public MultiSportFolderT getMultiSport() {
     
    145145    /**
    146146     * Sets the value of the multiSport property.
    147      * 
     147     *
    148148     * @param value
    149149     *     allowed object is
    150150     *     {@link MultiSportFolderT }
    151      *     
     151     *
    152152     */
    153153    public void setMultiSport(MultiSportFolderT value) {
     
    157157    /**
    158158     * Gets the value of the extensions property.
    159      * 
     159     *
    160160     * @return
    161161     *     possible object is
    162162     *     {@link ExtensionsT }
    163      *     
     163     *
    164164     */
    165165    public ExtensionsT getExtensions() {
     
    169169    /**
    170170     * Sets the value of the extensions property.
    171      * 
     171     *
    172172     * @param value
    173173     *     allowed object is
    174174     *     {@link ExtensionsT }
    175      *     
     175     *
    176176     */
    177177    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/IntensityT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for Intensity_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2727 * &lt;/simpleType>
    2828 * </pre>
    29  * 
     29 *
    3030 */
    3131@XmlType(name = "Intensity_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/MultiSportFolderT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for MultiSportFolder_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="MultiSportFolder_t">
     
    3939 * &lt;/complexType>
    4040 * </pre>
    41  * 
    42  * 
     41 *
     42 *
    4343 */
    4444@XmlAccessorType(XmlAccessType.FIELD)
     
    6767    /**
    6868     * Gets the value of the folder property.
    69      * 
     69     *
    7070     * <p>
    7171     * This accessor method returns a reference to the live list,
     
    7373     * returned list will be present inside the JAXB object.
    7474     * This is why there is not a <CODE>set</CODE> method for the folder property.
    75      * 
     75     *
    7676     * <p>
    7777     * For example, to add a new item, do as follows:
     
    7979     *    getFolder().add(newItem);
    8080     * </pre>
    81      * 
    82      * 
     81     *
     82     *
    8383     * <p>
    8484     * Objects of the following type(s) are allowed in the list
    8585     * {@link MultiSportFolderT }
    86      * 
    87      * 
     86     *
     87     *
    8888     */
    8989    public List<MultiSportFolderT> getFolder() {
     
    9696    /**
    9797     * Gets the value of the multisportActivityRef property.
    98      * 
     98     *
    9999     * <p>
    100100     * This accessor method returns a reference to the live list,
     
    102102     * returned list will be present inside the JAXB object.
    103103     * This is why there is not a <CODE>set</CODE> method for the multisportActivityRef property.
    104      * 
     104     *
    105105     * <p>
    106106     * For example, to add a new item, do as follows:
     
    108108     *    getMultisportActivityRef().add(newItem);
    109109     * </pre>
    110      * 
    111      * 
     110     *
     111     *
    112112     * <p>
    113113     * Objects of the following type(s) are allowed in the list
    114114     * {@link ActivityReferenceT }
    115      * 
    116      * 
     115     *
     116     *
    117117     */
    118118    public List<ActivityReferenceT> getMultisportActivityRef() {
     
    125125    /**
    126126     * Gets the value of the week property.
    127      * 
     127     *
    128128     * <p>
    129129     * This accessor method returns a reference to the live list,
     
    131131     * returned list will be present inside the JAXB object.
    132132     * This is why there is not a <CODE>set</CODE> method for the week property.
    133      * 
     133     *
    134134     * <p>
    135135     * For example, to add a new item, do as follows:
     
    137137     *    getWeek().add(newItem);
    138138     * </pre>
    139      * 
    140      * 
     139     *
     140     *
    141141     * <p>
    142142     * Objects of the following type(s) are allowed in the list
    143143     * {@link WeekT }
    144      * 
    145      * 
     144     *
     145     *
    146146     */
    147147    public List<WeekT> getWeek() {
     
    154154    /**
    155155     * Gets the value of the notes property.
    156      * 
     156     *
    157157     * @return
    158158     *     possible object is
    159159     *     {@link String }
    160      *     
     160     *
    161161     */
    162162    public String getNotes() {
     
    166166    /**
    167167     * Sets the value of the notes property.
    168      * 
     168     *
    169169     * @param value
    170170     *     allowed object is
    171171     *     {@link String }
    172      *     
     172     *
    173173     */
    174174    public void setNotes(String value) {
     
    178178    /**
    179179     * Gets the value of the extensions property.
    180      * 
     180     *
    181181     * @return
    182182     *     possible object is
    183183     *     {@link ExtensionsT }
    184      *     
     184     *
    185185     */
    186186    public ExtensionsT getExtensions() {
     
    190190    /**
    191191     * Sets the value of the extensions property.
    192      * 
     192     *
    193193     * @param value
    194194     *     allowed object is
    195195     *     {@link ExtensionsT }
    196      *     
     196     *
    197197     */
    198198    public void setExtensions(ExtensionsT value) {
     
    202202    /**
    203203     * Gets the value of the name property.
    204      * 
     204     *
    205205     * @return
    206206     *     possible object is
    207207     *     {@link String }
    208      *     
     208     *
    209209     */
    210210    public String getName() {
     
    214214    /**
    215215     * Sets the value of the name property.
    216      * 
     216     *
    217217     * @param value
    218218     *     allowed object is
    219219     *     {@link String }
    220      *     
     220     *
    221221     */
    222222    public void setName(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/MultiSportSessionT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2121/**
    2222 * <p>Java class for MultiSportSession_t complex type.
    23  * 
     23 *
    2424 * <p>The following schema fragment specifies the expected content contained within this class.
    25  * 
     25 *
    2626 * <pre>
    2727 * &lt;complexType name="MultiSportSession_t">
     
    3838 * &lt;/complexType>
    3939 * </pre>
    40  * 
    41  * 
     40 *
     41 *
    4242 */
    4343@XmlAccessorType(XmlAccessType.FIELD)
     
    6262    /**
    6363     * Gets the value of the id property.
    64      * 
     64     *
    6565     * @return
    6666     *     possible object is
    6767     *     {@link XMLGregorianCalendar }
    68      *     
     68     *
    6969     */
    7070    public XMLGregorianCalendar getId() {
     
    7474    /**
    7575     * Sets the value of the id property.
    76      * 
     76     *
    7777     * @param value
    7878     *     allowed object is
    7979     *     {@link XMLGregorianCalendar }
    80      *     
     80     *
    8181     */
    8282    public void setId(XMLGregorianCalendar value) {
     
    8686    /**
    8787     * Gets the value of the firstSport property.
    88      * 
     88     *
    8989     * @return
    9090     *     possible object is
    9191     *     {@link FirstSportT }
    92      *     
     92     *
    9393     */
    9494    public FirstSportT getFirstSport() {
     
    9898    /**
    9999     * Sets the value of the firstSport property.
    100      * 
     100     *
    101101     * @param value
    102102     *     allowed object is
    103103     *     {@link FirstSportT }
    104      *     
     104     *
    105105     */
    106106    public void setFirstSport(FirstSportT value) {
     
    110110    /**
    111111     * Gets the value of the nextSport property.
    112      * 
     112     *
    113113     * <p>
    114114     * This accessor method returns a reference to the live list,
     
    116116     * returned list will be present inside the JAXB object.
    117117     * This is why there is not a <CODE>set</CODE> method for the nextSport property.
    118      * 
     118     *
    119119     * <p>
    120120     * For example, to add a new item, do as follows:
     
    122122     *    getNextSport().add(newItem);
    123123     * </pre>
    124      * 
    125      * 
     124     *
     125     *
    126126     * <p>
    127127     * Objects of the following type(s) are allowed in the list
    128128     * {@link NextSportT }
    129      * 
    130      * 
     129     *
     130     *
    131131     */
    132132    public List<NextSportT> getNextSport() {
     
    139139    /**
    140140     * Gets the value of the notes property.
    141      * 
     141     *
    142142     * @return
    143143     *     possible object is
    144144     *     {@link String }
    145      *     
     145     *
    146146     */
    147147    public String getNotes() {
     
    151151    /**
    152152     * Sets the value of the notes property.
    153      * 
     153     *
    154154     * @param value
    155155     *     allowed object is
    156156     *     {@link String }
    157      *     
     157     *
    158158     */
    159159    public void setNotes(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/NameKeyReferenceT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for NameKeyReference_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="NameKeyReference_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    4848    /**
    4949     * Gets the value of the id property.
    50      * 
     50     *
    5151     * @return
    5252     *     possible object is
    5353     *     {@link String }
    54      *     
     54     *
    5555     */
    5656    public String getId() {
     
    6060    /**
    6161     * Sets the value of the id property.
    62      * 
     62     *
    6363     * @param value
    6464     *     allowed object is
    6565     *     {@link String }
    66      *     
     66     *
    6767     */
    6868    public void setId(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/NextSportT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for NextSport_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="NextSport_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the transition property.
    51      * 
     51     *
    5252     * @return
    5353     *     possible object is
    5454     *     {@link ActivityLapT }
    55      *     
     55     *
    5656     */
    5757    public ActivityLapT getTransition() {
     
    6161    /**
    6262     * Sets the value of the transition property.
    63      * 
     63     *
    6464     * @param value
    6565     *     allowed object is
    6666     *     {@link ActivityLapT }
    67      *     
     67     *
    6868     */
    6969    public void setTransition(ActivityLapT value) {
     
    7373    /**
    7474     * Gets the value of the activity property.
    75      * 
     75     *
    7676     * @return
    7777     *     possible object is
    7878     *     {@link ActivityT }
    79      *     
     79     *
    8080     */
    8181    public ActivityT getActivity() {
     
    8585    /**
    8686     * Sets the value of the activity property.
    87      * 
     87     *
    8888     * @param value
    8989     *     allowed object is
    9090     *     {@link ActivityT }
    91      *     
     91     *
    9292     */
    9393    public void setActivity(ActivityT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/NoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for None_t complex type.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    20  * 
     20 *
    2121 * <pre>
    2222 * &lt;complexType name="None_t">
     
    2727 * &lt;/complexType>
    2828 * </pre>
    29  * 
    30  * 
     29 *
     30 *
    3131 */
    3232@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ObjectFactory.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616
    1717/**
    18  * This object contains factory methods for each 
    19  * Java content interface and Java element interface 
    20  * generated in the org.openstreetmap.josm.plugins.dataimport.io.tcx package. 
    21  * <p>An ObjectFactory allows you to programatically 
    22  * construct new instances of the Java representation 
    23  * for XML content. The Java representation of XML 
    24  * content can consist of schema derived interfaces 
    25  * and classes representing the binding of schema 
    26  * type definitions, element declarations and model 
    27  * groups.  Factory methods for each of these are 
     18 * This object contains factory methods for each
     19 * Java content interface and Java element interface
     20 * generated in the org.openstreetmap.josm.plugins.dataimport.io.tcx package.
     21 * <p>An ObjectFactory allows you to programatically
     22 * construct new instances of the Java representation
     23 * for XML content. The Java representation of XML
     24 * content can consist of schema derived interfaces
     25 * and classes representing the binding of schema
     26 * type definitions, element declarations and model
     27 * groups.  Factory methods for each of these are
    2828 * provided in this class.
    29  * 
     29 *
    3030 */
    3131@XmlRegistry
     
    3636    /**
    3737     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openstreetmap.josm.plugins.dataimport.io.tcx
    38      * 
     38     *
    3939     */
    4040    public ObjectFactory() {
     
    4343    /**
    4444     * Create an instance of {@link NameKeyReferenceT }
    45      * 
     45     *
    4646     */
    4747    public NameKeyReferenceT createNameKeyReferenceT() {
     
    5151    /**
    5252     * Create an instance of {@link CourseListT }
    53      * 
     53     *
    5454     */
    5555    public CourseListT createCourseListT() {
     
    5959    /**
    6060     * Create an instance of {@link RepeatT }
    61      * 
     61     *
    6262     */
    6363    public RepeatT createRepeatT() {
     
    6767    /**
    6868     * Create an instance of {@link SpeedT }
    69      * 
     69     *
    7070     */
    7171    public SpeedT createSpeedT() {
     
    7575    /**
    7676     * Create an instance of {@link HeartRateAsPercentOfMaxT }
    77      * 
     77     *
    7878     */
    7979    public HeartRateAsPercentOfMaxT createHeartRateAsPercentOfMaxT() {
     
    8383    /**
    8484     * Create an instance of {@link NoneT }
    85      * 
     85     *
    8686     */
    8787    public NoneT createNoneT() {
     
    9191    /**
    9292     * Create an instance of {@link CourseFolderT }
    93      * 
     93     *
    9494     */
    9595    public CourseFolderT createCourseFolderT() {
     
    9999    /**
    100100     * Create an instance of {@link TrackT }
    101      * 
     101     *
    102102     */
    103103    public TrackT createTrackT() {
     
    107107    /**
    108108     * Create an instance of {@link PredefinedSpeedZoneT }
    109      * 
     109     *
    110110     */
    111111    public PredefinedSpeedZoneT createPredefinedSpeedZoneT() {
     
    115115    /**
    116116     * Create an instance of {@link CadenceT }
    117      * 
     117     *
    118118     */
    119119    public CadenceT createCadenceT() {
     
    123123    /**
    124124     * Create an instance of {@link WorkoutFolderT }
    125      * 
     125     *
    126126     */
    127127    public WorkoutFolderT createWorkoutFolderT() {
     
    131131    /**
    132132     * Create an instance of {@link QuickWorkoutT }
    133      * 
     133     *
    134134     */
    135135    public QuickWorkoutT createQuickWorkoutT() {
     
    139139    /**
    140140     * Create an instance of {@link ActivityReferenceT }
    141      * 
     141     *
    142142     */
    143143    public ActivityReferenceT createActivityReferenceT() {
     
    147147    /**
    148148     * Create an instance of {@link VersionT }
    149      * 
     149     *
    150150     */
    151151    public VersionT createVersionT() {
     
    155155    /**
    156156     * Create an instance of {@link WorkoutListT }
    157      * 
     157     *
    158158     */
    159159    public WorkoutListT createWorkoutListT() {
     
    163163    /**
    164164     * Create an instance of {@link HeartRateInBeatsPerMinuteT }
    165      * 
     165     *
    166166     */
    167167    public HeartRateInBeatsPerMinuteT createHeartRateInBeatsPerMinuteT() {
     
    171171    /**
    172172     * Create an instance of {@link PositionT }
    173      * 
     173     *
    174174     */
    175175    public PositionT createPositionT() {
     
    179179    /**
    180180     * Create an instance of {@link HistoryT }
    181      * 
     181     *
    182182     */
    183183    public HistoryT createHistoryT() {
     
    187187    /**
    188188     * Create an instance of {@link ApplicationT }
    189      * 
     189     *
    190190     */
    191191    public ApplicationT createApplicationT() {
     
    195195    /**
    196196     * Create an instance of {@link DeviceT }
    197      * 
     197     *
    198198     */
    199199    public DeviceT createDeviceT() {
     
    203203    /**
    204204     * Create an instance of {@link ExtensionsT }
    205      * 
     205     *
    206206     */
    207207    public ExtensionsT createExtensionsT() {
     
    211211    /**
    212212     * Create an instance of {@link TimeT }
    213      * 
     213     *
    214214     */
    215215    public TimeT createTimeT() {
     
    219219    /**
    220220     * Create an instance of {@link WorkoutsT }
    221      * 
     221     *
    222222     */
    223223    public WorkoutsT createWorkoutsT() {
     
    227227    /**
    228228     * Create an instance of {@link ActivityLapT }
    229      * 
     229     *
    230230     */
    231231    public ActivityLapT createActivityLapT() {
     
    235235    /**
    236236     * Create an instance of {@link MultiSportSessionT }
    237      * 
     237     *
    238238     */
    239239    public MultiSportSessionT createMultiSportSessionT() {
     
    243243    /**
    244244     * Create an instance of {@link BuildT }
    245      * 
     245     *
    246246     */
    247247    public BuildT createBuildT() {
     
    251251    /**
    252252     * Create an instance of {@link ActivityT }
    253      * 
     253     *
    254254     */
    255255    public ActivityT createActivityT() {
     
    259259    /**
    260260     * Create an instance of {@link TrainingT }
    261      * 
     261     *
    262262     */
    263263    public TrainingT createTrainingT() {
     
    267267    /**
    268268     * Create an instance of {@link PlanT }
    269      * 
     269     *
    270270     */
    271271    public PlanT createPlanT() {
     
    275275    /**
    276276     * Create an instance of {@link TrainingCenterDatabaseT }
    277      * 
     277     *
    278278     */
    279279    public TrainingCenterDatabaseT createTrainingCenterDatabaseT() {
     
    283283    /**
    284284     * Create an instance of {@link FoldersT }
    285      * 
     285     *
    286286     */
    287287    public FoldersT createFoldersT() {
     
    291291    /**
    292292     * Create an instance of {@link UserInitiatedT }
    293      * 
     293     *
    294294     */
    295295    public UserInitiatedT createUserInitiatedT() {
     
    299299    /**
    300300     * Create an instance of {@link MultiSportFolderT }
    301      * 
     301     *
    302302     */
    303303    public MultiSportFolderT createMultiSportFolderT() {
     
    307307    /**
    308308     * Create an instance of {@link ActivityListT }
    309      * 
     309     *
    310310     */
    311311    public ActivityListT createActivityListT() {
     
    315315    /**
    316316     * Create an instance of {@link CustomHeartRateZoneT }
    317      * 
     317     *
    318318     */
    319319    public CustomHeartRateZoneT createCustomHeartRateZoneT() {
     
    323323    /**
    324324     * Create an instance of {@link TrackpointT }
    325      * 
     325     *
    326326     */
    327327    public TrackpointT createTrackpointT() {
     
    331331    /**
    332332     * Create an instance of {@link CourseT }
    333      * 
     333     *
    334334     */
    335335    public CourseT createCourseT() {
     
    339339    /**
    340340     * Create an instance of {@link CourseLapT }
    341      * 
     341     *
    342342     */
    343343    public CourseLapT createCourseLapT() {
     
    347347    /**
    348348     * Create an instance of {@link NextSportT }
    349      * 
     349     *
    350350     */
    351351    public NextSportT createNextSportT() {
     
    355355    /**
    356356     * Create an instance of {@link DistanceT }
    357      * 
     357     *
    358358     */
    359359    public DistanceT createDistanceT() {
     
    363363    /**
    364364     * Create an instance of {@link FirstSportT }
    365      * 
     365     *
    366366     */
    367367    public FirstSportT createFirstSportT() {
     
    371371    /**
    372372     * Create an instance of {@link HeartRateT }
    373      * 
     373     *
    374374     */
    375375    public HeartRateT createHeartRateT() {
     
    379379    /**
    380380     * Create an instance of {@link CaloriesBurnedT }
    381      * 
     381     *
    382382     */
    383383    public CaloriesBurnedT createCaloriesBurnedT() {
     
    387387    /**
    388388     * Create an instance of {@link StepT }
    389      * 
     389     *
    390390     */
    391391    public StepT createStepT() {
     
    395395    /**
    396396     * Create an instance of {@link HeartRateBelowT }
    397      * 
     397     *
    398398     */
    399399    public HeartRateBelowT createHeartRateBelowT() {
     
    403403    /**
    404404     * Create an instance of {@link HeartRateAboveT }
    405      * 
     405     *
    406406     */
    407407    public HeartRateAboveT createHeartRateAboveT() {
     
    411411    /**
    412412     * Create an instance of {@link CoursesT }
    413      * 
     413     *
    414414     */
    415415    public CoursesT createCoursesT() {
     
    419419    /**
    420420     * Create an instance of {@link WorkoutT }
    421      * 
     421     *
    422422     */
    423423    public WorkoutT createWorkoutT() {
     
    427427    /**
    428428     * Create an instance of {@link WeekT }
    429      * 
     429     *
    430430     */
    431431    public WeekT createWeekT() {
     
    435435    /**
    436436     * Create an instance of {@link CustomSpeedZoneT }
    437      * 
     437     *
    438438     */
    439439    public CustomSpeedZoneT createCustomSpeedZoneT() {
     
    443443    /**
    444444     * Create an instance of {@link HistoryFolderT }
    445      * 
     445     *
    446446     */
    447447    public HistoryFolderT createHistoryFolderT() {
     
    451451    /**
    452452     * Create an instance of {@link PredefinedHeartRateZoneT }
    453      * 
     453     *
    454454     */
    455455    public PredefinedHeartRateZoneT createPredefinedHeartRateZoneT() {
     
    459459    /**
    460460     * Create an instance of {@link CoursePointT }
    461      * 
     461     *
    462462     */
    463463    public CoursePointT createCoursePointT() {
     
    467467    /**
    468468     * Create an instance of {@link JAXBElement }{@code <}{@link TrainingCenterDatabaseT }{@code >}}
    469      * 
     469     *
    470470     */
    471471    @XmlElementDecl(namespace = "http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2", name = "TrainingCenterDatabase")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/PlanT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for Plan_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="Plan_t">
     
    3737 * &lt;/complexType>
    3838 * </pre>
    39  * 
    40  * 
     39 *
     40 *
    4141 */
    4242@XmlAccessorType(XmlAccessType.FIELD)
     
    5959    /**
    6060     * Gets the value of the name property.
    61      * 
     61     *
    6262     * @return
    6363     *     possible object is
    6464     *     {@link String }
    65      *     
     65     *
    6666     */
    6767    public String getName() {
     
    7171    /**
    7272     * Sets the value of the name property.
    73      * 
     73     *
    7474     * @param value
    7575     *     allowed object is
    7676     *     {@link String }
    77      *     
     77     *
    7878     */
    7979    public void setName(String value) {
     
    8383    /**
    8484     * Gets the value of the extensions property.
    85      * 
     85     *
    8686     * @return
    8787     *     possible object is
    8888     *     {@link ExtensionsT }
    89      *     
     89     *
    9090     */
    9191    public ExtensionsT getExtensions() {
     
    9595    /**
    9696     * Sets the value of the extensions property.
    97      * 
     97     *
    9898     * @param value
    9999     *     allowed object is
    100100     *     {@link ExtensionsT }
    101      *     
     101     *
    102102     */
    103103    public void setExtensions(ExtensionsT value) {
     
    107107    /**
    108108     * Gets the value of the type property.
    109      * 
     109     *
    110110     * @return
    111111     *     possible object is
    112112     *     {@link TrainingTypeT }
    113      *     
     113     *
    114114     */
    115115    public TrainingTypeT getType() {
     
    119119    /**
    120120     * Sets the value of the type property.
    121      * 
     121     *
    122122     * @param value
    123123     *     allowed object is
    124124     *     {@link TrainingTypeT }
    125      *     
     125     *
    126126     */
    127127    public void setType(TrainingTypeT value) {
     
    131131    /**
    132132     * Gets the value of the intervalWorkout property.
    133      * 
     133     *
    134134     */
    135135    public boolean isIntervalWorkout() {
     
    139139    /**
    140140     * Sets the value of the intervalWorkout property.
    141      * 
     141     *
    142142     */
    143143    public void setIntervalWorkout(boolean value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/PositionT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Position_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Position_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the latitudeDegrees property.
    51      * 
     51     *
    5252     */
    5353    public double getLatitudeDegrees() {
     
    5757    /**
    5858     * Sets the value of the latitudeDegrees property.
    59      * 
     59     *
    6060     */
    6161    public void setLatitudeDegrees(double value) {
     
    6565    /**
    6666     * Gets the value of the longitudeDegrees property.
    67      * 
     67     *
    6868     */
    6969    public double getLongitudeDegrees() {
     
    7373    /**
    7474     * Sets the value of the longitudeDegrees property.
    75      * 
     75     *
    7676     */
    7777    public void setLongitudeDegrees(double value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/PredefinedHeartRateZoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for PredefinedHeartRateZone_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="PredefinedHeartRateZone_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the number property.
    49      * 
     49     *
    5050     */
    5151    public int getNumber() {
     
    5555    /**
    5656     * Sets the value of the number property.
    57      * 
     57     *
    5858     */
    5959    public void setNumber(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/PredefinedSpeedZoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for PredefinedSpeedZone_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="PredefinedSpeedZone_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the number property.
    49      * 
     49     *
    5050     */
    5151    public int getNumber() {
     
    5555    /**
    5656     * Sets the value of the number property.
    57      * 
     57     *
    5858     */
    5959    public void setNumber(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/QuickWorkoutT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for QuickWorkout_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="QuickWorkout_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the totalTimeSeconds property.
    51      * 
     51     *
    5252     */
    5353    public double getTotalTimeSeconds() {
     
    5757    /**
    5858     * Sets the value of the totalTimeSeconds property.
    59      * 
     59     *
    6060     */
    6161    public void setTotalTimeSeconds(double value) {
     
    6565    /**
    6666     * Gets the value of the distanceMeters property.
    67      * 
     67     *
    6868     */
    6969    public double getDistanceMeters() {
     
    7373    /**
    7474     * Sets the value of the distanceMeters property.
    75      * 
     75     *
    7676     */
    7777    public void setDistanceMeters(double value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/RepeatT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for Repeat_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="Repeat_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    5353    /**
    5454     * Gets the value of the repetitions property.
    55      * 
     55     *
    5656     */
    5757    public int getRepetitions() {
     
    6161    /**
    6262     * Sets the value of the repetitions property.
    63      * 
     63     *
    6464     */
    6565    public void setRepetitions(int value) {
     
    6969    /**
    7070     * Gets the value of the child property.
    71      * 
     71     *
    7272     * <p>
    7373     * This accessor method returns a reference to the live list,
     
    7575     * returned list will be present inside the JAXB object.
    7676     * This is why there is not a <CODE>set</CODE> method for the child property.
    77      * 
     77     *
    7878     * <p>
    7979     * For example, to add a new item, do as follows:
     
    8181     *    getChild().add(newItem);
    8282     * </pre>
    83      * 
    84      * 
     83     *
     84     *
    8585     * <p>
    8686     * Objects of the following type(s) are allowed in the list
    8787     * {@link AbstractStepT }
    88      * 
    89      * 
     88     *
     89     *
    9090     */
    9191    public List<AbstractStepT> getChild() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/SensorStateT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for SensorState_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2727 * &lt;/simpleType>
    2828 * </pre>
    29  * 
     29 *
    3030 */
    3131@XmlType(name = "SensorState_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/SpeedT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Speed_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Speed_t">
     
    3131 * &lt;/complexType>
    3232 * </pre>
    33  * 
    34  * 
     33 *
     34 *
    3535 */
    3636@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the speedZone property.
    49      * 
     49     *
    5050     * @return
    5151     *     possible object is
    5252     *     {@link ZoneT }
    53      *     
     53     *
    5454     */
    5555    public ZoneT getSpeedZone() {
     
    5959    /**
    6060     * Sets the value of the speedZone property.
    61      * 
     61     *
    6262     * @param value
    6363     *     allowed object is
    6464     *     {@link ZoneT }
    65      *     
     65     *
    6666     */
    6767    public void setSpeedZone(ZoneT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/SpeedTypeT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for SpeedType_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2727 * &lt;/simpleType>
    2828 * </pre>
    29  * 
     29 *
    3030 */
    3131@XmlType(name = "SpeedType_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/SportT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for Sport_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2828 * &lt;/simpleType>
    2929 * </pre>
    30  * 
     30 *
    3131 */
    3232@XmlType(name = "Sport_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/StepT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for Step_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="Step_t">
     
    3636 * &lt;/complexType>
    3737 * </pre>
    38  * 
    39  * 
     38 *
     39 *
    4040 */
    4141@XmlAccessorType(XmlAccessType.FIELD)
     
    6262    /**
    6363     * Gets the value of the name property.
    64      * 
     64     *
    6565     * @return
    6666     *     possible object is
    6767     *     {@link String }
    68      *     
     68     *
    6969     */
    7070    public String getName() {
     
    7474    /**
    7575     * Sets the value of the name property.
    76      * 
     76     *
    7777     * @param value
    7878     *     allowed object is
    7979     *     {@link String }
    80      *     
     80     *
    8181     */
    8282    public void setName(String value) {
     
    8686    /**
    8787     * Gets the value of the duration property.
    88      * 
     88     *
    8989     * @return
    9090     *     possible object is
    9191     *     {@link DurationT }
    92      *     
     92     *
    9393     */
    9494    public DurationT getDuration() {
     
    9898    /**
    9999     * Sets the value of the duration property.
    100      * 
     100     *
    101101     * @param value
    102102     *     allowed object is
    103103     *     {@link DurationT }
    104      *     
     104     *
    105105     */
    106106    public void setDuration(DurationT value) {
     
    110110    /**
    111111     * Gets the value of the intensity property.
    112      * 
     112     *
    113113     * @return
    114114     *     possible object is
    115115     *     {@link IntensityT }
    116      *     
     116     *
    117117     */
    118118    public IntensityT getIntensity() {
     
    122122    /**
    123123     * Sets the value of the intensity property.
    124      * 
     124     *
    125125     * @param value
    126126     *     allowed object is
    127127     *     {@link IntensityT }
    128      *     
     128     *
    129129     */
    130130    public void setIntensity(IntensityT value) {
     
    134134    /**
    135135     * Gets the value of the target property.
    136      * 
     136     *
    137137     * @return
    138138     *     possible object is
    139139     *     {@link TargetT }
    140      *     
     140     *
    141141     */
    142142    public TargetT getTarget() {
     
    146146    /**
    147147     * Sets the value of the target property.
    148      * 
     148     *
    149149     * @param value
    150150     *     allowed object is
    151151     *     {@link TargetT }
    152      *     
     152     *
    153153     */
    154154    public void setTarget(TargetT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TargetT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Target_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Target_t">
     
    2828 * &lt;/complexType>
    2929 * </pre>
    30  * 
    31  * 
     30 *
     31 *
    3232 */
    3333@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TimeT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for Time_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="Time_t">
     
    3232 * &lt;/complexType>
    3333 * </pre>
    34  * 
    35  * 
     34 *
     35 *
    3636 */
    3737@XmlAccessorType(XmlAccessType.FIELD)
     
    4949    /**
    5050     * Gets the value of the seconds property.
    51      * 
     51     *
    5252     */
    5353    public int getSeconds() {
     
    5757    /**
    5858     * Sets the value of the seconds property.
    59      * 
     59     *
    6060     */
    6161    public void setSeconds(int value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TrackT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for Track_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="Track_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the trackpoint property.
    49      * 
     49     *
    5050     * <p>
    5151     * This accessor method returns a reference to the live list,
     
    5353     * returned list will be present inside the JAXB object.
    5454     * This is why there is not a <CODE>set</CODE> method for the trackpoint property.
    55      * 
     55     *
    5656     * <p>
    5757     * For example, to add a new item, do as follows:
     
    5959     *    getTrackpoint().add(newItem);
    6060     * </pre>
    61      * 
    62      * 
     61     *
     62     *
    6363     * <p>
    6464     * Objects of the following type(s) are allowed in the list
    6565     * {@link TrackpointT }
    66      * 
    67      * 
     66     *
     67     *
    6868     */
    6969    public List<TrackpointT> getTrackpoint() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TrackpointT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for Trackpoint_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="Trackpoint_t">
     
    4040 * &lt;/complexType>
    4141 * </pre>
    42  * 
    43  * 
     42 *
     43 *
    4444 */
    4545@XmlAccessorType(XmlAccessType.FIELD)
     
    7676    /**
    7777     * Gets the value of the time property.
    78      * 
     78     *
    7979     * @return
    8080     *     possible object is
    8181     *     {@link XMLGregorianCalendar }
    82      *     
     82     *
    8383     */
    8484    public XMLGregorianCalendar getTime() {
     
    8888    /**
    8989     * Sets the value of the time property.
    90      * 
     90     *
    9191     * @param value
    9292     *     allowed object is
    9393     *     {@link XMLGregorianCalendar }
    94      *     
     94     *
    9595     */
    9696    public void setTime(XMLGregorianCalendar value) {
     
    100100    /**
    101101     * Gets the value of the position property.
    102      * 
     102     *
    103103     * @return
    104104     *     possible object is
    105105     *     {@link PositionT }
    106      *     
     106     *
    107107     */
    108108    public PositionT getPosition() {
     
    112112    /**
    113113     * Sets the value of the position property.
    114      * 
     114     *
    115115     * @param value
    116116     *     allowed object is
    117117     *     {@link PositionT }
    118      *     
     118     *
    119119     */
    120120    public void setPosition(PositionT value) {
     
    124124    /**
    125125     * Gets the value of the altitudeMeters property.
    126      * 
    127      * @return
    128      *     possible object is
    129      *     {@link Double }
    130      *     
     126     *
     127     * @return
     128     *     possible object is
     129     *     {@link Double }
     130     *
    131131     */
    132132    public Double getAltitudeMeters() {
     
    136136    /**
    137137     * Sets the value of the altitudeMeters property.
    138      * 
    139      * @param value
    140      *     allowed object is
    141      *     {@link Double }
    142      *     
     138     *
     139     * @param value
     140     *     allowed object is
     141     *     {@link Double }
     142     *
    143143     */
    144144    public void setAltitudeMeters(Double value) {
     
    148148    /**
    149149     * Gets the value of the distanceMeters property.
    150      * 
    151      * @return
    152      *     possible object is
    153      *     {@link Double }
    154      *     
     150     *
     151     * @return
     152     *     possible object is
     153     *     {@link Double }
     154     *
    155155     */
    156156    public Double getDistanceMeters() {
     
    160160    /**
    161161     * Sets the value of the distanceMeters property.
    162      * 
    163      * @param value
    164      *     allowed object is
    165      *     {@link Double }
    166      *     
     162     *
     163     * @param value
     164     *     allowed object is
     165     *     {@link Double }
     166     *
    167167     */
    168168    public void setDistanceMeters(Double value) {
     
    172172    /**
    173173     * Gets the value of the heartRateBpm property.
    174      * 
     174     *
    175175     * @return
    176176     *     possible object is
    177177     *     {@link HeartRateInBeatsPerMinuteT }
    178      *     
     178     *
    179179     */
    180180    public HeartRateInBeatsPerMinuteT getHeartRateBpm() {
     
    184184    /**
    185185     * Sets the value of the heartRateBpm property.
    186      * 
     186     *
    187187     * @param value
    188188     *     allowed object is
    189189     *     {@link HeartRateInBeatsPerMinuteT }
    190      *     
     190     *
    191191     */
    192192    public void setHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
     
    196196    /**
    197197     * Gets the value of the cadence property.
    198      * 
     198     *
    199199     * @return
    200200     *     possible object is
    201201     *     {@link Short }
    202      *     
     202     *
    203203     */
    204204    public Short getCadence() {
     
    208208    /**
    209209     * Sets the value of the cadence property.
    210      * 
     210     *
    211211     * @param value
    212212     *     allowed object is
    213213     *     {@link Short }
    214      *     
     214     *
    215215     */
    216216    public void setCadence(Short value) {
     
    220220    /**
    221221     * Gets the value of the sensorState property.
    222      * 
     222     *
    223223     * @return
    224224     *     possible object is
    225225     *     {@link SensorStateT }
    226      *     
     226     *
    227227     */
    228228    public SensorStateT getSensorState() {
     
    232232    /**
    233233     * Sets the value of the sensorState property.
    234      * 
     234     *
    235235     * @param value
    236236     *     allowed object is
    237237     *     {@link SensorStateT }
    238      *     
     238     *
    239239     */
    240240    public void setSensorState(SensorStateT value) {
     
    244244    /**
    245245     * Gets the value of the extensions property.
    246      * 
     246     *
    247247     * @return
    248248     *     possible object is
    249249     *     {@link ExtensionsT }
    250      *     
     250     *
    251251     */
    252252    public ExtensionsT getExtensions() {
     
    256256    /**
    257257     * Sets the value of the extensions property.
    258      * 
     258     *
    259259     * @param value
    260260     *     allowed object is
    261261     *     {@link ExtensionsT }
    262      *     
     262     *
    263263     */
    264264    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TrainingCenterDatabaseT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for TrainingCenterDatabase_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="TrainingCenterDatabase_t">
     
    3636 * &lt;/complexType>
    3737 * </pre>
    38  * 
    39  * 
     38 *
     39 *
    4040 */
    4141@XmlAccessorType(XmlAccessType.FIELD)
     
    6565    /**
    6666     * Gets the value of the folders property.
    67      * 
     67     *
    6868     * @return
    6969     *     possible object is
    7070     *     {@link FoldersT }
    71      *     
     71     *
    7272     */
    7373    public FoldersT getFolders() {
     
    7777    /**
    7878     * Sets the value of the folders property.
    79      * 
     79     *
    8080     * @param value
    8181     *     allowed object is
    8282     *     {@link FoldersT }
    83      *     
     83     *
    8484     */
    8585    public void setFolders(FoldersT value) {
     
    8989    /**
    9090     * Gets the value of the activities property.
    91      * 
     91     *
    9292     * @return
    9393     *     possible object is
    9494     *     {@link ActivityListT }
    95      *     
     95     *
    9696     */
    9797    public ActivityListT getActivities() {
     
    101101    /**
    102102     * Sets the value of the activities property.
    103      * 
     103     *
    104104     * @param value
    105105     *     allowed object is
    106106     *     {@link ActivityListT }
    107      *     
     107     *
    108108     */
    109109    public void setActivities(ActivityListT value) {
     
    113113    /**
    114114     * Gets the value of the workouts property.
    115      * 
     115     *
    116116     * @return
    117117     *     possible object is
    118118     *     {@link WorkoutListT }
    119      *     
     119     *
    120120     */
    121121    public WorkoutListT getWorkouts() {
     
    125125    /**
    126126     * Sets the value of the workouts property.
    127      * 
     127     *
    128128     * @param value
    129129     *     allowed object is
    130130     *     {@link WorkoutListT }
    131      *     
     131     *
    132132     */
    133133    public void setWorkouts(WorkoutListT value) {
     
    137137    /**
    138138     * Gets the value of the courses property.
    139      * 
     139     *
    140140     * @return
    141141     *     possible object is
    142142     *     {@link CourseListT }
    143      *     
     143     *
    144144     */
    145145    public CourseListT getCourses() {
     
    149149    /**
    150150     * Sets the value of the courses property.
    151      * 
     151     *
    152152     * @param value
    153153     *     allowed object is
    154154     *     {@link CourseListT }
    155      *     
     155     *
    156156     */
    157157    public void setCourses(CourseListT value) {
     
    161161    /**
    162162     * Gets the value of the author property.
    163      * 
     163     *
    164164     * @return
    165165     *     possible object is
    166166     *     {@link AbstractSourceT }
    167      *     
     167     *
    168168     */
    169169    public AbstractSourceT getAuthor() {
     
    173173    /**
    174174     * Sets the value of the author property.
    175      * 
     175     *
    176176     * @param value
    177177     *     allowed object is
    178178     *     {@link AbstractSourceT }
    179      *     
     179     *
    180180     */
    181181    public void setAuthor(AbstractSourceT value) {
     
    185185    /**
    186186     * Gets the value of the extensions property.
    187      * 
     187     *
    188188     * @return
    189189     *     possible object is
    190190     *     {@link ExtensionsT }
    191      *     
     191     *
    192192     */
    193193    public ExtensionsT getExtensions() {
     
    197197    /**
    198198     * Sets the value of the extensions property.
    199      * 
     199     *
    200200     * @param value
    201201     *     allowed object is
    202202     *     {@link ExtensionsT }
    203      *     
     203     *
    204204     */
    205205    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TrainingT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for Training_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="Training_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    5353    /**
    5454     * Gets the value of the quickWorkoutResults property.
    55      * 
     55     *
    5656     * @return
    5757     *     possible object is
    5858     *     {@link QuickWorkoutT }
    59      *     
     59     *
    6060     */
    6161    public QuickWorkoutT getQuickWorkoutResults() {
     
    6565    /**
    6666     * Sets the value of the quickWorkoutResults property.
    67      * 
     67     *
    6868     * @param value
    6969     *     allowed object is
    7070     *     {@link QuickWorkoutT }
    71      *     
     71     *
    7272     */
    7373    public void setQuickWorkoutResults(QuickWorkoutT value) {
     
    7777    /**
    7878     * Gets the value of the plan property.
    79      * 
     79     *
    8080     * @return
    8181     *     possible object is
    8282     *     {@link PlanT }
    83      *     
     83     *
    8484     */
    8585    public PlanT getPlan() {
     
    8989    /**
    9090     * Sets the value of the plan property.
    91      * 
     91     *
    9292     * @param value
    9393     *     allowed object is
    9494     *     {@link PlanT }
    95      *     
     95     *
    9696     */
    9797    public void setPlan(PlanT value) {
     
    101101    /**
    102102     * Gets the value of the virtualPartner property.
    103      * 
     103     *
    104104     */
    105105    public boolean isVirtualPartner() {
     
    109109    /**
    110110     * Sets the value of the virtualPartner property.
    111      * 
     111     *
    112112     */
    113113    public void setVirtualPartner(boolean value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TrainingTypeT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for TrainingType_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    2727 * &lt;/simpleType>
    2828 * </pre>
    29  * 
     29 *
    3030 */
    3131@XmlType(name = "TrainingType_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/TriggerMethodT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for TriggerMethod_t.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    2020 * <p>
     
    3030 * &lt;/simpleType>
    3131 * </pre>
    32  * 
     32 *
    3333 */
    3434@XmlType(name = "TriggerMethod_t")
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/UserInitiatedT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1616/**
    1717 * <p>Java class for UserInitiated_t complex type.
    18  * 
     18 *
    1919 * <p>The following schema fragment specifies the expected content contained within this class.
    20  * 
     20 *
    2121 * <pre>
    2222 * &lt;complexType name="UserInitiated_t">
     
    2727 * &lt;/complexType>
    2828 * </pre>
    29  * 
    30  * 
     29 *
     30 *
    3131 */
    3232@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/VersionT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1818/**
    1919 * <p>Java class for Version_t complex type.
    20  * 
     20 *
    2121 * <p>The following schema fragment specifies the expected content contained within this class.
    22  * 
     22 *
    2323 * <pre>
    2424 * &lt;complexType name="Version_t">
     
    3535 * &lt;/complexType>
    3636 * </pre>
    37  * 
    38  * 
     37 *
     38 *
    3939 */
    4040@XmlAccessorType(XmlAccessType.FIELD)
     
    6262    /**
    6363     * Gets the value of the versionMajor property.
    64      * 
     64     *
    6565     */
    6666    public int getVersionMajor() {
     
    7070    /**
    7171     * Sets the value of the versionMajor property.
    72      * 
     72     *
    7373     */
    7474    public void setVersionMajor(int value) {
     
    7878    /**
    7979     * Gets the value of the versionMinor property.
    80      * 
     80     *
    8181     */
    8282    public int getVersionMinor() {
     
    8686    /**
    8787     * Sets the value of the versionMinor property.
    88      * 
     88     *
    8989     */
    9090    public void setVersionMinor(int value) {
     
    9494    /**
    9595     * Gets the value of the buildMajor property.
    96      * 
     96     *
    9797     * @return
    9898     *     possible object is
    9999     *     {@link Integer }
    100      *     
     100     *
    101101     */
    102102    public Integer getBuildMajor() {
     
    106106    /**
    107107     * Sets the value of the buildMajor property.
    108      * 
     108     *
    109109     * @param value
    110110     *     allowed object is
    111111     *     {@link Integer }
    112      *     
     112     *
    113113     */
    114114    public void setBuildMajor(Integer value) {
     
    118118    /**
    119119     * Gets the value of the buildMinor property.
    120      * 
     120     *
    121121     * @return
    122122     *     possible object is
    123123     *     {@link Integer }
    124      *     
     124     *
    125125     */
    126126    public Integer getBuildMinor() {
     
    130130    /**
    131131     * Sets the value of the buildMinor property.
    132      * 
     132     *
    133133     * @param value
    134134     *     allowed object is
    135135     *     {@link Integer }
    136      *     
     136     *
    137137     */
    138138    public void setBuildMinor(Integer value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/WeekT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for Week_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="Week_t">
     
    3535 * &lt;/complexType>
    3636 * </pre>
    37  * 
    38  * 
     37 *
     38 *
    3939 */
    4040@XmlAccessorType(XmlAccessType.FIELD)
     
    5252    /**
    5353     * Gets the value of the notes property.
    54      * 
     54     *
    5555     * @return
    5656     *     possible object is
    5757     *     {@link String }
    58      *     
     58     *
    5959     */
    6060    public String getNotes() {
     
    6464    /**
    6565     * Sets the value of the notes property.
    66      * 
     66     *
    6767     * @param value
    6868     *     allowed object is
    6969     *     {@link String }
    70      *     
     70     *
    7171     */
    7272    public void setNotes(String value) {
     
    7676    /**
    7777     * Gets the value of the startDay property.
    78      * 
     78     *
    7979     * @return
    8080     *     possible object is
    8181     *     {@link XMLGregorianCalendar }
    82      *     
     82     *
    8383     */
    8484    public XMLGregorianCalendar getStartDay() {
     
    8888    /**
    8989     * Sets the value of the startDay property.
    90      * 
     90     *
    9191     * @param value
    9292     *     allowed object is
    9393     *     {@link XMLGregorianCalendar }
    94      *     
     94     *
    9595     */
    9696    public void setStartDay(XMLGregorianCalendar value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/WorkoutFolderT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2020/**
    2121 * <p>Java class for WorkoutFolder_t complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType name="WorkoutFolder_t">
     
    3737 * &lt;/complexType>
    3838 * </pre>
    39  * 
    40  * 
     39 *
     40 *
    4141 */
    4242@XmlAccessorType(XmlAccessType.FIELD)
     
    5959    /**
    6060     * Gets the value of the folder property.
    61      * 
     61     *
    6262     * <p>
    6363     * This accessor method returns a reference to the live list,
     
    6565     * returned list will be present inside the JAXB object.
    6666     * This is why there is not a <CODE>set</CODE> method for the folder property.
    67      * 
     67     *
    6868     * <p>
    6969     * For example, to add a new item, do as follows:
     
    7171     *    getFolder().add(newItem);
    7272     * </pre>
    73      * 
    74      * 
     73     *
     74     *
    7575     * <p>
    7676     * Objects of the following type(s) are allowed in the list
    7777     * {@link WorkoutFolderT }
    78      * 
    79      * 
     78     *
     79     *
    8080     */
    8181    public List<WorkoutFolderT> getFolder() {
     
    8888    /**
    8989     * Gets the value of the workoutNameRef property.
    90      * 
     90     *
    9191     * <p>
    9292     * This accessor method returns a reference to the live list,
     
    9494     * returned list will be present inside the JAXB object.
    9595     * This is why there is not a <CODE>set</CODE> method for the workoutNameRef property.
    96      * 
     96     *
    9797     * <p>
    9898     * For example, to add a new item, do as follows:
     
    100100     *    getWorkoutNameRef().add(newItem);
    101101     * </pre>
    102      * 
    103      * 
     102     *
     103     *
    104104     * <p>
    105105     * Objects of the following type(s) are allowed in the list
    106106     * {@link NameKeyReferenceT }
    107      * 
    108      * 
     107     *
     108     *
    109109     */
    110110    public List<NameKeyReferenceT> getWorkoutNameRef() {
     
    117117    /**
    118118     * Gets the value of the extensions property.
    119      * 
     119     *
    120120     * @return
    121121     *     possible object is
    122122     *     {@link ExtensionsT }
    123      *     
     123     *
    124124     */
    125125    public ExtensionsT getExtensions() {
     
    129129    /**
    130130     * Sets the value of the extensions property.
    131      * 
     131     *
    132132     * @param value
    133133     *     allowed object is
    134134     *     {@link ExtensionsT }
    135      *     
     135     *
    136136     */
    137137    public void setExtensions(ExtensionsT value) {
     
    141141    /**
    142142     * Gets the value of the name property.
    143      * 
     143     *
    144144     * @return
    145145     *     possible object is
    146146     *     {@link String }
    147      *     
     147     *
    148148     */
    149149    public String getName() {
     
    153153    /**
    154154     * Sets the value of the name property.
    155      * 
     155     *
    156156     * @param value
    157157     *     allowed object is
    158158     *     {@link String }
    159      *     
     159     *
    160160     */
    161161    public void setName(String value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/WorkoutListT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1919/**
    2020 * <p>Java class for WorkoutList_t complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="WorkoutList_t">
     
    3333 * &lt;/complexType>
    3434 * </pre>
    35  * 
    36  * 
     35 *
     36 *
    3737 */
    3838@XmlAccessorType(XmlAccessType.FIELD)
     
    4747    /**
    4848     * Gets the value of the workout property.
    49      * 
     49     *
    5050     * <p>
    5151     * This accessor method returns a reference to the live list,
     
    5353     * returned list will be present inside the JAXB object.
    5454     * This is why there is not a <CODE>set</CODE> method for the workout property.
    55      * 
     55     *
    5656     * <p>
    5757     * For example, to add a new item, do as follows:
     
    5959     *    getWorkout().add(newItem);
    6060     * </pre>
    61      * 
    62      * 
     61     *
     62     *
    6363     * <p>
    6464     * Objects of the following type(s) are allowed in the list
    6565     * {@link WorkoutT }
    66      * 
    67      * 
     66     *
     67     *
    6868     */
    6969    public List<WorkoutT> getWorkout() {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/WorkoutT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    2424/**
    2525 * <p>Java class for Workout_t complex type.
    26  * 
     26 *
    2727 * <p>The following schema fragment specifies the expected content contained within this class.
    28  * 
     28 *
    2929 * <pre>
    3030 * &lt;complexType name="Workout_t">
     
    4444 * &lt;/complexType>
    4545 * </pre>
    46  * 
    47  * 
     46 *
     47 *
    4848 */
    4949@XmlAccessorType(XmlAccessType.FIELD)
     
    7777    /**
    7878     * Gets the value of the name property.
    79      * 
    80      * @return
    81      *     possible object is
    82      *     {@link String }
    83      *     
     79     *
     80     * @return
     81     *     possible object is
     82     *     {@link String }
     83     *
    8484     */
    8585    public String getName() {
     
    8989    /**
    9090     * Sets the value of the name property.
    91      * 
    92      * @param value
    93      *     allowed object is
    94      *     {@link String }
    95      *     
     91     *
     92     * @param value
     93     *     allowed object is
     94     *     {@link String }
     95     *
    9696     */
    9797    public void setName(String value) {
     
    101101    /**
    102102     * Gets the value of the step property.
    103      * 
     103     *
    104104     * <p>
    105105     * This accessor method returns a reference to the live list,
     
    107107     * returned list will be present inside the JAXB object.
    108108     * This is why there is not a <CODE>set</CODE> method for the step property.
    109      * 
     109     *
    110110     * <p>
    111111     * For example, to add a new item, do as follows:
     
    113113     *    getStep().add(newItem);
    114114     * </pre>
    115      * 
    116      * 
     115     *
     116     *
    117117     * <p>
    118118     * Objects of the following type(s) are allowed in the list
    119119     * {@link AbstractStepT }
    120      * 
    121      * 
     120     *
     121     *
    122122     */
    123123    public List<AbstractStepT> getStep() {
     
    130130    /**
    131131     * Gets the value of the scheduledOn property.
    132      * 
     132     *
    133133     * <p>
    134134     * This accessor method returns a reference to the live list,
     
    136136     * returned list will be present inside the JAXB object.
    137137     * This is why there is not a <CODE>set</CODE> method for the scheduledOn property.
    138      * 
     138     *
    139139     * <p>
    140140     * For example, to add a new item, do as follows:
     
    142142     *    getScheduledOn().add(newItem);
    143143     * </pre>
    144      * 
    145      * 
     144     *
     145     *
    146146     * <p>
    147147     * Objects of the following type(s) are allowed in the list
    148148     * {@link XMLGregorianCalendar }
    149      * 
    150      * 
     149     *
     150     *
    151151     */
    152152    public List<XMLGregorianCalendar> getScheduledOn() {
     
    159159    /**
    160160     * Gets the value of the notes property.
    161      * 
    162      * @return
    163      *     possible object is
    164      *     {@link String }
    165      *     
     161     *
     162     * @return
     163     *     possible object is
     164     *     {@link String }
     165     *
    166166     */
    167167    public String getNotes() {
     
    171171    /**
    172172     * Sets the value of the notes property.
    173      * 
    174      * @param value
    175      *     allowed object is
    176      *     {@link String }
    177      *     
     173     *
     174     * @param value
     175     *     allowed object is
     176     *     {@link String }
     177     *
    178178     */
    179179    public void setNotes(String value) {
     
    183183    /**
    184184     * Gets the value of the creator property.
    185      * 
     185     *
    186186     * @return
    187187     *     possible object is
    188188     *     {@link AbstractSourceT }
    189      *     
     189     *
    190190     */
    191191    public AbstractSourceT getCreator() {
     
    195195    /**
    196196     * Sets the value of the creator property.
    197      * 
     197     *
    198198     * @param value
    199199     *     allowed object is
    200200     *     {@link AbstractSourceT }
    201      *     
     201     *
    202202     */
    203203    public void setCreator(AbstractSourceT value) {
     
    207207    /**
    208208     * Gets the value of the extensions property.
    209      * 
     209     *
    210210     * @return
    211211     *     possible object is
    212212     *     {@link ExtensionsT }
    213      *     
     213     *
    214214     */
    215215    public ExtensionsT getExtensions() {
     
    219219    /**
    220220     * Sets the value of the extensions property.
    221      * 
     221     *
    222222     * @param value
    223223     *     allowed object is
    224224     *     {@link ExtensionsT }
    225      *     
     225     *
    226226     */
    227227    public void setExtensions(ExtensionsT value) {
     
    231231    /**
    232232     * Gets the value of the sport property.
    233      * 
     233     *
    234234     * @return
    235235     *     possible object is
    236236     *     {@link SportT }
    237      *     
     237     *
    238238     */
    239239    public SportT getSport() {
     
    243243    /**
    244244     * Sets the value of the sport property.
    245      * 
     245     *
    246246     * @param value
    247247     *     allowed object is
    248248     *     {@link SportT }
    249      *     
     249     *
    250250     */
    251251    public void setSport(SportT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/WorkoutsT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Workouts_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Workouts_t">
     
    3434 * &lt;/complexType>
    3535 * </pre>
    36  * 
    37  * 
     36 *
     37 *
    3838 */
    3939@XmlAccessorType(XmlAccessType.FIELD)
     
    5757    /**
    5858     * Gets the value of the running property.
    59      * 
     59     *
    6060     * @return
    6161     *     possible object is
    6262     *     {@link WorkoutFolderT }
    63      *     
     63     *
    6464     */
    6565    public WorkoutFolderT getRunning() {
     
    6969    /**
    7070     * Sets the value of the running property.
    71      * 
     71     *
    7272     * @param value
    7373     *     allowed object is
    7474     *     {@link WorkoutFolderT }
    75      *     
     75     *
    7676     */
    7777    public void setRunning(WorkoutFolderT value) {
     
    8181    /**
    8282     * Gets the value of the biking property.
    83      * 
     83     *
    8484     * @return
    8585     *     possible object is
    8686     *     {@link WorkoutFolderT }
    87      *     
     87     *
    8888     */
    8989    public WorkoutFolderT getBiking() {
     
    9393    /**
    9494     * Sets the value of the biking property.
    95      * 
     95     *
    9696     * @param value
    9797     *     allowed object is
    9898     *     {@link WorkoutFolderT }
    99      *     
     99     *
    100100     */
    101101    public void setBiking(WorkoutFolderT value) {
     
    105105    /**
    106106     * Gets the value of the other property.
    107      * 
     107     *
    108108     * @return
    109109     *     possible object is
    110110     *     {@link WorkoutFolderT }
    111      *     
     111     *
    112112     */
    113113    public WorkoutFolderT getOther() {
     
    117117    /**
    118118     * Sets the value of the other property.
    119      * 
     119     *
    120120     * @param value
    121121     *     allowed object is
    122122     *     {@link WorkoutFolderT }
    123      *     
     123     *
    124124     */
    125125    public void setOther(WorkoutFolderT value) {
     
    129129    /**
    130130     * Gets the value of the extensions property.
    131      * 
     131     *
    132132     * @return
    133133     *     possible object is
    134134     *     {@link ExtensionsT }
    135      *     
     135     *
    136136     */
    137137    public ExtensionsT getExtensions() {
     
    141141    /**
    142142     * Sets the value of the extensions property.
    143      * 
     143     *
    144144     * @param value
    145145     *     allowed object is
    146146     *     {@link ExtensionsT }
    147      *     
     147     *
    148148     */
    149149    public void setExtensions(ExtensionsT value) {
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/ZoneT.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
     
    1717/**
    1818 * <p>Java class for Zone_t complex type.
    19  * 
     19 *
    2020 * <p>The following schema fragment specifies the expected content contained within this class.
    21  * 
     21 *
    2222 * <pre>
    2323 * &lt;complexType name="Zone_t">
     
    2828 * &lt;/complexType>
    2929 * </pre>
    30  * 
    31  * 
     30 *
     31 *
    3232 */
    3333@XmlAccessorType(XmlAccessType.FIELD)
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/tcx/package-info.java

    r18063 r23191  
    11//
    2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 
    3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
    4 // Any modifications to this file will be lost upon recompilation of the source schema. 
    5 // Generated on: 2008.08.10 at 10:24:05 AM CEST 
     2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
     3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
     4// Any modifications to this file will be lost upon recompilation of the source schema.
     5// Generated on: 2008.08.10 at 10:24:05 AM CEST
    66//
    77
  • applications/editors/josm/plugins/ext_tools/src/ext_tools/DataSetToCmd.java

    r21930 r23191  
    4141     * <P>
    4242     * onto my primitives.
    43      * 
     43     *
    4444     * @param <P>
    4545     *            the type of the other primitive
     
    9191    /**
    9292     * Merges the node list of a source way onto its target way.
    93      * 
     93     *
    9494     * @param source
    9595     *            the source way
     
    9999     *             thrown if there isn't a target node for one of the nodes in
    100100     *             the source way
    101      * 
     101     *
    102102     */
    103103    private void mergeNodeList(Way source) throws IllegalStateException {
     
    129129     * Merges the relation members of a source relation onto the corresponding
    130130     * target relation.
    131      * 
     131     *
    132132     * @param source
    133133     *            the source relation
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java

    r20267 r23191  
    135135     */
    136136    public GpxData readData(ProgressMonitor progressMonitor) throws ConnectionException {
    137         progressMonitor.beginTask(null);
    138         try {
    139                 GpxData result = null;
    140                 cancelled = false;
    141                 if(port == null){
    142                         connect();
    143                 }
    144 
    145                 List<FileInfoRec> fileInfoList = readFileInfoList();
    146                 List<GpsRec> gpsRecList = readGpsRecList(fileInfoList);
    147 
    148                 progressMonitor.setTicksCount(gpsRecList.size());
    149                 if(gpsRecList.size() > 0){
    150                         GpsRec last = null;
    151                         result = new GpxData();
    152                         Collection<WayPoint> seg = new ArrayList<WayPoint>(100);
    153                         for(GpsRec r:gpsRecList){
    154                                 if(cancelled){
    155                                         return result;
    156                                 }
    157                                 WayPoint p = wayPointFrom(r);
    158                                 if(r.equals(last)){
    159                                         result.waypoints.add(p);
    160                                 }else{
    161                                         seg.add(p);
    162                                 }
    163                                 last = r;
    164                                 progressMonitor.worked(1);
    165                         }
    166                         result.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(seg), Collections.<String, Object>emptyMap()));
    167                 }
    168                 return result;
    169         } finally {
    170                 progressMonitor.finishTask();
    171         }
     137        progressMonitor.beginTask(null);
     138        try {
     139            GpxData result = null;
     140            cancelled = false;
     141            if(port == null){
     142                connect();
     143            }
     144
     145            List<FileInfoRec> fileInfoList = readFileInfoList();
     146            List<GpsRec> gpsRecList = readGpsRecList(fileInfoList);
     147
     148            progressMonitor.setTicksCount(gpsRecList.size());
     149            if(gpsRecList.size() > 0){
     150                GpsRec last = null;
     151                result = new GpxData();
     152                Collection<WayPoint> seg = new ArrayList<WayPoint>(100);
     153                for(GpsRec r:gpsRecList){
     154                    if(cancelled){
     155                        return result;
     156                    }
     157                    WayPoint p = wayPointFrom(r);
     158                    if(r.equals(last)){
     159                        result.waypoints.add(p);
     160                    }else{
     161                        seg.add(p);
     162                    }
     163                    last = r;
     164                    progressMonitor.worked(1);
     165                }
     166                result.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(seg), Collections.<String, Object>emptyMap()));
     167            }
     168            return result;
     169        } finally {
     170            progressMonitor.finishTask();
     171        }
    172172    }
    173173
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java

    r19436 r23191  
    4747
    4848        @Override public void realRun() throws IOException, SAXException {
    49                 progressMonitor.subTask(tr("Importing data from DG100..."));
     49            progressMonitor.subTask(tr("Importing data from DG100..."));
    5050            try{
    5151                data = GlobalsatPlugin.dg100().readData(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, true));
     
    8989    GlobalsatImportAction importAction;
    9090    public GlobalsatPlugin(PluginInformation info) {
    91         super(info);
     91        super(info);
    9292        boolean error = false;
    9393        try{
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/SingleSegmentGpxTrack.java

    r20431 r23191  
    1111public class SingleSegmentGpxTrack implements GpxTrack {
    1212
    13         private final Map<String, Object> attributes;
    14         private final GpxTrackSegment trackSegment;
     13    private final Map<String, Object> attributes;
     14    private final GpxTrackSegment trackSegment;
    1515
    16         public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
    17                 this.attributes = Collections.unmodifiableMap(attributes);
    18                 this.trackSegment = trackSegment;
    19         }
     16    public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
     17        this.attributes = Collections.unmodifiableMap(attributes);
     18        this.trackSegment = trackSegment;
     19    }
    2020
    2121
    22         public Map<String, Object> getAttributes() {
    23                 return attributes;
    24         }
     22    public Map<String, Object> getAttributes() {
     23        return attributes;
     24    }
    2525
    26         public Bounds getBounds() {
    27                 return trackSegment.getBounds();
    28         }
     26    public Bounds getBounds() {
     27        return trackSegment.getBounds();
     28    }
    2929
    30         public Collection<GpxTrackSegment> getSegments() {
    31                 return Collections.singleton(trackSegment);
    32         }
     30    public Collection<GpxTrackSegment> getSegments() {
     31        return Collections.singleton(trackSegment);
     32    }
    3333
    34         public double length() {
    35                 return trackSegment.length();
    36         }
     34    public double length() {
     35        return trackSegment.length();
     36    }
    3737
    38         @Override
    39         public int getUpdateCount() {
    40                 return trackSegment.getUpdateCount();
    41         }
     38    @Override
     39    public int getUpdateCount() {
     40        return trackSegment.getUpdateCount();
     41    }
    4242
    4343}
  • applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java

    r19444 r23191  
    9696     */
    9797    public ImageWayPointPlugin(PluginInformation info) {
    98         super(info);
    99        
     98        super(info);
     99
    100100        MainMenu menu = Main.main.menu;
    101101        menu.add(menu.fileMenu, new LoadImagesAction(this));
  • applications/editors/josm/plugins/livegps/src/livegps/AppendableGpxTrackSegment.java

    r20431 r23191  
    1414public class AppendableGpxTrackSegment implements GpxTrackSegment {
    1515
    16         private WayPoint[] wayPoints = new WayPoint[16];
    17         private int size;
    18         private Bounds bounds;
    19         private double length;
     16    private WayPoint[] wayPoints = new WayPoint[16];
     17    private int size;
     18    private Bounds bounds;
     19    private double length;
    2020
    21         public Bounds getBounds() {
    22                 return bounds;
    23         }
     21    public Bounds getBounds() {
     22        return bounds;
     23    }
    2424
    25         public Collection<WayPoint> getWayPoints() {
    26                 return new CopyList<WayPoint>(wayPoints, size);
    27         }
     25    public Collection<WayPoint> getWayPoints() {
     26        return new CopyList<WayPoint>(wayPoints, size);
     27    }
    2828
    29         public void addWaypoint(WayPoint p) {
    30                 if (wayPoints.length == size) {
    31                         WayPoint[] newWaypoints = new WayPoint[wayPoints.length * 2];
    32                         System.arraycopy(wayPoints, 0, newWaypoints, 0, wayPoints.length);
    33                         wayPoints = newWaypoints;
    34                 }
     29    public void addWaypoint(WayPoint p) {
     30        if (wayPoints.length == size) {
     31            WayPoint[] newWaypoints = new WayPoint[wayPoints.length * 2];
     32            System.arraycopy(wayPoints, 0, newWaypoints, 0, wayPoints.length);
     33            wayPoints = newWaypoints;
     34        }
    3535
    36                 if (size > 0) {
    37                         Double distance = wayPoints[size - 1].getCoor().greatCircleDistance(p.getCoor());
    38                         if (!distance.isNaN() && !distance.isInfinite()) {
    39                                 length += distance;
    40                         }
    41                 }
     36        if (size > 0) {
     37            Double distance = wayPoints[size - 1].getCoor().greatCircleDistance(p.getCoor());
     38            if (!distance.isNaN() && !distance.isInfinite()) {
     39                length += distance;
     40            }
     41        }
    4242
    43                 if (bounds == null) {
    44                         bounds = new Bounds(p.getCoor());
    45                 } else {
    46                         bounds.extend(p.getCoor());
    47                 }
     43        if (bounds == null) {
     44            bounds = new Bounds(p.getCoor());
     45        } else {
     46            bounds.extend(p.getCoor());
     47        }
    4848
    49                 wayPoints[size] = p;
    50                 size++;
    51         }
     49        wayPoints[size] = p;
     50        size++;
     51    }
    5252
    53         public double length() {
    54                 return length;
    55         }
     53    public double length() {
     54        return length;
     55    }
    5656
    57         @Override
    58         public int getUpdateCount() {
    59                 return size;
    60         }
     57    @Override
     58    public int getUpdateCount() {
     59        return size;
     60    }
    6161
    6262}
  • applications/editors/josm/plugins/livegps/src/livegps/ILiveGpsSuppressor.java

    r19011 r23191  
    33/**
    44 * Interface for class LiveGpsSuppressor, only has a query if currently an update is allowed.
    5  * 
    6  * @author casualwalker 
     5 *
     6 * @author casualwalker
    77 *
    88 */
    99public interface ILiveGpsSuppressor {
    1010
    11         /**
    12         * Query, if an update is currently allowed.
    13         * When it is allowed, it will disable the allowUpdate flag as a side effect.
    14         * (this means, one thread got to issue an update event)
    15         *
    16         * @return true, if an update is currently allowed; false, if the update shall be suppressed.
    17         */
    18         boolean isAllowUpdate();
     11    /**
     12    * Query, if an update is currently allowed.
     13    * When it is allowed, it will disable the allowUpdate flag as a side effect.
     14    * (this means, one thread got to issue an update event)
     15    *
     16    * @return true, if an update is currently allowed; false, if the update shall be suppressed.
     17    */
     18    boolean isAllowUpdate();
    1919
    2020}
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsAcquirer.java

    r21622 r23191  
    2222
    2323public class LiveGpsAcquirer implements Runnable {
    24         private String gpsdHost;
    25         private int gpsdPort;
    26 
    27         private Socket gpsdSocket;
    28         private BufferedReader gpsdReader;
    29         private boolean connected = false;
    30         private boolean shutdownFlag = false;
    31         private boolean JSONProtocol = true;
    32 
    33         private final List<PropertyChangeListener> propertyChangeListener = new ArrayList<PropertyChangeListener>();
    34         private PropertyChangeEvent lastStatusEvent;
    35         private PropertyChangeEvent lastDataEvent;
    36 
    37         /**
    38         * Constructor, initializes the configurable settings.
    39         */
    40         public LiveGpsAcquirer() {
    41                 super();
    42 
    43                 gpsdHost = Main.pref.get("livegps.gpsd.host", "localhost");
    44                 gpsdPort = Main.pref.getInteger("livegps.gpsd.port", 2947);
    45                 // put the settings back in to the preferences, makes keys appear.
    46                 Main.pref.put("livegps.gpsd.host", gpsdHost);
    47                 Main.pref.putInteger("livegps.gpsd.port", gpsdPort);
    48         }
    49 
    50         /**
    51         * Adds a property change listener to the acquirer.
    52         * @param listener the new listener
    53         */
    54         public void addPropertyChangeListener(PropertyChangeListener listener) {
    55                 if (!propertyChangeListener.contains(listener)) {
    56                         propertyChangeListener.add(listener);
    57                 }
    58         }
    59 
    60         /**
    61         * Remove a property change listener from the acquirer.
    62         * @param listener the new listener
    63         */
    64         public void removePropertyChangeListener(PropertyChangeListener listener) {
    65                 if (propertyChangeListener.contains(listener)) {
    66                         propertyChangeListener.remove(listener);
    67                 }
    68         }
    69 
    70         /**
    71         * Fire a gps status change event. Fires events with key "gpsstatus" and a {@link LiveGpsStatus}
    72         * object as value.
    73         * The status event may be sent any time.
    74         * @param status the status.
    75         * @param statusMessage the status message.
    76         */
    77         public void fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus status,
    78                         String statusMessage) {
    79                 PropertyChangeEvent event = new PropertyChangeEvent(this, "gpsstatus",
    80                                 null, new LiveGpsStatus(status, statusMessage));
    81 
    82                 if (!event.equals(lastStatusEvent)) {
    83                         firePropertyChangeEvent(event);
    84                         lastStatusEvent = event;
    85                 }
    86         }
    87 
    88         /**
    89         * Fire a gps data change event to all listeners. Fires events with key "gpsdata" and a
    90         * {@link LiveGpsData} object as values.
    91         * This event is only sent, when the suppressor permits it. This
    92         * event will cause the UI to re-draw itself, which has some performance penalty,
    93         * @param oldData the old gps data.
    94         * @param newData the new gps data.
    95         */
    96         public void fireGpsDataChangeEvent(LiveGpsData oldData, LiveGpsData newData) {
    97                 PropertyChangeEvent event = new PropertyChangeEvent(this, "gpsdata",
    98                                 oldData, newData);
    99 
    100                 if (!event.equals(lastDataEvent)) {
    101                         firePropertyChangeEvent(event);
    102                         lastDataEvent = event;
    103                 }
    104         }
    105 
    106         /**
    107         * Fires the given event to all listeners.
    108         * @param event the event to fire.
    109         */
    110         protected void firePropertyChangeEvent(PropertyChangeEvent event) {
    111                 for (PropertyChangeListener listener : propertyChangeListener) {
    112                         listener.propertyChange(event);
    113                 }
    114         }
    115 
    116         public void run() {
    117                 LiveGpsData oldGpsData = null;
    118                 LiveGpsData gpsData = null;
    119 
    120                 shutdownFlag = false;
    121                 while (!shutdownFlag) {
    122 
    123                         try {
    124                                 if (!connected)
    125                                         connect();
    126 
    127                                 if (connected) {
    128                                         String line;
    129 
    130                                         // <FIXXME date="23.06.2007" author="cdaller">
    131                                         // TODO this read is blocking if gps is connected but has no
    132                                         // fix, so gpsd does not send positions
    133                                         line = gpsdReader.readLine();
    134                                         // </FIXXME>
    135                                         if (line == null)
    136                                                 break;
    137 
    138                                         if (JSONProtocol == true)
    139                                                 gpsData = ParseJSON(line);
    140                                         else
    141                                                 gpsData = ParseOld(line);
    142 
    143                                         if (gpsData == null)
    144                                                 continue;
    145 
    146                                         fireGpsDataChangeEvent(oldGpsData, gpsData);
    147                                         oldGpsData = gpsData;
    148                                 } else {
    149                                         fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED, tr("Not connected"));
    150                                         try {
    151                                                 Thread.sleep(1000);
    152                                         } catch (InterruptedException ignore) {}
    153                                 }
    154                         } catch (IOException iox) {
    155                                 connected = false;
    156                                 if (gpsData != null) {
    157                                         gpsData.setFix(false);
    158                                         fireGpsDataChangeEvent(oldGpsData, gpsData);
    159                                 }
    160                                 fireGpsStatusChangeEvent(
    161                                                 LiveGpsStatus.GpsStatus.CONNECTION_FAILED,
    162                                                 tr("Connection Failed"));
    163                                 try {
    164                                         Thread.sleep(1000);
    165                                 } catch (InterruptedException ignore) {} ;
    166                                 // send warning to layer
    167                         }
    168                 }
    169 
    170                 fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED,
    171                                 tr("Not connected"));
    172                 if (gpsdSocket != null) {
    173                         try {
    174                                 gpsdSocket.close();
    175                                 gpsdSocket = null;
    176                                 System.out.println("LiveGps: Disconnected from gpsd");
    177                         } catch (Exception e) {
    178                                 System.out.println("LiveGps: Unable to close socket; reconnection may not be possible");
    179                         }
    180                 }
    181         }
    182 
    183         public void shutdown() {
    184                 shutdownFlag = true;
    185         }
    186 
    187         private void connect() throws IOException {
    188                 JSONObject greeting;
    189                 String line, type, release;
    190 
    191                 System.out.println("LiveGps: trying to connect to gpsd at " + gpsdHost + ":" + gpsdPort);
    192                 fireGpsStatusChangeEvent( LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting"));
    193 
    194                 InetAddress[] addrs = InetAddress.getAllByName(gpsdHost);
    195                 for (int i = 0; i < addrs.length && gpsdSocket == null; i++) {
    196                         try {
    197                                 gpsdSocket = new Socket(addrs[i], gpsdPort);
    198                                 break;
    199                         } catch (Exception e) {
    200                                 System.out.println("LiveGps: Could not open connection to gpsd: " + e);
    201                                 gpsdSocket = null;
    202                         }
    203                 }
    204 
    205                 if (gpsdSocket == null)
    206                         return;
    207 
    208                 fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting"));
    209 
    210                 /*
    211                 * First emit the "w" symbol. The older version will activate, the newer one will ignore it.
    212                 */
    213                 gpsdSocket.getOutputStream().write(new byte[] { 'w', 13, 10 });
    214 
    215                 gpsdReader = new BufferedReader(new InputStreamReader(gpsdSocket.getInputStream()));
    216                 line = gpsdReader.readLine();
    217                 if (line == null)
    218                         return;
    219 
    220                 try {
    221                         greeting = new JSONObject(line);
    222                         type = greeting.getString("class");
    223                         if (type.equals("VERSION")) {
    224                                 release = greeting.getString("release");
    225                                 System.out.println("LiveGps: Connected to gpsd " + release);
    226                         } else
    227                                 System.out.println("LiveGps: Unexpected JSON in gpsd greeting: " + line);
    228                 } catch (JSONException jex) {
    229                         if (line.startsWith("GPSD,")) {
    230                                 connected = true;
    231                                 JSONProtocol = false;
    232                                 System.out.println("LiveGps: Connected to old gpsd protocol version.");
    233                                 fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTED, tr("Connected"));
    234                         }
    235                 }
    236 
    237                 if (JSONProtocol == true) {
    238                         JSONObject Watch = new JSONObject();
    239                         try {
    240                                 Watch.put("enable", true);
    241                                 Watch.put("json", true);
    242                         } catch (JSONException je) {};
    243 
    244                         String Request = "?WATCH=" + Watch.toString() + ";\n";
    245                         gpsdSocket.getOutputStream().write(Request.getBytes());
    246 
    247                         connected = true;
    248                         fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTED, tr("Connected"));
    249                 }
    250         }
    251 
    252         private LiveGpsData ParseJSON(String line) {
    253                 JSONObject report;
    254                 String type;
    255                 double lat = 0;
    256                 double lon = 0;
    257                 float speed = 0;
    258                 float course = 0;
    259 
    260                 try {
    261                         report = new JSONObject(line);
    262                         type = report.getString("class");
    263                 } catch (JSONException jex) {
    264                         System.out.println("LiveGps: line read from gpsd is not a JSON object:" + line);
    265                         return null;
    266                 }
    267                 if (!type.equals("TPV"))
    268                         return null;
    269 
    270                 try {
    271                         lat = report.getDouble("lat");
    272                         lon = report.getDouble("lon");
    273                         speed = (new Float(report.getDouble("speed"))).floatValue();
    274                         course = (new Float(report.getDouble("track"))).floatValue();
    275 
    276                         return new LiveGpsData(lat, lon, course, speed, true);
    277                 } catch (JSONException je) {}
    278 
    279                 return null;
    280         }
    281 
    282         private LiveGpsData ParseOld(String line) {
    283                 String words[];
    284                 double lat = 0;
    285                 double lon = 0;
    286                 float speed = 0;
    287                 float course = 0;
    288 
    289                 words = line.split(",");
    290                 if ((words.length == 0) || (!words[0].equals("GPSD")))
    291                         return null;
    292 
    293                 for (int i = 1; i < words.length; i++) {
    294                         if ((words[i].length() < 2) || (words[i].charAt(1) != '=')) {
    295                                 // unexpected response.
    296                                 continue;
    297                         }
    298 
    299                         char what = words[i].charAt(0);
    300                         String value = words[i].substring(2);
    301                         switch (what) {
    302                         case 'O':
    303                                 // full report, tab delimited.
    304                                 String[] status = value.split("\\s+");
    305                                 if (status.length >= 5) {
    306                                         lat = Double.parseDouble(status[3]);
    307                                         lon = Double.parseDouble(status[4]);
    308                                         try {
    309                                                 speed = Float.parseFloat(status[9]);
    310                                                 course = Float.parseFloat(status[8]);
    311                                         } catch (NumberFormatException nex) {}
    312                                         return new LiveGpsData(lat, lon, course, speed, true);
    313                                 }
    314                                 break;
    315                         case 'P':
    316                                 // position report, tab delimited.
    317                                 String[] pos = value.split("\\s+");
    318                                 if (pos.length >= 2) {
    319                                         lat = Double.parseDouble(pos[0]);
    320                                         lon = Double.parseDouble(pos[1]);
    321                                         speed = Float.NaN;
    322                                         course = Float.NaN;
    323                                         return new LiveGpsData(lat, lon, course, speed, true);
    324                                 }
    325                                 break;
    326                         default:
    327                                 // not interested
    328                         }
    329                 }
    330 
    331                 return null;
    332         }
     24    private String gpsdHost;
     25    private int gpsdPort;
     26
     27    private Socket gpsdSocket;
     28    private BufferedReader gpsdReader;
     29    private boolean connected = false;
     30    private boolean shutdownFlag = false;
     31    private boolean JSONProtocol = true;
     32
     33    private final List<PropertyChangeListener> propertyChangeListener = new ArrayList<PropertyChangeListener>();
     34    private PropertyChangeEvent lastStatusEvent;
     35    private PropertyChangeEvent lastDataEvent;
     36
     37    /**
     38    * Constructor, initializes the configurable settings.
     39    */
     40    public LiveGpsAcquirer() {
     41        super();
     42
     43        gpsdHost = Main.pref.get("livegps.gpsd.host", "localhost");
     44        gpsdPort = Main.pref.getInteger("livegps.gpsd.port", 2947);
     45        // put the settings back in to the preferences, makes keys appear.
     46        Main.pref.put("livegps.gpsd.host", gpsdHost);
     47        Main.pref.putInteger("livegps.gpsd.port", gpsdPort);
     48    }
     49
     50    /**
     51    * Adds a property change listener to the acquirer.
     52    * @param listener the new listener
     53    */
     54    public void addPropertyChangeListener(PropertyChangeListener listener) {
     55        if (!propertyChangeListener.contains(listener)) {
     56            propertyChangeListener.add(listener);
     57        }
     58    }
     59
     60    /**
     61    * Remove a property change listener from the acquirer.
     62    * @param listener the new listener
     63    */
     64    public void removePropertyChangeListener(PropertyChangeListener listener) {
     65        if (propertyChangeListener.contains(listener)) {
     66            propertyChangeListener.remove(listener);
     67        }
     68    }
     69
     70    /**
     71    * Fire a gps status change event. Fires events with key "gpsstatus" and a {@link LiveGpsStatus}
     72    * object as value.
     73    * The status event may be sent any time.
     74    * @param status the status.
     75    * @param statusMessage the status message.
     76    */
     77    public void fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus status,
     78            String statusMessage) {
     79        PropertyChangeEvent event = new PropertyChangeEvent(this, "gpsstatus",
     80                null, new LiveGpsStatus(status, statusMessage));
     81
     82        if (!event.equals(lastStatusEvent)) {
     83            firePropertyChangeEvent(event);
     84            lastStatusEvent = event;
     85        }
     86    }
     87
     88    /**
     89    * Fire a gps data change event to all listeners. Fires events with key "gpsdata" and a
     90    * {@link LiveGpsData} object as values.
     91    * This event is only sent, when the suppressor permits it. This
     92    * event will cause the UI to re-draw itself, which has some performance penalty,
     93    * @param oldData the old gps data.
     94    * @param newData the new gps data.
     95    */
     96    public void fireGpsDataChangeEvent(LiveGpsData oldData, LiveGpsData newData) {
     97        PropertyChangeEvent event = new PropertyChangeEvent(this, "gpsdata",
     98                oldData, newData);
     99
     100        if (!event.equals(lastDataEvent)) {
     101            firePropertyChangeEvent(event);
     102            lastDataEvent = event;
     103        }
     104    }
     105
     106    /**
     107    * Fires the given event to all listeners.
     108    * @param event the event to fire.
     109    */
     110    protected void firePropertyChangeEvent(PropertyChangeEvent event) {
     111        for (PropertyChangeListener listener : propertyChangeListener) {
     112            listener.propertyChange(event);
     113        }
     114    }
     115
     116    public void run() {
     117        LiveGpsData oldGpsData = null;
     118        LiveGpsData gpsData = null;
     119
     120        shutdownFlag = false;
     121        while (!shutdownFlag) {
     122
     123            try {
     124                if (!connected)
     125                    connect();
     126
     127                if (connected) {
     128                    String line;
     129
     130                    // <FIXXME date="23.06.2007" author="cdaller">
     131                    // TODO this read is blocking if gps is connected but has no
     132                    // fix, so gpsd does not send positions
     133                    line = gpsdReader.readLine();
     134                    // </FIXXME>
     135                    if (line == null)
     136                        break;
     137
     138                    if (JSONProtocol == true)
     139                        gpsData = ParseJSON(line);
     140                    else
     141                        gpsData = ParseOld(line);
     142
     143                    if (gpsData == null)
     144                        continue;
     145
     146                    fireGpsDataChangeEvent(oldGpsData, gpsData);
     147                    oldGpsData = gpsData;
     148                } else {
     149                    fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED, tr("Not connected"));
     150                    try {
     151                        Thread.sleep(1000);
     152                    } catch (InterruptedException ignore) {}
     153                }
     154            } catch (IOException iox) {
     155                connected = false;
     156                if (gpsData != null) {
     157                    gpsData.setFix(false);
     158                    fireGpsDataChangeEvent(oldGpsData, gpsData);
     159                }
     160                fireGpsStatusChangeEvent(
     161                        LiveGpsStatus.GpsStatus.CONNECTION_FAILED,
     162                        tr("Connection Failed"));
     163                try {
     164                    Thread.sleep(1000);
     165                } catch (InterruptedException ignore) {} ;
     166                // send warning to layer
     167            }
     168        }
     169
     170        fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED,
     171                tr("Not connected"));
     172        if (gpsdSocket != null) {
     173            try {
     174                gpsdSocket.close();
     175                gpsdSocket = null;
     176                System.out.println("LiveGps: Disconnected from gpsd");
     177            } catch (Exception e) {
     178                System.out.println("LiveGps: Unable to close socket; reconnection may not be possible");
     179            }
     180        }
     181    }
     182
     183    public void shutdown() {
     184        shutdownFlag = true;
     185    }
     186
     187    private void connect() throws IOException {
     188        JSONObject greeting;
     189        String line, type, release;
     190
     191        System.out.println("LiveGps: trying to connect to gpsd at " + gpsdHost + ":" + gpsdPort);
     192        fireGpsStatusChangeEvent( LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting"));
     193
     194        InetAddress[] addrs = InetAddress.getAllByName(gpsdHost);
     195        for (int i = 0; i < addrs.length && gpsdSocket == null; i++) {
     196            try {
     197                gpsdSocket = new Socket(addrs[i], gpsdPort);
     198                break;
     199            } catch (Exception e) {
     200                System.out.println("LiveGps: Could not open connection to gpsd: " + e);
     201                gpsdSocket = null;
     202            }
     203        }
     204
     205        if (gpsdSocket == null)
     206            return;
     207
     208        fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting"));
     209
     210        /*
     211        * First emit the "w" symbol. The older version will activate, the newer one will ignore it.
     212        */
     213        gpsdSocket.getOutputStream().write(new byte[] { 'w', 13, 10 });
     214
     215        gpsdReader = new BufferedReader(new InputStreamReader(gpsdSocket.getInputStream()));
     216        line = gpsdReader.readLine();
     217        if (line == null)
     218            return;
     219
     220        try {
     221            greeting = new JSONObject(line);
     222            type = greeting.getString("class");
     223            if (type.equals("VERSION")) {
     224                release = greeting.getString("release");
     225                System.out.println("LiveGps: Connected to gpsd " + release);
     226            } else
     227                System.out.println("LiveGps: Unexpected JSON in gpsd greeting: " + line);
     228        } catch (JSONException jex) {
     229            if (line.startsWith("GPSD,")) {
     230                connected = true;
     231                JSONProtocol = false;
     232                System.out.println("LiveGps: Connected to old gpsd protocol version.");
     233                fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTED, tr("Connected"));
     234            }
     235        }
     236
     237        if (JSONProtocol == true) {
     238            JSONObject Watch = new JSONObject();
     239            try {
     240                Watch.put("enable", true);
     241                Watch.put("json", true);
     242            } catch (JSONException je) {};
     243
     244            String Request = "?WATCH=" + Watch.toString() + ";\n";
     245            gpsdSocket.getOutputStream().write(Request.getBytes());
     246
     247            connected = true;
     248            fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTED, tr("Connected"));
     249        }
     250    }
     251
     252    private LiveGpsData ParseJSON(String line) {
     253        JSONObject report;
     254        String type;
     255        double lat = 0;
     256        double lon = 0;
     257        float speed = 0;
     258        float course = 0;
     259
     260        try {
     261            report = new JSONObject(line);
     262            type = report.getString("class");
     263        } catch (JSONException jex) {
     264            System.out.println("LiveGps: line read from gpsd is not a JSON object:" + line);
     265            return null;
     266        }
     267        if (!type.equals("TPV"))
     268            return null;
     269
     270        try {
     271            lat = report.getDouble("lat");
     272            lon = report.getDouble("lon");
     273            speed = (new Float(report.getDouble("speed"))).floatValue();
     274            course = (new Float(report.getDouble("track"))).floatValue();
     275
     276            return new LiveGpsData(lat, lon, course, speed, true);
     277        } catch (JSONException je) {}
     278
     279        return null;
     280    }
     281
     282    private LiveGpsData ParseOld(String line) {
     283        String words[];
     284        double lat = 0;
     285        double lon = 0;
     286        float speed = 0;
     287        float course = 0;
     288
     289        words = line.split(",");
     290        if ((words.length == 0) || (!words[0].equals("GPSD")))
     291            return null;
     292
     293        for (int i = 1; i < words.length; i++) {
     294            if ((words[i].length() < 2) || (words[i].charAt(1) != '=')) {
     295                // unexpected response.
     296                continue;
     297            }
     298
     299            char what = words[i].charAt(0);
     300            String value = words[i].substring(2);
     301            switch (what) {
     302            case 'O':
     303                // full report, tab delimited.
     304                String[] status = value.split("\\s+");
     305                if (status.length >= 5) {
     306                    lat = Double.parseDouble(status[3]);
     307                    lon = Double.parseDouble(status[4]);
     308                    try {
     309                        speed = Float.parseFloat(status[9]);
     310                        course = Float.parseFloat(status[8]);
     311                    } catch (NumberFormatException nex) {}
     312                    return new LiveGpsData(lat, lon, course, speed, true);
     313                }
     314                break;
     315            case 'P':
     316                // position report, tab delimited.
     317                String[] pos = value.split("\\s+");
     318                if (pos.length >= 2) {
     319                    lat = Double.parseDouble(pos[0]);
     320                    lon = Double.parseDouble(pos[1]);
     321                    speed = Float.NaN;
     322                    course = Float.NaN;
     323                    return new LiveGpsData(lat, lon, course, speed, true);
     324                }
     325                break;
     326            default:
     327                // not interested
     328            }
     329        }
     330
     331        return null;
     332    }
    333333}
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java

    r20431 r23191  
    2323
    2424public class LiveGpsLayer extends GpxLayer implements PropertyChangeListener {
    25         public static final String LAYER_NAME = tr("LiveGPS layer");
    26         public static final String KEY_LIVEGPS_COLOR = "color.livegps.position";
    27         LatLon lastPos;
    28         WayPoint lastPoint;
    29         private final AppendableGpxTrackSegment trackSegment;
    30         float speed;
    31         float course;
    32         // JLabel lbl;
    33         boolean autocenter;
    34         private SimpleDateFormat dateFormat = new SimpleDateFormat(
    35         "yyyy-MM-dd'T'HH:mm:ss.SSS");
     25    public static final String LAYER_NAME = tr("LiveGPS layer");
     26    public static final String KEY_LIVEGPS_COLOR = "color.livegps.position";
     27    LatLon lastPos;
     28    WayPoint lastPoint;
     29    private final AppendableGpxTrackSegment trackSegment;
     30    float speed;
     31    float course;
     32    // JLabel lbl;
     33    boolean autocenter;
     34    private SimpleDateFormat dateFormat = new SimpleDateFormat(
     35    "yyyy-MM-dd'T'HH:mm:ss.SSS");
    3636
    37         /**
    38         * The suppressor is queried, if the GUI shall be re-drawn.
    39         */
    40         private ILiveGpsSuppressor suppressor;
     37    /**
     38    * The suppressor is queried, if the GUI shall be re-drawn.
     39    */
     40    private ILiveGpsSuppressor suppressor;
    4141
    42         public LiveGpsLayer(GpxData data) {
    43                 super(data, LAYER_NAME);
    44                 trackSegment = new AppendableGpxTrackSegment();
     42    public LiveGpsLayer(GpxData data) {
     43        super(data, LAYER_NAME);
     44        trackSegment = new AppendableGpxTrackSegment();
    4545
    46                 Map<String, Object> attr = new HashMap<String, Object>();
    47                 attr.put("desc", "josm live gps");
     46        Map<String, Object> attr = new HashMap<String, Object>();
     47        attr.put("desc", "josm live gps");
    4848
    49                 GpxTrack trackBeingWritten = new SingleSegmentGpxTrack(trackSegment, attr);
    50                 data.tracks.add(trackBeingWritten);
    51         }
     49        GpxTrack trackBeingWritten = new SingleSegmentGpxTrack(trackSegment, attr);
     50        data.tracks.add(trackBeingWritten);
     51    }
    5252
    53         void setCurrentPosition(double lat, double lon) {
    54                 // System.out.println("adding pos " + lat + "," + lon);
    55                 LatLon thisPos = new LatLon(lat, lon);
    56                 if ((lastPos != null) && (thisPos.equalsEpsilon(lastPos))) {
    57                         // no change in position
    58                         // maybe show a "paused" cursor or some such
    59                         return;
    60                 }
     53    void setCurrentPosition(double lat, double lon) {
     54        // System.out.println("adding pos " + lat + "," + lon);
     55        LatLon thisPos = new LatLon(lat, lon);
     56        if ((lastPos != null) && (thisPos.equalsEpsilon(lastPos))) {
     57            // no change in position
     58            // maybe show a "paused" cursor or some such
     59            return;
     60        }
    6161
    62                 lastPos = thisPos;
    63                 lastPoint = new WayPoint(thisPos);
    64                 lastPoint.attr.put("time", dateFormat.format(new Date()));
    65                 trackSegment.addWaypoint(lastPoint);
    66                 if (autocenter && allowRedraw()) {
    67                         center();
    68                 }
     62        lastPos = thisPos;
     63        lastPoint = new WayPoint(thisPos);
     64        lastPoint.attr.put("time", dateFormat.format(new Date()));
     65        trackSegment.addWaypoint(lastPoint);
     66        if (autocenter && allowRedraw()) {
     67            center();
     68        }
    6969
    70                 // Main.map.repaint();
    71         }
     70        // Main.map.repaint();
     71    }
    7272
    73         public void center() {
    74                 if (lastPoint != null)
    75                         Main.map.mapView.zoomTo(lastPoint.getCoor());
    76         }
     73    public void center() {
     74        if (lastPoint != null)
     75            Main.map.mapView.zoomTo(lastPoint.getCoor());
     76    }
    7777
    78         // void setStatus(String status)
    79         // {
    80         // this.status = status;
    81         // Main.map.repaint();
    82         // System.out.println("LiveGps status: " + status);
    83         // }
     78    // void setStatus(String status)
     79    // {
     80    // this.status = status;
     81    // Main.map.repaint();
     82    // System.out.println("LiveGps status: " + status);
     83    // }
    8484
    85         void setSpeed(float metresPerSecond) {
    86                 speed = metresPerSecond;
    87                 // Main.map.repaint();
    88         }
     85    void setSpeed(float metresPerSecond) {
     86        speed = metresPerSecond;
     87        // Main.map.repaint();
     88    }
    8989
    90         void setCourse(float degrees) {
    91                 course = degrees;
    92                 // Main.map.repaint();
    93         }
     90    void setCourse(float degrees) {
     91        course = degrees;
     92        // Main.map.repaint();
     93    }
    9494
    95         public void setAutoCenter(boolean ac) {
    96                 autocenter = ac;
    97         }
     95    public void setAutoCenter(boolean ac) {
     96        autocenter = ac;
     97    }
    9898
    99         @Override
    100         public void paint(Graphics2D g, MapView mv, Bounds bounds) {
    101                 // System.out.println("in paint");
    102                 // System.out.println("in synced paint");
    103                 super.paint(g, mv, bounds);
    104                 // int statusHeight = 50;
    105                 // Rectangle mvs = mv.getBounds();
    106                 // mvs.y = mvs.y + mvs.height - statusHeight;
    107                 // mvs.height = statusHeight;
    108                 // g.setColor(new Color(1.0f, 1.0f, 1.0f, 0.8f));
    109                 // g.fillRect(mvs.x, mvs.y, mvs.width, mvs.height);
     99    @Override
     100    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
     101        // System.out.println("in paint");
     102        // System.out.println("in synced paint");
     103        super.paint(g, mv, bounds);
     104        // int statusHeight = 50;
     105        // Rectangle mvs = mv.getBounds();
     106        // mvs.y = mvs.y + mvs.height - statusHeight;
     107        // mvs.height = statusHeight;
     108        // g.setColor(new Color(1.0f, 1.0f, 1.0f, 0.8f));
     109        // g.fillRect(mvs.x, mvs.y, mvs.width, mvs.height);
    110110
    111                 if (lastPoint != null) {
    112                         Point screen = mv.getPoint(lastPoint.getCoor());
    113                         g.setColor(Main.pref.getColor(KEY_LIVEGPS_COLOR, Color.RED));
    114                         g.drawOval(screen.x - 10, screen.y - 10, 20, 20);
    115                         g.drawOval(screen.x - 9, screen.y - 9, 18, 18);
    116                 }
     111        if (lastPoint != null) {
     112            Point screen = mv.getPoint(lastPoint.getCoor());
     113            g.setColor(Main.pref.getColor(KEY_LIVEGPS_COLOR, Color.RED));
     114            g.drawOval(screen.x - 10, screen.y - 10, 20, 20);
     115            g.drawOval(screen.x - 9, screen.y - 9, 18, 18);
     116        }
    117117
    118                 // lbl.setText("gpsd: "+status+" Speed: " + speed +
    119                 // " Course: "+course);
    120                 // lbl.setBounds(0, 0, mvs.width-10, mvs.height-10);
    121                 // Graphics sub = g.create(mvs.x+5, mvs.y+5, mvs.width-10,
    122                 // mvs.height-10);
    123                 // lbl.paint(sub);
     118        // lbl.setText("gpsd: "+status+" Speed: " + speed +
     119        // " Course: "+course);
     120        // lbl.setBounds(0, 0, mvs.width-10, mvs.height-10);
     121        // Graphics sub = g.create(mvs.x+5, mvs.y+5, mvs.width-10,
     122        // mvs.height-10);
     123        // lbl.paint(sub);
    124124
    125                 // if(status != null) {
    126                 // g.setColor(Color.WHITE);
    127                 // g.drawString("gpsd: " + status, 5, mv.getBounds().height - 15);
    128                 // // lower left corner
    129                 // }
    130         }
     125        // if(status != null) {
     126        // g.setColor(Color.WHITE);
     127        // g.drawString("gpsd: " + status, 5, mv.getBounds().height - 15);
     128        // // lower left corner
     129        // }
     130    }
    131131
    132         /* (non-Javadoc)
    133         * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
    134         */
    135         public void propertyChange(PropertyChangeEvent evt) {
    136                 if (!isVisible()) {
    137                         return;
    138                 }
    139                 if ("gpsdata".equals(evt.getPropertyName())) {
    140                         LiveGpsData data = (LiveGpsData) evt.getNewValue();
    141                         if (data.isFix()) {
    142                                 setCurrentPosition(data.getLatitude(), data.getLongitude());
    143                                 if (!Float.isNaN(data.getSpeed())) {
    144                                         setSpeed(data.getSpeed());
    145                                 }
    146                                 if (!Float.isNaN(data.getCourse())) {
    147                                         setCourse(data.getCourse());
    148                                 }
    149                                 if (!autocenter && allowRedraw()) {
    150                                         Main.map.repaint();
    151                                 }
    152                         }
    153                 }
    154         }
     132    /* (non-Javadoc)
     133    * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
     134    */
     135    public void propertyChange(PropertyChangeEvent evt) {
     136        if (!isVisible()) {
     137            return;
     138        }
     139        if ("gpsdata".equals(evt.getPropertyName())) {
     140            LiveGpsData data = (LiveGpsData) evt.getNewValue();
     141            if (data.isFix()) {
     142                setCurrentPosition(data.getLatitude(), data.getLongitude());
     143                if (!Float.isNaN(data.getSpeed())) {
     144                    setSpeed(data.getSpeed());
     145                }
     146                if (!Float.isNaN(data.getCourse())) {
     147                    setCourse(data.getCourse());
     148                }
     149                if (!autocenter && allowRedraw()) {
     150                    Main.map.repaint();
     151                }
     152            }
     153        }
     154    }
    155155
    156         /**
    157         * @param suppressor the suppressor to set
    158         */
    159         public void setSuppressor(ILiveGpsSuppressor suppressor) {
    160                 this.suppressor = suppressor;
    161         }
     156    /**
     157    * @param suppressor the suppressor to set
     158    */
     159    public void setSuppressor(ILiveGpsSuppressor suppressor) {
     160        this.suppressor = suppressor;
     161    }
    162162
    163         /**
    164         * @return the suppressor
    165         */
    166         public ILiveGpsSuppressor getSuppressor() {
    167                 return suppressor;
    168         }
     163    /**
     164    * @return the suppressor
     165    */
     166    public ILiveGpsSuppressor getSuppressor() {
     167        return suppressor;
     168    }
    169169
    170         /**
    171         * Check, if a redraw is currently allowed.
    172         *
    173         * @return true, if a redraw is permitted, false, if a re-draw
    174         * should be suppressed.
    175         */
    176         private boolean allowRedraw() {
    177                 if (this.suppressor != null) {
    178                         return this.suppressor.isAllowUpdate();
    179                 } else {
    180                         return true;
    181                 }
    182         }
     170    /**
     171    * Check, if a redraw is currently allowed.
     172    *
     173    * @return true, if a redraw is permitted, false, if a re-draw
     174    * should be suppressed.
     175    */
     176    private boolean allowRedraw() {
     177        if (this.suppressor != null) {
     178            return this.suppressor.isAllowUpdate();
     179        } else {
     180            return true;
     181        }
     182    }
    183183}
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java

    r20431 r23191  
    2828
    2929public class LiveGpsPlugin extends Plugin implements LayerChangeListener {
    30         private LiveGpsAcquirer acquirer = null;
    31         private Thread acquirerThread = null;
    32         private JMenu lgpsmenu;
    33         private JCheckBoxMenuItem lgpscapture;
    34         private JCheckBoxMenuItem lgpsautocenter;
    35         private LiveGpsDialog lgpsdialog;
    36         List<PropertyChangeListener> listenerQueue;
    37 
    38         private GpxData data = new GpxData();
    39         private LiveGpsLayer lgpslayer = null;
    40 
    41         /**
    42         * The LiveGpsSuppressor is queried, if an event shall be suppressed.
    43         */
    44         private LiveGpsSuppressor suppressor;
    45 
    46         /**
    47         * separate thread, where the LiveGpsSuppressor executes.
    48         */
    49         private Thread suppressorThread;
    50 
    51         public class CaptureAction extends JosmAction {
    52                 public CaptureAction() {
    53                         super(
    54                                         tr("Capture GPS Track"),
    55                                         "capturemenu",
    56                                         tr("Connect to gpsd server and show current position in LiveGPS layer."),
    57                                         Shortcut.registerShortcut("menu:livegps:capture", tr(
    58                                                         "Menu: {0}", tr("Capture GPS Track")),
    59                                                         KeyEvent.VK_R, Shortcut.GROUP_MENU), true);
    60                 }
    61 
    62                 public void actionPerformed(ActionEvent e) {
    63                         enableTracking(lgpscapture.isSelected());
    64                 }
    65         }
    66 
    67         public class CenterAction extends JosmAction {
    68                 public CenterAction() {
    69                         super(tr("Center Once"), "centermenu",
    70                                         tr("Center the LiveGPS layer to current position."),
    71                                         Shortcut.registerShortcut("edit:centergps", tr("Edit: {0}",
    72                                                         tr("Center Once")), KeyEvent.VK_HOME,
    73                                                         Shortcut.GROUP_EDIT), true);
    74                 }
    75 
    76                 public void actionPerformed(ActionEvent e) {
    77                         if (lgpslayer != null) {
    78                                 lgpslayer.center();
    79                         }
    80                 }
    81         }
    82 
    83         public class AutoCenterAction extends JosmAction {
    84                 public AutoCenterAction() {
    85                         super(
    86                                         tr("Auto-Center"),
    87                                         "autocentermenu",
    88                                         tr("Continuously center the LiveGPS layer to current position."),
    89                                         Shortcut.registerShortcut("menu:livegps:autocenter", tr(
    90                                                         "Menu: {0}", tr("Capture GPS Track")),
    91                                                         KeyEvent.VK_HOME, Shortcut.GROUP_MENU), true);
    92                 }
    93 
    94                 public void actionPerformed(ActionEvent e) {
    95                         if (lgpslayer != null) {
    96                                 setAutoCenter(lgpsautocenter.isSelected());
    97                         }
    98                 }
    99         }
    100 
    101         public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    102         }
    103 
    104         public void layerAdded(Layer newLayer) {
    105         }
    106 
    107         public void layerRemoved(Layer oldLayer) {
    108                 if (oldLayer == lgpslayer) {
    109                         enableTracking(false);
    110                         lgpscapture.setSelected(false);
    111                         removePropertyChangeListener(lgpslayer);
    112                         MapView.removeLayerChangeListener(this);
    113                         lgpslayer = null;
    114                 }
    115         }
    116 
    117         public LiveGpsPlugin(PluginInformation info) {
    118                 super(info);
    119                 MainMenu menu = Main.main.menu;
    120                 lgpsmenu = menu.addMenu(marktr("LiveGPS"), KeyEvent.VK_G,
    121                                 menu.defaultMenuPos, ht("/Plugin/LiveGPS"));
    122 
    123                 JosmAction captureAction = new CaptureAction();
    124                 lgpscapture = new JCheckBoxMenuItem(captureAction);
    125                 lgpsmenu.add(lgpscapture);
    126                 lgpscapture.setAccelerator(captureAction.getShortcut().getKeyStroke());
    127 
    128                 JosmAction centerAction = new CenterAction();
    129                 JMenuItem centerMenu = new JMenuItem(centerAction);
    130                 lgpsmenu.add(centerMenu);
    131                 centerMenu.setAccelerator(centerAction.getShortcut().getKeyStroke());
    132 
    133                 JosmAction autoCenterAction = new AutoCenterAction();
    134                 lgpsautocenter = new JCheckBoxMenuItem(autoCenterAction);
    135                 lgpsmenu.add(lgpsautocenter);
    136                 lgpsautocenter.setAccelerator(autoCenterAction.getShortcut()
    137                                 .getKeyStroke());
    138         }
    139 
    140         /**
    141         * Set to <code>true</code> if the current position should always be in the center of the map.
    142         * @param autoCenter if <code>true</code> the map is always centered.
    143         */
    144         public void setAutoCenter(boolean autoCenter) {
    145                 lgpsautocenter.setSelected(autoCenter); // just in case this method was
    146                 // not called from the menu
    147                 if (lgpslayer != null) {
    148                         lgpslayer.setAutoCenter(autoCenter);
    149                         if (autoCenter)
    150                                 lgpslayer.center();
    151                 }
    152         }
    153 
    154         /**
    155         * Returns <code>true</code> if autocenter is selected.
    156         * @return <code>true</code> if autocenter is selected.
    157         */
    158         public boolean isAutoCenter() {
    159                 return lgpsautocenter.isSelected();
    160         }
    161 
    162         /**
    163         * Enable or disable gps tracking
    164         * @param enable if <code>true</code> tracking is started.
    165         */
    166         public void enableTracking(boolean enable) {
    167                 if ((acquirer != null) && (!enable)) {
    168                         acquirer.shutdown();
    169                         acquirerThread = null;
    170 
    171                         // also stop the suppressor
    172                         if (suppressor != null) {
    173                                 suppressor.shutdown();
    174                                 suppressorThread = null;
    175                                 if (lgpslayer != null) {
    176                                         lgpslayer.setSuppressor(null);
    177                                 }
    178                         }
    179                 } else if (enable) {
    180                         // also start the suppressor
    181                         if (suppressor == null) {
    182                                 suppressor = new LiveGpsSuppressor();
    183                         }
    184                         if (suppressorThread == null) {
    185                                 suppressorThread = new Thread(suppressor);
    186                                 suppressorThread.start();
    187                         }
    188 
    189                         if (acquirer == null) {
    190                                 acquirer = new LiveGpsAcquirer();
    191                                 if (lgpslayer == null) {
    192                                         lgpslayer = new LiveGpsLayer(data);
    193                                         Main.main.addLayer(lgpslayer);
    194                                         MapView.addLayerChangeListener(this);
    195                                         lgpslayer.setAutoCenter(isAutoCenter());
    196                                 }
    197                                 // connect layer with acquirer:
    198                                 addPropertyChangeListener(lgpslayer);
    199 
    200                                 // connect layer with suppressor:
    201                                 lgpslayer.setSuppressor(suppressor);
    202                                 // add all listeners that were added before the acquirer
    203                                 // existed:
    204                                 if (listenerQueue != null) {
    205                                         for (PropertyChangeListener listener : listenerQueue) {
    206                                                 addPropertyChangeListener(listener);
    207                                         }
    208                                         listenerQueue.clear();
    209                                 }
    210                         }
    211                         if (acquirerThread == null) {
    212                                 acquirerThread = new Thread(acquirer);
    213                                 acquirerThread.start();
    214                         }
    215 
    216                 }
    217         }
    218 
    219         /**
    220         * Add a listener for gps events.
    221         * @param listener the listener.
    222         */
    223         public void addPropertyChangeListener(PropertyChangeListener listener) {
    224                 if (acquirer != null) {
    225                         acquirer.addPropertyChangeListener(listener);
    226                 } else {
    227                         if (listenerQueue == null) {
    228                                 listenerQueue = new ArrayList<PropertyChangeListener>();
    229                         }
    230                         listenerQueue.add(listener);
    231                 }
    232         }
    233 
    234         /**
    235         * Remove a listener for gps events.
    236         * @param listener the listener.
    237         */
    238         public void removePropertyChangeListener(PropertyChangeListener listener) {
    239                 if (acquirer != null)
    240                         acquirer.removePropertyChangeListener(listener);
    241                 else if (listenerQueue != null && listenerQueue.contains(listener))
    242                         listenerQueue.remove(listener);
    243         }
    244 
    245         /* (non-Javadoc)
    246         * @see org.openstreetmap.josm.plugins.Plugin#mapFrameInitialized(org.openstreetmap.josm.gui.MapFrame, org.openstreetmap.josm.gui.MapFrame)
    247         */
    248         @Override
    249         public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    250                 if (newFrame != null) {
    251                         // add dialog
    252                         newFrame.addToggleDialog(lgpsdialog = new LiveGpsDialog(newFrame));
    253                         // connect listeners with acquirer:
    254                         addPropertyChangeListener(lgpsdialog);
    255                 }
    256         }
    257 
    258         /**
    259         * @return the lgpsmenu
    260         */
    261         public JMenu getLgpsMenu() {
    262                 return this.lgpsmenu;
    263         }
     30    private LiveGpsAcquirer acquirer = null;
     31    private Thread acquirerThread = null;
     32    private JMenu lgpsmenu;
     33    private JCheckBoxMenuItem lgpscapture;
     34    private JCheckBoxMenuItem lgpsautocenter;
     35    private LiveGpsDialog lgpsdialog;
     36    List<PropertyChangeListener> listenerQueue;
     37
     38    private GpxData data = new GpxData();
     39    private LiveGpsLayer lgpslayer = null;
     40
     41    /**
     42    * The LiveGpsSuppressor is queried, if an event shall be suppressed.
     43    */
     44    private LiveGpsSuppressor suppressor;
     45
     46    /**
     47    * separate thread, where the LiveGpsSuppressor executes.
     48    */
     49    private Thread suppressorThread;
     50
     51    public class CaptureAction extends JosmAction {
     52        public CaptureAction() {
     53            super(
     54                    tr("Capture GPS Track"),
     55                    "capturemenu",
     56                    tr("Connect to gpsd server and show current position in LiveGPS layer."),
     57                    Shortcut.registerShortcut("menu:livegps:capture", tr(
     58                            "Menu: {0}", tr("Capture GPS Track")),
     59                            KeyEvent.VK_R, Shortcut.GROUP_MENU), true);
     60        }
     61
     62        public void actionPerformed(ActionEvent e) {
     63            enableTracking(lgpscapture.isSelected());
     64        }
     65    }
     66
     67    public class CenterAction extends JosmAction {
     68        public CenterAction() {
     69            super(tr("Center Once"), "centermenu",
     70                    tr("Center the LiveGPS layer to current position."),
     71                    Shortcut.registerShortcut("edit:centergps", tr("Edit: {0}",
     72                            tr("Center Once")), KeyEvent.VK_HOME,
     73                            Shortcut.GROUP_EDIT), true);
     74        }
     75
     76        public void actionPerformed(ActionEvent e) {
     77            if (lgpslayer != null) {
     78                lgpslayer.center();
     79            }
     80        }
     81    }
     82
     83    public class AutoCenterAction extends JosmAction {
     84        public AutoCenterAction() {
     85            super(
     86                    tr("Auto-Center"),
     87                    "autocentermenu",
     88                    tr("Continuously center the LiveGPS layer to current position."),
     89                    Shortcut.registerShortcut("menu:livegps:autocenter", tr(
     90                            "Menu: {0}", tr("Capture GPS Track")),
     91                            KeyEvent.VK_HOME, Shortcut.GROUP_MENU), true);
     92        }
     93
     94        public void actionPerformed(ActionEvent e) {
     95            if (lgpslayer != null) {
     96                setAutoCenter(lgpsautocenter.isSelected());
     97            }
     98        }
     99    }
     100
     101    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
     102    }
     103
     104    public void layerAdded(Layer newLayer) {
     105    }
     106
     107    public void layerRemoved(Layer oldLayer) {
     108        if (oldLayer == lgpslayer) {
     109            enableTracking(false);
     110            lgpscapture.setSelected(false);
     111            removePropertyChangeListener(lgpslayer);
     112            MapView.removeLayerChangeListener(this);
     113            lgpslayer = null;
     114        }
     115    }
     116
     117    public LiveGpsPlugin(PluginInformation info) {
     118        super(info);
     119        MainMenu menu = Main.main.menu;
     120        lgpsmenu = menu.addMenu(marktr("LiveGPS"), KeyEvent.VK_G,
     121                menu.defaultMenuPos, ht("/Plugin/LiveGPS"));
     122
     123        JosmAction captureAction = new CaptureAction();
     124        lgpscapture = new JCheckBoxMenuItem(captureAction);
     125        lgpsmenu.add(lgpscapture);
     126        lgpscapture.setAccelerator(captureAction.getShortcut().getKeyStroke());
     127
     128        JosmAction centerAction = new CenterAction();
     129        JMenuItem centerMenu = new JMenuItem(centerAction);
     130        lgpsmenu.add(centerMenu);
     131        centerMenu.setAccelerator(centerAction.getShortcut().getKeyStroke());
     132
     133        JosmAction autoCenterAction = new AutoCenterAction();
     134        lgpsautocenter = new JCheckBoxMenuItem(autoCenterAction);
     135        lgpsmenu.add(lgpsautocenter);
     136        lgpsautocenter.setAccelerator(autoCenterAction.getShortcut()
     137                .getKeyStroke());
     138    }
     139
     140    /**
     141    * Set to <code>true</code> if the current position should always be in the center of the map.
     142    * @param autoCenter if <code>true</code> the map is always centered.
     143    */
     144    public void setAutoCenter(boolean autoCenter) {
     145        lgpsautocenter.setSelected(autoCenter); // just in case this method was
     146        // not called from the menu
     147        if (lgpslayer != null) {
     148            lgpslayer.setAutoCenter(autoCenter);
     149            if (autoCenter)
     150                lgpslayer.center();
     151        }
     152    }
     153
     154    /**
     155    * Returns <code>true</code> if autocenter is selected.
     156    * @return <code>true</code> if autocenter is selected.
     157    */
     158    public boolean isAutoCenter() {
     159        return lgpsautocenter.isSelected();
     160    }
     161
     162    /**
     163    * Enable or disable gps tracking
     164    * @param enable if <code>true</code> tracking is started.
     165    */
     166    public void enableTracking(boolean enable) {
     167        if ((acquirer != null) && (!enable)) {
     168            acquirer.shutdown();
     169            acquirerThread = null;
     170
     171            // also stop the suppressor
     172            if (suppressor != null) {
     173                suppressor.shutdown();
     174                suppressorThread = null;
     175                if (lgpslayer != null) {
     176                    lgpslayer.setSuppressor(null);
     177                }
     178            }
     179        } else if (enable) {
     180            // also start the suppressor
     181            if (suppressor == null) {
     182                suppressor = new LiveGpsSuppressor();
     183            }
     184            if (suppressorThread == null) {
     185                suppressorThread = new Thread(suppressor);
     186                suppressorThread.start();
     187            }
     188
     189            if (acquirer == null) {
     190                acquirer = new LiveGpsAcquirer();
     191                if (lgpslayer == null) {
     192                    lgpslayer = new LiveGpsLayer(data);
     193                    Main.main.addLayer(lgpslayer);
     194                    MapView.addLayerChangeListener(this);
     195                    lgpslayer.setAutoCenter(isAutoCenter());
     196                }
     197                // connect layer with acquirer:
     198                addPropertyChangeListener(lgpslayer);
     199
     200                // connect layer with suppressor:
     201                lgpslayer.setSuppressor(suppressor);
     202                // add all listeners that were added before the acquirer
     203                // existed:
     204                if (listenerQueue != null) {
     205                    for (PropertyChangeListener listener : listenerQueue) {
     206                        addPropertyChangeListener(listener);
     207                    }
     208                    listenerQueue.clear();
     209                }
     210            }
     211            if (acquirerThread == null) {
     212                acquirerThread = new Thread(acquirer);
     213                acquirerThread.start();
     214            }
     215
     216        }
     217    }
     218
     219    /**
     220    * Add a listener for gps events.
     221    * @param listener the listener.
     222    */
     223    public void addPropertyChangeListener(PropertyChangeListener listener) {
     224        if (acquirer != null) {
     225            acquirer.addPropertyChangeListener(listener);
     226        } else {
     227            if (listenerQueue == null) {
     228                listenerQueue = new ArrayList<PropertyChangeListener>();
     229            }
     230            listenerQueue.add(listener);
     231        }
     232    }
     233
     234    /**
     235    * Remove a listener for gps events.
     236    * @param listener the listener.
     237    */
     238    public void removePropertyChangeListener(PropertyChangeListener listener) {
     239        if (acquirer != null)
     240            acquirer.removePropertyChangeListener(listener);
     241        else if (listenerQueue != null && listenerQueue.contains(listener))
     242            listenerQueue.remove(listener);
     243    }
     244
     245    /* (non-Javadoc)
     246    * @see org.openstreetmap.josm.plugins.Plugin#mapFrameInitialized(org.openstreetmap.josm.gui.MapFrame, org.openstreetmap.josm.gui.MapFrame)
     247    */
     248    @Override
     249    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     250        if (newFrame != null) {
     251            // add dialog
     252            newFrame.addToggleDialog(lgpsdialog = new LiveGpsDialog(newFrame));
     253            // connect listeners with acquirer:
     254            addPropertyChangeListener(lgpsdialog);
     255        }
     256    }
     257
     258    /**
     259    * @return the lgpsmenu
     260    */
     261    public JMenu getLgpsMenu() {
     262        return this.lgpsmenu;
     263    }
    264264
    265265}
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsSuppressor.java

    r19011 r23191  
    1818public class LiveGpsSuppressor implements Runnable, ILiveGpsSuppressor {
    1919
    20         /**
    21         * Default sleep time is 5 seconds.
    22         */
    23         private static final int DEFAULT_SLEEP_TIME = 5;
     20    /**
     21    * Default sleep time is 5 seconds.
     22    */
     23    private static final int DEFAULT_SLEEP_TIME = 5;
    2424
    25         /**
    26         * The currently used sleepTime.
    27         */
    28         private int sleepTime = DEFAULT_SLEEP_TIME;
     25    /**
     26    * The currently used sleepTime.
     27    */
     28    private int sleepTime = DEFAULT_SLEEP_TIME;
    2929
    30         /**
    31         * The flag allowUpdate is enabled once during the sleepTime.
    32         */
    33         private boolean allowUpdate = false;
     30    /**
     31    * The flag allowUpdate is enabled once during the sleepTime.
     32    */
     33    private boolean allowUpdate = false;
    3434
    35         /**
    36         * Controls if this thread is still in used.
    37         */
    38         private boolean shutdownFlag = false;
     35    /**
     36    * Controls if this thread is still in used.
     37    */
     38    private boolean shutdownFlag = false;
    3939
    40         /**
    41         * Run thread enables the allowUpdate flag once during its cycle.
    42         * @see java.lang.Runnable#run()
    43         */
    44         public void run() {
    45                 initSleepTime();
     40    /**
     41    * Run thread enables the allowUpdate flag once during its cycle.
     42    * @see java.lang.Runnable#run()
     43    */
     44    public void run() {
     45        initSleepTime();
    4646
    47                 shutdownFlag = false;
    48                 // stop the thread, when explicitely shut down or when disabled by
    49                 // config setting
    50                 while (!shutdownFlag && isEnabled()) {
    51                         setAllowUpdate(true);
     47        shutdownFlag = false;
     48        // stop the thread, when explicitely shut down or when disabled by
     49        // config setting
     50        while (!shutdownFlag && isEnabled()) {
     51            setAllowUpdate(true);
    5252
    53                         try {
    54                                 Thread.sleep(getSleepTime());
    55                         } catch (InterruptedException e) {
    56                                 // TODO I never knew, how to handle this??? Probably just carry
    57                                 // on
    58                         }
    59                 }
     53            try {
     54                Thread.sleep(getSleepTime());
     55            } catch (InterruptedException e) {
     56                // TODO I never knew, how to handle this??? Probably just carry
     57                // on
     58            }
     59        }
    6060
    61         }
     61    }
    6262
    63         /**
    64         * Retrieve the sleepTime from the configuration.
    65         * If no such configuration key exists, it will be initialized here.
    66         */
    67         private void initSleepTime() {
    68                 // fetch it from the user setting, or use the default value.
    69                 int sleepSeconds = 0;
    70                 sleepSeconds = Main.pref.getInteger("livegps.refreshinterval",
    71                                 DEFAULT_SLEEP_TIME);
    72                 // creates the setting, if none present.
    73                 Main.pref.putInteger("livegps.refreshinterval", sleepSeconds);
     63    /**
     64    * Retrieve the sleepTime from the configuration.
     65    * If no such configuration key exists, it will be initialized here.
     66    */
     67    private void initSleepTime() {
     68        // fetch it from the user setting, or use the default value.
     69        int sleepSeconds = 0;
     70        sleepSeconds = Main.pref.getInteger("livegps.refreshinterval",
     71                DEFAULT_SLEEP_TIME);
     72        // creates the setting, if none present.
     73        Main.pref.putInteger("livegps.refreshinterval", sleepSeconds);
    7474
    75                 // convert seconds into milliseconds internally.
    76                 this.sleepTime = sleepSeconds * 1000;
    77         }
     75        // convert seconds into milliseconds internally.
     76        this.sleepTime = sleepSeconds * 1000;
     77    }
    7878
    79         /**
    80         * Set the allowUpdate flag. May only privately accessible!
    81         * @param allowUpdate the allowUpdate to set
    82         */
    83         private synchronized void setAllowUpdate(boolean allowUpdate) {
    84                 this.allowUpdate = allowUpdate;
    85         }
     79    /**
     80    * Set the allowUpdate flag. May only privately accessible!
     81    * @param allowUpdate the allowUpdate to set
     82    */
     83    private synchronized void setAllowUpdate(boolean allowUpdate) {
     84        this.allowUpdate = allowUpdate;
     85    }
    8686
    87         /**
    88         * Query, if an update is currently allowed.
    89         * When it is allowed, it will disable the allowUpdate flag as a side effect.
    90         * (this means, one thread got to issue an update event)
    91         *
    92         * @return true, if an update is currently allowed; false, if the update shall be suppressed.
    93         * @see livegps.ILiveGpsSuppressor#isAllowUpdate()
    94         */
    95         public synchronized boolean isAllowUpdate() {
     87    /**
     88    * Query, if an update is currently allowed.
     89    * When it is allowed, it will disable the allowUpdate flag as a side effect.
     90    * (this means, one thread got to issue an update event)
     91    *
     92    * @return true, if an update is currently allowed; false, if the update shall be suppressed.
     93    * @see livegps.ILiveGpsSuppressor#isAllowUpdate()
     94    */
     95    public synchronized boolean isAllowUpdate() {
    9696
    97                 // if disabled, always permit a re-draw.
    98                 if (!isEnabled()) {
    99                         return true;
    100                 } else {
     97        // if disabled, always permit a re-draw.
     98        if (!isEnabled()) {
     99            return true;
     100        } else {
    101101
    102                         if (allowUpdate) {
    103                                 allowUpdate = false;
    104                                 return true;
    105                         } else {
    106                                 return false;
    107                         }
    108                 }
    109         }
     102            if (allowUpdate) {
     103                allowUpdate = false;
     104                return true;
     105            } else {
     106                return false;
     107            }
     108        }
     109    }
    110110
    111         /**
    112         * A value below 1 disables this feature.
    113         * This ensures that a small value does not run this thread
    114         * in a tight loop.
    115          *
    116         * @return true, if suppressing is enabled
    117         */
    118         private boolean isEnabled() {
    119                 return this.sleepTime > 0;
    120         }
     111    /**
     112    * A value below 1 disables this feature.
     113    * This ensures that a small value does not run this thread
     114    * in a tight loop.
     115     *
     116    * @return true, if suppressing is enabled
     117    */
     118    private boolean isEnabled() {
     119        return this.sleepTime > 0;
     120    }
    121121
    122         /**
    123         * Shut this thread down.
    124         */
    125         public void shutdown() {
    126                 shutdownFlag = true;
    127         }
     122    /**
     123    * Shut this thread down.
     124    */
     125    public void shutdown() {
     126        shutdownFlag = true;
     127    }
    128128
    129         /**
    130         * @return the defaultSleepTime
    131         */
    132         private int getSleepTime() {
    133                 return this.sleepTime;
    134         }
     129    /**
     130    * @return the defaultSleepTime
     131    */
     132    private int getSleepTime() {
     133        return this.sleepTime;
     134    }
    135135
    136136}
  • applications/editors/josm/plugins/livegps/src/livegps/SingleSegmentGpxTrack.java

    r20431 r23191  
    1111public class SingleSegmentGpxTrack implements GpxTrack {
    1212
    13         private final Map<String, Object> attributes;
    14         private final GpxTrackSegment trackSegment;
     13    private final Map<String, Object> attributes;
     14    private final GpxTrackSegment trackSegment;
    1515
    16         public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
    17                 this.attributes = Collections.unmodifiableMap(attributes);
    18                 this.trackSegment = trackSegment;
    19         }
     16    public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
     17        this.attributes = Collections.unmodifiableMap(attributes);
     18        this.trackSegment = trackSegment;
     19    }
    2020
    2121
    22         public Map<String, Object> getAttributes() {
    23                 return attributes;
    24         }
     22    public Map<String, Object> getAttributes() {
     23        return attributes;
     24    }
    2525
    26         public Bounds getBounds() {
    27                 return trackSegment.getBounds();
    28         }
     26    public Bounds getBounds() {
     27        return trackSegment.getBounds();
     28    }
    2929
    30         public Collection<GpxTrackSegment> getSegments() {
    31                 return Collections.singleton(trackSegment);
    32         }
     30    public Collection<GpxTrackSegment> getSegments() {
     31        return Collections.singleton(trackSegment);
     32    }
    3333
    34         public double length() {
    35                 return trackSegment.length();
    36         }
     34    public double length() {
     35        return trackSegment.length();
     36    }
    3737
    38         @Override
    39         public int getUpdateCount() {
    40                 return trackSegment.getUpdateCount();
    41         }
     38    @Override
     39    public int getUpdateCount() {
     40        return trackSegment.getUpdateCount();
     41    }
    4242
    4343}
  • applications/editors/josm/plugins/livegps/src/org/json/JSONArray.java

    r21622 r23191  
    7474 * <li>Values can be separated by <code>;</code> <small>(semicolon)</small> as
    7575 *     well as by <code>,</code> <small>(comma)</small>.</li>
    76  * <li>Numbers may have the 
     76 * <li>Numbers may have the
    7777 *     <code>0x-</code> <small>(hex)</small> prefix.</li>
    7878 * </ul>
     
    164164     */
    165165    public JSONArray(Collection collection) {
    166                 this.myArrayList = new ArrayList();
    167                 if (collection != null) {
    168                         Iterator iter = collection.iterator();
    169                         while (iter.hasNext()) {
    170                             Object o = iter.next();
    171                 this.myArrayList.add(JSONObject.wrap(o)); 
    172                         }
    173                 }
    174     }
    175 
    176    
     166        this.myArrayList = new ArrayList();
     167        if (collection != null) {
     168            Iterator iter = collection.iterator();
     169            while (iter.hasNext()) {
     170                Object o = iter.next();
     171                this.myArrayList.add(JSONObject.wrap(o));
     172            }
     173        }
     174    }
     175
     176
    177177    /**
    178178     * Construct a JSONArray from an array
     
    192192    }
    193193
    194      
     194
    195195    /**
    196196     * Get the object value associated with an index.
     
    765765        return this;
    766766    }
    767    
    768    
     767
     768
    769769    /**
    770770     * Remove an index and close the hole.
     
    774774     */
    775775    public Object remove(int index) {
    776         Object o = opt(index);
     776        Object o = opt(index);
    777777        this.myArrayList.remove(index);
    778778        return o;
  • applications/editors/josm/plugins/livegps/src/org/json/JSONException.java

    r21622 r23191  
    88public class JSONException extends Exception {
    99    /**
    10         *
    11         */
    12         private static final long serialVersionUID = 0;
    13         private Throwable cause;
     10    *
     11    */
     12    private static final long serialVersionUID = 0;
     13    private Throwable cause;
    1414
    1515    /**
  • applications/editors/josm/plugins/livegps/src/org/json/JSONObject.java

    r21622 r23191  
    155155     * @param jo A JSONObject.
    156156     * @param names An array of strings.
    157      * @throws JSONException 
     157     * @throws JSONException
    158158     * @exception JSONException If a value is a non-finite number or if a name is duplicated.
    159159     */
     
    161161        this();
    162162        for (int i = 0; i < names.length; i += 1) {
    163                 try {
    164                         putOnce(names[i], jo.opt(names[i]));
    165                 } catch (Exception ignore) {
    166                 }
     163            try {
     164                putOnce(names[i], jo.opt(names[i]));
     165            } catch (Exception ignore) {
     166            }
    167167        }
    168168    }
     
    235235     * @param map A map object that can be used to initialize the contents of
    236236     *  the JSONObject.
    237      * @throws JSONException 
     237     * @throws JSONException
    238238     */
    239239    public JSONObject(Map map) {
     
    455455
    456456    /**
    457      * Get the int value associated with a key. 
     457     * Get the int value associated with a key.
    458458     *
    459459     * @param key   A key string.
     
    512512
    513513    /**
    514      * Get the long value associated with a key. 
     514     * Get the long value associated with a key.
    515515     *
    516516     * @param key   A key string.
     
    596596        return this.map.containsKey(key);
    597597    }
    598    
    599    
     598
     599
    600600    /**
    601601     * Increment a property of a JSONObject. If there is no such property,
     
    608608     */
    609609    public JSONObject increment(String key) throws JSONException {
    610         Object value = opt(key);
    611         if (value == null) {
    612                 put(key, 1);
    613         } else {
    614                 if (value instanceof Integer) {
    615                         put(key, ((Integer)value).intValue() + 1);
    616                 } else if (value instanceof Long) {
    617                         put(key, ((Long)value).longValue() + 1);                       
    618                 } else if (value instanceof Double) {
    619                         put(key, ((Double)value).doubleValue() + 1);                           
    620                 } else if (value instanceof Float) {
    621                         put(key, ((Float)value).floatValue() + 1);                     
    622                     } else {
    623                         throw new JSONException("Unable to increment [" + key + "].");
    624                     }
    625             }
    626         return this;
     610        Object value = opt(key);
     611        if (value == null) {
     612            put(key, 1);
     613        } else {
     614            if (value instanceof Integer) {
     615                put(key, ((Integer)value).intValue() + 1);
     616            } else if (value instanceof Long) {
     617                put(key, ((Long)value).longValue() + 1);
     618            } else if (value instanceof Double) {
     619                put(key, ((Double)value).doubleValue() + 1);
     620            } else if (value instanceof Float) {
     621                put(key, ((Float)value).floatValue() + 1);
     622            } else {
     623                throw new JSONException("Unable to increment [" + key + "].");
     624            }
     625        }
     626        return this;
    627627    }
    628628
     
    903903        Class klass = bean.getClass();
    904904
    905 // If klass is a System class then set includeSuperClass to false. 
     905// If klass is a System class then set includeSuperClass to false.
    906906
    907907        boolean includeSuperClass = klass.getClassLoader() != null;
     
    916916                    String key = "";
    917917                    if (name.startsWith("get")) {
    918                         if (name.equals("getClass") ||
    919                                         name.equals("getDeclaringClass")) {
    920                                 key = "";
    921                         } else {
    922                                 key = name.substring(3);
    923                         }
     918                        if (name.equals("getClass") ||
     919                                name.equals("getDeclaringClass")) {
     920                            key = "";
     921                        } else {
     922                            key = name.substring(3);
     923                        }
    924924                    } else if (name.startsWith("is")) {
    925925                        key = name.substring(2);
     
    11991199
    12001200        /*
    1201          * If it might be a number, try converting it. 
    1202          * We support the non-standard 0x- convention. 
     1201         * If it might be a number, try converting it.
     1202         * We support the non-standard 0x- convention.
    12031203         * If a number cannot be produced, then the value will just
    12041204         * be a string. Note that the 0x-, plus, and implied string
     
    12171217            }
    12181218            try {
    1219                 if (s.indexOf('.') > -1 || 
    1220                                 s.indexOf('e') > -1 || s.indexOf('E') > -1) {
     1219                if (s.indexOf('.') > -1 ||
     1220                        s.indexOf('e') > -1 || s.indexOf('E') > -1) {
    12211221                    return Double.valueOf(s);
    12221222                } else {
     
    14951495
    14961496     /**
    1497       * Wrap an object, if necessary. If the object is null, return the NULL 
    1498       * object. If it is an array or collection, wrap it in a JSONArray. If 
    1499       * it is a map, wrap it in a JSONObject. If it is a standard property 
    1500       * (Double, String, et al) then it is already wrapped. Otherwise, if it 
    1501       * comes from one of the java packages, turn it into a string. And if 
     1497      * Wrap an object, if necessary. If the object is null, return the NULL
     1498      * object. If it is an array or collection, wrap it in a JSONArray. If
     1499      * it is a map, wrap it in a JSONObject. If it is a standard property
     1500      * (Double, String, et al) then it is already wrapped. Otherwise, if it
     1501      * comes from one of the java packages, turn it into a string. And if
    15021502      * it doesn't, try to wrap it in a JSONObject. If the wrapping fails,
    15031503      * then null is returned.
     
    15111511                 return NULL;
    15121512             }
    1513              if (object instanceof JSONObject || object instanceof JSONArray || 
    1514                          NULL.equals(object)      || object instanceof JSONString ||
    1515                         object instanceof Byte   || object instanceof Character ||
     1513             if (object instanceof JSONObject || object instanceof JSONArray ||
     1514                     NULL.equals(object)      || object instanceof JSONString ||
     1515                    object instanceof Byte   || object instanceof Character ||
    15161516                     object instanceof Short  || object instanceof Integer   ||
    1517                      object instanceof Long   || object instanceof Boolean   || 
     1517                     object instanceof Long   || object instanceof Boolean   ||
    15181518                     object instanceof Float  || object instanceof Double    ||
    15191519                     object instanceof String) {
    15201520                 return object;
    15211521             }
    1522              
     1522
    15231523             if (object instanceof Collection) {
    15241524                 return new JSONArray((Collection)object);
     
    15331533             String objectPackageName = ( objectPackage != null ? objectPackage.getName() : "" );
    15341534             if (objectPackageName.startsWith("java.") ||
    1535                         objectPackageName.startsWith("javax.") ||
    1536                         object.getClass().getClassLoader() == null) {
     1535                    objectPackageName.startsWith("javax.") ||
     1536                    object.getClass().getClassLoader() == null) {
    15371537                 return object.toString();
    15381538             }
     
    15431543     }
    15441544
    1545      
     1545
    15461546     /**
    15471547      * Write the contents of the JSONObject as JSON text to a writer.
  • applications/editors/josm/plugins/livegps/src/org/json/JSONString.java

    r21622 r23191  
    99 */
    1010public interface JSONString {
    11         /**
    12         * The <code>toJSONString</code> method allows a class to produce its own JSON
    13         * serialization.
    14         *
    15         * @return A strictly syntactically correct JSON text.
    16         */
    17         public String toJSONString();
     11    /**
     12    * The <code>toJSONString</code> method allows a class to produce its own JSON
     13    * serialization.
     14    *
     15    * @return A strictly syntactically correct JSON text.
     16    */
     17    public String toJSONString();
    1818}
  • applications/editors/josm/plugins/livegps/src/org/json/JSONTokener.java

    r21622 r23191  
    3939public class JSONTokener {
    4040
    41     private int         character;
    42         private boolean eof;
    43     private int         index;
    44     private int         line;
    45     private char        previous;
    46     private Reader      reader;
     41    private int     character;
     42    private boolean eof;
     43    private int     index;
     44    private int     line;
     45    private char    previous;
     46    private Reader  reader;
    4747    private boolean usePrevious;
    4848
     
    5454     */
    5555    public JSONTokener(Reader reader) {
    56         this.reader = reader.markSupported() ? 
    57                         reader : new BufferedReader(reader);
     56        this.reader = reader.markSupported() ?
     57                reader : new BufferedReader(reader);
    5858        this.eof = false;
    5959        this.usePrevious = false;
     
    109109        return -1;
    110110    }
    111    
     111
    112112    public boolean end() {
    113         return eof && !usePrevious;     
     113        return eof && !usePrevious;
    114114    }
    115115
     
    124124        if (end()) {
    125125            return false;
    126         } 
     126        }
    127127        back();
    128128        return true;
     
    138138        int c;
    139139        if (this.usePrevious) {
    140                 this.usePrevious = false;
     140            this.usePrevious = false;
    141141            c = this.previous;
    142142        } else {
    143                 try {
    144                     c = this.reader.read();
    145                 } catch (IOException exception) {
    146                     throw new JSONException(exception);
    147                 }
    148        
    149                 if (c <= 0) { // End of stream
    150                         this.eof = true;
    151                         c = 0;
    152                 }
    153         }
    154         this.index += 1;
    155         if (this.previous == '\r') {
    156                 this.line += 1;
    157                 this.character = c == '\n' ? 0 : 1;
    158         } else if (c == '\n') {
    159                 this.line += 1;
    160                 this.character = 0;
    161         } else {
    162                 this.character += 1;
    163         }
    164         this.previous = (char) c;
     143            try {
     144                c = this.reader.read();
     145            } catch (IOException exception) {
     146                throw new JSONException(exception);
     147            }
     148
     149            if (c <= 0) { // End of stream
     150                this.eof = true;
     151                c = 0;
     152            }
     153        }
     154        this.index += 1;
     155        if (this.previous == '\r') {
     156            this.line += 1;
     157            this.character = c == '\n' ? 0 : 1;
     158        } else if (c == '\n') {
     159            this.line += 1;
     160            this.character = 0;
     161        } else {
     162            this.character += 1;
     163        }
     164        this.previous = (char) c;
    165165        return this.previous;
    166166    }
     
    204204             buffer[pos] = next();
    205205             if (end()) {
    206                  throw syntaxError("Substring bounds error");                 
     206                 throw syntaxError("Substring bounds error");
    207207             }
    208208             pos += 1;
     
    273273                case '\\':
    274274                case '/':
    275                         sb.append(c);
    276                         break;
     275                    sb.append(c);
     276                    break;
    277277                default:
    278278                    throw syntaxError("Illegal escape.");
     
    412412        return c;
    413413    }
    414    
     414
    415415
    416416    /**
  • applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersPlugin.java

    r19460 r23191  
    66import java.io.IOException;
    77
    8 import javax.swing.*;
     8import javax.swing.JMenu;
     9import javax.swing.JMenuBar;
     10import javax.swing.JMenuItem;
    911
    1012import org.openstreetmap.josm.Main;
     
    2628
    2729    public OpenLayersPlugin(PluginInformation info) {
    28         super(info);
     30        super(info);
    2931        pluginDir = getPluginDir();
    3032        try {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/ConfigKeys.java

    r19282 r23191  
    11/* Copyright (c) 2008, Henrik Niehaus
    22 * All rights reserved.
    3  * 
     3 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions are met:
    6  * 
     6 *
    77 * 1. Redistributions of source code must retain the above copyright notice,
    88 *    this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright notice, 
    10  *    this list of conditions and the following disclaimer in the documentation 
     9 * 2. Redistributions in binary form must reproduce the above copyright notice,
     10 *    this list of conditions and the following disclaimer in the documentation
    1111 *    and/or other materials provided with the distribution.
    12  * 3. Neither the name of the project nor the names of its 
    13  *    contributors may be used to endorse or promote products derived from this 
     12 * 3. Neither the name of the project nor the names of its
     13 *    contributors may be used to endorse or promote products derived from this
    1414 *    software without specific prior written permission.
    15  * 
     15 *
    1616 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1717 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbDownloadLoop.java

    r19282 r23191  
    7878
    7979                // auto download if configured
    80                 if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && !Main.pref.getBoolean(ConfigKeys.OSB_API_OFFLINE) && 
     80                if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && !Main.pref.getBoolean(ConfigKeys.OSB_API_OFFLINE) &&
    8181                        plugin != null && plugin.getDialog() != null && plugin.getDialog().isDialogShowing() ) {
    8282                    if(countdown < 0) {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r22684 r23191  
    8484            UploadAction.registerUploadHook(uploadHook);
    8585        } else {
    86                 MapView.removeLayerChangeListener(this);
    87                 UploadAction.unregisterUploadHook(uploadHook);
    88                 uploadHook = null;
     86            MapView.removeLayerChangeListener(this);
     87            UploadAction.unregisterUploadHook(uploadHook);
     88            uploadHook = null;
    8989        }
    9090    }
     
    231231    public void layerRemoved(Layer oldLayer) {
    232232        if(oldLayer == layer) {
    233                 MapView.removeLayerChangeListener(this);
    234                 MapView.removeLayerChangeListener(dialog);
     233            MapView.removeLayerChangeListener(this);
     234            MapView.removeLayerChangeListener(dialog);
    235235            layer = null;
    236236        }
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/AddCommentAction.java

    r19282 r23191  
    4949
    5050    private EditAction editAction = new EditAction();
    51    
     51
    5252    private String comment;
    53    
     53
    5454    private Node node;
    5555
     
    7373                OsbPlugin.loadIcon("add_comment22.png"),
    7474                history, l);
    75        
     75
    7676        if(comment == null) {
    7777            cancelled = true;
     
    8484        editAction.execute(node, comment);
    8585    }
    86    
     86
    8787    @Override
    8888    public String toString() {
    8989        return tr("Comment: " + node.get("note") + " - " + comment);
    9090    }
    91    
     91
    9292    @Override
    9393    public AddCommentAction clone() {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/CloseIssueAction.java

    r19282 r23191  
    5151    private CloseAction closeAction = new CloseAction();
    5252    private EditAction commentAction = new EditAction();
    53    
     53
    5454    private String comment;
    55    
     55
    5656    private Node node;
    5757
     
    7474                OsbPlugin.loadIcon("icon_valid22.png"),
    7575                history, l);
    76        
     76
    7777        if(comment == null) {
    7878            cancelled = true;
     
    8989        closeAction.execute(node);
    9090    }
    91    
     91
    9292    @Override
    9393    public String toString() {
    9494        return tr("Close: " + node.get("note") + " - Comment: " + comment);
    9595    }
    96    
     96
    9797    @Override
    9898    public CloseIssueAction clone() {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/NewIssueAction.java

    r19282 r23191  
    5151
    5252    private String result;
    53    
     53
    5454    private Point p;
    55    
     55
    5656    private NewAction newAction = new NewAction();
    57    
     57
    5858    public NewIssueAction(OsbPlugin plugin, Point p) {
    5959        super(tr("New issue"), plugin.getDialog());
     
    7777                OsbPlugin.loadIcon("icon_error_add22.png"),
    7878                history, l);
    79        
     79
    8080        if(result == null) {
    8181            cancelled = true;
     
    9696        }
    9797    }
    98    
     98
    9999    @Override
    100100    public String toString() {
    101101        return tr("Create: " + result);
    102102    }
    103    
     103
    104104    @Override
    105105    public OsbAction clone() {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/PointToNewIssueAction.java

    r19285 r23191  
    4646
    4747    private JToggleButton button;
    48    
     48
    4949    private OsbPlugin plugin;
    5050
    5151    private Cursor previousCursor;
    52    
     52
    5353    public PointToNewIssueAction(JToggleButton button, OsbPlugin plugin) {
    5454        super(tr("New issue"));
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/dialogs/TextInputDialog.java

    r17872 r23191  
    11/* Copyright (c) 2008, Henrik Niehaus
    22 * All rights reserved.
    3  * 
     3 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions are met:
    6  * 
     6 *
    77 * 1. Redistributions of source code must retain the above copyright notice,
    88 *    this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright notice, 
    10  *    this list of conditions and the following disclaimer in the documentation 
     9 * 2. Redistributions in binary form must reproduce the above copyright notice,
     10 *    this list of conditions and the following disclaimer in the documentation
    1111 *    and/or other materials provided with the distribution.
    12  * 3. Neither the name of the project nor the names of its 
    13  *    contributors may be used to endorse or promote products derived from this 
     12 * 3. Neither the name of the project nor the names of its
     13 *    contributors may be used to endorse or promote products derived from this
    1414 *    software without specific prior written permission.
    15  * 
     15 *
    1616 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1717 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     
    7474    private JLabel lblText;
    7575    private JPanel pnlMain;
    76    
     76
    7777    private String value = null;
    78    
     78
    7979    private TextInputDialog() {
    8080        initGUI();
     
    8888            }
    8989        });
    90        
     90
    9191        btnOk.addActionListener(new ActionListener() {
    9292            public void actionPerformed(ActionEvent e) {
     
    9494            }
    9595        });
    96        
     96
    9797        btnCancel.addActionListener(new ActionListener() {
    9898            public void actionPerformed(ActionEvent e) {
     
    101101        });
    102102    }
    103    
     103
    104104    private void okPressed() {
    105105        value = input.getText();
     
    155155        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    156156    }
    157    
     157
    158158    public static String showDialog(JComponent parent, String title, String text, List<String> history, HistoryChangedListener l) {
    159159        return showDialog(parent, title, text, null, history, l);
    160160    }
    161    
     161
    162162    /**
    163163     * Opens a text input dialog and returns the entered text
     
    180180        int y = (int) (p.getY() +  (double)(parent.getHeight() - tid.getHeight()) / 2);
    181181        tid.setLocation(x, y);
    182        
     182
    183183        //tid.pack();
    184184        tid.setVisible(true);
     
    189189        return this.value;
    190190    }
    191    
     191
    192192    public void setDescription(String text) {
    193193        lblText.setText(text);
    194194    }
    195    
     195
    196196    public void setHistory(List<String> history) {
    197197        input.setHistory(history);
     
    199199        value = null;
    200200    }
    201    
     201
    202202    public void addHistoryChangedListener(HistoryChangedListener l) {
    203203        ((ComboBoxHistory)input.getModel()).addHistoryChangedListener(l);
    204204    }
    205    
     205
    206206    public void setIcon(Icon icon) {
    207207        lblIcon.setIcon(icon);
  • applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisibleAction.java

    r20067 r23191  
    9898                e1.printStackTrace();
    9999            } catch(IllegalDataException e1) {
    100                 e1.printStackTrace();
     100                e1.printStackTrace();
    101101            }
    102102        }
     
    128128                JOptionPane.showMessageDialog(Main.parent, tr("Parsing file \"{0}\" failed", file));
    129129                throw new IllegalStateException();
    130             }                           
     130            }
    131131            r.data.storageFile = file;
    132132            GpxLayer gpxLayer = new GpxLayer(r.data, fn);
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java

    r22018 r23191  
    7575    JCheckBox deleteOutlineCheckBox;
    7676
    77         HouseNumberInputHandler inputHandler;
     77    HouseNumberInputHandler inputHandler;
    7878
    7979    /**
     
    102102    }
    103103
    104         /**
     104    /**
    105105     * This method initializes this
    106106     *
     
    111111        this.hi.addFocusListener(this.inputHandler);
    112112        this.segments.addFocusListener(this.inputHandler);
    113                 this.interpolation.addItemListener(this.inputHandler);
     113        this.interpolation.addItemListener(this.inputHandler);
    114114    }
    115115
     
    136136        if (inputPanel == null) {
    137137
    138                 GridBagConstraints c = new GridBagConstraints();
    139 
    140                 messageLabel = new JTextArea();
     138            GridBagConstraints c = new GridBagConstraints();
     139
     140            messageLabel = new JTextArea();
    141141            messageLabel.setText(DEFAULT_MESSAGE);
    142142            messageLabel.setAutoscrolls(true);
     
    168168            inputPanel.setLayout(new GridBagLayout());
    169169            c.fill = GridBagConstraints.HORIZONTAL;
    170                         c.gridwidth = GridBagConstraints.REMAINDER;
     170            c.gridwidth = GridBagConstraints.REMAINDER;
    171171            inputPanel.add(messageLabel, c);
    172172
     
    191191    }
    192192
    193         /**
     193    /**
    194194     * Overrides the default actions. Will not close the window when upload trace is clicked
    195195     */
     
    268268            interpolation.add(tr("Even/Odd"));
    269269            if (Main.pref.getInteger(INTERPOLATION, 2) == 1) {
    270                 interpolation.select(tr("All"));
     270                interpolation.select(tr("All"));
    271271            } else {
    272                 interpolation.select(tr("Even/Odd"));
     272                interpolation.select(tr("Even/Odd"));
    273273            }
    274274            //return (dialog.interpolation.getSelectedItem().equals(tr("All"))) ? 1 : 2;
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java

    r21169 r23191  
    6161        this.street = street;
    6262        this.associatedStreet = associatedStreet;
    63        
     63
    6464        // This dialog is started modal
    6565        this.dialog = new HouseNumberInputDialog(this, street, associatedStreet != null);
    66        
     66
    6767        // We're done
    6868    }
    6969
    70         /**
    71         * Find a button with a certain caption.
    72         * Loops recursively through all objects to find all buttons.
    73         * Function returns on the first match.
    74         *
    75         * @param root A container object that is recursively searched for other containers or buttons
    76         * @param caption The caption of the button that is being searched
    77         *
    78         * @return The first button that matches the caption or null if not found
    79         */
    80         private static JButton getButton(Container root, String caption) {
    81                 Component children[] = root.getComponents();
     70    /**
     71    * Find a button with a certain caption.
     72    * Loops recursively through all objects to find all buttons.
     73    * Function returns on the first match.
     74    *
     75    * @param root A container object that is recursively searched for other containers or buttons
     76    * @param caption The caption of the button that is being searched
     77    *
     78    * @return The first button that matches the caption or null if not found
     79    */
     80    private static JButton getButton(Container root, String caption) {
     81        Component children[] = root.getComponents();
    8282         for (Component child : children) {
    83                 JButton b;
    84                 if (child instanceof JButton) {
    85                                 b = (JButton) child;
    86                                 if (caption.equals(b.getText())) return b;
    87                         } else if (child instanceof Container) {
     83            JButton b;
     84            if (child instanceof JButton) {
     85                b = (JButton) child;
     86                if (caption.equals(b.getText())) return b;
     87            } else if (child instanceof Container) {
    8888                  b = getButton((Container)child, caption);
    8989                  if (b != null) return b;
    9090             }
    9191         }
    92                 return null;
    93         }
    94        
     92        return null;
     93    }
     94
    9595    /**
    9696     * Validate the current input fields.
     
    110110        // Allow non numeric characters for the low number as long as there is no high number of the segmentcount is 1
    111111        if (dialog.hi.getText().length() > 0 | segments() > 1) {
    112                     isOk = isOk
    113                             && checkNumberStringField(dialog.lo, tr("Lowest number"),
    114                                     message);
    115                 }
     112            isOk = isOk
     113                    && checkNumberStringField(dialog.lo, tr("Lowest number"),
     114                            message);
     115        }
    116116        isOk = isOk
    117117                && checkNumberStringField(dialog.hi, tr("Highest number"),
     
    124124            JButton okButton = getButton(dialog, "OK");
    125125            if (okButton != null)
    126                 okButton.setEnabled(true);
    127            
     126                okButton.setEnabled(true);
     127
    128128            // For some reason the messageLabel doesn't want to show up
    129129            dialog.messageLabel.setForeground(Color.black);
     
    133133            JButton okButton = getButton(dialog, "OK");
    134134            if (okButton != null)
    135                         okButton.setEnabled(false);
    136                                
    137                 // For some reason the messageLabel doesn't want to show up, so a MessageDialog is shown instead. Someone more knowledgeable might fix this.
    138                 dialog.messageLabel.setForeground(Color.red);
    139                 dialog.messageLabel.setText(message.toString());
    140                 //JOptionPane.showMessageDialog(null, message.toString(), tr("Error"), JOptionPane.ERROR_MESSAGE);
     135                okButton.setEnabled(false);
     136
     137            // For some reason the messageLabel doesn't want to show up, so a MessageDialog is shown instead. Someone more knowledgeable might fix this.
     138            dialog.messageLabel.setForeground(Color.red);
     139            dialog.messageLabel.setText(message.toString());
     140            //JOptionPane.showMessageDialog(null, message.toString(), tr("Error"), JOptionPane.ERROR_MESSAGE);
    141141
    142142            return false;
     
    273273            JButton button = (JButton) e.getSource();
    274274            if ("OK".equals(button.getActionCommand()) & button.isEnabled()) {
    275                 if (validateInput()) {
    276                             saveValues();
    277                            
    278                                 terracerAction.terraceBuilding(
    279                                     outline,
    280                                     street,
    281                                     associatedStreet,
    282                                     segments(),
    283                                     dialog.lo.getText(),
    284                                     dialog.hi.getText(),
    285                                     stepSize(),
    286                                     streetName(),
    287                                     doHandleRelation(),
    288                                     doDeleteOutline());
    289                                
    290                             this.dialog.dispose();
    291                         }
     275                if (validateInput()) {
     276                    saveValues();
     277
     278                    terracerAction.terraceBuilding(
     279                        outline,
     280                        street,
     281                        associatedStreet,
     282                        segments(),
     283                        dialog.lo.getText(),
     284                        dialog.hi.getText(),
     285                        stepSize(),
     286                        streetName(),
     287                        doHandleRelation(),
     288                        doDeleteOutline());
     289
     290                    this.dialog.dispose();
     291                }
    292292            } else if ("Cancel".equals(button.getActionCommand())) {
    293293                this.dialog.dispose();
     
    357357        if (street != null)
    358358            return null;
    359            
     359
    360360        Object selected = dialog.streetComboBox.getSelectedItem();
    361361        if (selected == null) {
     
    376376     */
    377377    public boolean doHandleRelation() {
    378         if (this.dialog == null) {
    379                 JOptionPane.showMessageDialog(null, "dialog", "alert", JOptionPane.ERROR_MESSAGE);
    380         }
    381         if (this.dialog.handleRelationCheckBox == null) {
    382                 JOptionPane.showMessageDialog(null, "checkbox", "alert", JOptionPane.ERROR_MESSAGE);
    383                 return true;
    384         }  else {
    385                 return this.dialog.handleRelationCheckBox.isSelected();
    386         }
    387     }
    388 
    389    
     378        if (this.dialog == null) {
     379            JOptionPane.showMessageDialog(null, "dialog", "alert", JOptionPane.ERROR_MESSAGE);
     380        }
     381        if (this.dialog.handleRelationCheckBox == null) {
     382            JOptionPane.showMessageDialog(null, "checkbox", "alert", JOptionPane.ERROR_MESSAGE);
     383            return true;
     384        }  else {
     385            return this.dialog.handleRelationCheckBox.isSelected();
     386        }
     387    }
     388
     389
    390390    /**
    391391     * Whether the user likes to delete the outline way.
     
    394394        return dialog.deleteOutlineCheckBox.isSelected();
    395395    }
    396    
     396
    397397    /* (non-Javadoc)
    398398     * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
    399399     */
    400400    public void focusGained(FocusEvent e) {
    401                 // Empty, but placeholder is required
     401        // Empty, but placeholder is required
    402402    }
    403403
     
    406406     */
    407407    public void focusLost(FocusEvent e) {
    408         if (e.getOppositeComponent() == null)
    409                 return;
     408        if (e.getOppositeComponent() == null)
     409            return;
    410410
    411411        validateInput();
  • applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java

    r19678 r23191  
    7878            }
    7979        }
    80        
     80
    8181        if (front.isEmpty()) {
    8282            JOptionPane.showMessageDialog(Main.parent,
    8383                    tr("Cannot reverse!"));
    8484            return;
    85         }               
     85        }
    8686
    8787        // This is like a visitedWays set, but in a linear order.
     
    130130    protected void updateEnabledState() {
    131131        setEnabled(getCurrentDataSet() != null);
    132     }   
     132    }
    133133}
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java

    r21376 r23191  
    5858    // repeated terraces. this is the easiest, but not necessarily nicest, way.
    5959    // private static String lastSelectedValue = "";
    60        
    61         Collection<Command> commands;
    62        
     60
     61    Collection<Command> commands;
     62
    6363    public TerracerAction() {
    6464        super(tr("Terrace a building"), "terrace",
     
    152152    }
    153153
    154         public Integer getNumber(String number) {
    155                 try {
     154    public Integer getNumber(String number) {
     155        try {
    156156            return Integer.parseInt(number);
    157157        } catch (NumberFormatException ex) {
    158158            return null;
    159159        }
    160         }
    161        
     160    }
     161
    162162    /**
    163163     * Terraces a single, closed, quadrilateral way.
     
    178178     */
    179179    public void terraceBuilding(Way outline,
    180                                 Way street,
    181                                 Relation associatedStreet,
    182                                 Integer segments,
    183                                 String From,
    184                                 String To,
    185                                 int step,
    186                                 String streetName,
    187                                 boolean handleRelations,
    188                                 boolean deleteOutline) {
     180                Way street,
     181                Relation associatedStreet,
     182                Integer segments,
     183                String From,
     184                String To,
     185                int step,
     186                String streetName,
     187                boolean handleRelations,
     188                boolean deleteOutline) {
    189189        final int nb;
    190        
     190
    191191        Integer to, from;
    192192        to = getNumber(To);
     
    210210        Collection<Way> ways = new LinkedList<Way>();
    211211
    212                 // Should this building be terraced (i.e. is there more then one section?)
    213                 if (nb > 1) {
    214                     // create intermediate nodes by interpolating.
    215                    
    216                     // now find which is the longest side connecting the first node
    217                         Pair<Way, Way> interp = findFrontAndBack(outline);
    218 
    219                         final double frontLength = wayLength(interp.a);
    220                         final double backLength = wayLength(interp.b);
    221                        
    222                     for (int i = 0; i <= nb; ++i) {
    223                         new_nodes[0][i] = interpolateAlong(interp.a, frontLength * i / nb);
    224                         new_nodes[1][i] = interpolateAlong(interp.b, backLength * i / nb);
    225                         this.commands.add(new AddCommand(new_nodes[0][i]));
    226                         this.commands.add(new AddCommand(new_nodes[1][i]));
    227                     }
    228 
    229                     // assemble new quadrilateral, closed ways
    230                     for (int i = 0; i < nb; ++i) {
    231                         Way terr = new Way();
    232                         // Using Way.nodes.add rather than Way.addNode because the latter
    233                         // doesn't
    234                         // exist in older versions of JOSM.
    235                         terr.addNode(new_nodes[0][i]);
    236                         terr.addNode(new_nodes[0][i + 1]);
    237                         terr.addNode(new_nodes[1][i + 1]);
    238                         terr.addNode(new_nodes[1][i]);
    239                         terr.addNode(new_nodes[0][i]);
    240                        
    241                         // add the tags of the outline to each building (e.g. source=*)
    242                         TagCollection.from(outline).applyTo(terr);
    243 
    244                                 String number = null;
    245                                 if (from != null) {
    246                                         number = Integer.toString(from + i * step);
    247                                 }
    248                         terr = addressBuilding(terr, street, streetName, number);
    249 
    250                         ways.add(terr);
    251                         this.commands.add(new AddCommand(terr));
    252                     }
    253 
    254                     if (deleteOutline) {
    255                         this.commands.add(DeleteCommand.delete(Main.main.getEditLayer(), Collections.singleton(outline), true, true));
    256                     }
    257                 } else {
    258                         // Single section, just add the address details
    259                         Way newOutline;
    260                         newOutline = addressBuilding(outline, street, streetName, From);
    261                         ways.add(newOutline);
    262                         this.commands.add(new ChangeCommand(outline, newOutline));
    263                 }
    264                
    265                 if (handleRelations) { // create a new relation or merge with existing
    266                     if (associatedStreet == null) {  // create a new relation
    267                         associatedStreet = new Relation();
    268                         associatedStreet.put("type", "associatedStreet");
    269                         if (street != null) { // a street was part of the selection
    270                             associatedStreet.put("name", street.get("name"));
    271                             associatedStreet.addMember(new RelationMember("street", street));
    272                         } else {
    273                             associatedStreet.put("name", streetName);
    274                         }
    275                         for (Way w : ways) {
    276                             associatedStreet.addMember(new RelationMember("house", w));
    277                         }
    278                         this.commands.add(new AddCommand(associatedStreet));
    279                     }
    280                     else { // relation exists already - add new members
    281                         Relation newAssociatedStreet = new Relation(associatedStreet);
    282                         for (Way w : ways) {
    283                             newAssociatedStreet.addMember(new RelationMember("house", w));
    284                         }
    285                         this.commands.add(new ChangeCommand(associatedStreet, newAssociatedStreet));
    286                     }
    287                 }
    288                 Main.main.undoRedo.add(new SequenceCommand(tr("Terrace"), commands));
    289                 if (nb > 1) {
    290                         // Select the new building outlines (for quick reversing)
    291                     Main.main.getCurrentDataSet().setSelected(ways);
    292                 } else if (street != null) {
    293                         // Select the way (for quick selection of a new house (with the same way))
    294                     Main.main.getCurrentDataSet().setSelected(street);
    295                 }
     212        // Should this building be terraced (i.e. is there more then one section?)
     213        if (nb > 1) {
     214            // create intermediate nodes by interpolating.
     215
     216            // now find which is the longest side connecting the first node
     217            Pair<Way, Way> interp = findFrontAndBack(outline);
     218
     219            final double frontLength = wayLength(interp.a);
     220            final double backLength = wayLength(interp.b);
     221
     222            for (int i = 0; i <= nb; ++i) {
     223                new_nodes[0][i] = interpolateAlong(interp.a, frontLength * i / nb);
     224                new_nodes[1][i] = interpolateAlong(interp.b, backLength * i / nb);
     225                this.commands.add(new AddCommand(new_nodes[0][i]));
     226                this.commands.add(new AddCommand(new_nodes[1][i]));
     227            }
     228
     229            // assemble new quadrilateral, closed ways
     230            for (int i = 0; i < nb; ++i) {
     231                Way terr = new Way();
     232                // Using Way.nodes.add rather than Way.addNode because the latter
     233                // doesn't
     234                // exist in older versions of JOSM.
     235                terr.addNode(new_nodes[0][i]);
     236                terr.addNode(new_nodes[0][i + 1]);
     237                terr.addNode(new_nodes[1][i + 1]);
     238                terr.addNode(new_nodes[1][i]);
     239                terr.addNode(new_nodes[0][i]);
     240
     241                // add the tags of the outline to each building (e.g. source=*)
     242                TagCollection.from(outline).applyTo(terr);
     243
     244                String number = null;
     245                if (from != null) {
     246                    number = Integer.toString(from + i * step);
     247                }
     248                terr = addressBuilding(terr, street, streetName, number);
     249
     250                ways.add(terr);
     251                this.commands.add(new AddCommand(terr));
     252            }
     253
     254            if (deleteOutline) {
     255                this.commands.add(DeleteCommand.delete(Main.main.getEditLayer(), Collections.singleton(outline), true, true));
     256            }
     257        } else {
     258            // Single section, just add the address details
     259            Way newOutline;
     260            newOutline = addressBuilding(outline, street, streetName, From);
     261            ways.add(newOutline);
     262            this.commands.add(new ChangeCommand(outline, newOutline));
     263        }
     264
     265        if (handleRelations) { // create a new relation or merge with existing
     266            if (associatedStreet == null) {  // create a new relation
     267                associatedStreet = new Relation();
     268                associatedStreet.put("type", "associatedStreet");
     269                if (street != null) { // a street was part of the selection
     270                    associatedStreet.put("name", street.get("name"));
     271                    associatedStreet.addMember(new RelationMember("street", street));
     272                } else {
     273                    associatedStreet.put("name", streetName);
     274                }
     275                for (Way w : ways) {
     276                    associatedStreet.addMember(new RelationMember("house", w));
     277                }
     278                this.commands.add(new AddCommand(associatedStreet));
     279            }
     280            else { // relation exists already - add new members
     281                Relation newAssociatedStreet = new Relation(associatedStreet);
     282                for (Way w : ways) {
     283                    newAssociatedStreet.addMember(new RelationMember("house", w));
     284                }
     285                this.commands.add(new ChangeCommand(associatedStreet, newAssociatedStreet));
     286            }
     287        }
     288        Main.main.undoRedo.add(new SequenceCommand(tr("Terrace"), commands));
     289        if (nb > 1) {
     290            // Select the new building outlines (for quick reversing)
     291            Main.main.getCurrentDataSet().setSelected(ways);
     292        } else if (street != null) {
     293            // Select the way (for quick selection of a new house (with the same way))
     294            Main.main.getCurrentDataSet().setSelected(street);
     295        }
    296296    }
    297297
     
    306306     */
    307307    private Way addressBuilding(Way outline, Way street, String streetName, String number) {
    308         Way changedOutline = outline;
     308        Way changedOutline = outline;
    309309        if (number != null) {
    310310            // only, if the user has specified house numbers
     
    431431        return Math.min(positiveModulus(i1 - i2, n), positiveModulus(i2 - i1, n));
    432432    }
    433    
     433
    434434    /**
    435435     * return the modulus in the range [0, n)
    436436     */
    437437    private int positiveModulus(int a, int n) {
    438         if (n <=0) 
     438        if (n <=0)
    439439            throw new IllegalArgumentException();
    440440        int res = a % n;
     
    444444        return res;
    445445    }
    446    
     446
    447447    /**
    448448     * Calculate the length of a side (from node i to i+1) in a way. This assumes that
     
    548548    protected void updateEnabledState() {
    549549        setEnabled(getCurrentDataSet() != null);
    550     }   
     550    }
    551551}
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerPlugin.java

    r19658 r23191  
    11/**
    22 * Terracer: A JOSM Plugin for terraced houses.
    3  * 
     3 *
    44 * Copyright 2009 CloudMade Ltd.
    5  * 
     5 *
    66 * Released under the GPLv2, see LICENSE file for details.
    77 */
     
    1515/**
    1616 * Plugin interface implementation for Terracer.
    17  * 
     17 *
    1818 * @author zere
    1919 */
     
    2121    public TerracerPlugin(PluginInformation info) {
    2222        super(info);
    23        
     23
    2424        MainMenu.add(Main.main.menu.toolsMenu, new TerracerAction());
    2525        MainMenu.add(Main.main.menu.toolsMenu, new ReverseTerraceAction());
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerRuntimeException.java

    r19085 r23191  
    1010/**
    1111 * The Class TerracerRuntimeException indicates errors from the Terracer Plugin.
    12  * 
     12 *
    1313 * @author casualwalker
    1414 */
    1515public class TerracerRuntimeException extends RuntimeException {
    1616
    17         /** The Constant serialVersionUID. */
    18         private static final long serialVersionUID = 857926026580277816L;
     17    /** The Constant serialVersionUID. */
     18    private static final long serialVersionUID = 857926026580277816L;
    1919
    20         /**
    21         * Default constructor.
    22         */
    23         public TerracerRuntimeException() {
    24                 super();
    25         }
     20    /**
     21    * Default constructor.
     22    */
     23    public TerracerRuntimeException() {
     24        super();
     25    }
    2626
    27         /**
    28         * @param message
    29         * @param cause
    30         */
    31         public TerracerRuntimeException(String message, Throwable cause) {
    32                 super(message, cause);
    33         }
     27    /**
     28    * @param message
     29    * @param cause
     30    */
     31    public TerracerRuntimeException(String message, Throwable cause) {
     32        super(message, cause);
     33    }
    3434
    35         /**
    36         * @param message
    37         */
    38         public TerracerRuntimeException(String message) {
    39                 super(message);
    40         }
     35    /**
     36    * @param message
     37    */
     38    public TerracerRuntimeException(String message) {
     39        super(message);
     40    }
    4141
    42         /**
    43         * @param cause
    44         */
    45         public TerracerRuntimeException(Throwable cause) {
    46                 super(cause);
    47         }
     42    /**
     43    * @param cause
     44    */
     45    public TerracerRuntimeException(Throwable cause) {
     46        super(cause);
     47    }
    4848
    4949}
  • applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java

    r21852 r23191  
    4040        LinkedList<Command> cmds = new LinkedList<Command>();
    4141        Way newWay = new Way(way);
    42         for (int i = 0; i < way.getNodesCount() - 1; i++) { 
    43             Node n = way.getNode(i); 
     42        for (int i = 0; i < way.getNodesCount() - 1; i++) {
     43            Node n = way.getNode(i);
    4444            System.out.println("-------");
    4545            System.out.println("Node: " + n);
     
    9393    private static List<Command> mergeNodes(Node n1, Node n2, Way way){
    9494        List<Command> cmds = new LinkedList<Command>();
    95         cmds.add(new MoveCommand(n2, 
    96                  (n1.getEastNorth().getX() - n2.getEastNorth().getX())/2, 
     95        cmds.add(new MoveCommand(n2,
     96                 (n1.getEastNorth().getX() - n2.getEastNorth().getX())/2,
    9797                 (n1.getEastNorth().getY() - n2.getEastNorth().getY())/2
    9898                 ));
     
    123123    private static void tryConnectNodeToAnyWay(Node node, Map<Way, Way> m)
    124124            throws IllegalStateException, IndexOutOfBoundsException {
    125        
     125
    126126        List<Command> cmds = new LinkedList<Command>();
    127127
  • applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/TracerServer.java

    r19881 r23191  
    1616
    1717    static final String URL = "http://localhost:5050/";
    18    
     18
    1919    public TracerServer() {
    2020
    2121    }
    22    
     22
    2323    /**
    2424     * Call Trace server.
  • applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java

    r19489 r23191  
    4545    /** Plugin constructor called at JOSM startup */
    4646    public WayDownloaderPlugin(PluginInformation info) {
    47         super(info);
     47        super(info);
    4848        //add WayDownloadAction to tools menu
    4949        MainMenu.add(Main.main.menu.toolsMenu, new WayDownloadAction());
Note: See TracChangeset for help on using the changeset viewer.