Revision 11042 trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/buttonspanel/ButtonsPanel.java

View differences:

ButtonsPanel.java
108 108
		}
109 109
	}
110 110

  
111
	public void addActionListener(ActionListener listener) {
111
	public void addButtonPressedListener(ButtonsPanelListener listener) {
112 112
	  if (!actionCommandListeners.contains(listener))
113 113
	    actionCommandListeners.add(listener);
114 114
	}
115 115

  
116
	public void removeActionListener(ActionListener listener) {
116
	public void removeButtonPressedListener(ButtonsPanelListener listener) {
117 117
	  actionCommandListeners.remove(listener);
118 118
	}
119 119

  
120
	private void callActionCommandListeners(String buttonID) {
120
	private void callActionCommandListeners(int buttonID) {
121 121
	  Iterator acIterator = actionCommandListeners.iterator();
122 122
	  while (acIterator.hasNext()) {
123
	    ActionListener listener = (ActionListener) acIterator.next();
124
	    listener.actionPerformed(new ActionEvent(this, eventId, buttonID));
123
	  	ButtonsPanelListener listener = (ButtonsPanelListener) acIterator.next();
124
	    listener.actionButtonPressed(new ButtonsPanelEvent(this, buttonID));
125 125
	  }
126 126
	  eventId++;
127 127
	}
......
216 216
		button.setActionCommand(id + "");
217 217
		button.addActionListener(new ActionListener() {
218 218
      public void actionPerformed(ActionEvent e) {
219
      	callActionCommandListeners(e.getActionCommand());
219
      	callActionCommandListeners(Integer.parseInt(e.getActionCommand()));
220 220
      }
221 221
		});
222 222
	
......
232 232
		Iterator acIterator = buttonsList.iterator();
233 233
	  while (acIterator.hasNext()) {
234 234
	  	JButton button = (JButton) acIterator.next();
235
	  	if (button.getActionCommand().compareTo(id + "") == 0)
235
	  	if (Integer.parseInt(button.getActionCommand()) == id)
236 236
	  		return button;
237 237
	 	}
238 238
	  return null;

Also available in: Unified diff