--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.charts.ui;\r
+\r
+import org.simantics.databoard.util.ObjectUtils;\r
+\r
+/**\r
+ * Shared time in the desktop environment when analysing data. \r
+ *\r
+ * @author toni.kalajainen@semantum.fi\r
+ */\r
+public class ChartLinkData /*extends Bean*/ {\r
+ \r
+ // Actually is TimeSeriesEditor itself\r
+ public transient Object sender;\r
+ public double from, end, sx;\r
+ public Double valueTipTime; \r
+\r
+ public ChartLinkData() {}\r
+ \r
+ public ChartLinkData(Object sender, double from, double end, double sx) {\r
+ this.sender = sender;\r
+ this.from = from;\r
+ this.end = end;\r
+ this.sx = sx;\r
+ } \r
+ \r
+ @Override\r
+ public int hashCode() {\r
+ long bits1 = Double.doubleToLongBits(from);\r
+ long bits2 = Double.doubleToLongBits(end);\r
+ long bits3 = Double.doubleToLongBits(sx);\r
+ long bits4 = valueTipTime==null?0:Double.doubleToLongBits(valueTipTime);\r
+ int hash = (int) (\r
+ (bits1 ^ (bits1 >>> 32)) + \r
+ (bits2 ^ (bits2 >>> 32)) +\r
+ (bits3 ^ (bits3 >>> 32)) +\r
+ (bits4 ^ (bits4 >>> 32)) );\r
+ return hash;\r
+ }\r
+ \r
+ @Override\r
+ public boolean equals(Object obj) {\r
+ if (obj ==null) return false;\r
+ if (obj instanceof ChartLinkData==false) return false;\r
+ ChartLinkData other = (ChartLinkData) obj;\r
+ return from==other.from &&\r
+ end==other.end &&\r
+ sx==other.sx &&\r
+ ObjectUtils.objectEquals(valueTipTime, other.valueTipTime);\r
+ }\r
+\r
+}\r