|
|||||||||
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.JAtom
one of implementation of JWorldElement abstract class
Inner Class Summary | |
static class |
JAtom.AtomDraggable
|
static class |
JAtom.VelocityDraggable
|
Field Summary | |
static float |
DEFAULT_MASS
|
static float |
DEFAULT_RADIUS
|
protected boolean |
drawAllVelocityComponents
|
protected boolean |
drawOnlyFrame
|
boolean |
flashState
creates instance of the JAtom class with default mass and default radius |
protected float |
r
|
protected java.awt.Color |
traceColor
|
protected java.awt.Color |
velColor
|
protected int |
widthr
|
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 | |
JAtom()
|
Method Summary | |
void |
addNeighborX(JWorldElement element0,
JWorldElement element1)
|
void |
addNeighborY(JWorldElement element0,
JWorldElement element1)
|
void |
calculateAcceleration()
|
void |
clearTrace()
clears trace |
void |
correctV(float dt)
|
static JAtom |
createAtom(float ax,
float ay,
float avx,
float avy)
factory method (default radius and mass). |
static JAtom |
createAtom(float ax,
float ay,
float ar,
float avx,
float avy)
factory method (default mass). |
static JAtom |
createAtom(GUIPanel panel,
float ax,
float ay,
float avx,
float avy)
factory method (default radius and mass). |
static JAtom |
createAtom(GUIPanel panel,
float ax,
float ay,
float ar,
float avx,
float avy)
factory method (default mass). |
static JAtom |
createMotionlessAtom(float ax,
float ay)
factory method (default mass). |
static JAtom |
createMotionlessAtom(float ax,
float ay,
float r)
factory method (default mass). |
void |
doDrag(CCCoordinateTuner tuner,
int x,
int y)
|
protected void |
emptyTrace()
|
void |
endDrag(CCCoordinateTuner tuner,
int x,
int y)
|
CCDraggable |
getAtomDraggable(int dragMode)
|
float |
getCMPointX()
calculates X coordinate of center of mass |
float |
getCMPointY()
calculates Y coordinate of center of mass |
java.awt.Color |
getColor()
|
java.lang.Object |
getDraggableOwner()
|
int |
getDragMode()
|
boolean |
getDrawAllVelocityComponents()
|
boolean |
getDrawOnlyFrame()
|
CCDraggable |
getForceDraggable(float x,
float y)
|
int |
getNumbDrawTracePoints()
|
int |
getNumbSkipTracePoints()
|
float |
getR()
|
java.awt.Color |
getTraceColor()
|
java.awt.Color |
getVelColor()
|
CCDraggable |
getVelocityDraggable(char whichVelocity)
|
int |
getVelXArrowEnd()
|
int |
getVelYArrowEnd()
|
float |
getX()
|
JWorldElement[] |
getXNeighbors()
|
float |
getXPotentialEnergy()
|
float |
getXTemperature()
|
float |
getY()
|
JWorldElement[] |
getYNeighbors()
|
float |
getYPotentialEnergy()
|
float |
getYTemperature()
|
void |
initElement()
|
boolean |
isDoTrace()
|
boolean |
isPointInside(float px,
float py)
|
void |
notifyAreaListener()
|
void |
paint(java.awt.Graphics g,
java.awt.Graphics sg)
|
void |
paintAtom(java.awt.Graphics g,
java.awt.Graphics sg)
|
void |
paintForces(java.awt.Graphics g)
|
void |
paintSelection(java.awt.Graphics g)
|
void |
paintTrace(java.awt.Graphics g)
|
boolean |
panelInfoSupport()
|
void |
rememberCurrPosAsInit()
|
void |
rememberCurrVelAsInit()
|
void |
setAnimIcon(java.lang.String url)
|
void |
setCMPointX(float x)
set X coordinate of center of mass |
void |
setCMPointY(float y)
set Y coordinate of center of mass |
void |
setCoord(float x,
float y)
set atom's coordinates |
void |
setDoTrace(boolean dotrace)
|
void |
setDragMode(int m)
|
void |
setDrawAllVelocityComponents(boolean drawAllVelocityComponents)
|
void |
setDrawOnlyFrame(boolean drawOnlyFrame)
|
void |
setGeometry(float x,
float y,
float r)
set geometry's parameters |
void |
setGeometry(GUIPanel panel,
float x,
float y,
float r)
set geometry's parameters |
void |
setGeometry(java.lang.Object object)
|
void |
setIcon(java.lang.String url)
sets icon to show by default the icon is as big as the atom and scales with it!!! |
void |
setInfoDrawer(CCInfoDrawer infoDrawer)
|
void |
setNumbDrawTracePoints(int numbDrawTracePoints)
|
void |
setNumbSkipTracePoints(int numbSkipTracePoints)
|
void |
setProperty(java.lang.String name,
java.lang.Object val)
set propertie's value |
void |
setR(float r)
|
void |
setTraceColor(java.awt.Color traceColor)
set trace's color |
void |
setTraceProperties(int traceLength)
|
void |
setTraceProperties(int traceLength,
int drawPoints,
int skipPoints)
|
void |
setVelColor(java.awt.Color velColor)
set color for velocity's arrows |
void |
setVx(float vx)
set element's velocity |
void |
setVy(float vy)
|
void |
shift(float dt)
shift atom |
void |
shiftV(float dt)
|
void |
startDrag(int x,
int y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected float r
protected int widthr
public static final float DEFAULT_MASS
public static final float DEFAULT_RADIUS
protected java.awt.Color velColor
protected java.awt.Color traceColor
protected boolean drawOnlyFrame
protected boolean drawAllVelocityComponents
public boolean flashState
Constructor Detail |
public JAtom()
Method Detail |
public void initElement()
initElement
in class JWorldElement
public void rememberCurrPosAsInit()
rememberCurrPosAsInit
in class JWorldElement
public void rememberCurrVelAsInit()
rememberCurrVelAsInit
in class JWorldElement
public static JAtom createAtom(float ax, float ay, float avx, float avy)
ax
- atom's x coordinateay
- atom's y coordinateavx
- atom's horizontal velocityavy
- atom's vertical velocitypublic static JAtom createAtom(float ax, float ay, float ar, float avx, float avy)
ax
- atom's x coordinateay
- atom's y coordinater
- atom's radius (minimum 1)avx
- atom's horizontal velocityavy
- atom's vertical velocitypublic static JAtom createAtom(GUIPanel panel, float ax, float ay, float avx, float avy)
ax
- atom's x coordinateay
- atom's y coordinateavx
- atom's horizontal velocityavy
- atom's vertical velocitypublic static JAtom createAtom(GUIPanel panel, float ax, float ay, float ar, float avx, float avy)
ax
- atom's x coordinateay
- atom's y coordinater
- atom's radius (minimum 1)avx
- atom's horizontal velocityavy
- atom's vertical velocitypublic static JAtom createMotionlessAtom(float ax, float ay)
ax
- atom's x coordinateay
- atom's y coordinatepublic static JAtom createMotionlessAtom(float ax, float ay, float r)
ax
- atom's x coordinateay
- atom's y coordinater
- atom's radius (minimum 1)public void setGeometry(java.lang.Object object) throws java.lang.Exception
setGeometry
in class JWorldElement
public void setGeometry(float x, float y, float r) throws java.lang.Exception
x
- atom's x coordinatey
- atom's y coordinater
- atom's radius (minimum 1)public void setGeometry(GUIPanel panel, float x, float y, float r) throws java.lang.Exception
x
- atom's x coordinatey
- atom's y coordinater
- atom's radius (minimum 1)public void paint(java.awt.Graphics g, java.awt.Graphics sg)
paint
in class JWorldElement
public void paintForces(java.awt.Graphics g)
public void paintTrace(java.awt.Graphics g)
public java.awt.Color getColor()
getColor
in class JWorldElement
public int getVelXArrowEnd()
public int getVelYArrowEnd()
public boolean getDrawOnlyFrame()
public void setDrawOnlyFrame(boolean drawOnlyFrame)
public boolean getDrawAllVelocityComponents()
public void setDrawAllVelocityComponents(boolean drawAllVelocityComponents)
public void paintSelection(java.awt.Graphics g)
paintSelection
in class JWorldElement
public void paintAtom(java.awt.Graphics g, java.awt.Graphics sg)
public java.awt.Color getVelColor()
public void setVelColor(java.awt.Color velColor)
color
- to be setpublic java.awt.Color getTraceColor()
public void setTraceColor(java.awt.Color traceColor)
color
- to be setpublic void setProperty(java.lang.String name, java.lang.Object val)
setProperty
in class JWorldElement
property
- propertie's name
currently supported:val
- for color and velcolor property it should be java.awt.Color instanceColor
,
Boolean
public boolean isDoTrace()
public void setDoTrace(boolean dotrace)
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 float getR()
public void setR(float r)
public void setVx(float vx)
JWorldElement
setVx
in class JWorldElement
public void setVy(float vy)
setVy
in class JWorldElement
public void setIcon(java.lang.String url)
url
- url of the icon filepublic void setAnimIcon(java.lang.String url)
public void setCoord(float x, float y)
x
- atom's x coordinatey
- atom's y coordinatepublic void shift(float dt)
dx
- atom's delta xdy
- atom's delta ypublic void calculateAcceleration()
public void shiftV(float dt)
public void correctV(float dt)
protected void emptyTrace()
public void setTraceProperties(int traceLength, int drawPoints, int skipPoints)
public void setTraceProperties(int traceLength)
public void clearTrace()
GUIPanel.setTracePossible(boolean)
public float getXPotentialEnergy()
getXPotentialEnergy
in class JWorldElement
public float getYPotentialEnergy()
getYPotentialEnergy
in class JWorldElement
public float getXTemperature()
getXTemperature
in class JWorldElement
public float getYTemperature()
getYTemperature
in class JWorldElement
public void notifyAreaListener()
notifyAreaListener
in class JWorldElement
public java.lang.Object getDraggableOwner()
public boolean panelInfoSupport()
public void setInfoDrawer(CCInfoDrawer infoDrawer)
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 CCDraggable getVelocityDraggable(char whichVelocity)
public CCDraggable getAtomDraggable(int dragMode)
public CCDraggable getForceDraggable(float x, float y)
public JWorldElement[] getXNeighbors()
getXNeighbors
in class JWorldElement
public JWorldElement[] getYNeighbors()
getYNeighbors
in class JWorldElement
public void addNeighborX(JWorldElement element0, JWorldElement element1)
addNeighborX
in class JWorldElement
public void addNeighborY(JWorldElement element0, JWorldElement element1)
addNeighborY
in class JWorldElement
public boolean isPointInside(float px, float py)
isPointInside
in class JWorldElement
public int getNumbDrawTracePoints()
public void setNumbDrawTracePoints(int numbDrawTracePoints)
public int getNumbSkipTracePoints()
public void setNumbSkipTracePoints(int numbSkipTracePoints)
public int getDragMode()
public void setDragMode(int m)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |