Package curve.area
Class Tr
java.lang.Object
curve.area.Tr
Translate coordinates
b - board - as in board matrix
f - func - indicated on cursor position dis-play - 0, 0 at centre of screen to start wth - value in objects
s - screen - windows coordinates - tlh 0,0, brh screen width, screen height
offset - screen pixels to screen mid point px posx0, posy0
scale - multiple functional over screen
b - board - as in board matrix
f - func - indicated on cursor position dis-play - 0, 0 at centre of screen to start wth - value in objects
s - screen - windows coordinates - tlh 0,0, brh screen width, screen height
offset - screen pixels to screen mid point px posx0, posy0
scale - multiple functional over screen
- Author:
- eddie
-
Field Summary
Modifier and TypeFieldDescriptionprivate Board
link to boardprivate DotsCanvas
link to DotsCanvasprivate int
posx is screen offset from left of fx = 0 - change with panprivate int
posy is screen offset from top of fy = 0 - change with panprivate int
if 3, convert 3 x 3 board section to one screen dotprivate int
screen widthprivate int
screen heightprivate int
mid screen pixel positionprivate int
mid screen pixel position -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add Boardvoid
addBoardXOffset
(int offset) add Board X Offsetvoid
addBoardYOffset
(int offset) the offset is from the mouseint
getBoardXfromFunc
(int fx) convert to board x offsetint
getBoardXfromScreen
(int mouseX) get Board X from Screenint
getBoardXOffset - from pan actionget Board XY from FuncgetBoardXYfromScreen
(int screenX, int screenY) get Board XY from Screenint
getBoardYfromFunc
(int fy) convert to board y from function yint
getBoardYfromScreen
(int mouseY) get Board Y from Screen yint
getBoardYOffset - from pan actionint
getFunctXfromBoard
(int bx) get Funct X from Boardint
getFunctYfromBoard
(int by) get Funct Y from Boardint
getFuncXfromBoard
(int bx) get functional xint
getFuncXfromScreen
(int mouseX) get Functional X from Screenint
getFuncYfromBoard
(int by) get functional y from board yint
getFuncYfromScreen
(int mouseY) get Functional Y from Screenint
getScale()
get scaleint
getScreenXfromBoard
(int bx) get screen x fom board xint
getScreenXfromFunc
(int fx) get screen x from functional xint
get Board X Offsetint
getScreenYfromBoard
(int by) get screen y from board yint
getScreenYfromFunc
(int fy) input functional coordinates - get screen yint
get Board Y Offsetvoid
setBoardXOffset
(int offset) setBoardXOffset - from pan actionvoid
setBoardYOffset
(int offset) setBoardYOffset - from pan actionvoid
setPosScale
(int posx, int posy, int scale) set Pos Scalevoid
setScale
(int m) set scale
-
Field Details
-
board
link to board -
dc
link to DotsCanvas -
posx0
private int posx0posx is screen offset from left of fx = 0 - change with pan -
posy0
private int posy0posy is screen offset from top of fy = 0 - change with pan -
scale
private int scaleif 3, convert 3 x 3 board section to one screen dot -
sdx
private int sdxscreen width -
sdy
private int sdyscreen height -
smx
private int smxmid screen pixel position -
smy
private int smymid screen pixel position
-
-
Constructor Details
-
Tr
-
-
Method Details
-
addBoard
-
setPosScale
public void setPosScale(int posx, int posy, int scale) set Pos Scale- Parameters:
posx
- -posy
- -scale
- -
-
getScreenXOffset
public int getScreenXOffset()get Board X Offset- Returns:
- board x offset
-
getScreenYOffset
public int getScreenYOffset()get Board Y Offset- Returns:
- board y offset
-
addBoardXOffset
public void addBoardXOffset(int offset) add Board X Offset- Parameters:
offset
- - wrt fx, translates to bx
-
addBoardYOffset
public void addBoardYOffset(int offset) the offset is from the mouse- Parameters:
offset
- -
-
getBoardXOffset
public int getBoardXOffset()getBoardXOffset - from pan action- Returns:
- board offset
-
getBoardYOffset
public int getBoardYOffset()getBoardYOffset - from pan action- Returns:
- board offset
-
setBoardXOffset
public void setBoardXOffset(int offset) setBoardXOffset - from pan action- Parameters:
offset
- -
-
setBoardYOffset
public void setBoardYOffset(int offset) setBoardYOffset - from pan action- Parameters:
offset
- -
-
setScale
public void setScale(int m) set scale- Parameters:
m
- - new scale
-
getScale
public int getScale()get scale- Returns:
- scale
-
getScreenXfromBoard
public int getScreenXfromBoard(int bx) get screen x fom board x- Parameters:
bx
- - board x- Returns:
- functional x
-
getScreenYfromBoard
public int getScreenYfromBoard(int by) get screen y from board y- Parameters:
by
- - board y- Returns:
- functional y
-
getFuncXfromBoard
public int getFuncXfromBoard(int bx) get functional x- Parameters:
bx
- - board x- Returns:
- functional x
-
getFuncYfromBoard
public int getFuncYfromBoard(int by) get functional y from board y- Parameters:
by
- - board y- Returns:
- functional y
-
getScreenXfromFunc
public int getScreenXfromFunc(int fx) get screen x from functional x- Parameters:
fx
- - function x- Returns:
- scaled x
-
getScreenYfromFunc
public int getScreenYfromFunc(int fy) input functional coordinates - get screen y- Parameters:
fy
- - function y- Returns:
- scaled y
-
getBoardXfromScreen
public int getBoardXfromScreen(int mouseX) get Board X from Screen- Parameters:
mouseX
- -- Returns:
- Board X
-
getBoardYfromScreen
public int getBoardYfromScreen(int mouseY) get Board Y from Screen y- Parameters:
mouseY
- -- Returns:
- Board Y
-
getFuncXfromScreen
public int getFuncXfromScreen(int mouseX) get Functional X from Screen- Parameters:
mouseX
- -- Returns:
- Functional X
-
getFuncYfromScreen
public int getFuncYfromScreen(int mouseY) get Functional Y from Screen- Parameters:
mouseY
- -- Returns:
- fy
-
getBoardXfromFunc
public int getBoardXfromFunc(int fx) convert to board x offset- Parameters:
fx
- - the x functional position- Returns:
- board x position
-
getBoardYfromFunc
public int getBoardYfromFunc(int fy) convert to board y from function y- Parameters:
fy
- - the y functional position- Returns:
- board offset
-
getFunctXfromBoard
public int getFunctXfromBoard(int bx) get Funct X from Board- Parameters:
bx
- -- Returns:
- Funct X
-
getFunctYfromBoard
public int getFunctYfromBoard(int by) get Funct Y from Board- Parameters:
by
- -- Returns:
- Funct Y
-
getBoardXYfromScreen
get Board XY from Screen- Parameters:
screenX
- -screenY
- -- Returns:
- functional coordinates
-
getBoardXYfromFunc
-