public class IlvHoverHighlightingImageOperation extends IlvObjectInteractor
IlvManager.setHoverHighlightingImageOperation(IlvHoverHighlightingImageOperation)
.
This class allows you to choose an image operation and the transparency level, applied to the normal rendering of the object, to be used when displaying the highlighted graphic object. The highlighted object is drawn in a (transparent) buffered image on which the image operation is applied before being displayed on the view.
Modifier and Type | Class and Description |
---|---|
static interface |
IlvHoverHighlightingImageOperation.Filter
Inner interface that serves to filter the highlighted graphic objects.
|
static class |
IlvHoverHighlightingImageOperation.GraphicBagFilter
A filter class that only highlights graphic objects that are an instance
of
IlvGraphicBag . |
static class |
IlvHoverHighlightingImageOperation.NonGraphicBagFilter
A filter class that only highlights graphic objects that are not an instance
of
IlvGraphicBag . |
Modifier and Type | Field and Description |
---|---|
static BufferedImageOp |
BLUR_OP
Predefined blur operation
static float[] blurKernel = {
ninth,ninth,ninth,
ninth,ninth,ninth,
ninth,ninth,ninth
;
BufferedImageOp BLUR_OP = new ConvolveOp(new Kernel(3, 3, blurKernel));
|
static BufferedImageOp |
BRIGHTEN_OP
Predefined brighten operation
float[] brightKernel = { 1.5f };
BufferedImageOp BRIGHTEN_OP =
new ConvolveOp(new Kernel(1, 1, brightKernel));
|
static BufferedImageOp |
GRAYSCALE_OP
Predefined grayscale operation
BufferedImageOp GRAYSCALE_OP =
new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
|
static boolean |
HIGHLIGHT_SELECTION
Indicates whether selected graphic objects should be highlighted.
|
static BufferedImageOp |
INVERT_COLORS_OP
Predefined invert colors operation
byte lut[] = new byte[256];
for (int j = 0; j < 256; j++) {
lut[j] = (byte) (255 - j);
}
BufferedImageOp INVERT_COLORS_OP =
new LookupOp(new ByteLookupTable(0, lut), null);
|
static BufferedImageOp |
SHARPEN_OP
Predefined edge detection operation
float[] sharpenKernel = { 0.0f, -1.0f, 0.0f, -1.0f, 5.0f, -1.0f, 0.0f, -1.0f, 0.0f };
BufferedImageOp SHARPEN_OP =
new ConvolveOp(new Kernel(3, 3, sharpKernel),ConvolveOp.EDGE_NO_OP, null);
|
Constructor and Description |
---|
IlvHoverHighlightingImageOperation()
Creates a new default
IlvHoverHighlightingImageOperation with
an INVERT_COLORS_OP operation and an alpha value of 0.8 . |
IlvHoverHighlightingImageOperation(BufferedImageOp imageOperation,
float alpha)
Creates a new
IlvHoverHighlightingImageOperation . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
drawHighlight()
Draws the currently highlighted object on the target view, through an
image operation.
|
float |
getAlpha()
Returns the alpha composition value of the highlight representation.
|
protected IlvGraphic |
getHighlightedGraphic()
Returns the highlighted graphic object.
|
IlvHoverHighlightingImageOperation.Filter |
getHighlightFilter()
Returns the filter which indicates which graphic object can be highlighted.
|
BufferedImageOp |
getImageOperation()
Returns the image operation used to draw the highlighted object.
|
protected IlvManagerView |
getTargetView()
Returns the view where the highlighted graphic object is displayed.
|
protected void |
hideHighlight(int margin)
Redraws the region highlighted with its initial appearance.
|
void |
onExit(IlvGraphic sel,
IlvObjectInteractorContext context)
Tracks the exiting events to refresh the highlighted area.
|
boolean |
processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
Processes the
MOUSE_MOVED events to highlight the area where
the object is located. |
void |
setAlpha(float alpha)
Sets the alpha composition value of the highlight representation.
|
protected void |
setHighlightedGraphic(IlvGraphic currentObj)
Sets the highlighted graphic object.
|
void |
setHighlightFilter(IlvHoverHighlightingImageOperation.Filter filter)
Sets a filter to indicate which graphic object can be highlighted.
|
void |
setImageOperation(BufferedImageOp imageOperation)
Sets the image operation to use to display the highlighted object.
|
protected void |
setTargetView(IlvManagerView view)
Sets the view where the highlighted graphic object is displayed.
|
boolean |
showHighlight(IlvGraphic obj,
IlvManagerView view)
Draws a graphic object in the view through the image operation.
|
Get, handleExpose, onEnter, Put
public static boolean HIGHLIGHT_SELECTION
false
.public static final BufferedImageOp BRIGHTEN_OP
float[] brightKernel = { 1.5f };
BufferedImageOp BRIGHTEN_OP =
new ConvolveOp(new Kernel(1, 1, brightKernel));
public static final BufferedImageOp SHARPEN_OP
float[] sharpenKernel = { 0.0f, -1.0f, 0.0f, -1.0f, 5.0f, -1.0f, 0.0f, -1.0f, 0.0f };
BufferedImageOp SHARPEN_OP =
new ConvolveOp(new Kernel(3, 3, sharpKernel),ConvolveOp.EDGE_NO_OP, null);
public static final BufferedImageOp BLUR_OP
static float[] blurKernel = {
ninth,ninth,ninth,
ninth,ninth,ninth,
ninth,ninth,ninth
;
BufferedImageOp BLUR_OP = new ConvolveOp(new Kernel(3, 3, blurKernel));
public static final BufferedImageOp GRAYSCALE_OP
BufferedImageOp GRAYSCALE_OP =
new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
public static final BufferedImageOp INVERT_COLORS_OP
byte lut[] = new byte[256];
for (int j = 0; j < 256; j++) {
lut[j] = (byte) (255 - j);
}
BufferedImageOp INVERT_COLORS_OP =
new LookupOp(new ByteLookupTable(0, lut), null);
public IlvHoverHighlightingImageOperation()
IlvHoverHighlightingImageOperation
with
an INVERT_COLORS_OP
operation and an alpha value of 0.8
.public IlvHoverHighlightingImageOperation(BufferedImageOp imageOperation, float alpha)
IlvHoverHighlightingImageOperation
.imageOperation
- The image operation to use.
You can use your own instance, or the predefined following values:
alpha
- An alpha value in the range of [0.0, 1.0].public void setAlpha(float alpha)
alpha
- The transparency level in the range [0.0, 1.0].getAlpha()
public float getAlpha()
setAlpha(float)
public BufferedImageOp getImageOperation()
public void setImageOperation(BufferedImageOp imageOperation)
imageOperation
- The image operation used to draw the highlighted
object.public boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
MOUSE_MOVED
events to highlight the area where
the object is located.processEvent
in class IlvObjectInteractor
obj
- The graphic object.event
- The event to process.context
- The context in which the event occurred.true
if the event was handled
by this processEvent
invocation,
false
otherwise.showHighlight(IlvGraphic, IlvManagerView)
public void onExit(IlvGraphic sel, IlvObjectInteractorContext context)
hideHighlight(int)
is called (for example, the manager also calls it when the object interactor is changed),
it is not recommended to override this method,
but rather hideHighlight(int)
if you need to build your own subclass.onExit
in class IlvObjectInteractor
sel
- The object.context
- The context for the object interactor.hideHighlight(int)
,
IlvObjectInteractor.onExit(ilog.views.IlvGraphic, ilog.views.IlvObjectInteractorContext)
public void setHighlightFilter(IlvHoverHighlightingImageOperation.Filter filter)
null
, which indicates that all non-selected
objects will be highlighted.
To enable the highlighting of selected objects, set the value true
for the flag {link HIGHLIGHT_SELECTION
).filter
- Instance of HighlightFilter
.IlvHoverHighlightingImageOperation.GraphicBagFilter
,
IlvHoverHighlightingImageOperation.NonGraphicBagFilter
public IlvHoverHighlightingImageOperation.Filter getHighlightFilter()
Filter
or null
if no
filter has been set.public boolean showHighlight(IlvGraphic obj, IlvManagerView view)
obj
- The graphic object.view
- The manager view.drawHighlight()
,
setHighlightFilter(ilog.views.IlvHoverHighlightingImageOperation.Filter)
protected boolean drawHighlight()
protected void hideHighlight(int margin)
margin
- Margin added for safety reason to the area to refresh.protected IlvGraphic getHighlightedGraphic()
showHighlight(IlvGraphic, IlvManagerView)
protected void setHighlightedGraphic(IlvGraphic currentObj)
currentObj
- The highlighted graphic object.showHighlight(IlvGraphic, IlvManagerView)
,
hideHighlight(int)
protected IlvManagerView getTargetView()
showHighlight(IlvGraphic, IlvManagerView)
protected void setTargetView(IlvManagerView view)
view
- The view where the highlighted graphic object is displayed.showHighlight(IlvGraphic, IlvManagerView)
,
hideHighlight(int)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.