[619] | 1 |
|
---|
[434] | 2 | package de.ugoe.cs.quest.plugin.mfc.eventcore;
|
---|
[1] | 3 |
|
---|
[619] | 4 | import de.ugoe.cs.quest.eventcore.Event;
|
---|
| 5 | import de.ugoe.cs.quest.eventcore.IEventType;
|
---|
| 6 | import de.ugoe.cs.quest.eventcore.guimodel.GUIModel;
|
---|
| 7 | import de.ugoe.cs.quest.plugin.mfc.guimodel.MFCGUIElement;
|
---|
[1] | 8 |
|
---|
[171] | 9 | /**
|
---|
| 10 | * <p>
|
---|
[619] | 11 | * Contains all informations about a windows message, i.e., all parameters that are read when a
|
---|
| 12 | * windows message is parsed as well as its target, hwnd, etc.
|
---|
[171] | 13 | * </p>
|
---|
| 14 | *
|
---|
| 15 | * @author Steffen Herbold
|
---|
| 16 | * @version 1.0
|
---|
| 17 | *
|
---|
| 18 | */
|
---|
[619] | 19 | public class MFCEvent extends Event {
|
---|
[171] | 20 |
|
---|
[619] | 21 | /**
|
---|
| 22 | * <p>
|
---|
| 23 | * Id for object serialization.
|
---|
| 24 | * </p>
|
---|
| 25 | */
|
---|
| 26 | private static final long serialVersionUID = 1L;
|
---|
[171] | 27 |
|
---|
[619] | 28 | /**
|
---|
| 29 | * <p>
|
---|
| 30 | * TODO: comment
|
---|
| 31 | * </p>
|
---|
| 32 | *
|
---|
| 33 | * @param eventType
|
---|
| 34 | * @param target
|
---|
| 35 | * @param currentMessageParameters
|
---|
| 36 | */
|
---|
| 37 | public MFCEvent(IEventType eventType,
|
---|
| 38 | MFCGUIElement target,
|
---|
| 39 | GUIModel guiModel)
|
---|
| 40 | {
|
---|
| 41 | super(eventType);
|
---|
| 42 | super.setTarget(target);
|
---|
| 43 | }
|
---|
[171] | 44 |
|
---|
[619] | 45 | /**
|
---|
| 46 | * <p>
|
---|
| 47 | * Two {@link WindowsMessage} are equal, if their {@link #type}, {@link #xmlWindowDescription},
|
---|
| 48 | * and {@link #params} are equal.
|
---|
| 49 | * </p>
|
---|
| 50 | *
|
---|
| 51 | * @see java.lang.Object#equals(java.lang.Object)
|
---|
| 52 | */
|
---|
| 53 | @Override
|
---|
| 54 | public boolean equals(Object other) {
|
---|
| 55 | if (other == this) {
|
---|
| 56 | return true;
|
---|
| 57 | }
|
---|
| 58 | boolean isEqual = false;
|
---|
| 59 | if (other instanceof MFCEvent) {
|
---|
| 60 | isEqual =
|
---|
| 61 | ((MFCEvent) other).type == this.type &&
|
---|
| 62 | ((MFCEvent) other).target.equals(this.target);
|
---|
| 63 | }
|
---|
| 64 | return isEqual;
|
---|
| 65 | }
|
---|
[171] | 66 |
|
---|
[619] | 67 | /*
|
---|
| 68 | * (non-Javadoc)
|
---|
| 69 | *
|
---|
| 70 | * @see java.lang.Object#hashCode()
|
---|
| 71 | */
|
---|
| 72 | @Override
|
---|
| 73 | public int hashCode() {
|
---|
| 74 | int multiplier = 17;
|
---|
| 75 | int hash = 42;
|
---|
[171] | 76 |
|
---|
[619] | 77 | hash = multiplier * hash + type.hashCode();
|
---|
| 78 | hash = multiplier * hash + target.hashCode();
|
---|
[171] | 79 |
|
---|
[619] | 80 | return hash;
|
---|
| 81 | }
|
---|
[171] | 82 |
|
---|
[1] | 83 | }
|
---|