|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.collisions.engine.JWorldElement
Field Summary | |
protected float |
acx
|
protected float |
acy
|
protected AreaListener |
areaListener
|
protected java.util.Hashtable |
areaTables
|
protected boolean |
collSensitive
|
protected boolean |
controllable
|
protected static float |
DEFAULT_MAX_CONSTRAINT
|
protected static float |
DEFAULT_MIN_CONSTRAINT
|
protected boolean |
doProjection
|
protected boolean |
draggable
|
protected java.util.Vector |
elementListeners
|
protected boolean |
flashing
|
protected int |
iconHeight
|
protected int |
iconWidth
|
protected int |
index
|
protected CCImageViewer |
iviewer
|
float |
mass
|
protected java.lang.String |
name
|
protected boolean |
pressedState
|
protected java.util.Vector |
propertyListeners
|
protected PassiveQTImage |
qtIcon
|
protected PassiveQTMovie |
qtMovie
|
protected java.awt.Rectangle[] |
rectsForListener
|
protected boolean |
scaleIcon
|
protected boolean |
showAcceleration
|
protected boolean |
showVelocity
|
protected boolean |
showVelocityNumber
|
float |
suggestedCollisionTime
|
protected javax.swing.ImageIcon |
swingIcon
|
protected static int |
vel_scale
|
protected float |
vx
|
protected float |
vy
|
boolean |
wasLastStepCollision
|
Constructor Summary | |
JWorldElement()
|
Method Summary | |
void |
addAreaListener(AreaListener l,
int x,
int y,
int width,
int height)
|
void |
addAreaListener(AreaListener l,
int id,
int x,
int y,
int width,
int height)
|
void |
addAreaListener(AreaListener l,
int id,
PassiveElement pe)
|
void |
addAreaListener(AreaListener l,
PassiveElement pe)
|
void |
addAreaToListen(AreaListener l,
int x,
int y,
int width,
int height)
|
void |
addAreaToListen(AreaListener l,
int id,
int x,
int y,
int width,
int height)
|
void |
addAreaToListen(AreaListener l,
int id,
PassiveElement pe)
|
void |
addAreaToListen(AreaListener l,
PassiveElement pe)
|
void |
addElementListener(ElementListener listener)
|
void |
addElemMouseListener(ElemMouseListener l)
Add a mouse listener |
void |
addNeighborX(JWorldElement element0,
JWorldElement element1)
|
void |
addNeighborY(JWorldElement element0,
JWorldElement element1)
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
applyForce(CCForce force)
Apply force to the JWorldElement. |
void |
assignIndNumber(int indNumber)
|
void |
clearConstraints()
|
void |
clearForces()
remove all applied forces |
void |
clearIcon()
sets icon to don't show |
void |
closeEverything()
|
protected void |
createDefaultCalculator()
|
CCDraggable |
findDraggable(float x,
float y)
|
float |
getAccelerationKoeff()
|
JWorldElement |
getCollidedParticle()
|
java.awt.Color |
getColor()
|
boolean |
getDoProjection()
|
float |
getDownConstraint()
|
java.awt.Color |
getFlashingColor()
|
float |
getFullEnergy()
|
float |
getFullXEnergy()
|
float |
getFullYEnergy()
|
float |
getGravityX()
|
float |
getGravityY()
|
javax.swing.ImageIcon |
getIcon()
returns the icon |
int |
getIconHeight()
gets the height of the icon to show in pixels |
int |
getIconWidth()
gets the width of the icon to show in pixels |
int |
getIndex()
|
int |
getIndNumber()
|
float |
getLeftConstraint()
|
float |
getMass()
|
java.lang.String |
getName()
|
CCForce |
getNthForce(int index)
Nth force applied to JWorldElement |
int |
getNumbAppliedForces()
number of applied forces to JWorldElement |
JWorldElement |
getOwner()
|
CCElementPositionChanger |
getPositionChanger()
|
float |
getPotentialEnergy()
|
PassiveQTImage |
getQTIcon()
returns the qt icon |
PassiveQTMovie |
getQTMovie()
returns the qt movie |
float |
getRightConstraint()
|
boolean |
getShowAcceleration()
|
boolean |
getShowVelocity()
|
float |
getTemperature()
|
float |
getUpConstraint()
|
static int |
getVelScale()
|
float |
getVx()
|
float |
getVy()
|
JPartWorld |
getWorldModel()
|
abstract float |
getX()
|
float |
getX(CCUnit unit)
|
float |
getXacceleration()
X projection of acceleration cause by applied forces |
JWorldElement[] |
getXNeighbors()
|
abstract float |
getXPotentialEnergy()
|
abstract float |
getXTemperature()
|
abstract float |
getY()
|
float |
getY(CCUnit unit)
|
float |
getYacceleration()
Y projection of acceleration cause by applied forces |
JWorldElement[] |
getYNeighbors()
|
abstract float |
getYPotentialEnergy()
|
abstract float |
getYTemperature()
|
abstract void |
initElement()
|
boolean |
isCollisionSensitive()
|
boolean |
isConstraintsWasSet()
|
boolean |
isControllable()
|
boolean |
isDraggable()
|
boolean |
isEnabled()
Determine if the JWorldElement is enabled. |
boolean |
isFlashing()
|
boolean |
isMoveable()
|
abstract boolean |
isPointInside(float px,
float py)
|
boolean |
isPointInside(java.awt.Point pt)
|
boolean |
isPressedState()
|
boolean |
isSelected()
|
boolean |
isVisible()
Determine if the JWorldElement is visible. |
void |
notifyAreaListener()
|
protected void |
notifyElementListeners(ElementEvent evt)
|
void |
notifyMouseListeners(float x,
float y,
int evtType)
|
protected void |
notifyPropertyListeners(java.beans.PropertyChangeEvent evt)
|
abstract void |
paint(java.awt.Graphics g,
java.awt.Graphics sg)
|
abstract void |
paintSelection(java.awt.Graphics g)
|
void |
paintSelection(java.awt.Graphics g,
int width,
int height)
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
rememberCurrAllAsInit()
|
abstract void |
rememberCurrPosAsInit()
|
void |
rememberCurrPropAsInit()
|
void |
rememberCurrPropAsInit(java.lang.String name)
|
abstract void |
rememberCurrVelAsInit()
|
void |
removeAreaListener(AreaListener l)
|
void |
removeAreaToListen(AreaListener l,
int x,
int y,
int width,
int height)
|
void |
removeAreaToListen(AreaListener l,
PassiveElement pe)
|
void |
removeElementListener(ElementListener listener)
|
void |
removeElemMouseListener(ElemMouseListener l)
Remove a mouse listener |
void |
removeForce(CCForce force)
Remove force applied to the JWorldElement. |
void |
removeForce(int index)
Remove Nth force applied to the JWorldElement. |
void |
removePositionChanger()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
reverseVx()
|
void |
reverseVy()
|
void |
select()
|
void |
setAnimIcon(java.lang.String url,
int width,
int height)
|
void |
setCollidedParticle(JWorldElement collidedParticle)
|
void |
setCollisionSensitive(boolean b)
|
void |
setColor(java.awt.Color color)
|
void |
setColor(int r,
int g,
int b)
|
void |
setConstraints(float xLeft,
float yUp,
float xRight,
float yDown)
|
void |
setControllable(boolean controllable)
|
void |
setDoProjection(boolean b)
|
void |
setDraggable(boolean draggable)
|
void |
setEnabled(boolean enabled)
Set the enabled state of the JWorldElement. |
void |
setFlashing(boolean flashing)
|
void |
setForceCalculator(CCForceCalculator forceCalculator)
|
abstract void |
setGeometry(java.lang.Object object)
|
void |
setIcon(javax.swing.ImageIcon icon,
int width,
int height)
sets icon to show, specifying width and height in pixels |
void |
setIcon(java.lang.String url,
int width,
int height)
sets icon to show, specifying width and height in pixels |
void |
setIcon(java.lang.String url,
int width,
int height,
boolean scale)
sets icon to show, specifying width and height in pixels |
void |
setIconSize(int width,
int height,
boolean scale)
sets the size of the icon to show, specifying width and height in pixels |
void |
setIndex(int index)
|
void |
setMass(float newMass)
|
void |
setName(java.lang.String name)
set name's property |
void |
setOwner(JWorldElement owner)
|
void |
setPositionChanger(CCElementPositionChanger positionChanger)
|
void |
setPressedState(boolean pressedState)
|
void |
setProperty(java.lang.String name,
java.lang.Object val)
|
void |
setQTIcon(PassiveQTImage qtIcon)
|
void |
setQTIcon(java.lang.String url)
|
void |
setQTMovie(PassiveQTMovie qtMovie)
|
void |
setShowAcceleration(boolean b)
|
void |
setShowVelocity(boolean b)
|
void |
setVisible(boolean visible)
Set the visible state of the JWorldElement. |
void |
setVx(float vx)
set element's velocity |
void |
setVy(float vy)
|
void |
setWorldModel(JPartWorld world)
|
void |
setXConstraints(float xLeft,
float xRight)
|
void |
setYConstraints(float yUp,
float yDown)
|
void |
unselect()
|
boolean |
wasCollision()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.concord.collisions.ui.CCDraggable |
doDrag, endDrag, getDraggableOwner, getDragMode, panelInfoSupport, setDragMode, setInfoDrawer, startDrag |
Methods inherited from interface org.concord.collisions.engine.CCMassive |
getCMPointX, getCMPointY, setCMPointX, setCMPointY |
Field Detail |
public float mass
protected java.lang.String name
public float suggestedCollisionTime
public boolean wasLastStepCollision
protected int index
protected float vx
protected float vy
protected float acx
protected float acy
protected java.util.Hashtable areaTables
protected static final float DEFAULT_MIN_CONSTRAINT
protected static final float DEFAULT_MAX_CONSTRAINT
protected boolean controllable
protected boolean showVelocity
protected boolean doProjection
protected boolean showAcceleration
protected boolean showVelocityNumber
protected boolean draggable
protected boolean collSensitive
protected boolean flashing
protected AreaListener areaListener
protected java.awt.Rectangle[] rectsForListener
protected java.util.Vector propertyListeners
protected java.util.Vector elementListeners
protected static int vel_scale
protected boolean pressedState
protected javax.swing.ImageIcon swingIcon
protected PassiveQTImage qtIcon
protected PassiveQTMovie qtMovie
protected int iconWidth
protected int iconHeight
protected boolean scaleIcon
protected CCImageViewer iviewer
Constructor Detail |
public JWorldElement()
Method Detail |
public static int getVelScale()
public void closeEverything()
public void addElementListener(ElementListener listener)
public void removeElementListener(ElementListener listener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void addAreaListener(AreaListener l, int id, int x, int y, int width, int height)
public void addAreaListener(AreaListener l, int x, int y, int width, int height)
public void addAreaListener(AreaListener l, int id, PassiveElement pe)
public void addAreaListener(AreaListener l, PassiveElement pe)
public void addAreaToListen(AreaListener l, int id, PassiveElement pe)
public void addAreaToListen(AreaListener l, PassiveElement pe)
public void addAreaToListen(AreaListener l, int x, int y, int width, int height)
public void addAreaToListen(AreaListener l, int id, int x, int y, int width, int height)
public void removeAreaToListen(AreaListener l, PassiveElement pe)
public void removeAreaToListen(AreaListener l, int x, int y, int width, int height)
public void removeAreaListener(AreaListener l)
public void setControllable(boolean controllable)
public boolean isControllable()
public void setFlashing(boolean flashing)
public boolean isFlashing()
public void setDraggable(boolean draggable)
setDraggable
in interface CCDraggable
public boolean isDraggable()
isDraggable
in interface CCDraggable
public boolean isCollisionSensitive()
public void setCollisionSensitive(boolean b)
public abstract void setGeometry(java.lang.Object object) throws java.lang.Exception
public abstract void paint(java.awt.Graphics g, java.awt.Graphics sg)
public void setWorldModel(JPartWorld world)
public JPartWorld getWorldModel()
public void assignIndNumber(int indNumber)
public int getIndNumber()
public void setCollidedParticle(JWorldElement collidedParticle)
public boolean wasCollision()
public JWorldElement getCollidedParticle()
public float getMass()
getMass
in interface CCMassive
public void setMass(float newMass) throws java.beans.PropertyVetoException
public java.lang.String getName()
public void setName(java.lang.String name)
name
- propertypublic void setColor(java.awt.Color color)
public void setColor(int r, int g, int b)
public java.awt.Color getColor()
public java.awt.Color getFlashingColor()
public void setVx(float vx)
public void reverseVx()
protected void notifyElementListeners(ElementEvent evt)
protected void notifyPropertyListeners(java.beans.PropertyChangeEvent evt)
public float getVx()
public void setVy(float vy)
public void reverseVy()
public float getVy()
public abstract float getX()
public abstract float getY()
public float getX(CCUnit unit)
public float getY(CCUnit unit)
public void setConstraints(float xLeft, float yUp, float xRight, float yDown)
public void setYConstraints(float yUp, float yDown)
public void setXConstraints(float xLeft, float xRight)
public void clearConstraints()
public boolean isConstraintsWasSet()
public float getLeftConstraint()
public float getUpConstraint()
public float getRightConstraint()
public float getDownConstraint()
public void setProperty(java.lang.String name, java.lang.Object val)
public boolean isMoveable()
public float getTemperature()
public abstract float getXTemperature()
public abstract float getYTemperature()
public float getPotentialEnergy()
public abstract float getXPotentialEnergy()
public abstract float getYPotentialEnergy()
public float getFullEnergy()
public float getFullXEnergy()
public float getFullYEnergy()
public void notifyAreaListener()
public boolean getShowVelocity()
public void setShowVelocity(boolean b)
public boolean getDoProjection()
public void setDoProjection(boolean b)
public boolean getShowAcceleration()
public void setShowAcceleration(boolean b)
public void setPressedState(boolean pressedState)
setPressedState
in interface CCDraggable
public boolean isPressedState()
isPressedState
in interface CCDraggable
public float getGravityX()
public float getGravityY()
public float getAccelerationKoeff()
public JWorldElement getOwner()
public void setOwner(JWorldElement owner)
public boolean isVisible()
public void setVisible(boolean visible)
visible
- if true, shows this object; otherwise, hides itpublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- if false, this object will be ignored by JPartWorld;public void clearForces()
public void applyForce(CCForce force)
new
- force to apply to JWorldElementpublic void removeForce(CCForce force)
force
- to remove from forces applied to JWorldElementpublic void removeForce(int index)
index
- of force to remove from forces applied to JWorldElementpublic int getNumbAppliedForces()
public CCForce getNthForce(int index)
index
- of force applied to JWorldElementpublic float getXacceleration()
public float getYacceleration()
protected void createDefaultCalculator()
public void setForceCalculator(CCForceCalculator forceCalculator)
public void addNeighborX(JWorldElement element0, JWorldElement element1)
public void addNeighborY(JWorldElement element0, JWorldElement element1)
public JWorldElement[] getXNeighbors()
public JWorldElement[] getYNeighbors()
public void setPositionChanger(CCElementPositionChanger positionChanger)
public CCElementPositionChanger getPositionChanger()
public void removePositionChanger()
public abstract void initElement()
public abstract void rememberCurrPosAsInit()
public abstract void rememberCurrVelAsInit()
public void rememberCurrPropAsInit()
public void rememberCurrPropAsInit(java.lang.String name)
public void rememberCurrAllAsInit()
public int getIndex()
public void setIndex(int index)
public void setQTMovie(PassiveQTMovie qtMovie)
public void setQTIcon(PassiveQTImage qtIcon)
public void setQTIcon(java.lang.String url)
public void setIcon(javax.swing.ImageIcon icon, int width, int height)
icon
- swing icon already createdpublic void setIcon(java.lang.String url, int width, int height)
url
- url of the icon filewidth
- width of the icon in pixelsheight
- height of the icon in pixelsscale
- indicates whether the icon will be scaled if the atom changes sizepublic void setIcon(java.lang.String url, int width, int height, boolean scale)
url
- url of the icon filewidth
- width of the icon in pixelsheight
- height of the icon in pixelsscale
- indicates whether the icon will be scaled if the atom changes sizepublic void setAnimIcon(java.lang.String url, int width, int height)
public void setIconSize(int width, int height, boolean scale)
width
- width of the icon in pixelsheight
- height of the icon in pixelsscale
- indicates whether the icon will be scaled if the atom changes sizepublic void clearIcon()
public javax.swing.ImageIcon getIcon()
public int getIconHeight()
public int getIconWidth()
public PassiveQTImage getQTIcon()
public PassiveQTMovie getQTMovie()
public boolean isPointInside(java.awt.Point pt)
public abstract boolean isPointInside(float px, float py)
public void notifyMouseListeners(float x, float y, int evtType)
notifyMouseListeners
in interface CCDraggable
public void addElemMouseListener(ElemMouseListener l)
l
- mouse listener to addpublic void removeElemMouseListener(ElemMouseListener l)
l
- mouse listener to removepublic boolean isSelected()
public void select()
public void unselect()
public abstract void paintSelection(java.awt.Graphics g)
public void paintSelection(java.awt.Graphics g, int width, int height)
public CCDraggable findDraggable(float x, float y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |