|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.base.SelectionManager
This class handles Manager selections. It is basically a collection of Selection instances. Most of its operations just dispatch the same operation to each of the Selection instances in turn.
The SelectionManager is also responsible for sending out GraphSelectionEvents to any GraphSelectionListeners that are registered.
Selection
,
Serialized FormField Summary | |
protected Editor |
_editor
|
protected javax.swing.event.EventListenerList |
_listeners
|
protected java.util.Vector |
_selections
The collection of Selection instances |
Constructor Summary | |
SelectionManager(Editor ed)
|
Method Summary | |
protected void |
addAllFigs(java.util.Collection c)
|
protected void |
addEnclosed(java.util.Collection affected,
org.tigris.gef.presentation.Fig f)
|
protected void |
addFig(org.tigris.gef.presentation.Fig f)
|
void |
addGraphSelectionListener(GraphSelectionListener listener)
|
protected void |
addSelection(Selection s)
Add a new selection to the collection of selections |
void |
addToSelection(org.tigris.gef.presentation.Fig fig)
Adds an additional fig to the current selection. |
protected void |
allDamaged()
|
void |
cleanUp()
|
boolean |
contains(int x,
int y)
Reply true iff the given point is inside one of the selected Fig's |
boolean |
contains(Selection s)
Reply true if the given selection instance is part of my collection |
boolean |
containsFig(org.tigris.gef.presentation.Fig f)
Reply true if the given Fig is selected by any of my selection objects |
void |
damage()
When the SelectionManager is damageAll, that implies that each Selection should be damageAll. |
void |
deleteFromModel()
When a multiple selection are deleted, each selection is deleted |
void |
deselect(org.tigris.gef.presentation.Fig f)
Deselect the given Fig |
void |
deselectAll()
|
void |
dispose()
When a multiple selection are deleted, each selection is deleted |
void |
drag(int dx,
int dy)
|
void |
dragHandle(int mx,
int my,
int an_x,
int an_y,
org.tigris.gef.presentation.Handle h)
If only one thing is selected, then it is possible to mouse on one of its handles, but if Manager things are selected, users can only drag the objects around |
void |
endTrans()
End a transaction that damages all selected Fig's |
java.lang.Class |
findCommonSuperClass()
Determines and returns the first common superclass of all selected items. |
java.lang.Object |
findFirstSelectionOfType(java.lang.Class type)
Searches for the first appearance of an object of the designated type in the current selection. |
Selection |
findSelectionAt(int x,
int y)
|
Selection |
findSelectionFor(org.tigris.gef.presentation.Fig f)
|
protected void |
fireSelectionChanged()
|
java.awt.Rectangle |
getBounds()
|
java.awt.Rectangle |
getContentBounds()
|
java.awt.Point |
getDragLocation()
|
java.util.Vector |
getFigs()
Reply the collection of all selected Fig's |
java.awt.Point |
getLocation()
This method will return the upper-left coordinate point of the entire selection by iterating through the figs |
boolean |
getLocked()
|
boolean |
hit(java.awt.Rectangle r)
Reply true iff the given point is inside one of the selected Fig's |
void |
hitHandle(java.awt.Rectangle r,
org.tigris.gef.presentation.Handle h)
If only one thing is selected, then it is possible to mouse on one of its handles, but if Manager things are selected, users can only drag the objects around |
void |
keyPressed(java.awt.event.KeyEvent ke)
|
void |
keyReleased(java.awt.event.KeyEvent ke)
|
void |
keyTyped(java.awt.event.KeyEvent ke)
When an event is passed to a multiple selection, try to pass it off to the first selection that will handle it. |
static Selection |
makeSelectionFor(org.tigris.gef.presentation.Fig f)
|
void |
mouseClicked(java.awt.event.MouseEvent me)
|
void |
mouseDragged(java.awt.event.MouseEvent me)
|
void |
mouseEntered(java.awt.event.MouseEvent me)
|
void |
mouseExited(java.awt.event.MouseEvent me)
|
void |
mouseMoved(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
mouseReleased(java.awt.event.MouseEvent me)
|
void |
paint(java.awt.Graphics g)
Paint all selection objects |
protected void |
removeAllElements()
|
protected void |
removeFig(org.tigris.gef.presentation.Fig f)
|
void |
removeFromGraph()
When a multiple selection are deleted, each selection is deleted |
void |
removeGraphSelectionListener(GraphSelectionListener listener)
|
protected void |
removeSelection(Selection s)
|
void |
reorder(int func,
Layer lay)
When Manager selections are sent to back, each of them is sent to back. |
void |
select(java.util.Collection items)
|
void |
select(org.tigris.gef.presentation.Fig f)
|
java.util.Vector |
selections()
|
int |
size()
Reply the number of selected Fig's. |
void |
startDrag()
|
void |
stopDrag()
|
void |
toggle(org.tigris.gef.presentation.Fig f)
|
void |
toggle(java.util.Vector items)
|
void |
translate(int dx,
int dy)
When Manager selections are moved, each of them is moved |
void |
updatePropertySheet()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector _selections
protected Editor _editor
protected javax.swing.event.EventListenerList _listeners
Constructor Detail |
public SelectionManager(Editor ed)
Method Detail |
protected void addSelection(Selection s)
protected void addFig(org.tigris.gef.presentation.Fig f)
protected void addAllFigs(java.util.Collection c)
protected void removeAllElements()
protected void removeSelection(Selection s)
protected void removeFig(org.tigris.gef.presentation.Fig f)
protected void allDamaged()
public void select(org.tigris.gef.presentation.Fig f)
public void addToSelection(org.tigris.gef.presentation.Fig fig)
fig
- Additional fig to select.public void deselect(org.tigris.gef.presentation.Fig f)
public void toggle(org.tigris.gef.presentation.Fig f)
public void deselectAll()
public void select(java.util.Collection items)
public void toggle(java.util.Vector items)
public Selection findSelectionFor(org.tigris.gef.presentation.Fig f)
public Selection findSelectionAt(int x, int y)
public boolean contains(Selection s)
public boolean containsFig(org.tigris.gef.presentation.Fig f)
public boolean getLocked()
public int size()
public java.util.Vector selections()
public java.util.Vector getFigs()
public void endTrans()
public void paint(java.awt.Graphics g)
public void damage()
public boolean contains(int x, int y)
public boolean hit(java.awt.Rectangle r)
public java.awt.Rectangle getBounds()
public java.awt.Rectangle getContentBounds()
public java.awt.Point getLocation()
public void reorder(int func, Layer lay)
public void translate(int dx, int dy)
protected void addEnclosed(java.util.Collection affected, org.tigris.gef.presentation.Fig f)
public void startDrag()
public void drag(int dx, int dy)
public void stopDrag()
public java.awt.Point getDragLocation()
public void hitHandle(java.awt.Rectangle r, org.tigris.gef.presentation.Handle h)
public void dragHandle(int mx, int my, int an_x, int an_y, org.tigris.gef.presentation.Handle h)
public void cleanUp()
public void removeFromGraph()
public void dispose()
public void deleteFromModel()
public void keyTyped(java.awt.event.KeyEvent ke)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent ke)
keyReleased
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in interface java.awt.event.KeyListener
public void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent me)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent me)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent me)
mouseExited
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered
in interface java.awt.event.MouseListener
public void addGraphSelectionListener(GraphSelectionListener listener)
public void removeGraphSelectionListener(GraphSelectionListener listener)
protected void fireSelectionChanged()
public void updatePropertySheet()
public java.lang.Class findCommonSuperClass()
public java.lang.Object findFirstSelectionOfType(java.lang.Class type)
type
- Type of selection class to look for.
public static Selection makeSelectionFor(org.tigris.gef.presentation.Fig f)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |