*/
public class DiagramSettings {
- public final Optional<Function1<Resource, Double>> vertexScaleProperty;
- public final double vertexScaleGain;
- public final double vertexScaleBias;
- public final Optional<Function1<Resource, Double>> edgeThicknessProperty;
- public final double edgeThicknessGain;
- public final double edgeThicknessBias;
+ public final Optional<Function1<Resource, Double>> arrowLengthProperty;
+ public final double arrowLengthGain;
+ public final double arrowLengthBias;
- public DiagramSettings(Function1<Resource, Double> vertexScaleProperty, double vertexScaleGain, double vertexScaleBias, Function1<Resource, Double> edgeThicknessProperty, double edgeThicknessGain, double edgeThicknessBias) {
- this.vertexScaleProperty = Optional.ofNullable(vertexScaleProperty);
- this.vertexScaleGain = vertexScaleGain;
- this.vertexScaleBias = vertexScaleBias;
- this.edgeThicknessProperty = Optional.ofNullable(edgeThicknessProperty);
- this.edgeThicknessGain = edgeThicknessGain;
- this.edgeThicknessBias = edgeThicknessBias;
+ 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();
- long temp;
- temp = Double.doubleToLongBits(edgeThicknessGain);
+ //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);
+ //temp = Double.doubleToLongBits(edgeThicknessBias);
result = prime * result + (int) (temp ^ (temp >>> 32));
- result = prime * result + vertexScaleProperty.hashCode();
- temp = Double.doubleToLongBits(vertexScaleGain);
+ temp = Double.doubleToLongBits(arrowLengthGain);
result = prime * result + (int) (temp ^ (temp >>> 32));
- temp = Double.doubleToLongBits(vertexScaleBias);
+ temp = Double.doubleToLongBits(arrowLengthBias);
result = prime * result + (int) (temp ^ (temp >>> 32));
+
return result;
}
if (getClass() != obj.getClass())
return false;
DiagramSettings other = (DiagramSettings) obj;
- if (!edgeThicknessProperty.equals(other.edgeThicknessProperty))
- return false;
- if (Double.doubleToLongBits(edgeThicknessGain) != Double.doubleToLongBits(other.edgeThicknessGain))
- return false;
- if (Double.doubleToLongBits(edgeThicknessBias) != Double.doubleToLongBits(other.edgeThicknessBias))
- return false;
- if (!vertexScaleProperty.equals(other.vertexScaleProperty))
+
+ if (!arrowLengthProperty.equals(other.arrowLengthProperty))
return false;
- if (Double.doubleToLongBits(vertexScaleGain) != Double.doubleToLongBits(other.vertexScaleGain))
+ if (Double.doubleToLongBits(arrowLengthGain) != Double.doubleToLongBits(other.arrowLengthGain))
return false;
- if (Double.doubleToLongBits(vertexScaleBias) != Double.doubleToLongBits(other.vertexScaleBias))
+ if (Double.doubleToLongBits(arrowLengthBias) != Double.doubleToLongBits(other.arrowLengthBias))
return false;
+
return true;
}
@Override
public String toString() {
- return String.format("DiagramSettings[%s * %f + %f - %s * %f + %f]", vertexScaleProperty.toString(),
- vertexScaleGain, vertexScaleBias, edgeThicknessProperty, edgeThicknessGain, edgeThicknessBias);
+ return String.format("DiagramSettings[%s * %f + %f]",
+ arrowLengthProperty, arrowLengthGain, arrowLengthBias
+ );
}
}