|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmodelling.CircularArea
Implements circular area. The boxes coverage is a square containing the area
| Field Summary | |
float |
sqr2
|
float |
sqr2s2
|
| Constructor Summary | |
CircularArea(Map map,
float x,
float y,
float radius,
float angle)
|
|
| Method Summary | |
java.lang.Object |
clone()
Clone the area. |
void |
confirmSimuled()
Confirms the last move simulated with a simule method of the area. |
void |
draw(Drawing g)
Draws the Area and eventually the image of the associated element.
|
void |
drawBorder(Drawing g,
java.awt.Color c)
Draws the borders of the area with the given color. |
boolean |
exactIsCrashingElements()
Takes in argument a vector v returned by a simule method. |
boolean |
exactIsCrashingElements(java.util.Vector v)
|
void |
fill(Drawing g,
java.awt.Color c)
Fills the area with the given color. |
float |
getAngle()
Returns the orientation ( in Radian ) |
java.util.Vector |
getIntersectedBoxes()
Returns at least the boxes intersected by the area. |
java.util.Vector |
getPolygon()
Returns a polygon aproximating the area. |
java.lang.String[][] |
getProperties()
Returns the Area's properties. |
float |
getX()
Returns the x-coordinate of the area's reference point. |
float |
getY()
Returns the y-coordinate of the area's reference point. |
void |
highlight(Drawing g,
java.awt.Color c)
Highlights the Area. is used when it's selected in the interface.
|
boolean |
inMap()
Checks whether the area is included in te map. |
boolean |
intersect(Area a)
Returns whether the area intersect these one. |
boolean |
intersect(float ax,
float ay,
float bx,
float by)
Returns whether the area intersect the segment (ax,ay),(bx,by) |
boolean |
intersect(java.util.Vector p1)
Returns whether the polygon intersects this area. |
boolean |
isCrashingElements()
Rounded here, because of the approximate covering boxes (there would be undue collisions!). |
boolean |
isCrashingElements(java.util.Vector v)
|
boolean |
isIn(float px,
float py)
Returns whether the point is in the area. |
boolean |
isPolygon()
Returns whether the area is a polygon. |
boolean |
rescale(float x,
float y)
Rescale by a 'x' and a 'y' factor without going out of the Map.
|
boolean |
rotate(float angle)
Rotates the area by the angle around the reference point getX() without going out of the Map.
|
boolean |
setAngle(float a)
Sets the orientation ( in radian ) Returns true if the modification is done, else false. |
void |
setElement(Element el)
Sets the element to which we want to link the area. |
void |
setProperties(java.lang.String s1,
java.lang.String s2)
Sets the value of a property of the area. |
boolean |
setRadius(float r)
|
boolean |
setX(float x)
Modify the x-coordinate of the reference point, without going out of the .
|
boolean |
setY(float y)
Modify the y-coordinate of the reference point, without going out of the .
|
java.util.Vector |
simuleRescale(float xS,
float yS)
Returns the covering boxes which would result of the rescale. |
java.util.Vector |
simuleRotate(float angle)
Returns the covering boxes which would result of the rotation. |
java.util.Vector |
simuleTranslate(float x,
float y)
Returns the covering boxes which would result of the (x,y) translation of the area. |
boolean |
translate(float x,
float y)
Translates the area by the (x,y) vector without going out of the map. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final float sqr2
public final float sqr2s2
| Constructor Detail |
public CircularArea(Map map,
float x,
float y,
float radius,
float angle)
| Method Detail |
public java.util.Vector getIntersectedBoxes()
Area
getIntersectedBoxes in interface AreaArea.setElement(Element),
Box.register(Element),
Box.unregister(Element)public void setElement(Element el)
Area
setElement in interface Areael - the corresponding element ( if one is used ).public float getX()
Area
getX in interface Areapublic float getY()
Area
getY in interface Areapublic float getAngle()
Area
getAngle in interface Area
public boolean isIn(float px,
float py)
Area
isIn in interface Areapx - the x-coordinate of the point.py - the y-coordinate of the point.
public boolean isCrashingElements()
isCrashingElements in interface Areapublic boolean isCrashingElements(java.util.Vector v)
isCrashingElements in interface Areapublic boolean isPolygon()
Area
isPolygon in interface Areapublic java.util.Vector getPolygon()
Area
getPolygon in interface Area
public boolean intersect(float ax,
float ay,
float bx,
float by)
Area
intersect in interface Areaax - x-coordinate of the 'a' point.ay - y-coordinate of the 'a' point.bx - x-coordinate of the 'b' point.by - y-coordinate of the 'b' point.
public boolean intersect(java.util.Vector p1)
Area
intersect in interface Areap1 - the polygon to test.Area.getPolygon()
public boolean intersect(Area a)
Area
intersect in interface Areaa - the area to test.
public boolean exactIsCrashingElements()
AreaArea.isCrashingElements() is a fast approximation of this method.
exactIsCrashingElements in interface Areapublic boolean exactIsCrashingElements(java.util.Vector v)
exactIsCrashingElements in interface Area
public boolean translate(float x,
float y)
Area
translate in interface Areax - x-coordinate of the translation vector.y - x-coordinate of the translation vector.
public boolean setRadius(float r)
public boolean setX(float x)
Area .
Returns true if the modification is done, false otherwise.Renvoie true si la modification a eu lieu, false sinon.
setX in interface Areax - the x-coordinate of the reference point.
Area.getX()public boolean setY(float y)
Area .
Returns true if the modification is done, false otherwise.Renvoie true si la modification a eu lieu, false sinon.
setY in interface Areay - the y-coordinate of the reference point.
Area.getY()
public java.util.Vector simuleTranslate(float x,
float y)
Area
simuleTranslate in interface Areax - the x-coordinate of the translation.y - the y-coordinate of the translation.
public void confirmSimuled()
Area
confirmSimuled in interface Areapublic boolean rotate(float angle)
AreaArea.getX() without going out of the Map.
Returns true if the transformation has been done, false otherwise.
rotate in interface Areaangle - the angle of the rotation ( in radian )
public boolean setAngle(float a)
Area
setAngle in interface Areaa - Sets the orientation ( in radian )
public java.util.Vector simuleRotate(float angle)
Area
simuleRotate in interface Areaangle - the angle of the simulated rotation.
public boolean rescale(float x,
float y)
AreaMap.
Returns true if the transformation has been done, false otherwise.
rescale in interface Areax - the x-factor.y - the y-factor.
public java.util.Vector simuleRescale(float xS,
float yS)
Area
simuleRescale in interface AreaxS - the x-factor of the simulated rescale.yS - the y-factor of the simulated rescale.
public boolean inMap()
Area
inMap in interface Areapublic void draw(Drawing g)
AreaArea and eventually the image of the associated element.
It gives a default method to draw elements.
draw in interface Areag - the Drawing object containing the graphics context.
public void fill(Drawing g,
java.awt.Color c)
Area
fill in interface Area
public void drawBorder(Drawing g,
java.awt.Color c)
Area
drawBorder in interface Area
public void highlight(Drawing g,
java.awt.Color c)
AreaArea. is used when it's selected in the interface.
It's better to give a transparent color in order to have something nice.
highlight in interface Areag - the Drawing object.c - the Color used to highlight.public java.lang.String[][] getProperties()
Area
getProperties in interface AreaEngine.getProperties()
public void setProperties(java.lang.String s1,
java.lang.String s2)
Area
setProperties in interface Areas1 - the property to change.s2 - the new value for the property.Engine.setProperties(java.lang.String, java.lang.String)public java.lang.Object clone()
Area
clone in interface Area
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||