Package de.freaklamarsch.systarest
Class FakeSTouchDisplay
java.lang.Object
de.freaklamarsch.systarest.FakeSTouchDisplay
public class FakeSTouchDisplay
extends java.lang.Object
A mock implementation of a S-Touch display used, for interaction with a
S-Touch capable device.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FakeSTouchDisplay.DisplayButton
class
FakeSTouchDisplay.DisplayCircle
class
FakeSTouchDisplay.DisplayRectangle
class
FakeSTouchDisplay.DisplayText
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Color
backgroundColor
private int
button
private java.util.HashMap<java.lang.Integer,FakeSTouchDisplay.DisplayButton>
buttons
(package private) int
checksum
(package private) byte[]
checksumByte
(package private) int
config
(package private) int
FONTS_AVAILABLE
int
FONTS_USED
private java.awt.Color
foregroundColor
private RTree
objectTree
private java.util.ArrayList<FakeSTouchDisplay.DisplayRectangle>
rectangles
int
RESSOURCE_ID
private int
style
(package private) int
SYMBOLS_AVAILABLE
int
SYMBOLS_USED
private java.util.ArrayList<FakeSTouchDisplay.DisplayText>
texts
private int
x
private int
y
-
Constructor Summary
Constructors Constructor Description FakeSTouchDisplay()
-
Method Summary
Modifier and Type Method Description boolean
addButton(int id, int xMin, int yMin, int xMax, int yMax)
boolean
addButton(STouchProtocol.Button b)
boolean
addText(STouchProtocol.TextXY textXY)
private boolean
check()
void
clearButtons()
void
clearRectangles()
void
clearScreen()
void
clearTexts()
boolean
delButton(int id)
boolean
drawRect(int xMin, int yMin, int xMax, int yMax)
boolean
drawRect(STouchProtocol.Rectangle rectangle)
FakeSTouchDisplay.DisplayButton
findButtonInObjectTree(int id)
int
findButtonPressed(int x, int y)
FakeSTouchDisplay.DisplayText
findTextInObjectTree(java.lang.String searchText)
int
getButton()
int
getChecksum()
private java.awt.Color
getColorFrom16BitValue(int colorCode16bit)
java.lang.String
getContentAsExcalidrawJSON()
java.awt.image.BufferedImage
getContentAsImage()
int
getFontsAvailable()
int
getFreeCommandSpace()
RTree
getObjectTree()
int
getSymbolsAvailable()
int
getX()
int
getY()
void
printContent()
boolean
pushButton(int id)
void
selectButton(int btn)
boolean
setBackColor(int colorCode16bit)
boolean
setBackColor(java.awt.Color backColor)
boolean
setChecksum(byte[] bArr)
boolean
setChecksum(int checksum)
boolean
setClick(int id)
boolean
setConfig(byte[] bArr, int i2)
boolean
setConfig(int config)
boolean
setForeColor(int colorCode16bit)
boolean
setForeColor(java.awt.Color foreColor)
boolean
setStyle(int style)
void
setTouch(int x, int y)
void
setTouch(int id, int x, int y)
boolean
touchText(java.lang.String searchText)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
checksumByte
byte[] checksumByte -
checksum
int checksum -
config
int config -
FONTS_AVAILABLE
int FONTS_AVAILABLE -
FONTS_USED
public int FONTS_USED -
RESSOURCE_ID
public int RESSOURCE_ID -
SYMBOLS_AVAILABLE
int SYMBOLS_AVAILABLE -
SYMBOLS_USED
public int SYMBOLS_USED -
x
private int x -
y
private int y -
button
private int button -
texts
-
rectangles
-
buttons
-
objectTree
-
foregroundColor
private java.awt.Color foregroundColor -
backgroundColor
private java.awt.Color backgroundColor -
style
private int style
-
-
Constructor Details
-
FakeSTouchDisplay
public FakeSTouchDisplay()
-
-
Method Details
-
check
private boolean check() -
delButton
public boolean delButton(int id) -
clearScreen
public void clearScreen() -
clearButtons
public void clearButtons() -
clearTexts
public void clearTexts() -
clearRectangles
public void clearRectangles() -
setTouch
public void setTouch(int id, int x, int y) -
setTouch
public void setTouch(int x, int y) -
getX
public int getX() -
getY
public int getY() -
getButton
public int getButton()- Returns:
- the button
-
findButtonPressed
public int findButtonPressed(int x, int y)- Returns:
- the button
-
selectButton
public void selectButton(int btn)- Parameters:
btn
- the button to set
-
addButton
public boolean addButton(int id, int xMin, int yMin, int xMax, int yMax) -
addButton
-
setClick
public boolean setClick(int id) -
pushButton
public boolean pushButton(int id) -
touchText
public boolean touchText(java.lang.String searchText) -
setChecksum
public boolean setChecksum(int checksum) -
setChecksum
public boolean setChecksum(byte[] bArr) -
getChecksum
public int getChecksum() -
setConfig
public boolean setConfig(int config) -
setConfig
public boolean setConfig(byte[] bArr, int i2) -
addText
-
findTextInObjectTree
-
findButtonInObjectTree
-
getFreeCommandSpace
public int getFreeCommandSpace() -
setStyle
public boolean setStyle(int style) -
setForeColor
public boolean setForeColor(int colorCode16bit) -
setBackColor
public boolean setBackColor(int colorCode16bit) -
setForeColor
public boolean setForeColor(java.awt.Color foreColor) -
setBackColor
public boolean setBackColor(java.awt.Color backColor) -
getColorFrom16BitValue
private java.awt.Color getColorFrom16BitValue(int colorCode16bit)- Parameters:
colorCode16bit
-
-
drawRect
public boolean drawRect(int xMin, int yMin, int xMax, int yMax) -
drawRect
-
getFontsAvailable
public int getFontsAvailable() -
getSymbolsAvailable
public int getSymbolsAvailable() -
printContent
public void printContent() -
getObjectTree
- Returns:
- the objectTree
-
getContentAsExcalidrawJSON
public java.lang.String getContentAsExcalidrawJSON() -
getContentAsImage
public java.awt.image.BufferedImage getContentAsImage()
-