|
||||||||||
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
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.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. |
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. |
static void |
main(String[] args)
Show the dialog box. |
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)
Set the kernel. |
void |
setKernel(String name)
Set the kernel by its name. |
void |
setKernelSize(int width,
int height)
Set 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 discarted.public void removeKernel(KernelJAI kernel)
public void removeKernel(String kernel)
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 boolean showDialog(Component owner, String title)
owner
is contained into a
JDesktopPane
, the dialog box will appears as an internal frame. This
method can be invoked from any thread (may or may not be the Swing thread).
owner
- 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).public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |