Xoetrope

 Wiki : XPointSystem

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Carousel logo

XPointSystem

class com.xoetrope.svg.XPointSystem

Used to convert a coordinate from the user coordinate system to the SVG coordinate system and vice versa.

1. Example


public class Welcome extends XPage
{
  protected XSvgImageMap svgImage; 

  public void pageCreated()
  {
    svgImage = new XSvgImageMap();
    svgImage.setURL( ClassLoader.getSystemResource( "images/image1.svg" ));
    XPointSystem pointSystem = new XPointSystem( svgImage );
    Point2D p1 = pointSystem.glassPaneToSvg( 100.0, 200.0 );     
  }
}


The above example shows a coordinate being converted from the application coordinate system to the svg coordinate system.

2. Constructor


public XPointSystem( XSvgImageMap imageMap )

Constructor which takes an instance of the XSvgImageMap class which provides the SVG coordinate system.

3. Methods

1. glassPaneToSvg

public Point2D glassPaneToSvg( double x, double y )

Converts the passed double co-ordinate to the SVG coordinate system and returns it as a Point2D.

2. svgToGlassPane

public Point2D svgToGlassPane( double x, double y )

Converts the passed double co-ordinate to the user coordinate system and returns it as a Point2D.

There are no comments on this page. [Add comment]

Page was generated in 0.2783 seconds