Class CrossoverScalingControl
- java.lang.Object
-
- org.jungrapht.visualization.control.CrossoverScalingControl
-
- All Implemented Interfaces:
ScalingControl
- Direct Known Subclasses:
AbsoluteCrossoverScalingControl
public class CrossoverScalingControl extends Object implements ScalingControl
A scaling control that has a crossover point. When the overall scale of the view and model is less than the crossover point, the scaling is applied to the view's transform and the graph vertices, labels, etc grow smaller. This preserves the overall shape of the graph. When the scale is larger than the crossover, the scaling is applied to the graph layout. The graph spreads out, but the vertices and labels grow no larger than their original layoutSize.- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CrossoverScalingControl.Builder
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.control.ScalingControl
ScalingControl.Axis
-
-
Field Summary
Fields Modifier and Type Field Description protected double
crossover
Point where scale crosses over from view to layout.protected boolean
enableSingleAxisScaling
protected double
maxScale
protected double
minScale
-
Fields inherited from interface org.jungrapht.visualization.control.ScalingControl
CROSSOVER, ENABLE_SINGLE_AXIS_SCALING, MAX_SCALE, MIN_SCALE
-
-
Constructor Summary
Constructors Constructor Description CrossoverScalingControl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustTransformers(double horizontalAmount, double verticalAmount, Point2D at, MutableTransformer layoutTransformer, MutableTransformer viewTransformer, double inverseModelScaleX, double inverseModelScaleY, double inverseViewScaleX, double inverseViewScaleY, Point2D transformedAt, boolean reset, boolean adjustViewTransform)
static CrossoverScalingControl.Builder
builder()
double
getCrossover()
void
reset(VisualizationServer<?,?> vv, Point2D at)
void
scale(VisualizationServer<?,?> vv, double horizontalAmount, double verticalAmount, Point2D at)
zoom the display in or outvoid
setCrossover(double crossover)
Sets the crossover point to the specified value.void
setEnableSingleAxisScaling(boolean enableSingleAxisScaling)
protected boolean
withinScaleBounds(double scaleX, double scaleY, double minScale, double maxScale, double horizontalAmount, double verticalAmount)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.control.ScalingControl
scale
-
-
-
-
Method Detail
-
builder
public static CrossoverScalingControl.Builder builder()
-
setCrossover
public void setCrossover(double crossover)
Sets the crossover point to the specified value.- Parameters:
crossover
- the crossover point to use (defaults to 1.0)
-
getCrossover
public double getCrossover()
- Returns:
- the current crossover value
-
setEnableSingleAxisScaling
public void setEnableSingleAxisScaling(boolean enableSingleAxisScaling)
-
scale
public void scale(VisualizationServer<?,?> vv, double horizontalAmount, double verticalAmount, Point2D at)
Description copied from interface:ScalingControl
zoom the display in or out- Specified by:
scale
in interfaceScalingControl
- Parameters:
vv
- the VisualizationViewerhorizontalAmount
- how much to adjust horizontal scale byverticalAmount
- how much to adjust vertical scale byat
- where to adjust scale from
-
adjustTransformers
protected void adjustTransformers(double horizontalAmount, double verticalAmount, Point2D at, MutableTransformer layoutTransformer, MutableTransformer viewTransformer, double inverseModelScaleX, double inverseModelScaleY, double inverseViewScaleX, double inverseViewScaleY, Point2D transformedAt, boolean reset, boolean adjustViewTransform)
-
reset
public void reset(VisualizationServer<?,?> vv, Point2D at)
-
withinScaleBounds
protected boolean withinScaleBounds(double scaleX, double scaleY, double minScale, double maxScale, double horizontalAmount, double verticalAmount)
-
-