|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.IlvLinkImage
ilog.views.graphic.IlvPolylineLinkImage
ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage
ilog.views.graphic.linkpolicy.IlvCrossingAwareLinkImage
ilog.views.graphic.IlvEnhancedPolylineLinkImage
ilog.views.sdm.graphic.IlvSimpleLink
ilog.views.sdm.graphic.IlvGeneralLink
public class IlvGeneralLink
A graphic widget to display a link. This is intended to be used in the
IlvStyleSheetRenderer, as it uses the bean properties
for customization intensively.
For a complete description see the user documentation.
| Field Summary | |
|---|---|
static int |
ANIM_SPEED
Animation speed for all links. |
static int |
ARROW_DECORATION
A custom arrow shape, which is defined by a decoration. |
static int |
ARROW_FILL
The filled triangle arrow shape. |
static int |
ARROW_GRADIENT
The arrow (actually, the orientation) of the link is represented by a smooth luminosity effect along the link. |
static int |
ARROW_OPEN
The 2-arms arrow shape. |
static int |
DECORATION_ABSOLUTE
The decoration option to let the decoration position itself. |
static int |
DECORATION_ANCHOR_BOTTOM
The decoration option that anchors at the bottom. |
static int |
DECORATION_ANCHOR_LEFT
The decoration option that anchors to the left. |
static int |
DECORATION_ANCHOR_RIGHT
The decoration option that anchors to the right. |
static int |
DECORATION_ANCHOR_TOP
The decoration option that anchors on top. |
static int |
DECORATION_ANIMATE
The decoration option that enables animation. |
static int |
DECORATION_FIXED_SIZE
The decoration option that prevents zooming on the decoration. |
static int |
DECORATION_FULL_RETRACT_AT_END
The decoration option to simulate an arrow behavior. |
static int |
DECORATION_HALF_RETRACT_AT_END
The decoration option to simulate an arrow behavior. |
static int |
DECORATION_NO_RETRACT_AT_END
The decoration option to simulate an arrow behavior. |
static int |
DECORATION_NOTHING
The default decoration option. |
static int |
DECORATION_OVER
The decoration option for hard-positioning the decoration onto the center of the link. |
static int |
DECORATION_ROTATE
The decoration option that rotates the decoration according to the link orientation. |
static int |
MODE_GRADIENT
Mode where the foreground color generates a gradient to paint the link. |
static int |
MODE_NEON
Mode where the foreground color generates a neon-like gradient to paint the link. |
static int |
MODE_TEXTURE
Mode where the texture property is used to paint the link. |
static int |
MODE_UNICOLOR
Mode where the foreground color paints the link. |
| Fields inherited from class ilog.views.graphic.IlvEnhancedPolylineLinkImage |
|---|
BRIDGE_CROSSINGS, NO_CROSSINGS, TUNNEL_CROSSINGS |
| Constructor Summary | |
|---|---|
IlvGeneralLink()
Bean constructor. |
|
IlvGeneralLink(IlvGeneralLink source)
Copy constructor. |
|
IlvGeneralLink(IlvGraphic from,
IlvGraphic to)
Creates and initializes a new IlvGeneralLink. |
|
IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean oriented)
Creates and initializes a new IlvGeneralLink. |
|
IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean backoriented,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new IlvGeneralLink. |
|
IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new IlvGeneralLink. |
|
IlvGeneralLink(IlvInputStream stream)
Reads a link from an input stream. |
|
| Method Summary | |
|---|---|
void |
addObject(IlvGraphic graphic,
boolean redraw)
Adds a graphic object in the bag. |
void |
applyToObject(IlvGraphic graphic,
IlvApplyObject f,
Object arg,
boolean redraw)
Applies a method to a graphic object of the bag. |
protected IlvRect |
arrowBBox(IlvPoint pos,
double theta,
IlvTransformer t)
Returns the arrow bounding box. |
IlvRect |
calcBoundingBox(IlvTransformer t)
Calculates the bounding rectangle of the link. |
protected Paint[] |
colorize(Color base,
float fsize)
Generates rainbow colors from a base, when mode is MODE_GRADIENT. |
protected Paint[] |
colorizeNeon(Color base,
float fsize)
Generates rainbow colors from a base, when mode is MODE_NEON. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the link. |
IlvGraphic |
copy()
Copies the object. |
protected IlvGraphic |
createCrossingGraphic(int mode)
Creates the appropriate crossing graphic. |
protected Shape |
createFillArrowShape(IlvPoint pos,
double theta,
float length)
Returns the shape of a filled arrow. |
protected Shape |
createOpenArrowShape(IlvPoint pos,
double theta,
float length)
Returns the shape of an open arrow. |
protected Shape |
curvedShapeFromManyPoints(IlvPoint[] points)
Called by shapeFromPoints() to generate a curved shape. |
IlvRect |
decorationBoundingBox(IlvTransformer t,
int decorationIndex)
Returns the bounding box of one of the link decorations. |
int |
decorationHit(IlvPoint tp,
IlvTransformer t)
Returns the decoration which contains the given point. |
IlvTransformer |
decorationTransformer(IlvTransformer t,
int decorationIndex)
Returns the transformer that will be applied to one of the link decorations. |
protected void |
drawArrow(Graphics dst,
IlvPoint pos,
double theta,
IlvTransformer t)
Draws an arrow. |
protected void |
drawCore(Graphics2D dst,
IlvTransformer t)
Draws the object. |
Color |
getAlternateColor()
Returns the current alternate color. |
float |
getAnimateSpeed()
Returns the current animation speed. |
Color |
getArrowColor()
Returns the current arrow color. |
int |
getArrowMode()
Returns the current arrow style. |
float |
getArrowPosition()
Returns the current arrow position. |
float |
getArrowRatio()
Returns the current arrow size ratio. |
protected float |
getArrowSize(float lineWidth,
IlvTransformer t)
Returns the size of the arrow for the specified IlvTransformer and lineWidth. |
protected float |
getBackArrowSize(float lineWidth,
IlvTransformer t)
Returns the size of the backward arrow for the specified IlvTransformer and lineWidth. |
Color |
getBorderDownColor()
Returns the current lower border. |
float[] |
getBorderStyle()
Returns the dash pattern for the border. |
float |
getBorderStylePhase()
Returns the dash pattern offset for the border. |
Color |
getBorderUpColor()
Returns the current upper border color. |
float |
getBorderWidth()
Returns the current border width. |
float |
getCurved()
Returns whether the link is straight ( 0f) or curved (> 0f). |
int[] |
getDecorationOptions()
Returns the current decoration options. |
int |
getDecorationOptions(int index)
Returns the current decoration options. |
float[] |
getDecorationPositions()
Returns the current decoration positions. |
float |
getDecorationPositions(int index)
Returns the current decoration positions. |
IlvGraphic[] |
getDecorations()
Returns the current decorations of the link. |
IlvGraphic |
getDecorations(int index)
Returns the decoration located at the specified index. |
protected IlvPoint[] |
getDrawingLinkPoints(IlvTransformer t)
Returns the link points used to draw the polyline of the link. |
IlvPoint[] |
getIntermediateLinkPoints()
Returns the intermediate link points (without the two connection points). |
float |
getInternalZoom()
Returns the current internal scale factor. |
String |
getLabel()
Returns the label of the object. |
IlvRect |
getLabelBBox(IlvTransformer t)
Returns the area where the label is displayed. |
float |
getLineStylePhase()
Returns the dash pattern offset. |
float |
getMinimumLineWidth()
Returns the minimum line width (while zooming out). |
int |
getMode()
Returns the current drawing mode. |
IlvGraphic |
getObject(String name)
Returns the graphic object with that name if it exists in the bag, otherwise returns null. |
IlvGraphicEnumeration |
getObjects()
Implementation of the IlvGraphicBag interface. |
protected IlvPoint |
getPolylinePosition(IlvPoint[] points,
float ratio,
double[] slope)
Deprecated. replaced by getPolylinePosition(ilog.views.IlvPoint[], float,
double[], ilog.views.IlvTransformer) |
IlvPoint |
getPolylinePosition(IlvPoint[] points,
float ratio,
double[] slope,
IlvTransformer current)
Utility function to return the position of a point along a polyline. |
static int |
getQualityLevel()
Returns the current quality level. |
float |
getRadius()
Returns current radius for rounded links. |
float |
getRealLinkWidth(IlvTransformer t)
Returns the final width of the link, according to the given transformer. |
Shape |
getShape(IlvPoint[] points)
Deprecated. replaced by getShape(ilog.views.IlvPoint[], ilog.views.IlvTransformer) |
Shape |
getShape(IlvPoint[] points,
IlvTransformer t)
Returns the shape of the link, according to the given intermediate points. |
protected Shape |
getSimpleShape(IlvPoint[] points,
IlvTransformer t)
Returns the shape of the link, according to the given intermediate points. |
IlvTexture |
getTexture()
Returns the current texture. |
String |
getWave()
Returns the current wave value of the link. |
boolean |
isCrossingEnabled()
Returns true if crossings are shown on the link. |
boolean |
isOptimized()
Returns the "optimized" mode of this link. |
boolean |
isSpline()
Tests if the link has spline routing functionality. |
protected boolean |
mergeCrossings(float dist,
float gap,
float lineWidth,
IlvTransformer t)
Returns whether to merge two subsequent crossings. |
void |
moveDecoration(int index,
float x,
float y,
IlvTransformer t)
Label layout uses this method to set the decoration location. |
void |
moveLabel(float x,
float y,
IlvTransformer t)
Label layout uses this method to set the label location. |
void |
moveObject(IlvGraphic graphic,
float x,
float y,
boolean redraw)
Changes the location of a graphic object. |
void |
reDrawObj(IlvGraphic graphic)
Redraws a graphic object located in the bag. |
void |
reDrawRegion(IlvRegion region)
Redraws a region of the bag. |
void |
removeObject(IlvGraphic graphic,
boolean redraw)
Removes a graphic object from the bag. |
void |
reshapeObject(IlvGraphic graphic,
IlvRect newrect,
boolean redraw)
Changes the size of a graphic object. |
protected Shape |
roundedFromManyPoints(IlvPoint[] points,
float radius,
IlvTransformer current)
Called by shapeFromPoints() to generate a straight shape with rounded corners. |
void |
setAlternateColor(Color c)
Sets the alternating color. |
void |
setAnimateSpeed(float speed)
Sets the speed of animation. |
void |
setArrowColor(Color value)
Sets the arrow color. |
void |
setArrowMode(int style)
Sets the arrow drawing style. |
void |
setArrowPosition(float value)
Sets the arrow position as a proportion of the link length (for example, .5f is the middle of the link). |
void |
setArrowRatio(float value)
Sets the arrow size as a proportion of the link width (for example, 1f is about twice the link width). |
void |
setBackOriented(boolean oriented)
Sets whether the link is backward oriented. |
void |
setBorderDownColor(Color value)
Sets the lower border color. |
void |
setBorderStyle(float[] lineStyle)
Overrides the array representing the lengths of the dash segments for the border. |
void |
setBorderStylePhase(float phase)
Sets the dash pattern offset for the border. |
void |
setBorderUpColor(Color value)
Sets the border color. |
void |
setBorderWidth(float value)
Sets the border width. |
void |
setCrossingMode(int mode)
Sets the crossing mode of the link. |
void |
setCurved(float value)
Sets the curved look and the smoothness of the spline. |
void |
setDecorationOptions(int[] value)
Sets all the decoration options at once. |
void |
setDecorationOptions(int index,
int value)
Sets how the decoration is displayed. |
void |
setDecorationPositions(float[] value)
Sets all the relative decoration positions of the link. |
void |
setDecorationPositions(int index,
float value)
Sets the relative decoration positions on the link. |
void |
setDecorations(IlvGraphic[] decorations)
Sets decorations on the link. |
void |
setDecorations(int index,
IlvGraphic decoration)
Sets a decoration on the link. |
void |
setEndCap(int endCap)
Changes the decorations applied at the end of the polyline. |
void |
setForeground(Color c)
Sets the color of the link. |
void |
setIntermediateLinkPoints(IlvPoint[] points)
Sets the intermediate points of the link. |
void |
setInternalZoom(float value)
Sets the internal scale factor. |
void |
setLabel(String label)
Sets a label for the link. |
void |
setLineJoin(int lineJoin)
Changes the decoration applied when two segments are joined. |
void |
setLineStyle(float[] lineStyle)
Changes the array representing the lengths of the dash segments. |
void |
setLineStylePhase(float phase)
Sets the dash pattern offset. |
void |
setLineWidth(float val)
Changes the line width of the object. |
void |
setMinimumLineWidth(float val)
Sets the minimum line width while zooming out. |
void |
setMode(int mode)
Sets the link drawing mode. |
boolean |
setObjectName(IlvGraphic graphic,
String name)
Changes the name of a graphic object. |
void |
setOptimized(boolean optimized)
Sets or clears the "optimized" mode of this link. |
void |
setOriented(boolean oriented)
Sets the link as oriented or nonoriented. |
void |
setOrthogonal(boolean orthogonal)
Enables the orthogonal mode of the link. |
static void |
setQualityLevel(int val)
Controls the quality rendering of the link. |
void |
setRadius(float radius)
Sets radius for rounded link. |
void |
setTexture(IlvTexture value)
Sets the texture. |
void |
setWave(String wave)
Sets the wavy outline for the link. |
protected Shape |
shapeFromPoints(IlvPoint[] points)
Deprecated. replaced by shapeFromPoints(ilog.views.IlvPoint[], ilog.views.IlvTransformer) |
protected Shape |
shapeFromPoints(IlvPoint[] points,
IlvTransformer current)
Generates a shape from the given points. |
boolean |
supportMultiline()
Returns true if the label can be a multiline label;
false otherwise. |
void |
translate(float dx,
float dy)
Translates the object. |
void |
updateLabelingModel(IlvSDMEngine engine,
IlvAnnealingLabelLayout layout,
ilog.views.sdm.internal.labellayout.IlvSDMLabelingModel model,
Object obj,
IlvGraphic graphic)
You should not call this method directly. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
boolean |
zoomable()
Returns false. |
| Methods inherited from class ilog.views.sdm.graphic.IlvSimpleLink |
|---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setCrossingEnabled, setGap, setGapZoomable, setMaximumLineWidth, setName, setToolTipText |
| Methods inherited from class ilog.views.graphic.IlvEnhancedPolylineLinkImage |
|---|
draw, getAlpha, getCrossingMode, getDefaultLinkShapePolicy, isAlphaBufferEnabled, isBackOriented, isMultiLinkBundled, isOrthogonal, setAlpha, setAlphaBufferEnabled, setGraphicBag, setMultiLinkBundled |
| Methods inherited from class ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage |
|---|
getLinkPoints, getLinkShapePolicy, getPointAt, setLinkShapePolicy |
| Methods inherited from class ilog.views.graphic.IlvPolylineLinkImage |
|---|
allowsPointInsertion, allowsPointRemoval, getPointsCardinal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ilog.views.IlvGraphicBag |
|---|
getGraphicBag |
| Field Detail |
|---|
public static int ANIM_SPEED
public static final int MODE_TEXTURE
public static final int MODE_UNICOLOR
public static final int MODE_GRADIENT
public static final int MODE_NEON
public static final int ARROW_FILL
public static final int ARROW_OPEN
public static final int ARROW_GRADIENT
public static final int ARROW_DECORATION
public static final int DECORATION_NOTHING
public static final int DECORATION_ANIMATE
public static final int DECORATION_ROTATE
public static final int DECORATION_FIXED_SIZE
public static final int DECORATION_ANCHOR_TOP
public static final int DECORATION_ANCHOR_BOTTOM
public static final int DECORATION_ANCHOR_LEFT
public static final int DECORATION_ANCHOR_RIGHT
public static final int DECORATION_OVER
public static final int DECORATION_ABSOLUTE
public static final int DECORATION_FULL_RETRACT_AT_END
ARROW_DECORATION, the
decoration position is 1f, and decoration options include
DECORATION_OVER.
public static final int DECORATION_HALF_RETRACT_AT_END
ARROW_DECORATION, the decoration position is 1f,
and decoration options include DECORATION_OVER.
public static final int DECORATION_NO_RETRACT_AT_END
ARROW_DECORATION, the decoration
position is 1f, and decoration options include
DECORATION_OVER.
| Constructor Detail |
|---|
public IlvGeneralLink()
public IlvGeneralLink(IlvGeneralLink source)
source - The copied object.
public IlvGeneralLink(IlvInputStream stream)
throws IlvReadFileException
stream - The input stream.
IlvReadFileException - if the format is not correct.
public IlvGeneralLink(IlvGraphic from,
IlvGraphic to)
IlvGeneralLink.
from - The origin object.to - The destination object.
public IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean oriented)
IlvGeneralLink.
from - The origin object.to - The destination object.oriented - Specifies whether an arrow is drawn at the end of the
link or not.
public IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean oriented,
IlvPoint[] points)
IlvGeneralLink.
from - The origin object.to - The destination object.oriented - Specifies whether an arrow is drawn at the end of the
link or not.points - The intermediate points of the link.
public IlvGeneralLink(IlvGraphic from,
IlvGraphic to,
boolean backoriented,
boolean oriented,
IlvPoint[] points)
IlvGeneralLink.
from - The origin object.to - The destination object.backoriented - Specifies whether an arrow is drawn at the start of
the link or not.oriented - Specifies whether an arrow is drawn at the end of the
link or not.points - The intermediate points of the link.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvSimpleLinkIlvGraphic instance.IlvGraphicpublic void setMode(int mode)
MODE_NEON.
mode - The new mode, either MODE_TEXTURE,
MODE_UNICOLOR, MODE_GRADIENT (default),
or MODE_NEON.getMode(),
IlvSimpleLink.addPropertyChangeListener(java.beans.PropertyChangeListener)public int getMode()
setMode(int)public boolean zoomable()
false.
zoomable in class IlvLinkImageIlvGraphic.zoomable(),
IlvLinkConnector.zoomable()public static void setQualityLevel(int val)
val - The quality level.
getQualityLevel()public static int getQualityLevel()
setQualityLevel(int)public void setOptimized(boolean optimized)
MODE_UNICOLOR, or if the link is very thin
(link width less than 2 pixels after applying
the view's transformer). Painting is not optimized in
any of these cases:
ARROW_GRADIENT.
Optimized mode is on by default.
In optimized mode, the actual look of the link may be slightly different in some cases, especially for think links. If you need the links to look exactly the same as with JViews 6.0, you can turn optimized mode off.
optimized - If true, the code optimizations
are used, otherwise the behavior is the same as in JViews 6.0.setWave(String),
setCurved(float),
setMode(int),
setArrowMode(int),
setBorderWidth(float),
setCrossingMode(int)public boolean isOptimized()
setOptimized(boolean)public void setAlternateColor(Color c)
null is passed, the link alternates foreground color
with this color value.
The lineStyle property con