public final class Tank extends Object implements ITank
TankPanel (if set) and
implements static operations on it. If no panel is set, the panel stays
null.
Changes
| Modifier and Type | Field and Description |
|---|---|
private int |
currTankIndex
The currently selected item (stack) in the tank.
|
private static org.apache.log4j.Logger |
logger |
private int |
maxTankIndex
The maximum number (index) for the tank.
|
private PropertyChangeSupport |
pcs
A
PropertyChangeSupport for this workflow control instance. |
private TankPanel |
tankPanel
The tank panel.
|
| Modifier | Constructor and Description |
|---|---|
private |
Tank()
A private constructor for this singleton
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNewItem(IqmDataBox item)
This method adds 1 new item to the
JList. |
void |
addNewItems(List<IqmDataBox> itemList)
This method adds 1...n new items to the
JList. |
void |
addNewItemsSync(List<IqmDataBox> itemList)
Add a list of
IqmDataBoxes as a single item in the tank. |
void |
addNewItemSync(IqmDataBox item)
This method adds 1 new item to the
JList. |
void |
deleteAllTankItems()
This method deletes the entire tank list.
|
void |
deleteTankItems(int[] indices)
This method deletes a range of indices in the tank.
|
void |
destroyItems()
This method destroys existing tank items using the FIFO principle
(queuing).
|
IqmDataBox |
getCurrentTankIqmDataBoxAt(int mgrIndex)
This method gets the
IqmDataBox at the index
mgrIndex of the currently selected tank list cell. |
int |
getCurrIndex()
This method gets the current tank item number.
|
static ITank |
getInstance()
Gets the tank instance within this application.
|
int |
getMaxIndex()
This method gets the maximal tank item index.
|
int |
getNumberOfTankItems()
This method gets the number of List items
|
IqmDataBox |
getSelectedIqmDataBox()
This method gets the
IqmDataBox, which according to the selected
index in the current manager list, at the index of the currently selected
tank list cell. |
List<IqmDataBox> |
getTankDataAt(int index)
Gets the entire item stack at a specified index in the tank list.
|
IqmDataBox |
getTankIqmDataBoxAt(int tankIndex,
int mgrIndex)
This method gets the
IqmDataBox with the imgIndex at
the index tankIndex (which is a cell) of the tank model. |
TankPanel |
getTankPanel()
This method gets the tank panel instance.
|
boolean |
isEmpty()
Determine whether or not the Tank contains items.
|
boolean |
isVirtual(int index)
Determine whether a stack at position
index is virtual or
not. |
void |
loadImagesFromHD(File[] fileList)
This method adds new single items (also stacks) to the
JList
in the tank panel. |
void |
loadImagesFromHD(File[] fileList,
boolean waitForCompletion)
This method adds new single items (also stacks) to the
JList
in the tank panel. |
void |
loadImagesFromHD(List<File> fileList)
This method adds new single items (also stacks) to the
JList
in the tank panel. |
void |
loadNewImagesFromHDSequentially(List<File[]> batch)
This method adds a batch of items (also stacks) sequentially to the
JList in the tank panel. |
DataType |
parseDraggedContent(List<File> fileList)
|
void |
runPlotParser(File f)
Kicks off a
PlotParser instance parsing the file and showing a
PlotSelectionFrame for choosing data. |
void |
setCurrIndex(int arg)
This method sets the current tank item number.
|
void |
setManagerForTankIndex(int tankIndex)
Tell the
Manager to (re)set for a new tank index. |
void |
setMaxIndex(int arg)
This method sets the maximal tank image number
|
void |
setTankPanel(ITankPanel tankPanel)
This method sets the tank panel instance in this class.
|
void |
update(int tankIndex)
Updates the specified tank items.
|
void |
update(List<IqmDataBox> replacements,
int tankIndex)
Replaces the specified tank items.
|
private static final org.apache.log4j.Logger logger
private TankPanel tankPanel
private int currTankIndex
-1.private int maxTankIndex
private PropertyChangeSupport pcs
PropertyChangeSupport for this workflow control instance.public static ITank getInstance()
public TankPanel getTankPanel()
getTankPanel in interface ITankpublic void setTankPanel(ITankPanel tankPanel)
setTankPanel in interface ITanktankPanel - public void setCurrIndex(int arg)
It also highlights the corresponding cell of the JList.
setCurrIndex in interface ITankarg - - current tank item numberpublic int getCurrIndex()
getCurrIndex in interface ITankpublic void setMaxIndex(int arg)
setMaxIndex in interface ITankarg - - maximal tank image numberpublic int getMaxIndex()
getMaxIndex in interface ITankpublic void setManagerForTankIndex(int tankIndex)
Manager to (re)set for a new tank index.setManagerForTankIndex in interface ITanktankIndex - the tank index to generate the new icons fromIManager.setNewIconsForTankIndex(int)public List<IqmDataBox> getTankDataAt(int index)
getTankDataAt in interface ITankindex - the tank list indexListITankPanel.getModel()public void destroyItems()
TankPanel.destroyItems in interface ITankpublic void addNewItems(List<IqmDataBox> itemList)
JList.
This method should be used whenever new items are processed by the
ResultVisualizer or new items or item stacks are loaded from any
of the "Open" dialogs.
addNewItems in interface ITankitemList - a list of IqmDataBoxes containing displayable items.
This could be of the following types: DataType.IMAGE ,
DataType.PLOT, DataType.TABLE, or
DataType.CUSTOMpublic void update(List<IqmDataBox> replacements, int tankIndex)
ITankpublic void update(int tankIndex)
ITankpublic void loadNewImagesFromHDSequentially(List<File[]> batch)
JList in the tank panel.
This is used, when the order of items or item stacks is important.
loadNewImagesFromHDSequentially in interface ITankbatch - List of File[]public void loadImagesFromHD(File[] fileList)
JList
in the tank panel. The file list is loaded by a
ImageDataBoxLoader instance in the background, displaying
progress to the status panel.
This method is called by the OpenImageDialog.
loadImagesFromHD in interface ITankfileList - a File[] containing new items for the tank listpublic void loadImagesFromHD(File[] fileList, boolean waitForCompletion)
JList
in the tank panel. The file list is loaded by a
ImageDataBoxLoader instance in the background, displaying
progress to the status panel.
This method is called by the OpenImageDialog.
loadImagesFromHD in interface ITankfileList - a File[] containing new items for the tank listwaitForCompletion - waits for the loading to be finishedpublic void loadImagesFromHD(List<File> fileList)
JList
in the tank panel. The file list is loaded by a
ImageDataBoxLoader instance in the background, displaying
progress to the status panel.
This method is called by dragging images from the file system to the
ITankPanel.
loadImagesFromHD in interface ITankfileList - a List of Files containing new items for the
tank listpublic IqmDataBox getCurrentTankIqmDataBoxAt(int mgrIndex)
IqmDataBox at the index
mgrIndex of the currently selected tank list cell.getCurrentTankIqmDataBoxAt in interface ITankmgrIndex - - manager indexnull, if the tank index is not
valid (i.e. <0)public IqmDataBox getTankIqmDataBoxAt(int tankIndex, int mgrIndex)
IqmDataBox with the imgIndex at
the index tankIndex (which is a cell) of the tank model.getTankIqmDataBoxAt in interface ITanktankIndex - - tank indexmgrIndex - - manager indexnull, if the
tank index is not valid (i.e. <0)public IqmDataBox getSelectedIqmDataBox()
IqmDataBox, which according to the selected
index in the current manager list, at the index of the currently selected
tank list cell.getSelectedIqmDataBox in interface ITanknull, if the tank index is not
valid (i.e. <0)ITank.getTankDataAt(int)public int getNumberOfTankItems()
getNumberOfTankItems in interface ITankpublic void deleteAllTankItems()
deleteAllTankItems in interface ITankpublic void deleteTankItems(int[] indices)
deleteTankItems in interface ITankindices - the indices to be deletedpublic boolean isEmpty()
ITankpublic boolean isVirtual(int index)
ITankindex is virtual or
not.public void addNewItem(IqmDataBox item)
ITankJList. This is an
asynchronous method, which will do the loading in background.addNewItem in interface ITankitem - an IqmDataBox containing a single displayable item.
This could be of the following types: DataType.IMAGE ,
DataType.PLOT, DataType.TABLE, or
DataType.CUSTOMpublic DataType parseDraggedContent(List<File> fileList)
ITankparseDraggedContent in interface ITankfileList - the List of filesDataTypepublic void runPlotParser(File f)
PlotParser instance parsing the file and showing a
PlotSelectionFrame for choosing data.runPlotParser in interface ITankf - the File to be parsedpublic void addNewItemsSync(List<IqmDataBox> itemList)
ITankIqmDataBoxes as a single item in the tank. This is
a synchronous method that is waiting until loading has finished.addNewItemsSync in interface ITankpublic void addNewItemSync(IqmDataBox item)
ITankJList. This is a
synchronous method that is waiting until loading has finished.addNewItemSync in interface ITankitem - an IqmDataBox containing a single displayable item.
This could be of the following types: DataType.IMAGE ,
DataType.PLOT, DataType.TABLE, or
DataType.CUSTOMITank.addNewItem(IqmDataBox)Copyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.