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 103456
Collapse All | Expand All

(-)graph/lib/apichanges.xml (+14 lines)
Lines 330-335 Link Here
330
            <class package="org.netbeans.api.visual.vmd" name="VMDColorScheme" link="yes"/>
330
            <class package="org.netbeans.api.visual.vmd" name="VMDColorScheme" link="yes"/>
331
            <issue number="105929"/>
331
            <issue number="105929"/>
332
        </change>
332
        </change>
333
334
        <change>
335
            <api name="general"/>
336
            <summary>BorderSupport.getSwingBorder method introduced</summary>
337
            <version major="2" minor="6"/>
338
            <date day="18" month="7" year="2007"/>
339
            <author login="dkaspar"/>
340
            <compatibility addition="yes"/>
341
            <description>
342
                BorderSupport.getSwingBorder method introduced to acquired a Swing border from a library border.
343
            </description>
344
            <class package="org.netbeans.api.visual.border" name="BorderSupport" link="yes"/>
345
            <issue number="103456"/>
346
        </change>
333
    </changes>
347
    </changes>
334
348
335
    <htmlcontents>
349
    <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.5
4
OpenIDE-Module-Specification-Version: 2.6
(-)graph/lib/src/org/netbeans/api/visual/border/BorderSupport.java (+11 lines)
Lines 19-24 Link Here
19
package org.netbeans.api.visual.border;
19
package org.netbeans.api.visual.border;
20
20
21
import org.netbeans.modules.visual.border.ResizeBorder;
21
import org.netbeans.modules.visual.border.ResizeBorder;
22
import org.netbeans.modules.visual.border.SwingBorder;
22
23
23
/**
24
/**
24
 * This class contains support method for working with borders.
25
 * This class contains support method for working with borders.
Lines 37-42 Link Here
37
     */
38
     */
38
    public static boolean isOuterResizeBorder (Border border) {
39
    public static boolean isOuterResizeBorder (Border border) {
39
        return border instanceof ResizeBorder  &&  ((ResizeBorder) border).isOuter ();
40
        return border instanceof ResizeBorder  &&  ((ResizeBorder) border).isOuter ();
41
    }
42
    
43
    /**
44
     * Returns a swing border of a border created using BorderFactory.createSwingBorder or Widget.setBorder(javax.swing.border.Border).
45
     * @param border the widget border
46
     * @return Swing border if possible; otherwise null
47
     * @since 2.6
48
     */
49
    public static javax.swing.border.Border getSwingBorder (Border border) {
50
        return border instanceof SwingBorder ? ((SwingBorder) border).getSwingBorder () : null;
40
    }
51
    }
41
52
42
}
53
}
(-)graph/lib/src/org/netbeans/modules/visual/border/SwingBorder.java (+4 lines)
Lines 49-53 Link Here
49
    public boolean isOpaque () {
49
    public boolean isOpaque () {
50
        return false;
50
        return false;
51
    }
51
    }
52
    
53
    public javax.swing.border.Border getSwingBorder () {
54
        return swingBorder;
55
    }
52
56
53
}
57
}
(-)graph/lib/test/unit/src/apichanges/SwingBorderGetterTest.java (+46 lines)
Added Link Here
1
/*
2
 * The contents of this file are subject to the terms of the Common Development
3
 * and Distribution License (the License). You may not use this file except in
4
 * compliance with the License.
5
 *
6
 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7
 * or http://www.netbeans.org/cddl.txt.
8
 *
9
 * When distributing Covered Code, include this CDDL Header Notice in each file
10
 * and include the License file at http://www.netbeans.org/cddl.txt.
11
 * If applicable, add the following below the CDDL Header, with the fields
12
 * enclosed by brackets [] replaced by your own identifying information:
13
 * "Portions Copyrighted [year] [name of copyright owner]"
14
 *
15
 * The Original Software is NetBeans. The Initial Developer of the Original
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17
 * Microsystems, Inc. All Rights Reserved.
18
 */
19
package apichanges;
20
21
import org.netbeans.junit.NbTestCase;
22
import org.netbeans.api.visual.widget.Scene;
23
import org.netbeans.api.visual.border.BorderSupport;
24
25
import javax.swing.border.BevelBorder;
26
import javax.swing.border.Border;
27
28
/**
29
 * Test for issue #103456 - BorderSupport.getSwingBorder method introduced
30
 * @author David Kaspar
31
 */
32
public class SwingBorderGetterTest extends NbTestCase {
33
34
    public SwingBorderGetterTest (String name) {
35
        super (name);
36
    }
37
38
    public void testGetter () {
39
        Scene scene = new Scene ();
40
        BevelBorder originalBorder = new BevelBorder (BevelBorder.RAISED);
41
        scene.setBorder (originalBorder);
42
        Border foundBorder = BorderSupport.getSwingBorder (scene.getBorder ());
43
        assertEquals (originalBorder, foundBorder);
44
    }
45
46
}

Return to bug 103456