1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.charts.ui;
14 import org.simantics.databoard.util.ObjectUtils;
17 * Shared time in the desktop environment when analysing data.
19 * @author toni.kalajainen@semantum.fi
21 public class ChartLinkData /*extends Bean*/ {
23 // Actually is TimeSeriesEditor itself
24 public transient Object sender;
25 public double from, end, sx;
26 public Double valueTipTime;
28 public ChartLinkData() {}
30 public ChartLinkData(Object sender, double from, double end, double sx) {
38 public int hashCode() {
39 long bits1 = Double.doubleToLongBits(from);
40 long bits2 = Double.doubleToLongBits(end);
41 long bits3 = Double.doubleToLongBits(sx);
42 long bits4 = valueTipTime==null?0:Double.doubleToLongBits(valueTipTime);
44 (bits1 ^ (bits1 >>> 32)) +
45 (bits2 ^ (bits2 >>> 32)) +
46 (bits3 ^ (bits3 >>> 32)) +
47 (bits4 ^ (bits4 >>> 32)) );
52 public boolean equals(Object obj) {
53 if (obj ==null) return false;
54 if (obj instanceof ChartLinkData==false) return false;
55 ChartLinkData other = (ChartLinkData) obj;
56 return from==other.from &&
59 ObjectUtils.objectEquals(valueTipTime, other.valueTipTime);