]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/events/command/ShowPopup.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / events / command / ShowPopup.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.scenegraph.g2d.events.command;
13
14 import java.awt.geom.Point2D;
15
16 /**
17  * @author Tuukka Lehtonen
18  */
19 public class ShowPopup extends Command {
20
21     private static final long serialVersionUID = 8693557919059826895L;
22
23     private Point2D controlPosition;
24
25     public ShowPopup(Point2D controlPosition) {
26         super("showPopup");
27         this.controlPosition = controlPosition;
28     }
29
30     public Point2D getControlPosition() {
31         return controlPosition;
32     }
33
34     @Override
35     public int hashCode() {
36         final int prime = 31;
37         int result = super.hashCode();
38         result = prime * result + ((controlPosition == null) ? 0 : controlPosition.hashCode());
39         return result;
40     }
41
42     @Override
43     public boolean equals(Object obj) {
44         if (this == obj)
45             return true;
46         if (!super.equals(obj))
47             return false;
48         if (getClass() != obj.getClass())
49             return false;
50         ShowPopup other = (ShowPopup) obj;
51         if (controlPosition == null) {
52             if (other.controlPosition != null)
53                 return false;
54         } else if (!controlPosition.equals(other.controlPosition))
55             return false;
56         return true;
57     }
58
59     @Override
60     public String toString() {
61         return super.toString() + "(" + controlPosition + ")";
62     }
63
64 }