org.concord.collisions.engine
Class CCConstantForce

java.lang.Object
  |
  +--org.concord.collisions.engine.CCForce
        |
        +--org.concord.collisions.engine.CCConstantForce
Direct Known Subclasses:
CCImpulseForce

public class CCConstantForce
extends CCForce


Field Summary
static int DRAW_MODE_ARROW
           
static int DRAW_MODE_FLAME
           
static int DRAW_MODE_ROCKET
           
static int DRAW_MODE_SIMPLE
           
protected  int drawMode
           
protected  int iconHeight
           
protected  int iconWidth
           
protected  boolean pressedState
           
protected  PassiveQTImage qtIcon
           
protected  PassiveQTMovie qtMovie
           
protected  javax.swing.ImageIcon swingIcon
           
 
Fields inherited from class org.concord.collisions.engine.CCForce
color
 
Constructor Summary
CCConstantForce(CCConstantForce ff)
           
CCConstantForce(float projectionX, float projectionY)
           
 
Method Summary
 void clearIcon()
          sets icon to don't show
 void doDrag(CCCoordinateTuner tuner, int x, int y, JWorldElement element)
           
 void endDrag(CCCoordinateTuner tuner, int x, int y, JWorldElement element)
           
 int getDragMode()
           
 int getDrawMode()
           
 float getDrawProjection(float f)
           
 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
 float getMagnitude()
           
 float getProjectionX()
           
 float getProjectionX(JWorldElement element)
           
 float getProjectionY()
           
 float getProjectionY(JWorldElement element)
           
 PassiveQTImage getQTIcon()
          returns the qt icon
 PassiveQTMovie getQTMovie()
          returns the qt movie
 float getRealProjection(float f)
           
 boolean isActive()
           
 boolean isPointInside(float px, float py, JWorldElement element)
           
 boolean isPressedState()
           
 void paint(java.awt.Graphics g, JWorldElement element)
           
 void setDraggingConstantDirection(float x, float y)
           
 void setDragMode(int dragMode)
           
 void setDrawMode(int m)
           
 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 setIconSize(int width, int height)
          sets the size of the icon to show, specifying width and height in pixels
 void setMagnitude(float m)
           
 void setPressedState(boolean pressedState)
           
 void setProjectionX(float projectionX)
           
 void setProjectionY(float projectionY)
           
 void setQTIcon(PassiveQTImage qtIcon)
           
 void setQTIcon(java.lang.String url)
           
 void setQTMovie(PassiveQTMovie qtMovie)
           
 void startDrag(int x, int y)
           
 
Methods inherited from class org.concord.collisions.engine.CCForce
activate, deactivate, getColor, getProjections, getWorldModel, isVisible, setColor, setVisible, setWorldModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRAW_MODE_SIMPLE

public static final int DRAW_MODE_SIMPLE

DRAW_MODE_FLAME

public static final int DRAW_MODE_FLAME

DRAW_MODE_ROCKET

public static final int DRAW_MODE_ROCKET

DRAW_MODE_ARROW

public static final int DRAW_MODE_ARROW

drawMode

protected int drawMode

pressedState

protected boolean pressedState

swingIcon

protected javax.swing.ImageIcon swingIcon

qtIcon

protected PassiveQTImage qtIcon

qtMovie

protected PassiveQTMovie qtMovie

iconWidth

protected int iconWidth

iconHeight

protected int iconHeight
Constructor Detail

CCConstantForce

public CCConstantForce(float projectionX,
                       float projectionY)

CCConstantForce

public CCConstantForce(CCConstantForce ff)
Method Detail

getProjectionX

public float getProjectionX()

getProjectionY

public float getProjectionY()

getProjectionX

public float getProjectionX(JWorldElement element)
Overrides:
getProjectionX in class CCForce

getProjectionY

public float getProjectionY(JWorldElement element)
Overrides:
getProjectionY in class CCForce

setProjectionX

public void setProjectionX(float projectionX)

setProjectionY

public void setProjectionY(float projectionY)

getMagnitude

public float getMagnitude()

setMagnitude

public void setMagnitude(float m)

isActive

public boolean isActive()

paint

public void paint(java.awt.Graphics g,
                  JWorldElement element)
Overrides:
paint in class CCForce

isPointInside

public boolean isPointInside(float px,
                             float py,
                             JWorldElement element)

setDrawMode

public void setDrawMode(int m)

getDrawMode

public int getDrawMode()

startDrag

public void startDrag(int x,
                      int y)

doDrag

public void doDrag(CCCoordinateTuner tuner,
                   int x,
                   int y,
                   JWorldElement element)

endDrag

public void endDrag(CCCoordinateTuner tuner,
                    int x,
                    int y,
                    JWorldElement element)

getDragMode

public int getDragMode()

setDragMode

public void setDragMode(int dragMode)

setPressedState

public void setPressedState(boolean pressedState)

isPressedState

public boolean isPressedState()

getDrawProjection

public float getDrawProjection(float f)

getRealProjection

public float getRealProjection(float f)

setDraggingConstantDirection

public void setDraggingConstantDirection(float x,
                                         float y)

setQTMovie

public void setQTMovie(PassiveQTMovie qtMovie)

setQTIcon

public void setQTIcon(PassiveQTImage qtIcon)

setQTIcon

public void setQTIcon(java.lang.String url)

setIcon

public void setIcon(javax.swing.ImageIcon icon,
                    int width,
                    int height)
sets icon to show, specifying width and height in pixels
Parameters:
icon - swing icon already created

setIcon

public void setIcon(java.lang.String url,
                    int width,
                    int height)
sets icon to show, specifying width and height in pixels
Parameters:
url - url of the icon file
width - width of the icon in pixels
height - height of the icon in pixels

setIconSize

public void setIconSize(int width,
                        int height)
sets the size of the icon to show, specifying width and height in pixels
Parameters:
width - width of the icon in pixels
height - height of the icon in pixels

getIconHeight

public int getIconHeight()
gets the height of the icon to show in pixels

getIconWidth

public int getIconWidth()
gets the width of the icon to show in pixels

clearIcon

public void clearIcon()
sets icon to don't show

getIcon

public javax.swing.ImageIcon getIcon()
returns the icon

getQTIcon

public PassiveQTImage getQTIcon()
returns the qt icon

getQTMovie

public PassiveQTMovie getQTMovie()
returns the qt movie