8 |
|
|
9 |
import javax.swing.AbstractAction; |
import javax.swing.AbstractAction; |
10 |
import javax.swing.AbstractButton; |
import javax.swing.AbstractButton; |
11 |
|
import javax.swing.Action; |
12 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
13 |
import javax.swing.Icon; |
import javax.swing.Icon; |
14 |
import javax.swing.ImageIcon; |
import javax.swing.ImageIcon; |
725 |
*/ |
*/ |
726 |
public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, |
public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, |
727 |
String name, Icon icon) { |
String name, Icon icon) { |
728 |
|
this (id, toolBar, name, icon, null); |
729 |
|
} |
730 |
|
|
731 |
|
/** |
732 |
|
* Creates a new action. |
733 |
|
* |
734 |
|
* @param id |
735 |
|
* unique ID for the action |
736 |
|
* @param toolBar |
737 |
|
* The {@link MapPaneToolBar} this action is made for |
738 |
|
* @param name |
739 |
|
* description used for buttons or menus |
740 |
|
* @param icon |
741 |
|
* icon used for buttons or menus |
742 |
|
* @param toolTip |
743 |
|
* Tooltip to use for the button or menu |
744 |
|
*/ |
745 |
|
public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, |
746 |
|
String name, Icon icon, String toolTip) { |
747 |
super(name, icon); |
super(name, icon); |
748 |
|
|
749 |
|
if (toolTip != null && !toolTip.trim().isEmpty()){ |
750 |
|
putValue(Action.SHORT_DESCRIPTION, toolTip); |
751 |
|
} |
752 |
|
|
753 |
this.id = id; |
this.id = id; |
754 |
this.toolBar = toolBar; |
this.toolBar = toolBar; |
755 |
} |
} |