|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.collisions.engine.JWorldElement | +--org.concord.collisions.engine.JWall
one of implementation of JWorldElement abstract class
Field Summary | |
static float |
DEFAULT_MASS
|
static float |
DEFAULT_THICKNESS
|
protected int |
dragMode
|
boolean |
faceCollision
is true if collision with the wall occures from the face |
int |
halfThickness
wall's thickness/2 default value is 5 |
static boolean |
HORIZONTAL_WALL
|
float |
thickness
wall's thickness. |
static boolean |
VERTICAL_WALL
|
static int |
WALL_MODE_FREE
|
static int |
WALL_MODE_HORIZONTAL
|
static int |
WALL_MODE_VERTICAL
|
static int |
WALL_TEMP_CONST
|
static int |
WALL_TEMP_NONE
|
int |
wallMode
|
float |
x1
x coordinate of first wall's side |
float |
x2
x coordinate of second wall's side |
float |
y1
y coordinate of first wall's side |
float |
y2
y coordinate of second wall's side |
Fields inherited from class org.concord.collisions.engine.JWorldElement |
acx, acy, areaListener, areaTables, collSensitive, controllable, DEFAULT_MAX_CONSTRAINT, DEFAULT_MIN_CONSTRAINT, doProjection, draggable, elementListeners, flashing, iconHeight, iconWidth, index, iviewer, mass, name, pressedState, propertyListeners, qtIcon, qtMovie, rectsForListener, scaleIcon, showAcceleration, showVelocity, showVelocityNumber, suggestedCollisionTime, swingIcon, vel_scale, vx, vy, wasLastStepCollision |
Constructor Summary | |
JWall()
|
Method Summary | |
void |
applyForce(CCForce force)
JWall doesn't support applying forces |
float |
calcEnergyKoeff(float atomTemperature)
|
static JWall |
createSlopedWall(float wx,
float wy,
float length,
float angle,
float wt)
factory method |
static JWall |
createWall(float wx0,
float wy0,
float length,
float wt,
boolean isVertical)
factory method |
static JWall |
createWall(float wx1,
float wy1,
float wx2,
float wy2,
float wt)
factory method |
static JWall |
createWall(GUIPanel panel,
float wx0,
float wy0,
float length,
float wt,
boolean isVertical)
factory method |
static JWall |
createWall(GUIPanel panel,
float wx1,
float wy1,
float wx2,
float wy2,
float wt)
factory method |
void |
doDrag(CCCoordinateTuner tuner,
int x,
int y)
|
void |
down(float delta,
float constrain,
javax.swing.JComponent c)
shift wall down |
void |
endDrag(CCCoordinateTuner tuner,
int x,
int y)
|
float |
getCMPointX()
calculates X coordinate of center of mass |
float |
getCMPointY()
calculates Y coordinate of center of mass |
java.awt.Color |
getColor()
|
float |
getCosA()
|
static float |
getDefaultHeatConductKoeff()
|
static float |
getDefaultThickness()
retrieves default thickness |
float |
getDownConstraint()
|
java.lang.Object |
getDraggableOwner()
|
int |
getDragMode()
|
static int |
getHalfThickness(float t)
|
float |
getHeatConductKoeff()
|
float |
getLeftConstraint()
|
float |
getRightConstraint()
|
float |
getSinA()
|
float |
getTemperature()
|
float |
getThickness()
|
float |
getUpConstraint()
|
int |
getWallTemperatureMode()
|
float |
getX()
|
float |
getXPotentialEnergy()
|
float |
getXTemperature()
|
float |
getY()
|
float |
getYPotentialEnergy()
|
float |
getYTemperature()
|
void |
initElement()
|
boolean |
isMoveable()
|
boolean |
isPointInside(float x,
float y)
|
boolean |
isPointOnTheWall(float x,
float y)
check whether or not point with coordinates x,y belong to wall |
boolean |
isWallHorizontal()
|
boolean |
isWallVertical()
|
void |
left(float delta,
float constrain,
javax.swing.JComponent c)
shift wall left |
void |
paint(java.awt.Graphics g,
java.awt.Graphics sg)
|
void |
paintSelection(java.awt.Graphics g)
|
boolean |
panelInfoSupport()
|
void |
rememberCurrPosAsInit()
|
void |
rememberCurrVelAsInit()
|
void |
right(float delta,
float constrain,
javax.swing.JComponent c)
shift wall right |
void |
setCMPointX(float x)
set X coordinate of center of mass |
void |
setCMPointY(float y)
set Y coordinate of center of mass |
void |
setConstraints(float xLeft,
float yUp,
float xRight,
float yDown)
setting wall's constraints |
void |
setDragMode(int dragMode)
|
void |
setGeometry(float x1,
float y1,
float x2,
float y2)
set geometry's parameters for the wall with default thickness |
void |
setGeometry(float x1,
float y1,
float x2,
float y2,
float thickness)
set geometry's parameters for the wall |
void |
setGeometry(GUIPanel panel,
float x1,
float y1,
float x2,
float y2)
set geometry's parameters for the wall with default thickness |
void |
setGeometry(GUIPanel panel,
float x1,
float y1,
float x2,
float y2,
float thickness)
set geometry's parameters for the wall |
void |
setGeometry(java.lang.Object object)
|
void |
setHeatConductKoeff(float koeff)
set heat conducting koeff. |
void |
setInfoDrawer(CCInfoDrawer infoDrawer)
|
void |
setMoveable(boolean moveable)
set moveable property |
void |
setThickness(float thickness)
|
void |
setWallTemperature(float temperature)
set wall's "temperature" |
void |
setWallTemperatureMode(int wallTemperatureMode)
|
void |
setXConstraints(float xLeft,
float xRight)
setting horizontal wall's constraints |
void |
setYConstraints(float yUp,
float yDown)
setting vertical wall's constraints |
void |
startDrag(int x,
int y)
|
void |
up(float delta,
float constrain,
javax.swing.JComponent c)
shift wall up |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WALL_MODE_HORIZONTAL
public static final int WALL_MODE_VERTICAL
public static final int WALL_MODE_FREE
public int wallMode
public float x1
public float y1
public float x2
public float y2
public float thickness
public int halfThickness
public static final boolean VERTICAL_WALL
public static final boolean HORIZONTAL_WALL
public static final float DEFAULT_MASS
public static final float DEFAULT_THICKNESS
protected int dragMode
public boolean faceCollision
public static final int WALL_TEMP_NONE
public static final int WALL_TEMP_CONST
Constructor Detail |
public JWall()
Method Detail |
public void initElement()
initElement
in class JWorldElement
public void rememberCurrPosAsInit()
rememberCurrPosAsInit
in class JWorldElement
public void rememberCurrVelAsInit()
rememberCurrVelAsInit
in class JWorldElement
public float getCosA()
public float getSinA()
public static JWall createWall(float wx0, float wy0, float length, float wt, boolean isVertical)
wx0
- x coordinate of first wall's sidewy0
- y coordinate of first wall's sidelength0
- walls lengthwt
- walls thicknessisVertical
- if true
wall will be verticalpublic static JWall createWall(float wx1, float wy1, float wx2, float wy2, float wt)
wx1
- x coordinate of first wall's sidewy1
- y coordinate of first wall's sidewx2
- x coordinate of second wall's sidewy2
- y coordinate of second wall's sidewt
- walls thicknesspublic static JWall createSlopedWall(float wx, float wy, float length, float angle, float wt)
wx
- x coordinate of first wall's sidewy
- y coordinate of first wall's sidelength
- walls lengthangle
- wall's slope (degree) , should be more/equal than 0 and less/equal than 180wt
- walls thicknesspublic static JWall createWall(GUIPanel panel, float wx0, float wy0, float length, float wt, boolean isVertical)
wx0
- x coordinate of first wall's sidewy0
- y coordinate of first wall's sidelength0
- walls lengthwt
- walls thicknessisVertical
- if true
wall will be verticalpublic static JWall createWall(GUIPanel panel, float wx1, float wy1, float wx2, float wy2, float wt)
wx1
- x coordinate of first wall's sidewy1
- y coordinate of first wall's sidewx2
- x coordinate of second wall's sidewy2
- y coordinate of second wall's sidewt
- walls thicknesspublic void setGeometry(java.lang.Object object) throws java.lang.Exception
setGeometry
in class JWorldElement
public static int getHalfThickness(float t)
public void setGeometry(GUIPanel panel, float x1, float y1, float x2, float y2, float thickness) throws java.lang.Exception
x1
- x coordinate of first wall's sidey1
- y coordinate of first wall's sidex2
- x coordinate of second wall's sidey2
- y coordinate of second wall's sidethickness
- walls thicknesspublic void setGeometry(float x1, float y1, float x2, float y2, float thickness) throws java.lang.Exception
x1
- x coordinate of first wall's sidey1
- y coordinate of first wall's sidex2
- x coordinate of second wall's sidey2
- y coordinate of second wall's sidethickness
- walls thicknesspublic void setGeometry(float x1, float y1, float x2, float y2) throws java.lang.Exception
x1
- x coordinate of first wall's sidey1
- y coordinate of first wall's sidex2
- x coordinate of second wall's sidey2
- y coordinate of second wall's sidepublic void setGeometry(GUIPanel panel, float x1, float y1, float x2, float y2) throws java.lang.Exception
x1
- x coordinate of first wall's sidey1
- y coordinate of first wall's sidex2
- x coordinate of second wall's sidey2
- y coordinate of second wall's sidepublic java.awt.Color getColor()
getColor
in class JWorldElement
public void paintSelection(java.awt.Graphics g)
paintSelection
in class JWorldElement
public void paint(java.awt.Graphics g, java.awt.Graphics sg)
paint
in class JWorldElement
public static float getDefaultThickness()
public void up(float delta, float constrain, javax.swing.JComponent c)
delta
- distance to be shifted in up directionconstrain
- up constrainc
- component to be upfdated. could be null
public void down(float delta, float constrain, javax.swing.JComponent c)
delta
- distance to be shifted in down directionconstrain
- down constrainc
- component to be upfdated. could be null
public void left(float delta, float constrain, javax.swing.JComponent c)
delta
- distance to be shifted in left directionconstrain
- left constrainc
- component to be upfdated. could be null
public void right(float delta, float constrain, javax.swing.JComponent c)
delta
- distance to be shifted in right directionconstrain
- right constrainc
- component to be upfdated. could be null
public void setMoveable(boolean moveable)
moveable
- if(code>false wall couldn't be moved for any internal reason (collision)
you still can shift the wall via down,up,left,right methodspublic boolean isMoveable()
isMoveable
in class JWorldElement
public boolean isWallVertical()
public boolean isWallHorizontal()
public void setConstraints(float xLeft, float yUp, float xRight, float yDown)
setConstraints
in class JWorldElement
xLeft
- left constrainyUp
- up constrainxRight
- right constrainyDown
- bottom constrainpublic void setYConstraints(float yUp, float yDown)
setYConstraints
in class JWorldElement
yUp
- up constrainyDown
- bottom constrainpublic void setXConstraints(float xLeft, float xRight)
setXConstraints
in class JWorldElement
xLeft
- left constrainxRight
- right constrainpublic float getLeftConstraint()
getLeftConstraint
in class JWorldElement
public float getUpConstraint()
getUpConstraint
in class JWorldElement
public float getRightConstraint()
getRightConstraint
in class JWorldElement
public float getDownConstraint()
getDownConstraint
in class JWorldElement
public void setWallTemperature(float temperature)
desired
- wall's "temperature"public float getTemperature()
getTemperature
in class JWorldElement
public float getXTemperature()
getXTemperature
in class JWorldElement
public float getYTemperature()
getYTemperature
in class JWorldElement
public float getXPotentialEnergy()
getXPotentialEnergy
in class JWorldElement
public float getYPotentialEnergy()
getYPotentialEnergy
in class JWorldElement
public void setWallTemperatureMode(int wallTemperatureMode)
public int getWallTemperatureMode()
public static float getDefaultHeatConductKoeff()
public float getHeatConductKoeff()
public void setHeatConductKoeff(float koeff)
koeff
- desired heat conducting koeff. parameter less than 0 or more than 1 default value will be assignedpublic float calcEnergyKoeff(float atomTemperature)
public float getX()
getX
in class JWorldElement
public float getY()
getY
in class JWorldElement
public float getCMPointX()
public float getCMPointY()
public void setCMPointX(float x) throws CCUnimplOperationException
CCMassive
org.concord.collisions.engine.CCMassive
x
- desired X coordinate of center of masspublic void setCMPointY(float y) throws CCUnimplOperationException
CCMassive
org.concord.collisions.engine.CCMassive
y
- desired Y coordinate of center of masspublic void applyForce(CCForce force)
applyForce
in class JWorldElement
CCUnsuppOperationException
- public boolean isPointOnTheWall(float x, float y)
x
- point's x coordinatey
- point's y coordinatepublic boolean isPointInside(float x, float y)
isPointInside
in class JWorldElement
public void startDrag(int x, int y)
public void doDrag(CCCoordinateTuner tuner, int x, int y)
public void endDrag(CCCoordinateTuner tuner, int x, int y)
public java.lang.Object getDraggableOwner()
public boolean panelInfoSupport()
public void setInfoDrawer(CCInfoDrawer infoDrawer)
public int getDragMode()
public void setDragMode(int dragMode)
public float getThickness()
public void setThickness(float thickness)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |