From 670fcf2613f6db2a4bfdaa91ac9d90001a90359e Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Tue, 10 May 2011 16:59:40 +0200 Subject: docs fertig und vorher repariert git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@232 72836036-5685-4462-b002-a69064685172 --- doc/jrummikub/view/impl/StonePainter.html | 410 ++++++++++++++++++++++++++++++ 1 file changed, 410 insertions(+) create mode 100644 doc/jrummikub/view/impl/StonePainter.html (limited to 'doc/jrummikub/view/impl/StonePainter.html') diff --git a/doc/jrummikub/view/impl/StonePainter.html b/doc/jrummikub/view/impl/StonePainter.html new file mode 100644 index 0000000..36669ce --- /dev/null +++ b/doc/jrummikub/view/impl/StonePainter.html @@ -0,0 +1,410 @@ + + + + + + +StonePainter + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +jrummikub.view.impl +
+Class StonePainter

+
+java.lang.Object
+  extended by jrummikub.view.impl.StonePainter
+
+
+
+
 class StonePainter
extends java.lang.Object
+ + +

+The StonePainter paints stones and converts between pixel and grid + coordinates +

+ +

+


+ +

+ + + + + + + + + + + + + + + +
+Field Summary
+static floatHEIGHT_SCALE + +
+          The height of one pixel in the scale of 1.0
+static floatWIDTH_SCALE + +
+          The width of one pixel in the scale of 1.0
+  + + + + + + + + + + +
+Constructor Summary
StonePainter(float scale) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ PositioncalculatePosition(int x, + int y) + +
+           
+ intgetStoneHeight() + +
+           
+ intgetStoneWidth() + +
+           
+ voidpaintStone(java.awt.Graphics2D g, + Stone stone, + Position p, + boolean selected, + boolean hovered) + +
+          Paints a stone
+ voidsetScale(float scale) + +
+          Sets the new grid scale
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+WIDTH_SCALE

+
+public static final float WIDTH_SCALE
+
+
The width of one pixel in the scale of 1.0 +

+

+
See Also:
Constant Field Values
+
+
+ +

+HEIGHT_SCALE

+
+public static final float HEIGHT_SCALE
+
+
The height of one pixel in the scale of 1.0 +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+StonePainter

+
+StonePainter(float scale)
+
+
+
Parameters:
scale - the scaling factor for the grid coordinates
+
+ + + + + + + + +
+Method Detail
+ +

+setScale

+
+public void setScale(float scale)
+
+
Sets the new grid scale +

+

+
Parameters:
scale - the new scale
+
+
+
+ +

+calculatePosition

+
+public Position calculatePosition(int x,
+                                  int y)
+
+
+
Parameters:
x - x position in screen coordinates
y - y position in screen coordinates +
Returns:
position in grid coordinates
+
+
+
+ +

+getStoneWidth

+
+public int getStoneWidth()
+
+
+ +
Returns:
the width of a stone in the current scale in pixels
+
+
+
+ +

+getStoneHeight

+
+public int getStoneHeight()
+
+
+ +
Returns:
the height of a stone in the current scale in pixels
+
+
+
+ +

+paintStone

+
+public void paintStone(java.awt.Graphics2D g,
+                       Stone stone,
+                       Position p,
+                       boolean selected,
+                       boolean hovered)
+
+
Paints a stone +

+

+
Parameters:
g - the graphics context to paint the stone on
stone - the stone to paint
p - the position of the stone
selected - if selected is true the stone will be painted darker
hovered - if hovered is true the stone will be painted brighter
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3