public class IlvRectBalloon extends IlvBalloon
IlvRectBalloon
represents an
balloon with a rectangle shape.
The default settings for an IlvRectBalloon
instance are the
same as IlvBalloon
.
IlvRectBalloon
in a simple Java application:
IlvManager manager = new IlvManager(); // Creates the composite graphic with an IlvCenteredLayout IlvCompositeGraphic node = new IlvCompositeGraphic(); node.setLayout(new IlvCenteredLayout(new Insets(4,10,4,10))); // Creates the balloon IlvRectBalloon balloon = new IlvRectBalloon(); balloon.setOrientation(SwingConstants.NORTH_WEST); balloon.setPointerDepth(10); balloon.setShadowThickness(0); balloon.setShadowColor(Color.black); balloon.setBorderColor(Color.black); // Creates a multiline label IlvZoomableLabel label = new IlvZoomableLabel(new IlvPoint(0,0), "IlvRectBalloon Example\nThis is a balloon"); // Adds the balloon and its label node.setChildren(0,balloon); node.setChildren(1,label); manager.addObject(node, true);
The following image shows the graphic objects created in the code example:
>
IlvRectBalloon
is a custom graphic object, that is, a subclass
of IlvGraphic
. Graphic objects are controlled using an
IlvManager
instance and displayed using one or more
IlvManagerView
instances in a Java Swing application.
For information about generic features for graphic objects, see
IlvGraphic.
IlvCompositeGraphic
,
IlvCenteredLayout
,
IlvManager
,
IlvManagerView
,
Serialized FormConstructor and Description |
---|
IlvRectBalloon()
Creates an
IlvRectBalloon |
IlvRectBalloon(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
IlvRectBalloon(IlvRectBalloon source)
Creates a new
IlvRectBalloon by copying an existing one. |
IlvRectBalloon(int orientation,
int pointerDepth,
int shadowThickness,
Color balloonColor,
Color borderColor,
Color shadowColor)
Creates a rectangle balloon with the characteristics given by the supplied parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within this balloon.
|
IlvGraphic |
copy()
Returns a copy of this balloon.
|
void |
draw(Graphics g,
IlvTransformer t)
Draws the object.
|
IlvPoint |
getHotSpot()
The hotspot is the corner of the pointer relative to bounding box.
|
applyTransform, boundingBox, getBalloonColor, getBorderColor, getInsets, getOrientation, getPointerDepth, getShadowColor, getShadowThickness, moveResize, setBalloonColor, setBorderColor, setInsets, setOrientation, setPointerDepth, setShadowColor, setShadowThickness, write
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, isVisible, localeChanged, makeSelection, move, move, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, zoomable
public IlvRectBalloon()
IlvRectBalloon
public IlvRectBalloon(IlvRectBalloon source)
IlvRectBalloon
by copying an existing one.public IlvRectBalloon(int orientation, int pointerDepth, int shadowThickness, Color balloonColor, Color borderColor, Color shadowColor)
orientation
- Balloon orientation.
pointerDepth
- Balloon pointer depth.shadowThickness
- Balloon shadow thickness.balloonColor
- Balloon background color.borderColor
- Balloon border color.shadowColor
- Balloon shadow color.IlvBalloon.setOrientation(int)
,
IlvBalloon.setPointerDepth(int)
,
IlvBalloon.setShadowThickness(int)
,
IlvBalloon.setBalloonColor(java.awt.Color)
,
IlvBalloon.setBorderColor(java.awt.Color)
,
IlvBalloon.setShadowColor(java.awt.Color)
public IlvRectBalloon(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public IlvGraphic copy()
copy
in class IlvGraphic
IlvGraphic
public IlvPoint getHotSpot()
public void draw(Graphics g, IlvTransformer t)
draw
in class IlvGraphic
g
- The graphic context.t
- The transformer used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in class IlvGraphic
p
- The point to be tested.tp
- The point p
transformed by the transformer t
.t
- The transformation that was applied to this object when it
was drawn.true
if the point lies inside this graphic object.IlvGraphic
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.