/[schmitzm]/trunk/src/skrueger/geotools/MapPaneToolBar.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/MapPaneToolBar.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 296 by alfonx, Fri Jul 31 14:43:47 2009 UTC revision 297 by alfonx, Mon Aug 10 22:10:07 2009 UTC
# Line 122  public class MapPaneToolBar extends JToo Line 122  public class MapPaneToolBar extends JToo
122           */           */
123          public static final int TOOL_SELECTION_REMOVE = 230;          public static final int TOOL_SELECTION_REMOVE = 230;
124    
125            public static final int ACTION_CHARTS = 401;
126    
127          /** Tool currently selected */          /** Tool currently selected */
128          protected int selectedTool = TOOL_ZOOMIN;          protected int selectedTool = TOOL_ZOOMIN;
129    
# Line 472  public class MapPaneToolBar extends JToo Line 474  public class MapPaneToolBar extends JToo
474                          initToolBar();                          initToolBar();
475          }          }
476    
477    
478    
479          /**          /**
480           * Adds a tool to the tool bar and resets the toolbar GUI.           * Adds a tool to the tool bar and resets the toolbar GUI.
481           *           *
# Line 507  public class MapPaneToolBar extends JToo Line 511  public class MapPaneToolBar extends JToo
511                  if (resetToolBar)                  if (resetToolBar)
512                          initToolBar();                          initToolBar();
513          }          }
514            
515            /**
516             * Adds any JComponent to the tool bar. Does nothing if a tool or action with the
517             * specified ID already exists!
518             *
519             * @param component A {@link JComponent} that shall be added
520             * @param id The ID associaded with the {@link JComponent}
521             * @param resetToolBar
522             *            indicates whether the toolbar GUI is reset after adding the
523             *            button (if adding several actions it useful only to reset the
524             *            GUI for the last added tool)
525             */
526            public void addJComponent(JComponent component, int id,
527                            boolean resetToolBar) {
528    
529                    if (isButtonIDUsed(id)) {
530                            LOGGER
531                            .warn("addAction(.) ignored because ID already used for tool or action: "
532                                            + id);
533                            return;
534                    }
535                    
536                    toolAndActionButtons.put(id, component);
537                    if (resetToolBar)
538                            initToolBar();
539            }
540    
541          public void addSeparator(int id, Separator separator) {          public void addSeparator(int id, Separator separator) {
542                  if (isButtonIDUsed(id)) {                  if (isButtonIDUsed(id)) {

Legend:
Removed from v.296  
changed lines
  Added in v.297

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26