Class VertexEndpointsSelectedEdgeSelectedState<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.selection.VertexEndpointsSelectedEdgeSelectedState<V,E>
-
- All Implemented Interfaces:
ItemSelectable,MutableSelectedState<E>,SelectedState<E>
public class VertexEndpointsSelectedEdgeSelectedState<V,E> extends Object implements MutableSelectedState<E>
Maintains the state of what edges have been 'selected' in the graph based on whether both endpoints are selected- Author:
- Tom Nelson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.selection.SelectedState
SelectedState.StateChangeListener<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Supplier<org.jgrapht.Graph<V,E>>graphSupplierprotected EventListenerListlistenerListprotected Set<E>selectedthe 'selected' items
-
Constructor Summary
Constructors Constructor Description VertexEndpointsSelectedEdgeSelectedState(Supplier<org.jgrapht.Graph<V,E>> graphSupplier, MutableSelectedState<V> selectedVertexState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemListener(ItemListener l)voidclear()Clears the "selected" state from all elements.voidclear(boolean fireEvents)booleandeselect(E element)deselect one elementbooleandeselect(E element, boolean fireEvents)booleandeselect(Collection<E> elements)deselect a collection of elementsbooleandeselect(Collection<E> elements, boolean fireEvents)protected voidfireItemStateChanged(ItemEvent e)Set<E>getSelected()Object[]getSelectedObjects()booleanisSelected(E t)voidremoveItemListener(ItemListener l)booleanselect(E element)select one element.booleanselect(E element, boolean fireEvents)booleanselect(Collection<E> elements)select a collection of elements to be the only selected elementsbooleanselect(Collection<E> elements, boolean fireEvents)
-
-
-
Constructor Detail
-
VertexEndpointsSelectedEdgeSelectedState
public VertexEndpointsSelectedEdgeSelectedState(Supplier<org.jgrapht.Graph<V,E>> graphSupplier, MutableSelectedState<V> selectedVertexState)
-
-
Method Detail
-
addItemListener
public void addItemListener(ItemListener l)
- Specified by:
addItemListenerin interfaceItemSelectable
-
removeItemListener
public void removeItemListener(ItemListener l)
- Specified by:
removeItemListenerin interfaceItemSelectable
-
fireItemStateChanged
protected void fireItemStateChanged(ItemEvent e)
-
getSelected
public Set<E> getSelected()
- Specified by:
getSelectedin interfaceSelectedState<V>- Returns:
- all selected elements.
-
isSelected
public boolean isSelected(E t)
- Specified by:
isSelectedin interfaceSelectedState<V>
-
select
public boolean select(E element)
select one element.- Specified by:
selectin interfaceMutableSelectedState<V>- Parameters:
element- the element to select- Returns:
- true if the collection of selected elements was changed
-
select
public boolean select(E element, boolean fireEvents)
- Specified by:
selectin interfaceMutableSelectedState<V>
-
deselect
public boolean deselect(E element)
deselect one element- Specified by:
deselectin interfaceMutableSelectedState<V>- Parameters:
element- the element to deselect- Returns:
- true is the collection of selected elements was changed
-
deselect
public boolean deselect(E element, boolean fireEvents)
- Specified by:
deselectin interfaceMutableSelectedState<V>
-
select
public boolean select(Collection<E> elements)
select a collection of elements to be the only selected elements- Specified by:
selectin interfaceMutableSelectedState<V>- Parameters:
elements-- Returns:
- true if the collection of selected elements was changed
-
select
public boolean select(Collection<E> elements, boolean fireEvents)
- Specified by:
selectin interfaceMutableSelectedState<V>
-
deselect
public boolean deselect(Collection<E> elements)
deselect a collection of elements- Specified by:
deselectin interfaceMutableSelectedState<V>- Parameters:
elements- the elements to deselect- Returns:
- true if the collection of selected elements was changed
-
deselect
public boolean deselect(Collection<E> elements, boolean fireEvents)
- Specified by:
deselectin interfaceMutableSelectedState<V>
-
clear
public void clear()
Clears the "selected" state from all elements.- Specified by:
clearin interfaceMutableSelectedState<V>
-
clear
public void clear(boolean fireEvents)
- Specified by:
clearin interfaceMutableSelectedState<V>
-
getSelectedObjects
public Object[] getSelectedObjects()
- Specified by:
getSelectedObjectsin interfaceItemSelectable
-
-