25 |
* |
* |
26 |
* Contributors: |
* Contributors: |
27 |
* Martin O. J. Schmitz - initial API and implementation |
* Martin O. J. Schmitz - initial API and implementation |
28 |
* Stefan A. Krüger - additional utility classes |
* Stefan A. Tzeggai - additional utility classes |
29 |
******************************************************************************/ |
******************************************************************************/ |
30 |
/* |
/* |
31 |
* SearchMapDialog.java |
* SearchMapDialog.java |
57 |
import net.miginfocom.swing.MigLayout; |
import net.miginfocom.swing.MigLayout; |
58 |
|
|
59 |
import org.apache.log4j.Logger; |
import org.apache.log4j.Logger; |
|
import org.geotools.swing.ExceptionMonitor; |
|
60 |
|
|
61 |
import schmitzm.geotools.gui.JMapPane; |
import schmitzm.geotools.gui.SelectableXMapPane; |
62 |
|
import schmitzm.swing.ExceptionDialog; |
63 |
import schmitzm.swing.SortableJTable; |
import schmitzm.swing.SortableJTable; |
64 |
import schmitzm.swing.SwingUtil; |
import schmitzm.swing.SwingUtil; |
65 |
|
|
83 |
searchTextField.setText(text); |
searchTextField.setText(text); |
84 |
} |
} |
85 |
|
|
86 |
private final JMapPane mapPane; |
private final SelectableXMapPane mapPane; |
87 |
|
|
88 |
/** |
/** |
89 |
* The dialog will be relative to the {@link JMapPane}s parent |
* The dialog will be relative to the {@link SelectableXMapPane}s parent |
90 |
* {@link Window}. |
* {@link Window}. |
91 |
* |
* |
92 |
* @param parent |
* @param parent |
95 |
* @param windowTitle |
* @param windowTitle |
96 |
* A title to be used for the dialog. |
* A title to be used for the dialog. |
97 |
*/ |
*/ |
98 |
public SearchMapDialog(LabelSearch labelSearch, JMapPane mapPane, |
public SearchMapDialog(LabelSearch labelSearch, SelectableXMapPane mapPane, |
99 |
final String windowTitle) { |
final String windowTitle) { |
100 |
super(SwingUtil.getParentWindow(mapPane), windowTitle); |
super(SwingUtil.getParentWindow(mapPane), windowTitle); |
101 |
this.labelSearch = labelSearch; |
this.labelSearch = labelSearch; |
157 |
} |
} |
158 |
|
|
159 |
/** |
/** |
160 |
* Performes a search on the {@link JMapPane}'s labels and outputs the |
* Performes a search on the {@link SelectableXMapPane}'s labels and outputs the |
161 |
* possible numerouse results. |
* possible numerouse results. |
162 |
* |
* |
163 |
* @param text |
* @param text |
185 |
showMultipleResults(get()); |
showMultipleResults(get()); |
186 |
} catch (InterruptedException e) { |
} catch (InterruptedException e) { |
187 |
LOGGER.error(e); |
LOGGER.error(e); |
188 |
ExceptionMonitor.show(SearchMapDialog.this, e); |
ExceptionDialog.show(SearchMapDialog.this, e); |
189 |
} catch (ExecutionException e) { |
} catch (ExecutionException e) { |
190 |
LOGGER.error(e); |
LOGGER.error(e); |
191 |
ExceptionMonitor.show(SearchMapDialog.this, e); |
ExceptionDialog.show(SearchMapDialog.this, e); |
192 |
} |
} |
193 |
} |
} |
194 |
}; |
}; |