|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.GraphObj
com.quinncurtis.chart2djava.ChartMouseListener
com.quinncurtis.chart2djava.MoveObj
public class MoveObj
The MoveObj class extends the MouseListener class, providing additional methods that allow the user to move chart objects using the mouse.
Field Summary |
---|
Constructor Summary | |
---|---|
MoveObj()
The default MoveObj constructor. |
|
MoveObj(ChartView component)
This constructor creates a new MoveObj object using the specified component. |
|
MoveObj(ChartView component,
int buttonmask)
This constructor creates a new MoveObj object using the specified component. |
|
MoveObj(ChartView component,
int buttonmask,
java.lang.String objectfilter)
This constructor creates a new MoveObj object using the specified component. |
Method Summary | |
---|---|
void |
addMouseMoveListener()
This method installs the MoveObj object by adding it to the mouse listener list of the ChartView component. |
void |
copy(MoveObj source)
Copies the source MoveObj. |
void |
drawBoundingBox(java.awt.Graphics2D g,
ChartPoint2D pstart,
ChartPoint2D pstop)
This method draws the bounding box of a chart object The bounding box of the selected chart object tracks the mouse cursor as the mouse is dragged. |
int |
errorCheck(int nerror)
Checks the current object for common errors. |
GraphObj |
findObj(ChartPoint2D testpoint)
This method finds the moveable chart object nearest the test point. |
int |
getButtonMask()
Returns the mouse button that is associated with moving objects. |
boolean |
getMoveObjectEnable()
This method return true if the move object event listener is active. |
java.lang.String |
getMoveObjectFilter()
Returns the move object filter that qualifies selected objects. |
int |
getMoveObjMode()
Returns the move mode that is associated with moving objects. |
boolean |
isMoveableObject(GraphObj chartobj)
This method checks and returns true if a graph object is moveable. |
void |
mouseClicked(java.awt.event.MouseEvent event)
Dummy event listener for this object. |
void |
mouseDragged(java.awt.event.MouseEvent event)
The mouseDragged event listener for this object. |
void |
mousePressed(java.awt.event.MouseEvent event)
The mousePressed event listener for this object. |
void |
mouseReleased(java.awt.event.MouseEvent event)
The mouseReleased event listener for this object. |
void |
removeMouseMoveListener()
This method uninstalls the MoveObj object by removing it from the mouse listener list of the ChartView component. |
void |
setButtonMask(int buttonmask)
Sets the mouse button that is associated with moving objects. |
void |
setMoveObjectEnable(boolean enable)
Once the MoveObj object is created and installed using the addMouseMoveListener method, it can be turned on/off using this method. |
void |
setMoveObjectFilter(java.lang.String objfilter)
Sets the object filter used to qualify the selection of objects. |
void |
setMoveObjMode(int movemode)
Sets the move mode that is associated with moving objects. |
Methods inherited from class com.quinncurtis.chart2djava.ChartMouseListener |
---|
addChartMouseListener, checkIntersection, clone, copy, draw, getEnable, getMouseListenerEnable, mouseEntered, mouseExited, mouseMoved, removeChartMouseListener, setEnable, setMouseListenerEnable |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoveObj()
public MoveObj(ChartView component)
component
- A reference to the ChartView object that the chart is placed in.public MoveObj(ChartView component, int buttonmask)
component
- A reference to the ChartView object that the chart is placed in.buttonmask
- Specifies the mouse button that is trapped to invoke a move.public MoveObj(ChartView component, int buttonmask, java.lang.String objectfilter)
component
- A reference to the ChartView object that the chart is placed in.buttonmask
- Specifies the mouse button that is trapped to invoke a move.objectfilter
- The class name of the base class that
is used to filter the desired class objects. The string "ChartText" would
cause the routine to only move objects derived from the ChartText class.Method Detail |
---|
public void addMouseMoveListener()
public void copy(MoveObj source)
source
- The source MoveObj object.public void drawBoundingBox(java.awt.Graphics2D g, ChartPoint2D pstart, ChartPoint2D pstop)
g
- Specifies a graphics context.pstart
- Specifies the mouse position when the mouse button was pressed.pstop
- Specifies the current position of the mouse.public int errorCheck(int nerror)
errorCheck
in class ChartMouseListener
nerror
- Current error state
public GraphObj findObj(ChartPoint2D testpoint)
testpoint
- The current position of the mouse in Java user coordinates.
public int getButtonMask()
getButtonMask
in class ChartMouseListener
public boolean getMoveObjectEnable()
public java.lang.String getMoveObjectFilter()
public int getMoveObjMode()
public boolean isMoveableObject(GraphObj chartobj)
chartobj
- A chart object.
public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void removeMouseMoveListener()
public void setButtonMask(int buttonmask)
setButtonMask
in class ChartMouseListener
buttonmask
- The mouse button that is to be associated with moving objects.
Use one of the MouseEvent button constants: MouseEvent.BUTTON1_MASK,
MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON3_MASK.public void setMoveObjectEnable(boolean enable)
enable
- True turns the mouse listener on.public void setMoveObjectFilter(java.lang.String objfilter)
objfilter
- The class name of the base class that
is used to filter the desired class objects. The string "ChartText" would
cause the routine to only move objects derived from the ChartText class.public void setMoveObjMode(int movemode)
movemode
- The move mode that is to be associated with moving objects.
Use one of the move mode constants: MOVE_X, MOVE_Y or MOVE_XY.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |