protected void registerBoundingBoxBuilder() { BoundingBoxBuilder bboxbuilder = new BoundingBoxBuilder(); for (JosmTextField ll : latlon) { ll.addFocusListener(bboxbuilder); ll.addActionListener(bboxbuilder); } }
protected void build() { setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); // the checkbox for the default UL gc.fill = GridBagConstraints.HORIZONTAL; gc.anchor = GridBagConstraints.NORTHWEST; gc.weightx = 1.0; gc.insets = new Insets(0, 0, 0, 0); gc.gridwidth = 4; add(buildDefultServerUrlPanel(), gc); // the input field for the URL gc.gridx = 0; gc.gridy = 1; gc.gridwidth = 1; gc.weightx = 0.0; gc.insets = new Insets(0, 0, 0, 3); add(lblApiUrl = new JLabel(tr("OSM Server URL:")), gc); gc.gridx = 1; gc.weightx = 1.0; add(tfOsmServerUrl = new JosmTextField(), gc); SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl); valOsmServerUrl = new ApiUrlValidator(tfOsmServerUrl); valOsmServerUrl.validate(); ApiUrlPropagator propagator = new ApiUrlPropagator(); tfOsmServerUrl.addActionListener(propagator); tfOsmServerUrl.addFocusListener(propagator); gc.gridx = 2; gc.weightx = 0.0; add(lblValid = new JLabel(), gc); gc.gridx = 3; gc.weightx = 0.0; ValidateApiUrlAction actTest = new ValidateApiUrlAction(); tfOsmServerUrl.getDocument().addDocumentListener(actTest); add(btnTest = new SideButton(actTest), gc); }