net.refractions.udig.project.command.factory
Class NavigationCommandFactory

java.lang.Object
  extended by net.refractions.udig.project.command.NavigationCommandFactory
      extended by net.refractions.udig.project.command.factory.NavigationCommandFactory

public class NavigationCommandFactory
extends NavigationCommandFactory

API comment me TODO provide type description

Since:
TODO provide version
Author:
jeichar

Constructor Summary
protected NavigationCommandFactory()
           
 
Method Summary
 NavCommand createCompositeCommand(NavCommand[] commands)
          Creates a new NavComposite
 NavCommand createPanCommandUsingScreenCoords(int xpixels, int ypixels)
          Creates a new PanCommandPans the viewport in terms of pixels on the screen.
 NavCommand createPanCommandUsingWorldCoords(double x, double y)
          Creates a new PanCommand
 NavCommand createSetViewportBBoxCommand(Envelope newbbox)
          Creates a new SetViewportBBoxCommand
 NavCommand createSetViewportBBoxCommand(Envelope bounds, CoordinateReferenceSystem crs)
           
 NavCommand createSetViewportCenterCommand(Coordinate center)
          Creates a new SetViewportCenterCommand
 NavCommand createSetViewportHeight(double height)
          Creates a new SetViewportHeight
 NavCommand createSetViewportWidth(double width)
          Creates a new SetViewportWidth
 NavCommand createZoomCommand(double zoomfactor)
          Creates a new ZoomCommand
 NavCommand createZoomExtentCommand()
          Creates a new ZoomExtentCommand
static NavigationCommandFactory getInstance()
          Creates a new NavigationCommandFactory object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavigationCommandFactory

protected NavigationCommandFactory()
Method Detail

getInstance

public static NavigationCommandFactory getInstance()
Creates a new NavigationCommandFactory object

Returns:
a new NavigationCommandFactory object

createCompositeCommand

public NavCommand createCompositeCommand(NavCommand[] commands)
Creates a new NavComposite

Overrides:
createCompositeCommand in class NavigationCommandFactory
Parameters:
commands - an array of commands to execute as a simgle command. The array will be executed from position 0 to position length-1 in order.
Returns:
a new NavComposite object
See Also:
NavCommand

createSetViewportBBoxCommand

public NavCommand createSetViewportBBoxCommand(Envelope newbbox)
Creates a new SetViewportBBoxCommand

Overrides:
createSetViewportBBoxCommand in class NavigationCommandFactory
Parameters:
newbbox - the new bounding box to set in the viewport
Returns:
a new SetViewportBBoxCommand object
See Also:
NavCommand, Envelope

createZoomCommand

public NavCommand createZoomCommand(double zoomfactor)
Creates a new ZoomCommand

Overrides:
createZoomCommand in class NavigationCommandFactory
Parameters:
zoomfactor - the amount to zoom
Returns:
a new ZoomCommand object
See Also:
NavCommand

createZoomExtentCommand

public NavCommand createZoomExtentCommand()
Creates a new ZoomExtentCommand

Overrides:
createZoomExtentCommand in class NavigationCommandFactory
Returns:
a new ZoomExtentCommand object
See Also:
NavCommand

createSetViewportCenterCommand

public NavCommand createSetViewportCenterCommand(Coordinate center)
Creates a new SetViewportCenterCommand

Overrides:
createSetViewportCenterCommand in class NavigationCommandFactory
Parameters:
center - Sets the center of the viewport. The Coordinate must be in world coordinates.
Returns:
a new SetViewportCenterCommand object
See Also:
NavCommand, Coordinate

createSetViewportHeight

public NavCommand createSetViewportHeight(double height)
Creates a new SetViewportHeight

Overrides:
createSetViewportHeight in class NavigationCommandFactory
Parameters:
height - The new viewport height
Returns:
a new SetViewportHeight object
See Also:
NavCommand

createSetViewportWidth

public NavCommand createSetViewportWidth(double width)
Creates a new SetViewportWidth

Overrides:
createSetViewportWidth in class NavigationCommandFactory
Parameters:
width - the new viewport width
Returns:
a new SetViewportWidth object
See Also:
NavCommand

createPanCommandUsingScreenCoords

public NavCommand createPanCommandUsingScreenCoords(int xpixels,
                                                    int ypixels)
Creates a new PanCommandPans the viewport in terms of pixels on the screen. Each pixel represents a distance in world coordinates, the x and y distances differ, so a pan of 8 pixels in the x direction will be translated to a pan of 8*xdistance in the world.

Overrides:
createPanCommandUsingScreenCoords in class NavigationCommandFactory
Parameters:
xpixels - The amount, in pixels, to pan in the x direction
ypixels - The amount, in pixels, to pan in the y direction
Returns:
a new PanCommand object
See Also:
NavCommand

createPanCommandUsingWorldCoords

public NavCommand createPanCommandUsingWorldCoords(double x,
                                                   double y)
Creates a new PanCommand

Overrides:
createPanCommandUsingWorldCoords in class NavigationCommandFactory
Parameters:
x - The amount, in world coordinates, to pan in the x direction
y - The amount, in world coordinates, to pan in the y direction
Returns:
a new PanCommand object
See Also:
NavCommand

createSetViewportBBoxCommand

public NavCommand createSetViewportBBoxCommand(Envelope bounds,
                                               CoordinateReferenceSystem crs)
Overrides:
createSetViewportBBoxCommand in class NavigationCommandFactory