public class IlvCrossingCalculation extends Object
Modifier and Type | Method and Description |
---|---|
static void |
calculateCrossings(IlvCrossingAwareObject obj1,
IlvCrossingAwareObject obj2,
IlvTransformer t1,
IlvTransformer t2,
IlvManagerView view,
boolean horizontalPreferred)
Calculate the crossings between both input objects at given transformer
and adds them to both input objects.
|
static void |
calculateCrossings(IlvCrossingAwareObject obj,
IlvTransformer t,
IlvManagerView view,
boolean horizontalPreferred,
boolean nested)
Calculates the crossings between the input object and all other
objects in the grapher.
|
static void |
calculateCrossings(IlvManager manager,
HashSet objects,
IlvManagerView view,
boolean horizontalPreferred,
boolean nested)
Calculates the crossings between all crossing aware objects in the
input set and all crossing aware objects of the input manager.
|
static HashSet |
getCrossingAwareObjects(IlvManager m,
boolean traverse,
boolean onlyEnabled)
Returns the hashset of crossing aware objects of a manager.
|
static IlvManager |
getOwningManager(IlvGraphic g)
Returns the direct owning manager, of null if the graphic bag is not
an
IlvManager . |
static boolean |
isHorizontalPreferred(IlvManager manager)
Returns whether the crossings are active at segments that are more
or at segments that are more vertical.
|
static boolean |
isNestedCrossingCalculation(IlvManager manager)
Returns whether the calculation is done through nested graphs.
|
static void |
removeCrossings(Iterator crossings)
Removes all crossings of the input enumeration from its active and passive
crossing owner.
|
static boolean |
seeEachOther(IlvGraphic obj1,
IlvGraphic obj2)
Returns whether two crossing aware objects see each other.
|
static void |
setCrossingEnabled(IlvManager manager,
boolean traverse,
IlvGraphicFilter filter,
boolean enable,
boolean redraw)
Enables or disables the tunnel/jog crossing of all parameterizable
crossing aware objects.
|
static void |
setGap(IlvManager manager,
boolean traverse,
IlvGraphicFilter filter,
double gap,
boolean redraw)
Sets the gap width of the crossings of all parameterizable
crossing aware objects.
|
static void |
setGapZoomable(IlvManager manager,
boolean traverse,
IlvGraphicFilter filter,
boolean zoomable,
boolean redraw)
Sets whether the gap of the crossings of all parameterizable
crossing aware objects is zoomable.
|
static void |
setHorizontalPreferred(IlvManager manager,
boolean flag)
Sets whether the crossings are active at segments that are more
or at segments that are more vertical.
|
static void |
setLayerOfCrossingGraphic(IlvManager manager,
boolean traverse,
IlvGraphicFilter filter,
int layerNumber,
boolean redraw)
Sets the default layer of the graphic object that draws the crossings
at all parameterizable crossing aware objects.
|
static void |
setNestedCrossingCalculation(IlvManager manager,
boolean flag)
Sets whether the crossings calculation is done through nested graphs.
|
public static void calculateCrossings(IlvCrossingAwareObject obj, IlvTransformer t, IlvManagerView view, boolean horizontalPreferred, boolean nested)
null
, the input transformer is taken into
account.obj
- The object.t
- The transformer to draw the object.view
- The view to draw the object.horizontalPreferred
- If true
crossings are registered
at segments that are more horizontal, otherwise at segments that
are more vertical.nested
- If true
crossings between objects in different
managers are recognized. If false
, only the objects
inside the manager of the input object are recognized.public static void calculateCrossings(IlvManager manager, HashSet objects, IlvManagerView view, boolean horizontalPreferred, boolean nested)
manager
- The manager that contains all crossing aware objects.
Usually, this is the top level manager.objects
- A set of crossing aware objects whose crossings must
be recalculated.view
- The view to draw the objects.horizontalPreferred
- If true
crossings are registered
at segments that are more horizontal, otherwise at segments that
are more vertical.nested
- If true
crossings between objects in different
managers are recognized. If false
, only the objects
inside the manager of the input object are recognized.public static void calculateCrossings(IlvCrossingAwareObject obj1, IlvCrossingAwareObject obj2, IlvTransformer t1, IlvTransformer t2, IlvManagerView view, boolean horizontalPreferred)
IlvCrossingAwareObject.removeAllCrossings(IlvTransformer)
is
called on one of both input objects before calling this method.
If a view is given, the both input transformers are ignored and the
crossings are calculated relative to the drawing transformers of the view.
If the view is null
, the input transformers are taken into
account.obj1
- The one object.obj2
- The other object.t1
- The transformer to draw the one object.t2
- The transformer to draw the other object.view
- The view to display the objects.horizontalPreferred
- If true
crossings are registered
at segments that are more horizontal, otherwise at segments that
are more vertical.public static IlvManager getOwningManager(IlvGraphic g)
IlvManager
.public static void removeCrossings(Iterator crossings)
public static boolean seeEachOther(IlvGraphic obj1, IlvGraphic obj2)
obj1
- The first object.obj2
- The second object.public static void setHorizontalPreferred(IlvManager manager, boolean flag)
public static boolean isHorizontalPreferred(IlvManager manager)
public static void setNestedCrossingCalculation(IlvManager manager, boolean flag)
public static boolean isNestedCrossingCalculation(IlvManager manager)
public static HashSet getCrossingAwareObjects(IlvManager m, boolean traverse, boolean onlyEnabled)
m
- The manager.traverse
- If true
, submanagers are also considered.onlyEnabled
- If true
, only those objects are collected
that have currently crossings enabled.
If false
, all crossing aware objects are collected.IlvCrossingAwareObject.isCrossingEnabled()
public static void setCrossingEnabled(IlvManager manager, boolean traverse, IlvGraphicFilter filter, boolean enable, boolean redraw)
null
is passed as graphic object filter, all crossing
aware objects are treated. If a graphic object filter is passed, only
those objects are treated where IlvGraphicFilter.accept(ilog.views.IlvGraphic)
returns true
.manager
- The managertraverse
- If true
, submanagers are also considered.filter
- A filter that determines which graphic objects are changed.enable
- Whether the crossings are enabled.redraw
- Whether to redraw after the change.IlvParameterizedCrossingAwareObject.setCrossingEnabled(boolean)
public static void setGap(IlvManager manager, boolean traverse, IlvGraphicFilter filter, double gap, boolean redraw)
null
is passed as graphic object filter, all crossing
aware objects are treated. If a graphic object filter is passed, only
those objects are treated where IlvGraphicFilter.accept(ilog.views.IlvGraphic)
returns true
.manager
- The managertraverse
- If true
, submanagers are also considered.filter
- A filter that determines which graphic objects are changed.gap
- The gap width.redraw
- Whether to redraw after the change.IlvParameterizedCrossingAwareObject.setGap(double)
public static void setGapZoomable(IlvManager manager, boolean traverse, IlvGraphicFilter filter, boolean zoomable, boolean redraw)
null
is passed as graphic object filter, all crossing
aware objects are treated. If a graphic object filter is passed, only
those objects are treated where IlvGraphicFilter.accept(ilog.views.IlvGraphic)
returns true
.manager
- The managertraverse
- If true
, submanagers are also considered.filter
- A filter that determines which graphic objects are changed.zoomable
- Whether the gaps are zoomable.redraw
- Whether to redraw after the change.IlvParameterizedCrossingAwareObject.setGapZoomable(boolean)
public static void setLayerOfCrossingGraphic(IlvManager manager, boolean traverse, IlvGraphicFilter filter, int layerNumber, boolean redraw)
null
is passed as graphic object filter, all crossing
aware objects are treated. If a graphic object filter is passed, only
those objects are treated where IlvGraphicFilter.accept(ilog.views.IlvGraphic)
returns true
.manager
- The managertraverse
- If true
, submanagers are also considered.filter
- A filter that determines which graphic objects are changed.layerNumber
- The layer number of the crossing graphic.redraw
- Whether to redraw after the change.IlvParameterizedCrossingAwareObject.setLayerOfCrossingGraphic(int)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.