public class BinarySegmentationView extends QWindowBuilder
Modifies provided Nest reference on Apply. Update BOA screen on Apply button.
This is front end of BinarySegmentation
used in BOA.
QWindowBuilder
,
BinarySegmentation_
QWindowBuilder.ComponentList
applyB, cancelB, DELIMITER, pluginPanel, pluginWnd, ui, windowState
Constructor and Description |
---|
BinarySegmentationView()
Construct object.
|
Modifier and Type | Method and Description |
---|---|
void |
buildWindow(ParamList def)
Main window builder.
|
getBooleanFromUI, getDoubleFromUI, getIntegerFromUI, getStringFromUI, getValues, isWindowVisible, setValues, showWindow, toggleWindow
public BinarySegmentationView()
QWindowBuilder
public void buildWindow(ParamList def)
QWindowBuilder
The window is constructed using configuration provided by def parameter which is Map of [key,value]. The key is the name of the parameter that should be related to value held in it (e.g window, smooth, step, etc.). The name is not case sensitive but should not contain spaces (use underscore). Keys are strictly related to UI elements that are created by this method (basing on configuration passed in value). Keys are used to produce UI control label, any underscore is replaced by space and key is capitalised. There are two special names that are not related to UI directly:
The parameter list is defined as String and its content is depended on key. For help and name it contains single string with help text and plugin name respectively.
The UI elements are defined for all other cases in value filed of Map as comma separated string. UI element name is case insensitive. Known UI are as follows:
QWindowBuilder.setValues(ParamList)
is justified only if passed
parameters will be present in list already (so it has
been used during creation of window, passed in constructor) In this case it causes selection
of this entry in list. Otherwise passed value will be ignored. setVales for Choice does
not add new entry to list.
The type of required UI element associated with given parameter name (Key) is coded in value of given Key in accordance with list above. The correct order of sub-parameters must be preserved. By default window is not visible yet. User must call ShowWindow or ToggleWindow. The Apply button does nothing. It is only to refocus after change of values in spinners. They are not updated until unfocused. User can overwrite this behaviour in his own class derived from QWindowBuilder
This method can be overridden in implementing class that allows for e.g. setting size of the window or add listeners:
public void buildWindow(ParamList def) {
super.buildWindow(def); // add preferred size to this window
pluginWnd.setPreferredSize(new Dimension(300, 450));
pluginWnd.pack();
pluginWnd.setVisible(true);
pluginWnd.addWindowListener(new myWindowAdapter()); // close not hide ((JButton)
ui.get("Load Mask")).addActionListener(this);
applyB.addActionListener(this);
}
Throw IllegalArgumentException or other unchecked exceptions on wrong syntax of def
buildWindow
in class QWindowBuilder
def
- Configuration as describedCopyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.