org.netbeans.api.visual 2.21.1

org.netbeans.api.visual.anchor
Class AnchorShapeFactory

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

public class AnchorShapeFactory
extends Object

The factory class of all built-in anchor shapes. The instances of all built-in anchor shapes can be used multiple connection widgets.


Nested Class Summary
static class AnchorShapeFactory.ConnectionEnd
           
 
Method Summary
static AnchorShape createAdjustableAnchorShape(AnchorShape shape, AnchorShapeLocationResolver resolver)
          Creates a proxy AnchorShape that is used to adjust the location of an AnchorShape.
static AnchorShape createAdjustableAnchorShape(AnchorShape shape, ConnectionWidget owner, AnchorShapeFactory.ConnectionEnd referencingEnd, Widget attachedWidget)
          Creates a proxy AnchorShape that is used to adjust the location of an AnchorShape.
static AnchorShape createArrowAnchorShape(int degrees, int size)
          Creates an arrow anchor shape.
static AnchorShape createImageAnchorShape(Image image)
          Creates an image anchor shape.
static AnchorShape createImageAnchorShape(Image image, boolean lineOriented)
          Creates an image anchor shape with ability to specify line orientation.
static AnchorShape createTriangleAnchorShape(int size, boolean filled, boolean output)
          Creates a triangular anchor shape.
static AnchorShape createTriangleAnchorShape(int size, boolean filled, boolean output, int cutDistance)
          Creates a triangular anchor shape.
static AnchorShapeLocationResolver createWidgetResolver(ConnectionWidget owner, AnchorShapeFactory.ConnectionEnd referencingEnd, Widget attachedWidget)
          Creates a AnchorShapeLocationResolver that uses a widget to resolve the AnchorsShapes location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createImageAnchorShape

public static AnchorShape createImageAnchorShape(Image image)
Creates an image anchor shape.

Parameters:
image - the image
Returns:
the anchor shape

createImageAnchorShape

public static AnchorShape createImageAnchorShape(Image image,
                                                 boolean lineOriented)
Creates an image anchor shape with ability to specify line orientation.

Parameters:
image - the image
lineOriented - if true, then the image is line oriented
Returns:
the anchor shape

createTriangleAnchorShape

public static AnchorShape createTriangleAnchorShape(int size,
                                                    boolean filled,
                                                    boolean output)
Creates a triangular anchor shape.

Parameters:
size - the size of triangle
filled - if true, then the triangle is filled
output - if true, then it is output triangle
Returns:
the anchor shape

createTriangleAnchorShape

public static AnchorShape createTriangleAnchorShape(int size,
                                                    boolean filled,
                                                    boolean output,
                                                    int cutDistance)
Creates a triangular anchor shape.

Parameters:
size - the size of triangle
filled - if true, then the triangle is filled
output - if true, then it is output triangle
cutDistance - the distance where the related line is cut (usually 1px smaller than the size)
Returns:
the anchor shape

createArrowAnchorShape

public static AnchorShape createArrowAnchorShape(int degrees,
                                                 int size)
Creates an arrow anchor shape.

Parameters:
degrees - the angle of the arrow in degrees (not radians)
size - the size of the arrow
Returns:
the anchor shape
Since:
2.4

createAdjustableAnchorShape

public static AnchorShape createAdjustableAnchorShape(AnchorShape shape,
                                                      ConnectionWidget owner,
                                                      AnchorShapeFactory.ConnectionEnd referencingEnd,
                                                      Widget attachedWidget)
Creates a proxy AnchorShape that is used to adjust the location of an AnchorShape. The associated AnchorShape will fit on the outside of the attached widget. The connection end and the attached widget is used to determine the location of the location of the AnchorShape.

Parameters:
shape - The shape that will be adjusted.
owner - The owner of the AnchorShape.
referencingEnd - The end of the connection to place the shape.
attachedWidget - The widget on the shapes end.

createAdjustableAnchorShape

public static AnchorShape createAdjustableAnchorShape(AnchorShape shape,
                                                      AnchorShapeLocationResolver resolver)
Creates a proxy AnchorShape that is used to adjust the location of an AnchorShape. the location of the associated AnchorShape will be determined by a AnchorShapeLocationResolver.

Parameters:
The - shape that will be adjusted.
resolver - The AnchorShapeLocationResolver used to determine where to place the shape.

createWidgetResolver

public static AnchorShapeLocationResolver createWidgetResolver(ConnectionWidget owner,
                                                               AnchorShapeFactory.ConnectionEnd referencingEnd,
                                                               Widget attachedWidget)
Creates a AnchorShapeLocationResolver that uses a widget to resolve the AnchorsShapes location. The connection end and the attached widget is used to determine the location of the location of the AnchorShape.

Parameters:
owner - The owner of the AnchorShape.
referencingEnd - The end of the connection to place the shape.
attachedWidget - The widget on the shapes end.

org.netbeans.api.visual 2.21.1

Built on September 7 2010.  |  Portions Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.