Skip to content

Commit

Permalink
Made NiftyEvent non-generic.
Browse files Browse the repository at this point in the history
See #29

Signed-off-by: Joachim Durchholz <toolforger@durchholz.org>
  • Loading branch information
toolforger committed May 17, 2012
1 parent 7e17a38 commit 5b27ad1
Show file tree
Hide file tree
Showing 37 changed files with 29 additions and 38 deletions.
Expand Up @@ -2,7 +2,7 @@

import de.lessvoid.nifty.NiftyEvent;

public class ButtonClickedEvent implements NiftyEvent<Void> {
public class ButtonClickedEvent implements NiftyEvent {
private Button button;

public ButtonClickedEvent(final Button button) {
Expand Down
Expand Up @@ -11,7 +11,7 @@
*
* @author ractoc
*/
public class ChatTextSendEvent implements NiftyEvent<Void> {
public class ChatTextSendEvent implements NiftyEvent {
private ChatControl chatControl;
private String text;

Expand Down
Expand Up @@ -6,7 +6,6 @@
* Nifty generates this event when the state of the CheckBox changes.
* @author void
*/
@SuppressWarnings("rawtypes")
public class CheckBoxStateChangedEvent implements NiftyEvent {
private CheckBox checkbox;
private boolean checked;
Expand Down
Expand Up @@ -6,7 +6,6 @@
* Executed when a new command is being issued on the console.
* @author void
*/
@SuppressWarnings("rawtypes")
public class ConsoleExecuteCommandEvent implements NiftyEvent {
private Console console;
private ConsoleCommandSplitter splitter = new ConsoleCommandSplitter();
Expand Down
Expand Up @@ -2,7 +2,6 @@

import de.lessvoid.nifty.NiftyEvent;

@SuppressWarnings("rawtypes")
public class DraggableDragCanceledEvent implements NiftyEvent {
private Droppable source;
private Draggable draggable;
Expand Down
Expand Up @@ -2,7 +2,6 @@

import de.lessvoid.nifty.NiftyEvent;

@SuppressWarnings("rawtypes")
public class DraggableDragStartedEvent implements NiftyEvent {
private Droppable source;
private Draggable draggable;
Expand Down
Expand Up @@ -6,7 +6,7 @@
* Nifty generates this event when the selection of the DropDown changes.
* @author void
*/
public class DropDownSelectionChangedEvent<T> implements NiftyEvent<T> {
public class DropDownSelectionChangedEvent<T> implements NiftyEvent {
private DropDown<T> dropDown;
private T selection;
private int selectionItemIndex;
Expand Down
Expand Up @@ -2,7 +2,6 @@

import de.lessvoid.nifty.NiftyEvent;

@SuppressWarnings("rawtypes")
public class DroppableDroppedEvent implements NiftyEvent {
private Droppable source;
private Draggable draggable;
Expand Down
Expand Up @@ -6,7 +6,6 @@
* This event is published when the selection of the image select has been changed.
* @author void
*/
@SuppressWarnings("rawtypes")
public class ImageSelectSelectionChangedEvent implements NiftyEvent {
private ImageSelect imageSelect;
private int selectedIndex;
Expand Down
Expand Up @@ -8,7 +8,7 @@
* Nifty generates this event when the selection of the ListBox changes.
* @author void
*/
public class ListBoxSelectionChangedEvent<T> implements NiftyEvent<T> {
public class ListBoxSelectionChangedEvent<T> implements NiftyEvent {
private ListBox<T> listBox;
private List<T> selection;
private List<Integer> selectionIndices;
Expand Down
Expand Up @@ -7,7 +7,7 @@
* that was activated is being transmitted in this event.
* @author void
*/
public class MenuItemActivatedEvent<T> implements NiftyEvent<T> {
public class MenuItemActivatedEvent<T> implements NiftyEvent {
private Menu<T> menu;
private T item;

Expand Down
Expand Up @@ -7,7 +7,7 @@
* collection of individual RadioButtons) has changed.
* @author void
*/
public class RadioButtonGroupStateChangedEvent implements NiftyEvent<Void> {
public class RadioButtonGroupStateChangedEvent implements NiftyEvent {
private RadioButton selectedRadioButton;
private RadioButton previousSelectedRadioButton;

Expand Down
Expand Up @@ -10,7 +10,7 @@
* RadioGroupSelectionChangedEvent.
* @author void
*/
public class RadioButtonStateChangedEvent implements NiftyEvent<Void> {
public class RadioButtonStateChangedEvent implements NiftyEvent {
private RadioButton radioButton;
private boolean selected;

Expand Down
Expand Up @@ -6,7 +6,7 @@
* Nifty generates this event when a ScrollPanel position has changed.
* @author void
*/
public class ScrollPanelChangedEvent implements NiftyEvent<Void> {
public class ScrollPanelChangedEvent implements NiftyEvent {
private ScrollPanel scrollPanel;
private float x;
private float y;
Expand Down
Expand Up @@ -6,7 +6,7 @@
* Nifty generates this event when a Scrollbar value has been changed.
* @author void
*/
public class ScrollbarChangedEvent implements NiftyEvent<Void> {
public class ScrollbarChangedEvent implements NiftyEvent {
private Scrollbar scrollbar;
private float value;

Expand Down
Expand Up @@ -6,7 +6,7 @@
* Nifty generates this event when a Slider value has been changed.
* @author void
*/
public class SliderChangedEvent implements NiftyEvent<Void> {
public class SliderChangedEvent implements NiftyEvent {
private Slider slider;
private float value;

Expand Down
Expand Up @@ -12,7 +12,7 @@
* @author ractoc
* @author Martin Karing &lt;nitram@illarion.org&gt;
*/
public class TabSelectedEvent implements NiftyEvent<Void> {
public class TabSelectedEvent implements NiftyEvent {
/**
* The group that is the parent of the tab that got selected.
*/
Expand Down
Expand Up @@ -6,7 +6,7 @@
* Nifty generates this event when the current text of an TextField changes.
* @author void
*/
public class TextFieldChangedEvent implements NiftyEvent<Void> {
public class TextFieldChangedEvent implements NiftyEvent {
private TextField textField;
private String currentText;

Expand Down
Expand Up @@ -11,7 +11,7 @@
*
* @author ractoc
*/
public class TreeItemSelectedEvent implements NiftyEvent<Void> {
public class TreeItemSelectedEvent implements NiftyEvent {

private TreeBoxControl treeBoxControl;
private TreeItem treeItem;
Expand Down
Expand Up @@ -20,7 +20,6 @@ public CreateImageSelectControl(final String id) {
setName("imageSelect");
}

@SuppressWarnings("rawtypes")
public ImageSelect create(
final Nifty nifty,
final Screen screen,
Expand Down
1 change: 0 additions & 1 deletion nifty-core/src/main/java/de/lessvoid/nifty/Nifty.java
Expand Up @@ -214,7 +214,6 @@ public EventService getEventService() {
return EventServiceLocator.getEventService("NiftyEventBus");
}

@SuppressWarnings("rawtypes")
public void publishEvent(final String id, final NiftyEvent event) {
// we can't publish events for elements without an id
if (id != null) {
Expand Down
2 changes: 1 addition & 1 deletion nifty-core/src/main/java/de/lessvoid/nifty/NiftyEvent.java
Expand Up @@ -4,5 +4,5 @@
* Marker interface for NiftyEvents.
* @author void
*/
public interface NiftyEvent<T> {
public interface NiftyEvent {
}
Expand Up @@ -2,7 +2,7 @@

import de.lessvoid.nifty.NiftyEvent;

public class FocusGainedEvent implements NiftyEvent<Void> {
public class FocusGainedEvent implements NiftyEvent {
private Controller controller;
private NiftyControl niftyControl;

Expand Down
Expand Up @@ -2,7 +2,7 @@

import de.lessvoid.nifty.NiftyEvent;

public class FocusLostEvent implements NiftyEvent<Void> {
public class FocusLostEvent implements NiftyEvent {
private Controller controller;
private NiftyControl niftyControl;

Expand Down
Expand Up @@ -56,13 +56,12 @@
import de.lessvoid.nifty.tools.NullObjectFactory;
import de.lessvoid.nifty.tools.SizeValue;
import de.lessvoid.xml.xpp3.Attributes;
import java.util.*;

/**
* The Element.
* @author void
*/
public class Element implements NiftyEvent<Void>, EffectManager.Notify {
public class Element implements NiftyEvent, EffectManager.Notify {

/**
* the logger.
Expand Down
Expand Up @@ -49,7 +49,7 @@ public boolean onMouseRelease(final Nifty nifty, final NiftyMouseInputEvent mous
return result;
}

private void publishEvent(final Nifty nifty, final NiftyEvent<?> event) {
private void publishEvent(final Nifty nifty, final NiftyEvent event) {
nifty.publishEvent(element.getId(), event);
}
}
Expand Up @@ -36,7 +36,7 @@ public boolean onMouseRelease(final Nifty nifty, final NiftyMouseInputEvent mous
return super.onMouseRelease(nifty, mouseEvent);
}

private void publishEvent(final Nifty nifty, final NiftyEvent<?> event) {
private void publishEvent(final Nifty nifty, final NiftyEvent event) {
nifty.publishEvent(element.getId(), event);
}
}
Expand Up @@ -36,7 +36,7 @@ public boolean onMouseRelease(final Nifty nifty, final NiftyMouseInputEvent mous
return super.onMouseRelease(nifty, mouseEvent);
}

private void publishEvent(final Nifty nifty, final NiftyEvent<?> event) {
private void publishEvent(final Nifty nifty, final NiftyEvent event) {
nifty.publishEvent(element.getId(), event);
}
}
Expand Up @@ -3,7 +3,7 @@
import de.lessvoid.nifty.NiftyEvent;
import de.lessvoid.nifty.elements.Element;

public class ElementDisableEvent implements NiftyEvent<Void> {
public class ElementDisableEvent implements NiftyEvent {
private Element element;

public ElementDisableEvent(final Element element) {
Expand Down
Expand Up @@ -3,7 +3,7 @@
import de.lessvoid.nifty.NiftyEvent;
import de.lessvoid.nifty.elements.Element;

public class ElementEnableEvent implements NiftyEvent<Void> {
public class ElementEnableEvent implements NiftyEvent {
private Element element;

public ElementEnableEvent(final Element element) {
Expand Down
Expand Up @@ -3,7 +3,7 @@
import de.lessvoid.nifty.NiftyEvent;
import de.lessvoid.nifty.elements.Element;

public class ElementHideEvent implements NiftyEvent<Void> {
public class ElementHideEvent implements NiftyEvent {
private Element element;

public ElementHideEvent(final Element element) {
Expand Down
Expand Up @@ -3,7 +3,7 @@
import de.lessvoid.nifty.NiftyEvent;
import de.lessvoid.nifty.elements.Element;

public class ElementShowEvent implements NiftyEvent<Void> {
public class ElementShowEvent implements NiftyEvent {
private Element element;

public ElementShowEvent(final Element element) {
Expand Down
Expand Up @@ -4,7 +4,7 @@
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.input.NiftyMouseInputEvent;

public class NiftyMouseBaseEvent implements NiftyEvent<Void> {
public class NiftyMouseBaseEvent implements NiftyEvent {
private Element element;
private int mouseX;
private int mouseY;
Expand Down
Expand Up @@ -4,7 +4,7 @@
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.input.NiftyMouseInputEvent;

public class NiftyMouseEvent implements NiftyEvent<Void> {
public class NiftyMouseEvent implements NiftyEvent {
private Element element;
private int mouseX;
private int mouseY;
Expand Down
Expand Up @@ -4,7 +4,7 @@
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.input.NiftyMouseInputEvent;

public class NiftyMouseMovedEvent implements NiftyEvent<Void> {
public class NiftyMouseMovedEvent implements NiftyEvent {
private Element element;
private int mouseX;
private int mouseY;
Expand Down
Expand Up @@ -4,7 +4,7 @@
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.input.NiftyMouseInputEvent;

public class NiftyMouseWheelEvent implements NiftyEvent<Void> {
public class NiftyMouseWheelEvent implements NiftyEvent {
private Element element;
private int mouseWheel;

Expand Down
Expand Up @@ -6,7 +6,7 @@
* a nifty input event.
* @author void
*/
public enum NiftyInputEvent implements NiftyEvent<Void> {
public enum NiftyInputEvent implements NiftyEvent {
/**
* goto next input element.
*/
Expand Down

0 comments on commit 5b27ad1

Please sign in to comment.