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
FieldsModifier and TypeFieldDescriptionprivate static Color[]Holds the id of a line.private DotsCanvaslink to DotsCanvasprivate static booleandebugprivate static booleandebug drawprivate static booleandebug lineprivate static int[][]Holds the id of a drawable object.
A dot will hold a pointer, starting from 3, key into colourObjects arrayprivate Gridlinklinkprivate Trtranslateprivate static Stringprefix for logging -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAreaToLine(int lineID, MyArea area) add area to linevoidclearBoardgetBoardImagestatic Color[]get colour arrayint[][]getDot()get dot arrayintgetDot(int bx, int by) get Dot contentsintget Dotprivate intget Drawing First Lineprivate int[]getDrawingHorLimits(int[] verLimits) get Drawing Hor Limitsprivate intget Drawing Last Lineprivate intgetDrawingLeftColumn(int[] verLimits) get Drawing Left Columnprivate int[]get Drawing Limitsprivate intgetDrawingRightColumn(int[] verLimits) get Drawing Right Columnprivate int[]get Drawing Ver Limitsstatic intget max colour indexgetScaledDot(int screenX, int screenY) get Scaled Dot - x and y are screen coordinates.private voidlink to Log.mesvoidlogBoard()logBoardvoidlog Coloursvoidrepaint()repaint()static voidsetColourByIndex(int index, Color colour) set colour by indexvoidsetDot(int bx, int by, int id) set dotvoidset dotvoidset 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
-