public class Selection extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PADDING
Outward padding in pixels around the selected Displayables maximum enclosing box that may need repainting when updating the screen.
|
Constructor and Description |
---|
Selection(Display display)
The Display can be null, as long as paint, OvalHandle.contains, setTransforming, and getLinkedBox methods are never called on this object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Displayable d) |
protected void |
apply(int what,
double[] params) |
void |
clear()
Remove all Displayables from this selection.
|
boolean |
contains(Class<?> c)
Returns true if selection contains any items of the given class.
|
boolean |
contains(Displayable d) |
boolean |
containsAffected(Class<?> c)
If any of the selected or linked is of Class c.
|
protected void |
debug(String msg) |
boolean |
deleteAll()
Delete all selected objects from their Layer.
|
<T extends Displayable> |
get(Class<T> c)
Returns a list of selected Displayable of class c only.
|
Displayable |
getActive() |
Set<Displayable> |
getAffected()
Returns the set of all Displayable objects affected by this selection, that is, the selected ones and their linked ones.
|
Set<Displayable> |
getAffected(Class<?> c)
Returns the set of all Displayable objects of the given class affected by this selection, that is, among the selected ones and their linked ones.
|
Rectangle |
getBox()
Returns a copy of the box enclosing all selected ob, or null if none.
|
Layer |
getLayer()
Returns the Layer of the Display, or if the latter is null, that of the first selected Displayable.
|
Rectangle |
getLinkedBox()
Returns the total box enclosing all selected objects and their linked objects within the current layer, or null if none are selected.
|
int |
getNLinked() |
int |
getNSelected() |
Project |
getProject()
Returns the Project of the Display, or if the latter is null, that of the first selected Displayable.
|
ArrayList<Displayable> |
getSelected()
Returns a copy of the list of all selected Displayables (and not their linked ones).
|
ArrayList<Displayable> |
getSelected(Class<?> c)
Returns a copy of the list of all selected Displayables (and not their linked ones) of the given class.
|
List<Displayable> |
getSelectedSorted(Class<? extends Displayable> c)
Returns the subset of selected objects of Class c, in the proper order according to the Layer.indexOf or the LayerSet.indexOf.
|
boolean |
isEmpty() |
boolean |
isLocked()
Test if any of the selection objects is directly or indirectly locked.
|
void |
measure()
Call measure(ResultsTable) on every selected Displayable.
|
void |
moveDown()
Send all selected components to the next layer.
|
void |
moveUp()
Send all selected components to the previous layer.
|
void |
remove(Displayable d)
Remove the given displayable from this selection.
|
void |
removeAll(Collection<Displayable> col)
Remove all given displayables from this selection.
|
protected void |
removeFromPrev(Displayable d)
Removes the given Displayable from the selection and previous selection list.
|
void |
resetBox()
Recalculate box and reset handles.
|
void |
restore()
Restore the previous selection.
|
void |
rotate(double angle,
double xo,
double yo)
Rotate the objects in the current selection by the given angle, in degrees, relative to the x_o, y_o origin.
|
void |
scale(double sx,
double sy,
double x_o,
double y_o)
Scale all selected objects and their links by by the given scales, relative to the origin position.
|
void |
selectAll()
Select all objects in the Display's current layer, preserving the active one (if any) as active; includes all the ZDisplayables, whether visible in this layer or not.
|
void |
selectAll(Collection<? extends Displayable> al) |
void |
selectAll(Layer layer)
Select all objects in the given layer, preserving the active one (if any) as active.
|
void |
selectAll(Roi roi,
boolean visible_only)
Select all objects under the given roi, in the current display's layer.
|
void |
selectAllVisible()
Select all isVisible() objects in the Display's current layer, preserving the active one (if any) as active; includes all the ZDisplayables, whether visible in this layer or not, as long as their return true from isVisible().
|
void |
setActive(Displayable d) |
void |
setAlpha(float alpha) |
void |
setColor(Color c) |
void |
setLocked(boolean b)
Lock / unlock all selected objects.
|
void |
setLut(ColorModel cm)
Apply the given LUT to all selected 8-bit, 16-bit, 32-bit images.
|
Collection<Displayable> |
setVisible(boolean b)
Set all selected objects visible/hidden; returns a collection of those that changed state.
|
void |
specify() |
void |
translate(double dx,
double dy)
Translate all selected objects and their links by the given differentials.
|
void |
updateTransform(Displayable d)
Update the bounding box of the whole selection.
|
public static int PADDING
public Selection(Display display)
public void setActive(Displayable d)
public Displayable getActive()
public void add(Displayable d)
public void selectAll()
public void selectAllVisible()
public void selectAll(Layer layer)
public void selectAll(Roi roi, boolean visible_only)
public void selectAll(Collection<? extends Displayable> al)
public boolean deleteAll()
public void removeAll(Collection<Displayable> col)
public void remove(Displayable d)
public void clear()
public Rectangle getLinkedBox()
public boolean isLocked()
public void setLocked(boolean b)
public void setColor(Color c)
public void setAlpha(float alpha)
public boolean isEmpty()
public boolean contains(Displayable d)
public boolean contains(Class<?> c)
protected void debug(String msg)
public void updateTransform(Displayable d)
public int getNSelected()
public int getNLinked()
public void rotate(double angle, double xo, double yo)
public void translate(double dx, double dy)
public void scale(double sx, double sy, double x_o, double y_o)
public ArrayList<Displayable> getSelected()
public ArrayList<Displayable> getSelected(Class<?> c)
public <T extends Displayable> List<T> get(Class<T> c)
public List<Displayable> getSelectedSorted(Class<? extends Displayable> c)
public Set<Displayable> getAffected()
public Set<Displayable> getAffected(Class<?> c)
public boolean containsAffected(Class<?> c)
public void moveUp()
public void moveDown()
public Collection<Displayable> setVisible(boolean b)
protected void removeFromPrev(Displayable d)
public void restore()
public void specify()
protected void apply(int what, double[] params)
public void setLut(ColorModel cm)
public Project getProject()
public Layer getLayer()
public Rectangle getBox()
public void resetBox()
public void measure()
Copyright © 2015–2021 Fiji. All rights reserved.