public class IlvMarker extends IlvGraphic
IlvMarker
displays a specific graphic symbol at a given
location.
The default values for an IlvMarker
instance are as
follows:
Color.black
4
IlvPoint(0,0)
IlvMarker.IlvMarkerSquare
Note: an IlvMarker
instance is a
nonzoomable graphic object.
The following code example shows how to use an IlvMarker
in a
simple Java application:
IlvManager manager = new IlvManager(); IlvMarker myMarker = new IlvMarker( new IlvPoint(120,100), IlvMarker.IlvMarkerFilledDiamond); myMarker.setForeground(Color.cyan); myMarker.setSize(20); manager.addObject( myMarker, true);
The following image shows the different types of marker available with this class:
IlvMarker
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.
IlvPoint
,
IlvManager
,
IlvManagerView
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
IlvMarkerCircle
The Circle marker type.
|
static int |
IlvMarkerCross
The Cross marker type.
|
static int |
IlvMarkerDiamond
The Diamond marker type.
|
static int |
IlvMarkerFilledCircle
The Filled Circle marker type.
|
static int |
IlvMarkerFilledDiamond
The Filled Diamond marker type.
|
static int |
IlvMarkerFilledSquare
The Filled Square marker type.
|
static int |
IlvMarkerFilledTriangle
The Filled Triangle marker type.
|
static int |
IlvMarkerPlus
The Plus marker type.
|
static int |
IlvMarkerSquare
The Square marker type.
|
static int |
IlvMarkerTriangle
The Triangle marker type.
|
Constructor and Description |
---|
IlvMarker()
|
IlvMarker(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
IlvMarker(IlvMarker source)
Creates a marker by copying an existing one.
|
IlvMarker(IlvPoint p,
int type)
Creates a new marker.
|
IlvMarker(IlvPoint p,
int type,
int size)
Creates a new marker.
|
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(IlvTransformer t)
Applies a transformation to the object.
|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.
|
IlvGraphic |
copy()
Copies the object.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object.
|
static void |
DrawMarker(Graphics dst,
IlvPoint p,
int type,
int size)
Draws the marker.
|
Color |
getForeground()
Returns the color of the marker.
|
IlvPoint |
getPoint()
Returns the center point of the marker.
|
int |
getSize()
Returns the size of the marker.
|
int |
getType()
Returns the type of the marker.
|
IlvSelection |
makeSelection()
Creates a selection object for this graphic object.
|
void |
setForeground(Color color)
Changes the color of the marker.
|
void |
setPoint(IlvPoint p)
Changes the center point of the marker.
|
void |
setSize(int size)
Changes the size of the marker.
|
void |
setType(int type)
Changes the type of the marker.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
boolean |
zoomable()
Overrides the method of
IlvGraphic to return
false , because this object is not zoomable. |
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, contains, 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, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public static final int IlvMarkerSquare
public static final int IlvMarkerDiamond
public static final int IlvMarkerCircle
public static final int IlvMarkerCross
public static final int IlvMarkerPlus
public static final int IlvMarkerFilledSquare
public static final int IlvMarkerFilledCircle
public static final int IlvMarkerFilledDiamond
public static final int IlvMarkerTriangle
public static final int IlvMarkerFilledTriangle
public IlvMarker()
IlvMarker(IlvPoint, int)
public IlvMarker(IlvPoint p, int type, int size)
p
- The location of the marker.
It defines the center point of the marker.type
- The type of the marker. The type of the marker
defines the way the marker is drawn. Valid values are one of the
predefined marker types (IlvMarkerSquare
,
IlvMarkerDiamond
, and so on).
You can combine marker types
(such as IlvMarkerSquare & IlvMarkerDiamond
)
to create more complex markers.size
- The size of the marker. A marker is defined by its center
point p
and its size. The marker will then be drawn in the
square located at (p.x-size, p.y -size)
and of size 2*size
.public IlvMarker(IlvPoint p, int type)
public IlvMarker(IlvMarker source)
source
- The source marker.public IlvMarker(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 getPoint()
setPoint(ilog.views.IlvPoint)
public void setPoint(IlvPoint p)
p
- The new center point.getPoint()
public int getType()
setType(int)
public void setType(int type)
type
- The new type. Valid values are one of the
predefined marker types (IlvMarkerSquare
,
IlvMarkerDiamond
, and so on). You can combine marker types
(such as IlvMarkerSquare & IlvMarkerDiamond
)
to create a more complex marker.getType()
,
IlvMarkerSquare
,
IlvMarkerDiamond
,
IlvMarkerCircle
,
IlvMarkerCross
,
IlvMarkerPlus
,
IlvMarkerFilledSquare
,
IlvMarkerFilledCircle
,
IlvMarkerFilledDiamond
,
IlvMarkerTriangle
,
IlvMarkerFilledTriangle
public int getSize()
setSize(int)
public void setSize(int size)
getPoint()
)
and its size.
A marker is drawn in a square of size 2*size
located at (p.x-size, p.y-size)
, where p
is the center point.size
- The size of the marker.getSize()
public void draw(Graphics dst, IlvTransformer t)
draw
in class IlvGraphic
dst
- The destination Graphics.t
- The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public IlvRect boundingBox(IlvTransformer t)
boundingBox
in class IlvGraphic
t
- The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public void applyTransform(IlvTransformer t)
getPoint()
).applyTransform
in class IlvGraphic
t
- The transformer to be applied.IlvGraphic
public IlvSelection makeSelection()
IlvUnresizeableDrawSelection
.makeSelection
in class IlvGraphic
IlvDrawSelection
public void setForeground(Color color)
IlvBlinkingColor
.setForeground
in class IlvGraphic
color
- The new color.IlvGraphic.draw(Graphics, IlvTransformer)
,
IlvGraphic.setBackground(Color)
,
IlvGraphic.setFillOn(boolean)
,
IlvGraphic.setStrokeOn(boolean)
,
IlvGraphic
public Color getForeground()
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not call this
method directly; instead, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvGraphic
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public boolean zoomable()
IlvGraphic
to return
false
, because this object is not zoomable.zoomable
in class IlvGraphic
IlvGraphic
,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvManager
public static void DrawMarker(Graphics dst, IlvPoint p, int type, int size)
dst
- The destination Graphics to draw the marker.p
- The center point of the marker.type
- The type of the marker.size
- The size of the marker.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.