|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.umlv.unitex.GenericGraphBox
public abstract class GenericGraphBox
This class describes a box of a graph or a sentence graph.
Field Summary | |
---|---|
static int |
FINAL
|
static int |
INITIAL
|
static int |
NORMAL
|
Constructor Summary | |
---|---|
GenericGraphBox(int x,
int y,
int type,
GenericGraphicalZone p)
Constructs a new box |
Method Summary | |
---|---|
void |
addTransitionTo(GenericGraphBox g)
Adds a transition to a box. |
void |
draw(java.awt.Graphics2D g)
Draws the box |
void |
drawTransition(java.awt.Graphics2D g,
GenericGraphBox dest)
Draws a transition to a box |
void |
drawTransitions(java.awt.Graphics2D gr)
Draws all transitions that go out of the box |
java.lang.String |
getContent()
|
java.io.File |
getGraphClicked(int y)
Tests if the click point was in a sub-graph call area. |
java.util.ArrayList |
getTransitions()
|
int |
getType()
|
int |
getWidth()
|
int |
getX_in()
|
int |
getX_out()
|
int |
getX()
|
int |
getX1()
|
int |
getY_in()
|
int |
getY_out()
|
int |
getY()
|
int |
getY1()
|
boolean |
hasTransitionToItself()
|
boolean |
isSelected()
|
boolean |
isSelectedByRectangle(int Xr,
int Yr,
int Wr,
int Hr)
Tests if the box is selected by a rectangle |
int |
maxLineWidth()
Returns the width of the box's largest line. |
void |
onlyAddTransitionTo(GenericGraphBox g)
Adds a transition to a box. |
void |
removeTransitionTo(GenericGraphBox g)
removes a box transition |
abstract void |
setContent(java.lang.String s)
Sets the content of the box |
void |
setSelected(boolean b)
|
void |
setTransitions(java.util.ArrayList transitions)
|
void |
setType(int type)
|
void |
setX_in(int x_in)
|
void |
setX_out(int x_out)
|
void |
setX(int x1)
|
void |
setX1(int x1)
|
void |
setY_in(int y_in)
|
void |
setY_out(int y_out)
|
void |
setY(int y)
|
void |
setY1(int y1)
|
void |
translate(int dx,
int dy)
Translates the box |
void |
translateToPosition(int xPos,
int yPos)
Translate a box to the x,y position |
void |
update()
Updates the box by calling the setContent method with the
current box content, which refresh the box properties. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INITIAL
public static final int FINAL
public static final int NORMAL
Constructor Detail |
---|
public GenericGraphBox(int x, int y, int type, GenericGraphicalZone p)
x
- X coordinate of the input point of the boxy
- Y coordinate of the input point of the boxtype
- indicates if the box is initial, final or normalp
- component on which the box will be drawnMethod Detail |
---|
public java.io.File getGraphClicked(int y)
y
- Y coordinate of the click point
public void addTransitionTo(GenericGraphBox g)
g
- the destination boxpublic void onlyAddTransitionTo(GenericGraphBox g)
g
- the destination boxpublic void removeTransitionTo(GenericGraphBox g)
g
- the transition's destination boxpublic void translate(int dx, int dy)
dx
- length of X shift in pixelsdy
- length of Y shift in pixelspublic boolean isSelectedByRectangle(int Xr, int Yr, int Wr, int Hr)
Xr
- X coordinate of the upper left corner of the rectangleYr
- Y coordinate of the upper left corner of the rectangleWr
- width of the rectangleHr
- height of the rectangle
true
if the intersection between the box and the
rectangle is not empty, false
otherwisepublic void drawTransition(java.awt.Graphics2D g, GenericGraphBox dest)
g
- the graphical contextdest
- the destination boxpublic void drawTransitions(java.awt.Graphics2D gr)
gr
- the graphical contextpublic void draw(java.awt.Graphics2D g)
g
- the graphical contextpublic int maxLineWidth()
public abstract void setContent(java.lang.String s)
s
- the contentpublic void update()
setContent
method with the
current box content, which refresh the box properties. It used to
recompute box properties, for example when the user has changed font
sizes.
public java.util.ArrayList getTransitions()
public int getX()
public int getY()
public java.lang.String getContent()
public void translateToPosition(int xPos, int yPos)
xPos
- yPos
- public boolean hasTransitionToItself()
public boolean isSelected()
public void setSelected(boolean b)
b
- public void setX(int x1)
public void setY(int y)
public int getWidth()
public int getX_in()
public void setX_in(int x_in)
public int getX_out()
public void setX_out(int x_out)
public int getX1()
public void setX1(int x1)
public int getY1()
public void setY1(int y1)
public int getY_in()
public void setY_in(int y_in)
public int getY_out()
public void setY_out(int y_out)
public int getType()
public void setType(int type)
public void setTransitions(java.util.ArrayList transitions)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |