X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Fui%2FChartLinkData.java;fp=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Fui%2FChartLinkData.java;h=4439922f207a8d4a662e4ccb86aff12ebb2b61fa;hp=66dd947e196010e945fa6073e06337d4c2e04bad;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartLinkData.java b/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartLinkData.java index 66dd947e1..4439922f2 100644 --- a/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartLinkData.java +++ b/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartLinkData.java @@ -1,62 +1,62 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.charts.ui; - -import org.simantics.databoard.util.ObjectUtils; - -/** - * Shared time in the desktop environment when analysing data. - * - * @author toni.kalajainen@semantum.fi - */ -public class ChartLinkData /*extends Bean*/ { - - // Actually is TimeSeriesEditor itself - public transient Object sender; - public double from, end, sx; - public Double valueTipTime; - - public ChartLinkData() {} - - public ChartLinkData(Object sender, double from, double end, double sx) { - this.sender = sender; - this.from = from; - this.end = end; - this.sx = sx; - } - - @Override - public int hashCode() { - long bits1 = Double.doubleToLongBits(from); - long bits2 = Double.doubleToLongBits(end); - long bits3 = Double.doubleToLongBits(sx); - long bits4 = valueTipTime==null?0:Double.doubleToLongBits(valueTipTime); - int hash = (int) ( - (bits1 ^ (bits1 >>> 32)) + - (bits2 ^ (bits2 >>> 32)) + - (bits3 ^ (bits3 >>> 32)) + - (bits4 ^ (bits4 >>> 32)) ); - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj ==null) return false; - if (obj instanceof ChartLinkData==false) return false; - ChartLinkData other = (ChartLinkData) obj; - return from==other.from && - end==other.end && - sx==other.sx && - ObjectUtils.objectEquals(valueTipTime, other.valueTipTime); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.charts.ui; + +import org.simantics.databoard.util.ObjectUtils; + +/** + * Shared time in the desktop environment when analysing data. + * + * @author toni.kalajainen@semantum.fi + */ +public class ChartLinkData /*extends Bean*/ { + + // Actually is TimeSeriesEditor itself + public transient Object sender; + public double from, end, sx; + public Double valueTipTime; + + public ChartLinkData() {} + + public ChartLinkData(Object sender, double from, double end, double sx) { + this.sender = sender; + this.from = from; + this.end = end; + this.sx = sx; + } + + @Override + public int hashCode() { + long bits1 = Double.doubleToLongBits(from); + long bits2 = Double.doubleToLongBits(end); + long bits3 = Double.doubleToLongBits(sx); + long bits4 = valueTipTime==null?0:Double.doubleToLongBits(valueTipTime); + int hash = (int) ( + (bits1 ^ (bits1 >>> 32)) + + (bits2 ^ (bits2 >>> 32)) + + (bits3 ^ (bits3 >>> 32)) + + (bits4 ^ (bits4 >>> 32)) ); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (obj ==null) return false; + if (obj instanceof ChartLinkData==false) return false; + ChartLinkData other = (ChartLinkData) obj; + return from==other.from && + end==other.end && + sx==other.sx && + ObjectUtils.objectEquals(valueTipTime, other.valueTipTime); + } + +}