+++ /dev/null
-package org.simantics.district.network.profile;
-
-import java.util.Optional;
-
-import org.simantics.db.Resource;
-import org.simantics.scl.runtime.function.Function1;
-
-/**
- * @author Tuukka Lehtonen
- */
-public class DiagramSettings {
-
- public final Optional<Function1<Resource, Double>> arrowLengthProperty;
- public final double arrowLengthGain;
- public final double arrowLengthBias;
-
- public DiagramSettings(
- Function1<Resource, Double> arrowLengthProperty, double arrowLengthGain, double arrowLengthBias
- ) {
- this.arrowLengthProperty = Optional.ofNullable(arrowLengthProperty);
- this.arrowLengthGain = arrowLengthGain;
- this.arrowLengthBias = arrowLengthBias;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- //result = prime * result + edgeThicknessProperty.hashCode();
- result = prime * result + arrowLengthProperty.hashCode();
- long temp = result;
- //temp = Double.doubleToLongBits(edgeThicknessGain);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- //temp = Double.doubleToLongBits(edgeThicknessBias);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- temp = Double.doubleToLongBits(arrowLengthGain);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- temp = Double.doubleToLongBits(arrowLengthBias);
- result = prime * result + (int) (temp ^ (temp >>> 32));
-
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DiagramSettings other = (DiagramSettings) obj;
-
- if (!arrowLengthProperty.equals(other.arrowLengthProperty))
- return false;
- if (Double.doubleToLongBits(arrowLengthGain) != Double.doubleToLongBits(other.arrowLengthGain))
- return false;
- if (Double.doubleToLongBits(arrowLengthBias) != Double.doubleToLongBits(other.arrowLengthBias))
- return false;
-
- return true;
- }
-
- @Override
- public String toString() {
- return String.format("DiagramSettings[%s * %f + %f]",
- arrowLengthProperty, arrowLengthGain, arrowLengthBias
- );
- }
-
-}