public class EditingCompoundBehavior extends CompoundBehavior
| Modifier and Type | Field and Description |
|---|---|
static int |
EDITING_INDEX |
static int |
SELECTION_INDEX |
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, geomManager| Constructor and Description |
|---|
EditingCompoundBehavior(IBehavior editing) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMapBehavior(Behavior mt,
boolean draw)
Adds a new behavior, setting if will be real-time (when user is working with it) drawn or not.
|
boolean |
containsBehavior(Behavior mt)
Searches for
mt, returning true if is contained. |
Behavior |
getBehavior(int index)
Returns the first-level
Behavior at the specified position. |
Image |
getImageCursor()
Gets the mouse cursor of the tool listener associated to this behavior.
|
ToolListener |
getListener()
Gets the
ToolListener used by this behavior to perform actions on the
associated MapControl object. |
boolean |
isDrawnBehavior(int index)
Returns if it's invoked the method
public void paintComponent(Graphics g) of the
first-level Behavior at the specified position, each time is painted this component. |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e) |
void |
paintComponent(MapControlDrawer renderer)
Method executed in real-time, when user is working with a tool on the associated
MapControl
object, repainting the MapControl's image. |
void |
paintComponent(MapControlDrawer renderer,
boolean clean) |
void |
removeMapBehavior(Behavior mt)
Removes a
Behavior that composes this one. |
void |
setDrawnBehavior(int index,
boolean draw)
Sets if will be invoked the method
public void paintComponent(Graphics g) of the
first-level Behavior at the specified position, each time is painted this component. |
void |
setListener(ToolListener listener)
Sets a tool listener to work with a
MapControl instance using these behaviors. |
void |
setMapControl(MapControl mc)
Associates this behavior to a
MapControl object. |
int |
size()
Returns the number of first-level
Behaviors in this CompoundBehavior. |
getAllControlsBehavior, setAllControlsBehaviorclean, createArc, createArc, createArc, createCircle, createLineString, createPoint, createPoint, getMapControl, isMyButton, isMyButton, resetMyButtonpublic static final int EDITING_INDEX
public static final int SELECTION_INDEX
public EditingCompoundBehavior(IBehavior editing)
public void addMapBehavior(Behavior mt, boolean draw)
CompoundBehaviorAdds a new behavior, setting if will be real-time (when user is working with it) drawn or not.
When user works with a compound behavior, he/she will see on real-time the graphical changes produced at
the associated MapControl, only by those which have their associated draw flag to true.
addMapBehavior in class CompoundBehaviormt - the new behaviordraw - flag determining if will be real-time drawn or nopublic void removeMapBehavior(Behavior mt)
CompoundBehaviorRemoves a Behavior that composes this one.
removeMapBehavior in class CompoundBehaviormt - the Behavior to be removedpublic boolean containsBehavior(Behavior mt)
CompoundBehaviorSearches for mt, returning true if is contained.
containsBehavior in class CompoundBehaviormt - the behavior to searchtrue if is contained; otherwise falsepublic Behavior getBehavior(int index)
CompoundBehaviorReturns the first-level Behavior at the specified position.
getBehavior in class CompoundBehaviorindex - index of element to returnpublic boolean isDrawnBehavior(int index)
CompoundBehaviorReturns if it's invoked the method public void paintComponent(Graphics g) of the
first-level Behavior at the specified position, each time is painted this component.
isDrawnBehavior in class CompoundBehaviorindex - index of elementtrue if it's invoked the method public void paintComponent(Graphics g) of the
first-level Behavior at the specified position, each time is painted this component, otherwise
false.public void setDrawnBehavior(int index,
boolean draw)
CompoundBehaviorSets if will be invoked the method public void paintComponent(Graphics g) of the
first-level Behavior at the specified position, each time is painted this component.
setDrawnBehavior in class CompoundBehaviorindex - index of elementpublic int size()
CompoundBehaviorReturns the number of first-level Behaviors in this CompoundBehavior.
size in class CompoundBehaviorBehaviors in this CompoundBehaviorpublic Image getImageCursor()
IBehaviorGets the mouse cursor of the tool listener associated to this behavior.
getImageCursor in interface IBehaviorgetImageCursor in class CompoundBehaviorpublic void mouseClicked(MouseEvent e) throws BehaviorException
mouseClicked in interface IBehaviormouseClicked in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse clicked event, by the IBehavior objectMouseListener.mouseClicked(java.awt.event.MouseEvent)public void mouseDragged(MouseEvent e) throws BehaviorException
mouseDragged in interface IBehaviormouseDragged in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse dragged event, by the IBehavior objectMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)public void mouseEntered(MouseEvent e) throws BehaviorException
mouseEntered in interface IBehaviormouseEntered in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse entered event, by the IBehavior objectMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(MouseEvent e) throws BehaviorException
mouseExited in interface IBehaviormouseExited in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse exited event, by the IBehavior objectMouseListener.mouseExited(java.awt.event.MouseEvent)public void mouseMoved(MouseEvent e) throws BehaviorException
mouseMoved in interface IBehaviormouseMoved in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse moved event, by the IBehavior objectMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)public void mousePressed(MouseEvent e) throws BehaviorException
mousePressed in interface IBehaviormousePressed in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse pressed event, by the IBehavior objectMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(MouseEvent e) throws BehaviorException
mouseReleased in interface IBehaviormouseReleased in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse released event, by the IBehavior objectMouseListener.mouseReleased(java.awt.event.MouseEvent)public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException
mouseWheelMoved in interface IBehaviormouseWheelMoved in class CompoundBehaviorBehaviorException - any exception processing the action associated to a mouse wheel event, by the IBehavior objectMouseWheelListener.mouseWheelMoved(java.awt.event.MouseWheelEvent)public void paintComponent(MapControlDrawer renderer, boolean clean)
paintComponent in class CompoundBehaviorpublic void paintComponent(MapControlDrawer renderer)
IBehaviorMethod executed in real-time, when user is working with a tool on the associated MapControl
object, repainting the MapControl's image.
Returns immediately in all cases, even if the complete image has not yet been loaded.
This method will be implemented according to the specific nature of each behavior, and its extra and particular features.
paintComponent in interface IBehaviorpaintComponent in class CompoundBehaviorGraphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)public void setListener(ToolListener listener)
CompoundBehaviorMapControl instance using these behaviors.setListener in class CompoundBehaviorlistener - a RectangleListener object for this behaviorpublic ToolListener getListener()
IBehaviorGets the ToolListener used by this behavior to perform actions on the
associated MapControl object.
getListener in interface IBehaviorgetListener in class CompoundBehaviorToolListener used by this behaviorpublic void setMapControl(MapControl mc)
IBehaviorAssociates this behavior to a MapControl object.
setMapControl in interface IBehaviorsetMapControl in class CompoundBehaviormc - the MapControl object to associateIBehavior.getMapControl()