Class 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
    • Field Detail

      • minScale

        protected double minScale
      • maxScale

        protected double maxScale
      • crossover

        protected double crossover
        Point where scale crosses over from view to layout.
      • enableSingleAxisScaling

        protected boolean enableSingleAxisScaling
    • Constructor Detail

      • CrossoverScalingControl

        public CrossoverScalingControl()
    • Method Detail

      • 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 interface ScalingControl
        Parameters:
        vv - the VisualizationViewer
        horizontalAmount - how much to adjust horizontal scale by
        verticalAmount - how much to adjust vertical scale by
        at - 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)
      • withinScaleBounds

        protected boolean withinScaleBounds​(double scaleX,
                                            double scaleY,
                                            double minScale,
                                            double maxScale,
                                            double horizontalAmount,
                                            double verticalAmount)