The ShadowEllipse class
The ShadowEllipse object is an ellipse object with a drop shadow, as seen below:
A ShadowEllipse
You can design such an object from scratch by implementing a subclass of the
IlvGraphic class.
IlvGraphic is an abstract class. Therefore, some of its methods must be redefined in derived classes. This is the case for:
public abstract void draw(Graphics dst, IlvTransformer t)
public abstract IlvRect boundingBox(IlvTransformer t)
public abstract void applyTransform(IlvTransformer t)
public abstract IlvGraphic copy()
Other methods, such as move, resize, rotate, and contains, have a default implementation in the IlvGraphic implementation. These methods, as well as any other method that modifies the bounding box, are implemented by means of a call to the applyTransform function. If the new class has a parent that defines some of these methods, you simply inherit the functions from this parent class.
The
ShadowEllipse class defines the
draw,
contains, and
boundingBox methods. In addition, it defines a
write method that is necessary to write the object to a stream and a constructor that takes an
IlvInputStream as a parameter to read the object from a stream. For details, see
The write method and
The read constructor. These methods have no default implementation. You must provide a version of them for each subclass of the
IlvGraphic class. If you do not intend to write additional information to the stream, you do not need to implement the
write method, but you always need to define a constructor with an
IlvInputStream parameter. Otherwise, you will not be able to read the object from a stream.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.