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_BOUNDSBITMASK, 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 Paintcm - the specified ColorModelr - the specified Rectangler2d - the specified Rectangle2Dxform - the specified AffineTransformhints - the specified RenderingHintsPaintContext 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,
PaintContextpublic 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 TransparencyPaint object's transparency mode.Paint,
Transparencypublic boolean isAdapting()
true if the createContext method of this
object may rely on its userBounds argument.isAdapting in interface IlvAdaptablePaintpublic Paint getCurrentPaint()
public Paint[] getPaints()
public long getPeriod()
public long getOnPeriod()
getPeriod().getOnPeriod in interface IlvBlinkingDrawingResourcepublic long getOffPeriod()
getPeriod().getOffPeriod in interface IlvBlinkingDrawingResourcepublic void setOn(boolean flag)
setOn in interface IlvBlinkingDrawingResourceflag - 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 IlvBlinkingDrawingResourcepublic void setTemporarilyDisabled(boolean flag)
setTemporarilyDisabled in interface IlvBlinkingDrawingResourceflag - 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 IlvBlinkingDrawingResourceobj - The blinking object.used - Whether the paint is used.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.