Class MagnifyShapeTransformer

All Implemented Interfaces:
BidirectionalTransformer, MutableTransformer, ShapeFlatnessTransformer, ShapeTransformer, ChangeEventSupport

public class MagnifyShapeTransformer extends MagnifyTransformer implements ShapeFlatnessTransformer
MagnifyShapeTransformer extends MagnifyTransformer and adds implementations for methods in ShapeTransformer. It modifies the shapes (Vertex, Edge, and Arrowheads) so that they are enlarged by the magnify transformation.
  • Constructor Details

    • MagnifyShapeTransformer

      public MagnifyShapeTransformer(Component component)
      Create an instance, setting values from the passed component and registering to listen for size changes on the component.
      Parameters:
      component - the component used for rendering
    • MagnifyShapeTransformer

      public MagnifyShapeTransformer(Component component, MutableTransformer delegate)
      Create an instance, setting values from the passed component and registering to listen for size changes on the component, with a possibly shared transform delegate.
      Parameters:
      component - the component used for rendering
      delegate - the transformer to use
  • Method Details

    • transform

      public Shape transform(Shape shape)
      Transform the supplied shape with the overridden transform method so that the shape is distorted by the magnify transform.
      Specified by:
      transform in interface ShapeTransformer
      Overrides:
      transform in class LensTransformer
      Parameters:
      shape - a shape to transform
      Returns:
      a GeneralPath for the transformed shape
    • transform

      public Shape transform(Shape shape, float flatness)
      Description copied from interface: ShapeFlatnessTransformer
      map a shape from graph coordinate system to the screen coordinate system
      Specified by:
      transform in interface ShapeFlatnessTransformer
      Parameters:
      shape - the shape to be transformed
      flatness - used to break the supplied shape into segments
      Returns:
      a GeneralPath (Shape) representing the screen points of the shape
    • inverseTransform

      public Shape inverseTransform(Shape shape)
      Description copied from class: LensTransformer
      Returns the supplied shape, translated to the coordinates that result from calling inverseTransform on its center.
      Specified by:
      inverseTransform in interface ShapeTransformer
      Overrides:
      inverseTransform in class LensTransformer
    • _transform

      private Point2D _transform(Point2D graphPoint)
    • _inverseTransform

      private Point2D _inverseTransform(Point2D viewPoint)
      override base class to un-project the fisheye effect
    • magnify

      public Shape magnify(Shape shape)
      Magnify the shape, without considering the Lens.
      Parameters:
      shape - the shape to magnify
      Returns:
      the transformed shape
    • magnify

      public Shape magnify(Shape shape, float flatness)