1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.charts.ui;
\r
14 import org.simantics.databoard.util.ObjectUtils;
\r
17 * Shared time in the desktop environment when analysing data.
\r
19 * @author toni.kalajainen@semantum.fi
\r
21 public class ChartLinkData /*extends Bean*/ {
\r
23 // Actually is TimeSeriesEditor itself
\r
24 public transient Object sender;
\r
25 public double from, end, sx;
\r
26 public Double valueTipTime;
\r
28 public ChartLinkData() {}
\r
30 public ChartLinkData(Object sender, double from, double end, double sx) {
\r
31 this.sender = sender;
\r
38 public int hashCode() {
\r
39 long bits1 = Double.doubleToLongBits(from);
\r
40 long bits2 = Double.doubleToLongBits(end);
\r
41 long bits3 = Double.doubleToLongBits(sx);
\r
42 long bits4 = valueTipTime==null?0:Double.doubleToLongBits(valueTipTime);
\r
44 (bits1 ^ (bits1 >>> 32)) +
\r
45 (bits2 ^ (bits2 >>> 32)) +
\r
46 (bits3 ^ (bits3 >>> 32)) +
\r
47 (bits4 ^ (bits4 >>> 32)) );
\r
52 public boolean equals(Object obj) {
\r
53 if (obj ==null) return false;
\r
54 if (obj instanceof ChartLinkData==false) return false;
\r
55 ChartLinkData other = (ChartLinkData) obj;
\r
56 return from==other.from &&
\r
59 ObjectUtils.objectEquals(valueTipTime, other.valueTipTime);
\r