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

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

org.netbeans.api.visual 2.2

org.netbeans.api.visual.anchor
Interface AnchorShape


public interface AnchorShape

Represents an anchor shape which is rendered at the source and the target point of a connection widget where the shape is used. The same instance of a shape could be shared by multiple connection widgets.


Field Summary
static AnchorShape NONE
          The empty anchor shape.
static AnchorShape TRIANGLE_FILLED
          The filled-triangle anchor shape.
static AnchorShape TRIANGLE_HOLLOW
          The hollow-triangle anchor shape.
static AnchorShape TRIANGLE_OUT
          The output-triangle anchor shape.
 
Method Summary
 double getCutDistance()
          Returns a distance by which a line at particular source or target point should be cut (not rendered).
 int getRadius()
          Returns a radius of a shape that the shape used for rendering.
 boolean isLineOriented()
          Returns whether the shape is oriented by the line path of a connection.
 void paint(Graphics2D graphics, boolean source)
          Renders the shape into a graphics instance
 

Field Detail

NONE

static final AnchorShape NONE
The empty anchor shape.


TRIANGLE_HOLLOW

static final AnchorShape TRIANGLE_HOLLOW
The hollow-triangle anchor shape.


TRIANGLE_FILLED

static final AnchorShape TRIANGLE_FILLED
The filled-triangle anchor shape.


TRIANGLE_OUT

static final AnchorShape TRIANGLE_OUT
The output-triangle anchor shape.

Method Detail

isLineOriented

boolean isLineOriented()
Returns whether the shape is oriented by the line path of a connection.

Returns:
true if it is line-oriented

getRadius

int getRadius()
Returns a radius of a shape that the shape used for rendering.

Returns:
the radius

getCutDistance

double getCutDistance()
Returns a distance by which a line at particular source or target point should be cut (not rendered). This is used for hollow-triangle shapes, to not paint the connection-line within the triangle.

Returns:
the cut distance in pixels; if positive, then the line is cut by specified number of pixels, the line could be cut by radius pixels only; if 0.0, then the line is not cut; if negative, then the line is extended by specified number of pixels, the line could be extended by radius pixels only

paint

void paint(Graphics2D graphics,
           boolean source)
Renders the shape into a graphics instance

Parameters:
graphics - the graphics
source - true, if the shape is used for a source point; false if the shape is used for a target point.

org.netbeans.api.visual 2.2

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