public class HShape extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ARROW |
static int |
CIRCLE |
static int |
ELLIPSE |
static int |
IMAGE |
static int |
LINE |
static int |
POLYGON |
static int |
RECTAN |
static int |
TEXT |
Constructor and Description |
---|
HShape()
Build a default primitive
|
HShape(double[] XX,
double[] YY,
Stroke strock,
Color color)
Build a primitive using polyline.
|
HShape(double X1,
double Y1,
double X2,
double Y2)
Build a primitive using the default color and stroke
|
HShape(double X1,
double Y1,
double X2,
double Y2,
Stroke stroke,
Color color)
Build a primitive
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double Xm,
double Ym) |
Color |
getColor()
Get a color of the primitive
|
boolean |
getFill()
Is this primitive filled?
|
double[] |
getPosition()
Get position of a primitive
|
int |
getPositionCoordinate()
Is the position set?
|
double |
getRotation()
Get rotation angle theta.
|
double[] |
getScaledPosition(double Xscale,
double Yscale)
Scale the positions
|
void |
getSettings(XMLWrite xw)
Returns the settings of the primitive in a XML instance.
|
Stroke |
getStroke()
Get the Stroke to a specific value
|
Float |
getTransparency()
Get the transparency level
|
int |
getWhoAm()
Primitive type
|
void |
setColor(Color c)
Sets the color to a specific value
|
void |
setDashed(double thikness)
Set dashed line
|
void |
setDotted(double thikness)
Set dotted line
|
void |
setFill(boolean fill)
Fill a primitive
|
void |
setPosCoord(String howToSet)
Set the style of the coodinate position
|
void |
setPositionCoordinate(int usePosition)
How to set the position of this object?
|
void |
setRotation(double theta)
Rotate the shape or text.
|
void |
setStroke(Stroke stroke)
Set the Stroke to a specific value
|
void |
setTransparency(double trans)
Get the transparency level
|
void |
setWhoAm(int whoAm)
Set primitive type
|
void |
updateSettings(XMLRead xr)
Update the current primitive with the settings.
|
public static final int LINE
public static final int ARROW
public static final int TEXT
public static final int IMAGE
public static final int CIRCLE
public static final int ELLIPSE
public static final int RECTAN
public static final int POLYGON
public HShape(double X1, double Y1, double X2, double Y2, Stroke stroke, Color color)
X1
- X start positionY1
- Y start positionX2
- X end positionY2
- Y end positionstroke
- Stroke type for linecolor
- Colorpublic HShape()
public HShape(double X1, double Y1, double X2, double Y2)
X1
- X start positionY1
- Y start positionX2
- X end positionY2
- Y end positionpublic double[] getPosition()
public void setRotation(double theta)
theta
- rotaion angle for the object (in rad).public double getRotation()
public double[] getScaledPosition(double Xscale, double Yscale)
Xscale
- Yscale
- public void setColor(Color c)
c
- color used to draw the labelpublic Color getColor()
public Stroke getStroke()
public void setStroke(Stroke stroke)
public void setFill(boolean fill)
fill
- true if it is filledpublic boolean getFill()
public boolean contains(double Xm, double Ym)
public Float getTransparency()
public void setTransparency(double trans)
trans
- the transparency level (0-1)public int getPositionCoordinate()
public void setPositionCoordinate(int usePosition)
0
- if location is not defined
1 if the position is defined in the NDC system
2 if the location is defined in the USER coordinatespublic void setPosCoord(String howToSet)
howToSet
- set it to "NDC" for normilized coordinates (in the range
0-1). This is a data independent position.
Set it to "USER" for the user coordinatespublic void setDashed(double thikness)
thikness
- public void setDotted(double thikness)
thikness
- public void getSettings(XMLWrite xw)
xw
- instance of the class containing the settings.public void updateSettings(XMLRead xr)
xr
- instance of the reader class, containing the settings.public void setWhoAm(int whoAm)
whoAm
- Primitive typespublic int getWhoAm()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics