public final class DrawMessage extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DrawMessage.ParseException |
| Constructor and Description |
|---|
DrawMessage(int type,
byte colorR,
byte colorG,
byte colorB,
byte colorA,
double thickness,
double x1,
double x2,
double y1,
double y2,
boolean lastInChain) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Graphics2D g)
Draws this DrawMessage onto the given Graphics2D.
|
byte |
getColorA() |
byte |
getColorB() |
byte |
getColorG() |
byte |
getColorR() |
double |
getThickness() |
int |
getType()
The type.
1: Brush 2: Line 3: Rectangle 4: Ellipse |
double |
getX1() |
double |
getX2() |
double |
getY1() |
double |
getY2() |
boolean |
isLastInChain()
Specifies if this DrawMessage is the last one in a chain
(e.g.
|
static DrawMessage |
parseFromString(String str) |
void |
setColorA(byte colorA) |
void |
setColorB(byte colorB) |
void |
setColorG(byte colorG) |
void |
setColorR(byte colorR) |
void |
setLastInChain(boolean lastInChain) |
void |
setThickness(double thickness) |
void |
setType(int type) |
void |
setX1(double x1) |
void |
setX2(double x2) |
void |
setY1(double y1) |
void |
setY2(double y2) |
String |
toString()
Converts this message into a String representation that
can be sent over WebSocket.
Since a DrawMessage consists only of numbers, we concatenate those numbers with a ",". |
public DrawMessage(int type,
byte colorR,
byte colorG,
byte colorB,
byte colorA,
double thickness,
double x1,
double x2,
double y1,
double y2,
boolean lastInChain)
public int getType()
public void setType(int type)
public double getThickness()
public void setThickness(double thickness)
public byte getColorR()
public void setColorR(byte colorR)
public byte getColorG()
public void setColorG(byte colorG)
public byte getColorB()
public void setColorB(byte colorB)
public byte getColorA()
public void setColorA(byte colorA)
public double getX1()
public void setX1(double x1)
public double getX2()
public void setX2(double x2)
public double getY1()
public void setY1(double y1)
public double getY2()
public void setY2(double y2)
public boolean isLastInChain()
public void setLastInChain(boolean lastInChain)
public void draw(Graphics2D g)
g - public String toString()
public static DrawMessage parseFromString(String str) throws DrawMessage.ParseException
DrawMessage.ParseExceptionCopyright © 2015 WSO2 Inc. All rights reserved.