jezuch.utils.starmapper2
Class ImageParameters.Clip

java.lang.Object
  |
  +--jezuch.utils.starmapper2.ImageParameters.Clip
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
ImageParameters

public static final class ImageParameters.Clip
extends java.lang.Object
implements java.io.Serializable

Instances of this class encapsulate a Starmapper's map clip. Clip is defined by four values: west, south, east, north, each being a value in Stars! light years. Each of these values can be an "abstract" value that effectively is equal to corresponding map bound. Instances of this class are immutable and expose clip bounds as final ints.

Author:
John Chris
See Also:
Serialized Form

Field Summary
 int east
          Eastern edge of this clip.
static int MAP_BORDER
          An "abstract" clip bound that evaluates to corresponding map bound.
 int north
          Northern edge of this clip.
 int south
          Southern edge of this clip.
 int west
          Western edge of this clip.
 
Constructor Summary
ImageParameters.Clip(int west, int south, int east, int north)
          Constructs a clip with given bounds in Stars!
 
Method Summary
 void applyTo(java.awt.Rectangle mapBounds)
          Applies this clip to given map bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

east

public final int east
Eastern edge of this clip.

See Also:
MAP_BORDER

MAP_BORDER

public static final int MAP_BORDER
An "abstract" clip bound that evaluates to corresponding map bound.

See Also:
Constant Field Values

north

public final int north
Northern edge of this clip.

See Also:
MAP_BORDER

south

public final int south
Southern edge of this clip.

See Also:
MAP_BORDER

west

public final int west
Western edge of this clip.

See Also:
MAP_BORDER
Constructor Detail

ImageParameters.Clip

public ImageParameters.Clip(int west,
                            int south,
                            int east,
                            int north)
Constructs a clip with given bounds in Stars! light years.

Parameters:
west - western edge
south - southern edge
east - eastern edge
north - northern edge
Throws:
java.lang.IllegalArgumentException - reports invalid clip values when eastern edge is to the west of western edge or northern edge is to the south of southern edge.
See Also:
MAP_BORDER
Method Detail

applyTo

public void applyTo(java.awt.Rectangle mapBounds)
Applies this clip to given map bounds. This method returns nothing, and it changes the mapBounds.

Parameters:
mapBounds - Rectangle containing map size and location