|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectComponent
Container
JComponent
KernelEditor
public class KernelEditor
A widget for selecting and/or editing a KernelJAI object. Kernels are used for
image convolutions. KernelEditor widgets are
initially empty, but a set of default kernels can be added with addDefaultKernels()
including (but not limited to)
Floyd & Steinberg (1975),
Jarvis, Judice & Ninke (1976) and
Stucki (1981).
Each kernel can belong to an optional category. Example of categories includes "Error filters" and "Gradient masks".

GradientKernelEditor,
ConvolveDescriptor,
GradientMagnitude,
Serialized Form
| display/geotk-widgets-swing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
KernelEditor()
Constructs a new kernel editor. |
|
| Method Summary | |
|---|---|
void |
addDefaultKernels()
Add a set of predefined kernels. |
void |
addKernel(String category,
String name,
KernelJAI kernel)
Adds a kernel to the list of available kernels. |
void |
commitEdit()
Forces the current value to be taken from the editable fields and set them as the current values. |
KernelJAI |
getKernel()
Returns the currently edited kernel. |
String |
getKernelCategory()
Returns the category for the current kernel. |
ComboBoxModel |
getKernelListModel()
Returns the list of predefined kernels in the current category. |
String[] |
getKernelNames()
Returns an array of kernel names in the current category. |
TableModel |
getKernelTableModel()
Returns the table model containing the current kernel coefficients. |
void |
removeAllKernels()
Removes all kernels and categories. |
void |
removeKernel(KernelJAI kernel)
Removes a kernel. |
void |
removeKernel(String kernel)
Removes a kernel by its name. |
void |
setKernel(KernelJAI kernel)
Sets the kernel. |
void |
setKernel(String name)
Sets the kernel by its name. |
void |
setKernelSize(int width,
int height)
Sets the size of the current kernel. |
boolean |
showDialog(Component owner,
String title)
Shows a dialog box requesting input from the user. |
void |
sortKernelNames(Comparator<String> comparator)
Sort all kernel names according the specified comparator. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public KernelEditor()
setKernel(javax.media.jai.KernelJAI) must be invoked, or the user must performs a selection in
a combo box, in order to make a kernel visible.
| Method Detail |
|---|
public void addDefaultKernels()
public void addKernel(String category,
String name,
KernelJAI kernel)
sortKernelNames(java.util.Comparator) has been invoked. Each kernel can belong
to an optional category. Example of categories includes "Error filters" and "Gradient masks".
category - The kernel's category name, or null if none.name - The kernel name. Kernels will be displayed in alphabetic order.kernel - The kernel. If an other kernel was registered with the same
name, the previous kernel will be discarded.public void removeKernel(KernelJAI kernel)
kernel - The kernel to remove.public void removeKernel(String kernel)
kernel - The kernel to remove.public void removeAllKernels()
public void setKernel(KernelJAI kernel)
addKernel method, then the kernel
name and category will be updated according.
kernel - The new kernel.public void setKernel(String name)
addKernel(java.lang.String, float[]).
If name is not found, then nothing is done.
name - The name of the kernel to select.
public void setKernelSize(int width,
int height)
width - The number of rows.height - The number of columns.public KernelJAI getKernel()
public String getKernelCategory()
category argument
given to addKernel(category, name, kernel), where
kernel is the current kernel.
null if none.public void sortKernelNames(Comparator<String> comparator)
comparator - The comparator, or null for the natural ordering.public String[] getKernelNames()
KernelEditor state.
public ComboBoxModel getKernelListModel()
public TableModel getKernelTableModel()
public void commitEdit()
throws ParseException
This method is typically invoked after Dialog.showDialog(Component, String)
returned true and before to read the values from the dialog widget.
commitEdit in interface DialogParseException - If at least one values couldn't be commited.JFormattedTextField.commitEdit(),
JSpinner.commitEdit()
public boolean showDialog(Component owner,
String title)
owner. If owner is contained into a JDesktopPane,
the dialog box will appears as an internal frame.
Multi-threading
Geotk implementations allow this method to be invoked from any thread. If the caller
thread is not the Swing thread, then the execution of this method will be
registered in the AWT Event Queue and the caller thread will block until completion.
showDialog in interface Dialogowner - The parent component for the dialog box, or null if there is no parent.title - The dialog box title.
true if user pressed the "Ok" button, or false otherwise
(e.g. pressing "Cancel" or closing the dialog box from the title bar).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||