Gridarta Editor
net.sf.gridarta.utils.Size2D Class Reference

The class Size2D represents a 2d rectangular area. More...

+ Inheritance diagram for net.sf.gridarta.utils.Size2D:
+ Collaboration diagram for net.sf.gridarta.utils.Size2D:

Public Member Functions

boolean equals (@Nullable final Object obj)
 
int getHeight ()
 Returns the height of the area. More...
 
int getWidth ()
 Returns the width of the area. More...
 
int hashCode ()
 
 Size2D (final int width, final int height)
 Create a new Size2D. More...
 
String toString ()
 

Static Public Attributes

static final Size2D ONE = new Size2D(1, 1)
 One size object. More...
 

Private Attributes

final int height
 The height of the area. More...
 
final int width
 The width of the area. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 Serial Version. More...
 

Detailed Description

The class Size2D represents a 2d rectangular area.

Sizes always are positive. This class doesn't allow zero or negative sizes.

Author
unknown (please fill in!!!)

Definition at line 30 of file Size2D.java.

Constructor & Destructor Documentation

◆ Size2D()

net.sf.gridarta.utils.Size2D.Size2D ( final int  width,
final int  height 
)

Create a new Size2D.

Parameters
widththe width of the area; must be greater than zero
heightthe height of the area; must be greater than zero
Exceptions
IllegalArgumentExceptionin case or is less than 1.

Definition at line 63 of file Size2D.java.

References net.sf.gridarta.utils.Size2D.height, and net.sf.gridarta.utils.Size2D.width.

Referenced by net.sf.gridarta.utils.Size2D.equals().

+ Here is the caller graph for this function:

Member Function Documentation

◆ equals()

boolean net.sf.gridarta.utils.Size2D.equals ( @Nullable final Object  obj)

◆ getHeight()

int net.sf.gridarta.utils.Size2D.getHeight ( )

Returns the height of the area.

It is always greater than zero.

Returns
the height of the area

Definition at line 104 of file Size2D.java.

References net.sf.gridarta.utils.Size2D.height.

Referenced by net.sf.gridarta.model.mapcursor.MapCursorTest.assertPreSelection(), net.sf.gridarta.model.mapgrid.MapGrid.beginRecChange(), net.sf.gridarta.model.validation.checks.BlockedMatrix< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.BlockedMatrix(), net.sf.gridarta.model.mapgrid.MapGrid.calculateCachedSelectedRec(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.calculateOrigin(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.calculateOrigin(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.canShift(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.checkMapContents(), net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.clearMap(), net.sf.gridarta.model.mapcursor.MapCursorTest.createCursor(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.createMapPanel(), net.sf.gridarta.model.io.DefaultMapWriter< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), net.sf.gridarta.gui.map.mapactions.ExitIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ExitIterator(), net.sf.gridarta.model.validation.checks.AbstractShopSquareChecker< G, A, R >.findMatchingSquares(), net.sf.gridarta.model.floodfill.FloodFill< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.floodFill(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getRepaintRec(), net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeUtils.getShrinkFlags(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.getSquareLocationAt(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getSquareLocationAt(), net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goLocation(), net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.isEmpty(), net.sf.gridarta.model.maparchobject.AbstractMapArchObject< MapArchObject >.isPointValid(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.MapCursor(), net.sf.gridarta.model.mapmodel.MapSquareIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapSquareIterator(), net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane< net.sf.gridarta.var.daimonin.model.gameobject.GameObject, net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject, net.sf.gridarta.var.daimonin.model.archetype.Archetype >.mapTilesAttach(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.nextPoint(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.paintComponent(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.paintComponent2(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMap(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMapGrid(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapGrid(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMapSelection(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapSelection(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.resize(), net.sf.gridarta.model.mapgrid.MapGrid.resize(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.resizeFromModel(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.resizeMapGrid(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resizeMapInt(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.model.mapcursor.MapCursorTest.selecting(), net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.setCursorLocation(), net.sf.gridarta.model.mapcursor.MapCursorTest.setInside(), net.sf.gridarta.model.mapcursor.MapCursorTest.setOutside(), net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeUtils.shrinkMap(), net.sf.gridarta.utils.Size2DTest.testGetHeight(), net.sf.gridarta.model.mapcursor.MapCursorTest.testIsOnGrid(), net.sf.gridarta.utils.Size2DTest.testSize2D(), net.sf.gridarta.model.mapgrid.MapGrid.unSelect(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().

◆ getWidth()

int net.sf.gridarta.utils.Size2D.getWidth ( )

Returns the width of the area.

It is always greater than zero.

Returns
the width of the area

Definition at line 96 of file Size2D.java.

References net.sf.gridarta.utils.Size2D.width.

Referenced by net.sf.gridarta.model.mapcursor.MapCursorTest.assertPreSelection(), net.sf.gridarta.model.mapgrid.MapGrid.beginRecChange(), net.sf.gridarta.model.validation.checks.BlockedMatrix< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.BlockedMatrix(), net.sf.gridarta.model.mapgrid.MapGrid.calculateCachedSelectedRec(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.canShift(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.checkMapContents(), net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.clearMap(), net.sf.gridarta.model.mapcursor.MapCursorTest.createCursor(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.createMapPanel(), net.sf.gridarta.model.io.DefaultMapWriter< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), net.sf.gridarta.gui.map.mapactions.ExitIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ExitIterator(), net.sf.gridarta.model.validation.checks.AbstractShopSquareChecker< G, A, R >.findMatchingSquares(), net.sf.gridarta.model.floodfill.FloodFill< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.floodFill(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getRepaintRec(), net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeUtils.getShrinkFlags(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.getSquareLocationAt(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getSquareLocationAt(), net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goLocation(), net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.isEmpty(), net.sf.gridarta.model.maparchobject.AbstractMapArchObject< MapArchObject >.isPointValid(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.MapCursor(), net.sf.gridarta.model.mapmodel.MapSquareIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapSquareIterator(), net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane< net.sf.gridarta.var.daimonin.model.gameobject.GameObject, net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject, net.sf.gridarta.var.daimonin.model.archetype.Archetype >.mapTilesAttach(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.nextPoint(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.paintComponent(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.paintComponent2(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMap(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMapGrid(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapGrid(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMapSelection(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapSelection(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.model.mapmodel.MapSquareGrid< G, A, R >.resize(), net.sf.gridarta.model.mapgrid.MapGrid.resize(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.resizeFromModel(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.resizeMapGrid(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resizeMapInt(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.model.mapcursor.MapCursorTest.selecting(), net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.setCursorLocation(), net.sf.gridarta.model.mapcursor.MapCursorTest.setInside(), net.sf.gridarta.model.mapcursor.MapCursorTest.setOutside(), net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeUtils.shrinkMap(), net.sf.gridarta.utils.Size2DTest.testGetWidth(), net.sf.gridarta.model.mapcursor.MapCursorTest.testIsOnGrid(), net.sf.gridarta.utils.Size2DTest.testSize2D(), net.sf.gridarta.model.mapgrid.MapGrid.unSelect(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().

◆ hashCode()

int net.sf.gridarta.utils.Size2D.hashCode ( )

Definition at line 88 of file Size2D.java.

Referenced by net.sf.gridarta.model.maparchobject.AbstractMapArchObject< MapArchObject >.hashCode(), and net.sf.gridarta.utils.Size2DTest.testHashCode().

+ Here is the caller graph for this function:

◆ toString()

String net.sf.gridarta.utils.Size2D.toString ( )

Definition at line 109 of file Size2D.java.

References net.sf.gridarta.utils.Size2D.height.

Member Data Documentation

◆ height

final int net.sf.gridarta.utils.Size2D.height
private

The height of the area.

It is always greater than zero.

Invariant
height > 0 include

Definition at line 54 of file Size2D.java.

Referenced by net.sf.gridarta.utils.Size2D.equals(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.Size2D(), and net.sf.gridarta.utils.Size2D.toString().

◆ ONE

◆ serialVersionUID

final long net.sf.gridarta.utils.Size2D.serialVersionUID = 1L
staticprivate

Serial Version.

Definition at line 35 of file Size2D.java.

◆ width

final int net.sf.gridarta.utils.Size2D.width
private

The width of the area.

It is always greater than zero.

Invariant
width > 0 include

Definition at line 47 of file Size2D.java.

Referenced by net.sf.gridarta.utils.Size2D.equals(), net.sf.gridarta.utils.Size2D.getWidth(), and net.sf.gridarta.utils.Size2D.Size2D().


The documentation for this class was generated from the following file: