This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 106472
Collapse All | Expand All

(-)graph/lib/apichanges.xml (+20 lines)
Lines 299-304 Link Here
299
            <class package="org.netbeans.api.visual.layout" name="LayoutFactory" link="yes"/>
299
            <class package="org.netbeans.api.visual.layout" name="LayoutFactory" link="yes"/>
300
            <issue number="105390"/>
300
            <issue number="105390"/>
301
        </change>
301
        </change>
302
303
        <change>
304
            <api name="general"/>
305
            <summary>ConnectionWidget methods has been restricted</summary>
306
            <version major="2" minor="5"/>
307
            <date day="13" month="6" year="2007"/>
308
            <author login="dkaspar"/>
309
            <compatibility addition="no"/>
310
            <description>
311
                From beginning the ConnectionWidget.getTargetAnchorShapeRotation method was meant to be private.
312
                Also many getter and setter methods in ConnectionWidget was meant to be final.
313
                It had been there by mistake, therefore the getTargetAnchorShapeRotation was removed
314
                and getSourceAnchorEntry, getTargetAnchorEntry, getSourceAnchorShape, setSourceAnchorShape,
315
		getTargetAnchorShape, setTargetAnchorShape, getControlPointShape, setControlPointShape,
316
		getEndPointShape, setEndPointShape, getControlPoints, getControlPoint, setControlPoints,
317
		setConstraint, setConstraint, removeConstraint methods of the ConnectionWidget class were made final.
318
            </description>
319
            <class package="org.netbeans.api.visual.widget" name="ConnectionWidget" link="yes"/>
320
            <issue number="106472"/>
321
        </change>
302
    </changes>
322
    </changes>
303
323
304
    <htmlcontents>
324
    <htmlcontents>
(-)graph/lib/manifest.mf (-1 / +1 lines)
Lines 1-4 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.visual
2
OpenIDE-Module: org.netbeans.api.visual
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.4
4
OpenIDE-Module-Specification-Version: 2.5
(-)graph/lib/src/org/netbeans/api/visual/widget/ConnectionWidget.java (-18 / +17 lines)
Lines 227-233 Link Here
227
     * Returns an anchor entry representing the source of the connection widget.
227
     * Returns an anchor entry representing the source of the connection widget.
228
     * @return the anchor entry representing the source of the connection widget
228
     * @return the anchor entry representing the source of the connection widget
229
     */
229
     */
230
    public Anchor.Entry getSourceAnchorEntry () {
230
    public final Anchor.Entry getSourceAnchorEntry () {
231
        return sourceEntry;
231
        return sourceEntry;
232
    }
232
    }
233
233
Lines 235-241 Link Here
235
     * Returns an anchor entry representing the target of the connection widget.
235
     * Returns an anchor entry representing the target of the connection widget.
236
     * @return the anchor entry representing the target of the connection widget
236
     * @return the anchor entry representing the target of the connection widget
237
     */
237
     */
238
    public Anchor.Entry getTargetAnchorEntry () {
238
    public final Anchor.Entry getTargetAnchorEntry () {
239
        return targetEntry;
239
        return targetEntry;
240
    }
240
    }
241
241
Lines 243-249 Link Here
243
     * Returns an anchor shape of the source of the connection widget.
243
     * Returns an anchor shape of the source of the connection widget.
244
     * @return the source anchor shape
244
     * @return the source anchor shape
245
     */
245
     */
246
    public AnchorShape getSourceAnchorShape () {
246
    public final AnchorShape getSourceAnchorShape () {
247
        return sourceAnchorShape;
247
        return sourceAnchorShape;
248
    }
248
    }
249
249
Lines 251-257 Link Here
251
     * Sets the anchor shape of the source of the connection widget.
251
     * Sets the anchor shape of the source of the connection widget.
252
     * @param sourceAnchorShape the source anchor shape
252
     * @param sourceAnchorShape the source anchor shape
253
     */
253
     */
254
    public void setSourceAnchorShape (AnchorShape sourceAnchorShape) {
254
    public final void setSourceAnchorShape (AnchorShape sourceAnchorShape) {
255
        assert sourceAnchorShape != null;
255
        assert sourceAnchorShape != null;
256
        boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius ();
256
        boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius ();
257
        this.sourceAnchorShape = sourceAnchorShape;
257
        this.sourceAnchorShape = sourceAnchorShape;
Lines 262-268 Link Here
262
     * Returns an anchor shape of the target of the connection widget.
262
     * Returns an anchor shape of the target of the connection widget.
263
     * @return the target anchor shape
263
     * @return the target anchor shape
264
     */
264
     */
265
    public AnchorShape getTargetAnchorShape () {
265
    public final AnchorShape getTargetAnchorShape () {
266
        return targetAnchorShape;
266
        return targetAnchorShape;
267
    }
267
    }
268
268
Lines 270-276 Link Here
270
     * Sets the anchor shape of the target of the connection widget.
270
     * Sets the anchor shape of the target of the connection widget.
271
     * @param targetAnchorShape the target anchor shape
271
     * @param targetAnchorShape the target anchor shape
272
     */
272
     */
273
    public void setTargetAnchorShape (AnchorShape targetAnchorShape) {
273
    public final void setTargetAnchorShape (AnchorShape targetAnchorShape) {
274
        assert targetAnchorShape != null;
274
        assert targetAnchorShape != null;
275
        boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius ();
275
        boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius ();
276
        this.targetAnchorShape = targetAnchorShape;
276
        this.targetAnchorShape = targetAnchorShape;
Lines 281-287 Link Here
281
     * Returns a point shape of control points of the connection widget.
281
     * Returns a point shape of control points of the connection widget.
282
     * @return the control points shape
282
     * @return the control points shape
283
     */
283
     */
284
    public PointShape getControlPointShape () {
284
    public final PointShape getControlPointShape () {
285
        return controlPointShape;
285
        return controlPointShape;
286
    }
286
    }
287
287
Lines 289-295 Link Here
289
     * Sets a point shape of control points of the connection widget.
289
     * Sets a point shape of control points of the connection widget.
290
     * @param controlPointShape the control points shape
290
     * @param controlPointShape the control points shape
291
     */
291
     */
292
    public void setControlPointShape (PointShape controlPointShape) {
292
    public final void setControlPointShape (PointShape controlPointShape) {
293
        assert controlPointShape != null;
293
        assert controlPointShape != null;
294
        boolean repaintOnly = this.controlPointShape.getRadius () == controlPointShape.getRadius ();
294
        boolean repaintOnly = this.controlPointShape.getRadius () == controlPointShape.getRadius ();
295
        this.controlPointShape = controlPointShape;
295
        this.controlPointShape = controlPointShape;
Lines 300-306 Link Here
300
     * Returns a point shape of end points of the connection widget.
300
     * Returns a point shape of end points of the connection widget.
301
     * @return the end points shape
301
     * @return the end points shape
302
     */
302
     */
303
    public PointShape getEndPointShape () {
303
    public final PointShape getEndPointShape () {
304
        return endPointShape;
304
        return endPointShape;
305
    }
305
    }
306
306
Lines 308-314 Link Here
308
     * Sets a point shape of end points of the connection widget.
308
     * Sets a point shape of end points of the connection widget.
309
     * @param endPointShape the end points shape
309
     * @param endPointShape the end points shape
310
     */
310
     */
311
    public void setEndPointShape (PointShape endPointShape) {
311
    public final void setEndPointShape (PointShape endPointShape) {
312
        assert endPointShape != null;
312
        assert endPointShape != null;
313
        boolean repaintOnly = this.endPointShape.getRadius () == endPointShape.getRadius ();
313
        boolean repaintOnly = this.endPointShape.getRadius () == endPointShape.getRadius ();
314
        this.endPointShape = endPointShape;
314
        this.endPointShape = endPointShape;
Lines 336-352 Link Here
336
     * Returns a list of control points.
336
     * Returns a list of control points.
337
     * @return the list of control points
337
     * @return the list of control points
338
     */
338
     */
339
    public List<Point> getControlPoints () {
339
    public final List<Point> getControlPoints () {
340
        return controlPointsUm;
340
        return controlPointsUm;
341
    }
341
    }
342
    
342
    
343
    /**
343
    /**
344
     * Returns a location of control point at the specified index in the list of control points.
344
     * Returns a location of control point at the specified index in the list of control points.
345
     *
346
     * @param index index of the control point to return
345
     * @param index index of the control point to return
347
     * @return the point; null if the control point does not exist
346
     * @return the point; null if the control point does not exist
348
     */
347
     */
349
    public Point getControlPoint (int index) {
348
    public final Point getControlPoint (int index) {
350
        if (index < 0  &&  index >= controlPoints.size ())
349
        if (index < 0  &&  index >= controlPoints.size ())
351
            return null;
350
            return null;
352
        return new Point (controlPoints.get(index));
351
        return new Point (controlPoints.get(index));
Lines 358-364 Link Here
358
     * @param sceneLocations if true, then controlPoints argyment is taken as a list of scene locations;
357
     * @param sceneLocations if true, then controlPoints argyment is taken as a list of scene locations;
359
     *            if false, then controlPoints argument is taken as a list of local locations
358
     *            if false, then controlPoints argument is taken as a list of local locations
360
     */
359
     */
361
    public void setControlPoints (Collection<Point> controlPoints, boolean sceneLocations) {
360
    public final void setControlPoints (Collection<Point> controlPoints, boolean sceneLocations) {
362
        if (sceneLocations) {
361
        if (sceneLocations) {
363
            Point translation = this.convertLocalToScene (new Point ());
362
            Point translation = this.convertLocalToScene (new Point ());
364
            ArrayList<Point> list = new ArrayList<Point> ();
363
            ArrayList<Point> list = new ArrayList<Point> ();
Lines 378-384 Link Here
378
     * @param alignment the alignment specified relatively to the origin point
377
     * @param alignment the alignment specified relatively to the origin point
379
     * @param placementInPercentage the placement on a path in percentage of the path length
378
     * @param placementInPercentage the placement on a path in percentage of the path length
380
     */
379
     */
381
    public void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage) {
380
    public final void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage) {
382
        connectionWidgetLayout.setConstraint (childWidget, alignment, placementInPercentage);
381
        connectionWidgetLayout.setConstraint (childWidget, alignment, placementInPercentage);
383
    }
382
    }
384
383
Lines 388-394 Link Here
388
     * @param alignment the alignment specified relatively to the origin point
387
     * @param alignment the alignment specified relatively to the origin point
389
     * @param placementAtDistance the placement on a path in pixels as a distance from the source anchor
388
     * @param placementAtDistance the placement on a path in pixels as a distance from the source anchor
390
     */
389
     */
391
    public void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, int placementAtDistance) {
390
    public final void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, int placementAtDistance) {
392
        connectionWidgetLayout.setConstraint (childWidget, alignment, placementAtDistance);
391
        connectionWidgetLayout.setConstraint (childWidget, alignment, placementAtDistance);
393
    }
392
    }
394
393
Lines 396-402 Link Here
396
     * Removes a constraint for a child widget.
395
     * Removes a constraint for a child widget.
397
     * @param childWidget the child widget
396
     * @param childWidget the child widget
398
     */
397
     */
399
    public void removeConstraint (Widget childWidget) {
398
    public final void removeConstraint (Widget childWidget) {
400
        connectionWidgetLayout.removeConstraint (childWidget);
399
        connectionWidgetLayout.removeConstraint (childWidget);
401
    }
400
    }
402
401
Lines 514-520 Link Here
514
     * Returns the rotation of the target anchor shape.
513
     * Returns the rotation of the target anchor shape.
515
     * @return the target anchor shape rotation
514
     * @return the target anchor shape rotation
516
     */
515
     */
517
    public double getTargetAnchorShapeRotation () {
516
    private double getTargetAnchorShapeRotation () {
518
        int size = controlPoints.size ();
517
        int size = controlPoints.size ();
519
        if (size <= 1)
518
        if (size <= 1)
520
            return 0.0;
519
            return 0.0;
(-)graph/lib/src/org/netbeans/api/visual/widget/FreeConnectionWidget.java (-13 lines)
Lines 21-27 Link Here
21
import java.awt.*;
21
import java.awt.*;
22
import java.awt.geom.Line2D;
22
import java.awt.geom.Line2D;
23
import java.util.ArrayList;
23
import java.util.ArrayList;
24
import java.util.List;
25
24
26
/**
25
/**
27
 * This class is an extension of the ConnectionWidget. Primarily it is used with FreeRouter and optionally Free*Anchor.
26
 * This class is an extension of the ConnectionWidget. Primarily it is used with FreeRouter and optionally Free*Anchor.
Lines 85-102 Link Here
85
            }
84
            }
86
        }
85
        }
87
        return false;
86
        return false;
88
    }
89
90
    /**
91
     * Returns a control point at a specific index.
92
     * @param index the index in the list of control points
93
     * @return the control point at specified index; null, if the connection widget does not have control points
94
     * @throws ArrayIndexOutOfBoundsException when index is out of bounds
95
     */
96
    public Point getControlPoint (int index) {
97
        List<Point> controlPoints=getControlPoints();
98
        if (controlPoints.size () <= 0) return null;
99
        return new Point (controlPoints.get (index));
100
    }
87
    }
101
88
102
    /**
89
    /**

Return to bug 106472