public class IlvBlinkingMultiPaint extends Object implements Paint, IlvAdaptablePaint, IlvBlinkingDrawingResource
IlvGraphic
support blinking paints.
Limitation: For technical reasons, the period duration is limited from 1 to max integer (not max long). It is recommended to use the same durations whenever possible for all objects, and to choose the durations not too small (e.g. not smaller than 100 ms), because otherwise the performance of the system will degrade dramatically.
KEY_USER_BOUNDS
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
IlvBlinkingMultiPaint(long period,
Paint... paint)
Creates a new multi blinking paint.
|
IlvBlinkingMultiPaint(Paint... paint)
Creates a new multi blinking paint.
|
Modifier and Type | Method and Description |
---|---|
PaintContext |
createContext(ColorModel cm,
Rectangle r,
Rectangle2D r2d,
AffineTransform xform,
RenderingHints hints)
Creates and returns a
PaintContext . |
boolean |
equals(Object obj)
Determines whether another object is equal to this
IlvBlinkingPaint . |
Paint |
getCurrentPaint()
Returns current paint.
|
long |
getOffPeriod()
Returns the duration, in milliseconds, of the "off" period.
|
long |
getOnPeriod()
Returns the duration, in milliseconds, of the "on" period.
|
Paint[] |
getPaints()
Returns the paints used in the different phases.
|
long |
getPeriod()
Returns the duration, in milliseconds, of the "on" and "off" period.
|
int |
getTransparency()
Returns the transparency mode for this
Paint . |
int |
hashCode()
Returns the hash code of this object.
|
boolean |
isAdapting()
Returns
true if the createContext method of this
object may rely on its userBounds argument. |
boolean |
isOn()
Returns
true if this paint displays like the "on" state,
and false if this paint displays like the "off" state. |
void |
notifyUsed(IlvBlinkingObject obj,
boolean used)
Called by
IlvGraphic if this paint is used. |
void |
setOn(boolean flag)
Sets whether this paint displays like the "on" or "off" state.
|
void |
setTemporarilyDisabled(boolean flag)
Temporarily disable the blinking.
|
public IlvBlinkingMultiPaint(Paint... paint)
paint
- A number of paints (at least 2) used during the periods.public IlvBlinkingMultiPaint(long period, Paint... paint)
period
- Duration, in milliseconds, of each periodpaint
- A number of paints (at least 2) used during the periods.public boolean equals(Object obj)
IlvBlinkingPaint
.public int hashCode()
public PaintContext createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints)
PaintContext
.
If the current state is on, it returns a context representing the "on
paint", otherwise the "off paint".createContext
in interface Paint
cm
- the specified ColorModel
r
- the specified Rectangle
r2d
- the specified Rectangle2D
xform
- the specified AffineTransform
hints
- the specified RenderingHints
PaintContext
that is used to generate a
solid color pattern.Paint.createContext(java.awt.image.ColorModel, java.awt.Rectangle, java.awt.geom.Rectangle2D, java.awt.geom.AffineTransform, java.awt.RenderingHints)
,
Paint
,
PaintContext
public int getTransparency()
Paint
.
If the current state is on, it returns a transparency of the "on
paint", otherwise of the "off paint".getTransparency
in interface Transparency
Paint
object's transparency mode.Paint
,
Transparency
public boolean isAdapting()
true
if the createContext
method of this
object may rely on its userBounds
argument.isAdapting
in interface IlvAdaptablePaint
public Paint getCurrentPaint()
public Paint[] getPaints()
public long getPeriod()
public long getOnPeriod()
getPeriod()
.getOnPeriod
in interface IlvBlinkingDrawingResource
public long getOffPeriod()
getPeriod()
.getOffPeriod
in interface IlvBlinkingDrawingResource
public void setOn(boolean flag)
setOn
in interface IlvBlinkingDrawingResource
flag
- true
means it displays like the "on" statepublic boolean isOn()
true
if this paint displays like the "on" state,
and false
if this paint displays like the "off" state.isOn
in interface IlvBlinkingDrawingResource
public void setTemporarilyDisabled(boolean flag)
setTemporarilyDisabled
in interface IlvBlinkingDrawingResource
flag
- true
if temporarily disabled.public void notifyUsed(IlvBlinkingObject obj, boolean used)
IlvGraphic
if this paint is used.
You should not call this method.notifyUsed
in interface IlvBlinkingDrawingResource
obj
- The blinking object.used
- Whether the paint is used.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.