Package curve.area
Class Board
java.lang.Object
curve.area.Board
A layer comprises two two dimensional arrays of 16 bit ints, each hoding
the id of a colour object, allowing for a panel of 30 cm by 30 cm, each
containing 3072 by 3072 pixels spaced 0.1 mm apart This board provides data
to the canvas of paintComponent in DotsCanvas
" So each layer will take around 18 Megabytes ( 2 * 3K * 3K)
On the user screen, y+ is up, so y is mirrored from the dots array
dots 0, 0 maps to top left cornerof user screen?????
The user screen shadows the layers with a scaling factor
so x = horPixels/2, y = verPixels/2 will start to show in the middle May need an index from id to line Only one board so make most of it static
" So each layer will take around 18 Megabytes ( 2 * 3K * 3K)
On the user screen, y+ is up, so y is mirrored from the dots array
dots 0, 0 maps to top left cornerof user screen?????
The user screen shadows the layers with a scaling factor
so x = horPixels/2, y = verPixels/2 will start to show in the middle May need an index from id to line Only one board so make most of it static
-
Field Summary
Modifier and TypeFieldDescriptionprivate static Color[]
Holds the id of a line.private DotsCanvas
link to DotsCanvasprivate static boolean
debugprivate static boolean
debug drawprivate static boolean
debug lineprivate static int[][]
Holds the id of a drawable object.
A dot will hold a pointer, starting from 3, key into colourObjects arrayprivate Grid
linklinkprivate Tr
translateprivate static String
prefix for logging -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAreaToLine
(int lineID, MyArea area) add area to linevoid
clearBoardgetBoardImagestatic Color[]
get colour arrayint[][]
getDot()
get dot arrayint
getDot
(int bx, int by) get Dot contentsint
get Dotprivate int
get Drawing First Lineprivate int[]
getDrawingHorLimits
(int[] verLimits) get Drawing Hor Limitsprivate int
get Drawing Last Lineprivate int
getDrawingLeftColumn
(int[] verLimits) get Drawing Left Columnprivate int[]
get Drawing Limitsprivate int
getDrawingRightColumn
(int[] verLimits) get Drawing Right Columnprivate int[]
get Drawing Ver Limitsstatic int
get max colour indexgetScaledDot
(int screenX, int screenY) get Scaled Dot - x and y are screen coordinates.private void
link to Log.mesvoid
logBoard()
logBoardvoid
log Coloursvoid
repaint()
repaint()static void
setColourByIndex
(int index, Color colour) set colour by indexvoid
setDot
(int bx, int by, int id) set dotvoid
set dotvoid
set grid
-
Field Details
-
zz
prefix for logging -
layer
link -
grid
link -
dc
link to DotsCanvas -
t
translate -
debug
private static boolean debugdebug -
debugDraw
private static boolean debugDrawdebug draw -
debugLine
private static boolean debugLinedebug line -
dot
private static int[][] dotHolds the id of a drawable object.
A dot will hold a pointer, starting from 3, key into colourObjects array -
colours
Holds the id of a line.
-
-
Constructor Details
-
Board
-
-
Method Details
-
setColourByIndex
set colour by index- Parameters:
index
- -colour
- -
-
getMaxColourIndex
public static int getMaxColourIndex()get max colour index- Returns:
- max index
-
getColourArray
-
addAreaToLine
-
repaint
public void repaint()repaint() -
log
-
clearBoard
public void clearBoard()clearBoard -
getDot
public int[][] getDot()get dot array- Returns:
- dot array
-
setGrid
-
getDot
-
setDot
public void setDot(int bx, int by, int id) set dot- Parameters:
bx
- -by
- -id
- -
-
setDot
-
getDot
public int getDot(int bx, int by) get Dot contents- Parameters:
bx
- - board parameterby
- - board parameter- Returns:
- dot contents
-
getScaledDot
get Scaled Dot - x and y are screen coordinates.rotates around the point up to scale radius
the width and height of sampled area are set by scale
- Parameters:
screenX
- -screenY
- -- Returns:
- colour from dot
-
getBoardImage
-
logBoard
public void logBoard()logBoard -
getDrawingLimits
private int[] getDrawingLimits()get Drawing Limits- Returns:
- limits x1, y1 (tlh), x2, y2 ((brh)
-
getDrawingVerLimits
private int[] getDrawingVerLimits()get Drawing Ver Limits- Returns:
- limits y1 (top), y2 (bot)
-
getDrawingFirstLine
private int getDrawingFirstLine()get Drawing First Line- Returns:
- Drawing First Line
-
getDrawingLastLine
private int getDrawingLastLine()get Drawing Last Line- Returns:
- Drawing Last Line
-
getDrawingHorLimits
private int[] getDrawingHorLimits(int[] verLimits) get Drawing Hor Limits- Parameters:
verLimits
- -- Returns:
- limits x1, y1 (tlh), x2, y2 ((brh)
-
getDrawingLeftColumn
private int getDrawingLeftColumn(int[] verLimits) get Drawing Left Column- Parameters:
verLimits
- -- Returns:
- Drawing Left Column
-
getDrawingRightColumn
private int getDrawingRightColumn(int[] verLimits) get Drawing Right Column- Parameters:
verLimits
- -- Returns:
- Drawing Right Column
-
logColours
public void logColours()log Colours
-