30 |
package skrueger.geotools; |
package skrueger.geotools; |
31 |
|
|
32 |
import java.awt.Color; |
import java.awt.Color; |
|
import java.awt.Dimension; |
|
33 |
import java.awt.Graphics; |
import java.awt.Graphics; |
34 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
35 |
import java.awt.event.ActionListener; |
import java.awt.event.ActionListener; |
197 |
*/ |
*/ |
198 |
public MapPaneToolBar(JMapPane mapPane) { |
public MapPaneToolBar(JMapPane mapPane) { |
199 |
super("Control the map", JToolBar.HORIZONTAL); |
super("Control the map", JToolBar.HORIZONTAL); |
200 |
|
|
201 |
|
// I want to see nothing on the background |
202 |
|
setOpaque(false); |
203 |
|
setBorder(null); |
204 |
|
|
205 |
this.toolButtonGroup = new ButtonGroup(); |
this.toolButtonGroup = new ButtonGroup(); |
206 |
|
|
207 |
// Create a Listener to listen to the zooms on the JMapPane |
// Create a Listener to listen to the zooms on the JMapPane |
276 |
* puts all tool buttons and all actions buttons to the tool bar. |
* puts all tool buttons and all actions buttons to the tool bar. |
277 |
*/ |
*/ |
278 |
protected void init() { |
protected void init() { |
279 |
|
|
280 |
initToolsAndActions(); |
initToolsAndActions(); |
281 |
|
|
282 |
addSeparator(SEPERATOR0, new JToolBar.Separator()); |
addSeparator(SEPERATOR0, new JToolBar.Separator()); |
326 |
setSelectedTool(selectedTool); |
setSelectedTool(selectedTool); |
327 |
|
|
328 |
} |
} |
329 |
|
|
330 |
|
@Override |
331 |
|
public void paint(Graphics g) { |
332 |
|
super.paint(g); |
333 |
|
} |
334 |
|
|
335 |
/** |
/** |
336 |
* Clears the GUI of all components and adds all tool and action buttons to |
* Clears the GUI of all components and adds all tool and action buttons to |
337 |
* the tool bar. |
* the tool bar. |
338 |
*/ |
*/ |
339 |
public void initToolBar() { |
public void initToolBar() { |
340 |
setAlignmentY(1f); |
// setOpaque(true); |
341 |
|
// |
342 |
|
// setAlignmentY(1f); |
343 |
|
// setAlignmentX(0.5f); |
344 |
removeAll(); |
removeAll(); |
345 |
// Separator to the left of the tool actions to start |
|
346 |
// the tool buttons with the map (not with the coordinate grid) |
// // Separator to the left of the tool actions to start |
347 |
Dimension dimension = new Dimension(49, 10); |
// // the tool buttons with the map (not with the coordinate grid) |
348 |
addSeparator(dimension); |
// Dimension dimension = new Dimension(49, 10); |
349 |
|
// addSeparator(dimension); |
350 |
|
|
351 |
|
|
352 |
// Tool buttons |
// Tool buttons |
353 |
for (Integer bKey : toolAndActionButtons.keySet()) { |
for (Integer bKey : toolAndActionButtons.keySet()) { |
354 |
|
|