站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

AnchorFactory (Visual Library API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.visual 2.2

org.netbeans.api.visual.anchor
Class AnchorFactory

java.lang.Object
  extended by org.netbeans.api.visual.anchor.AnchorFactory

public final class AnchorFactory
extends Object

This is a factory of all built-in anchor implementations. Anchors are designed to be shared by multiple instances of proxy anchors and connection widgets.


Nested Class Summary
static class AnchorFactory.DirectionalAnchorKind
          Represents possible orthogonal directions used by directional anchor.
 
Method Summary
static Anchor createCenterAnchor(Widget widget)
          Creates an anchor with always computes a point in the center of specified widget.
static Anchor createCircularAnchor(Widget widget, int radius)
          Creates an anchor which computes a point as the one on a circle around specified widget.
static Anchor createDirectionalAnchor(Widget widget, AnchorFactory.DirectionalAnchorKind kind)
          Creates a directional anchor with computes a point as the one in the middle of the boundary side of specified widget.
static Anchor createDirectionalAnchor(Widget widget, AnchorFactory.DirectionalAnchorKind kind, int gap)
          Creates a directional anchor with computes a point as the one in the middle of the boundary side of specified widget.
static Anchor createFixedAnchor(Point location)
          Creates a anchor with fixed scene location.
static Anchor createFreeRectangularAnchor(Widget widget, boolean includeBorders)
          Creates a free rectangular anchor.
static Anchor createProxyAnchor(StateModel model, Anchor... anchors)
          Creates a proxy anchor with delegates the computation one of specified anchors based on state in a model.
static Anchor createRectangularAnchor(Widget widget)
          Creates an anchor which computes a point as the one on the boundary of spacified widget.
static Anchor createRectangularAnchor(Widget widget, boolean includeBorders)
          Creates an anchor which computes a point as the one on the boundary of spacified widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFixedAnchor

public static Anchor createFixedAnchor(Point location)
Creates a anchor with fixed scene location.

Parameters:
location - the scene location
Returns:
the anchor

createProxyAnchor

public static Anchor createProxyAnchor(StateModel model,
                                       Anchor... anchors)
Creates a proxy anchor with delegates the computation one of specified anchors based on state in a model.

Parameters:
model - the model with state
anchors - the slave anchors
Returns:
the anchor

createCenterAnchor

public static Anchor createCenterAnchor(Widget widget)
Creates an anchor with always computes a point in the center of specified widget.

Parameters:
widget - the widget
Returns:
the anchor

createCircularAnchor

public static Anchor createCircularAnchor(Widget widget,
                                          int radius)
Creates an anchor which computes a point as the one on a circle around specified widget. The point is the closest one to location of opposite anchor.

Parameters:
widget - the widget
radius - the radius of the circle
Returns:
the anchor

createRectangularAnchor

public static Anchor createRectangularAnchor(Widget widget)
Creates an anchor which computes a point as the one on the boundary of spacified widget. The point is the closest one to location of opposite anchor.

Parameters:
widget - the widget
Returns:
the anchor

createRectangularAnchor

public static Anchor createRectangularAnchor(Widget widget,
                                             boolean includeBorders)
Creates an anchor which computes a point as the one on the boundary of spacified widget. The point is the closest one to location of opposite anchor.

Parameters:
widget - the widget
includeBorders - if true, then the boundary is widget bounds; if null then the boundary is widget client-area (bounds without borders)
Returns:
the anchor

createDirectionalAnchor

public static Anchor createDirectionalAnchor(Widget widget,
                                             AnchorFactory.DirectionalAnchorKind kind)
Creates a directional anchor with computes a point as the one in the middle of the boundary side of specified widget. The side is the closest one to the opposite anchor.

Parameters:
widget - the widget
kind - the kind of directional anchor
Returns:
the anchor

createDirectionalAnchor

public static Anchor createDirectionalAnchor(Widget widget,
                                             AnchorFactory.DirectionalAnchorKind kind,
                                             int gap)
Creates a directional anchor with computes a point as the one in the middle of the boundary side of specified widget. The side is the closest one to the opposite anchor.

Parameters:
widget - the widget
kind - the kind of directional anchor
gap - the gap between the widget and the anchor location
Returns:
the anchor

createFreeRectangularAnchor

public static Anchor createFreeRectangularAnchor(Widget widget,
                                                 boolean includeBorders)
Creates a free rectangular anchor. IT is similar to rectangular anchor but it is designed to be used together with FreeRouter.

Parameters:
widget - the widget
includeBorders - true if borders has to be included in the boundary
Returns:
the anchor

org.netbeans.api.visual 2.2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.