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
FieldsModifier and TypeFieldDescriptionprivate Boardlink to boardprivate DotsCanvaslink to DotsCanvasprivate intposx is screen offset from left of fx = 0 - change with panprivate intposy is screen offset from top of fy = 0 - change with panprivate intif 3, convert 3 x 3 board section to one screen dotprivate intscreen widthprivate intscreen heightprivate intmid screen pixel positionprivate intmid screen pixel position -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd BoardvoidaddBoardXOffset(int offset) add Board X OffsetvoidaddBoardYOffset(int offset) the offset is from the mouseintgetBoardXfromFunc(int fx) convert to board x offsetintgetBoardXfromScreen(int mouseX) get Board X from ScreenintgetBoardXOffset - from pan actionget Board XY from FuncgetBoardXYfromScreen(int screenX, int screenY) get Board XY from ScreenintgetBoardYfromFunc(int fy) convert to board y from function yintgetBoardYfromScreen(int mouseY) get Board Y from Screen yintgetBoardYOffset - from pan actionintgetFunctXfromBoard(int bx) get Funct X from BoardintgetFunctYfromBoard(int by) get Funct Y from BoardintgetFuncXfromBoard(int bx) get functional xintgetFuncXfromScreen(int mouseX) get Functional X from ScreenintgetFuncYfromBoard(int by) get functional y from board yintgetFuncYfromScreen(int mouseY) get Functional Y from ScreenintgetScale()get scaleintgetScreenXfromBoard(int bx) get screen x fom board xintgetScreenXfromFunc(int fx) get screen x from functional xintget Board X OffsetintgetScreenYfromBoard(int by) get screen y from board yintgetScreenYfromFunc(int fy) input functional coordinates - get screen yintget Board Y OffsetvoidsetBoardXOffset(int offset) setBoardXOffset - from pan actionvoidsetBoardYOffset(int offset) setBoardYOffset - from pan actionvoidsetPosScale(int posx, int posy, int scale) set Pos ScalevoidsetScale(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
-