public class PositionList
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AF_KEY |
static java.lang.String |
AF_VALUE_FULL |
static java.lang.String |
AF_VALUE_INCREMENTAL |
static java.lang.String |
AF_VALUE_NONE |
Constructor and Description |
---|
PositionList() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener) |
void |
addPosition(int in0,
MultiStagePosition pos)
Insert a position into the list.
|
void |
addPosition(MultiStagePosition pos)
Adds a new position to the list.
|
void |
clearAllPositions()
Empties the list.
|
java.lang.String |
generateLabel()
Helper method to generate unique label when inserting a new position.
|
java.lang.String |
generateLabel(java.lang.String proposal) |
int |
getNumberOfPositions()
Returns the number of positions contained within the list
|
MultiStagePosition |
getPosition(int idx)
Returns multi-stage position associated with the position index.
|
MultiStagePosition |
getPositionCopy(int idx)
Returns a copy of the multi-stage position associated with the position index.
|
int |
getPositionIndex(java.lang.String posLabel)
Returns position index associated with the position name.
|
MultiStagePosition[] |
getPositions()
Returns an array of positions contained in the list.
|
boolean |
isLabelUnique(java.lang.String label)
Verify that the new label is unique
|
void |
load(java.lang.String path)
Load position list from a file.
|
static PositionList |
newInstance(PositionList aPl) |
void |
notifyChangeListeners() |
void |
removeChangeListener(javax.swing.event.ChangeListener listener) |
void |
removePosition(int idx)
Removes a specific position based on the index
|
void |
replacePosition(int index,
MultiStagePosition pos)
Replaces position in the list with the new position
|
void |
restore(java.lang.String stream)
Restore object data from the JSON encoded stream.
|
void |
save(java.lang.String path)
Save list to a file.
|
java.lang.String |
serialize()
Serialize object into the JSON encoded stream.
|
void |
setLabel(int idx,
java.lang.String label)
Assigns a label to the position index
|
void |
setPositions(MultiStagePosition[] posArray)
Initialize the entire array by passing an array of multi-stage positions
|
public static final java.lang.String AF_KEY
public static final java.lang.String AF_VALUE_FULL
public static final java.lang.String AF_VALUE_INCREMENTAL
public static final java.lang.String AF_VALUE_NONE
public static PositionList newInstance(PositionList aPl)
public void addChangeListener(javax.swing.event.ChangeListener listener)
public void removeChangeListener(javax.swing.event.ChangeListener listener)
public void notifyChangeListeners()
public MultiStagePosition getPosition(int idx)
idx
- - position indexpublic MultiStagePosition getPositionCopy(int idx)
idx
- - position indexpublic int getPositionIndex(java.lang.String posLabel)
posLabel
- - label (name) of the positionpublic void addPosition(MultiStagePosition pos)
pos
- - multi-stage positionpublic void addPosition(int in0, MultiStagePosition pos)
pos
- - multi-stage positionpublic void replacePosition(int index, MultiStagePosition pos)
pos
- - multi-stage positionpublic int getNumberOfPositions()
public void clearAllPositions()
public void removePosition(int idx)
idx
- - position indexpublic void setPositions(MultiStagePosition[] posArray)
posArray
- - array of multi-stage positionspublic MultiStagePosition[] getPositions()
public void setLabel(int idx, java.lang.String label)
idx
- - position indexlabel
- - new label (name)public java.lang.String serialize() throws org.micromanager.utils.MMSerializationException
org.micromanager.utils.MMSerializationException
public void restore(java.lang.String stream) throws org.micromanager.utils.MMSerializationException
stream
- org.micromanager.utils.MMSerializationException
public java.lang.String generateLabel()
public java.lang.String generateLabel(java.lang.String proposal)
public boolean isLabelUnique(java.lang.String label)
label
- - proposed labelpublic void save(java.lang.String path) throws org.micromanager.utils.MMException
path
- org.micromanager.utils.MMException
public void load(java.lang.String path) throws org.micromanager.utils.MMException
path
- org.micromanager.utils.MMException