当前位置: 首页>>代码示例>>Java>>正文


Java Widget.setBorder方法代码示例

本文整理汇总了Java中org.netbeans.api.visual.widget.Widget.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java Widget.setBorder方法的具体用法?Java Widget.setBorder怎么用?Java Widget.setBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.visual.widget.Widget的用法示例。


在下文中一共展示了Widget.setBorder方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installUI

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void installUI (VMDNodeWidget widget) {
    widget.setBorder (VMDFactory.createVMDNodeBorder ());
    widget.setOpaque (false);

    Widget header = widget.getHeader ();
    header.setBorder (BORDER_PIN);
    header.setBackground (COLOR_SELECTED);
    header.setOpaque (false);

    Widget minimize = widget.getMinimizeButton ();
    minimize.setBorder (BORDER_MINIMIZE);

    Widget pinsSeparator = widget.getPinsSeparator ();
    pinsSeparator.setForeground (BORDER_CATEGORY_BACKGROUND);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VMDOriginalColorScheme.java

示例2: updateUI

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void updateUI (VMDNodeWidget widget, ObjectState previousState, ObjectState state) {
    if (! previousState.isSelected ()  &&  state.isSelected ())
        widget.bringToFront ();
    else if (! previousState.isHovered ()  &&  state.isHovered ())
        widget.bringToFront ();

    Widget header = widget.getHeader ();
    header.setOpaque (state.isSelected ());
    header.setBorder (state.isFocused () || state.isHovered () ? BORDER_PIN_HOVERED : BORDER_PIN);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:VMDOriginalColorScheme.java

示例3: installUI

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void installUI (VMDNodeWidget widget) {
    widget.setBorder (BORDER60);

    Widget header = widget.getHeader ();
    header.setBackground (COLOR60_HOVER_BACKGROUND);
    header.setBorder (VMDOriginalColorScheme.BORDER_PIN);

    Widget pinsSeparator = widget.getPinsSeparator ();
    pinsSeparator.setForeground (VMDOriginalColorScheme.BORDER_CATEGORY_BACKGROUND);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:VMDNetBeans60ColorScheme.java

示例4: testFlowLayoutInsets

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void testFlowLayoutInsets () {
    Scene scene = new Scene ();
    Widget parent = new Widget (scene);
    parent.setBorder (BorderFactory.createResizeBorder (10));
    parent.setLayout (LayoutFactory.createVerticalFlowLayout ());
    scene.addChild (parent);

    Widget child = new Widget (scene);
    child.setBackground (Color.BLUE);
    child.setOpaque (true);
    child.setPreferredBounds (new Rectangle (-50, -30, 30, 20));
    parent.addChild (child);

    assertScene (scene, Color.WHITE, new Rectangle (-1, -1, 52, 42));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:FlowLayout105400Test.java

示例5: testFlowLayoutWeightOverflow

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void testFlowLayoutWeightOverflow () {
    Scene scene = new Scene ();
    LayerWidget layer = new LayerWidget (scene);
    layer.setMinimumSize (new Dimension (300, 200));
    scene.addChild (layer);

    Widget vbox = new Widget (scene);
    vbox.setBorder (BorderFactory.createLineBorder (1, Color.BLACK));
    vbox.setLayout (LayoutFactory.createVerticalFlowLayout (LayoutFactory.SerialAlignment.JUSTIFY, 0));
    layer.addChild (vbox);

    Widget hbox1 = new Widget (scene);
    hbox1.setBorder (BorderFactory.createLineBorder (1, Color.BLUE));
    hbox1.setLayout (LayoutFactory.createHorizontalFlowLayout ());
    vbox.addChild (hbox1);

    Widget item1 = new LabelWidget (scene, "Item1");
    item1.setBorder (BorderFactory.createLineBorder (1, Color.GREEN));
    hbox1.addChild (item1);

    Widget item2 = new LabelWidget (scene, "Item2");
    item2.setBorder (BorderFactory.createLineBorder (1, Color.YELLOW));
    hbox1.addChild (item2, 1000);

    Widget item3 = new LabelWidget (scene, "Item3");
    item3.setBorder (BorderFactory.createLineBorder (1, Color.RED));
    hbox1.addChild (item3);

    Widget hbox2 = new Widget (scene);
    hbox2.setBorder (BorderFactory.createLineBorder (1, Color.BLUE));
    hbox2.setPreferredSize (new Dimension (200, 20));
    vbox.addChild (hbox2);
    
    Color color = (Color) (new DefaultLookFeel()).getBackground();
    assertScene (scene, color, new Rectangle (-5, -5, 210, 100));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:FlowLayoutWeightOverflow108052Test.java

示例6: testShow

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void testShow () {
    Scene scene = new Scene ();
    
    LayerWidget mainLayer = new LayerWidget (scene);
    scene.addChild(mainLayer);
    
    Widget w1 = new Widget (scene);
    w1.setBorder (BorderFactory.createLineBorder ());
    w1.setPreferredLocation (new Point (100, 100));
    w1.setPreferredSize (new Dimension (40, 20));
    mainLayer.addChild(w1);
    
    Widget w2 = new Widget (scene);
    w2.setBorder (BorderFactory.createLineBorder ());
    w2.setPreferredLocation (new Point (200, 100));
    w2.setPreferredSize (new Dimension (40, 20));
    mainLayer.addChild(w2);
    
    LayerWidget connLayer = new LayerWidget (scene);
    scene.addChild(connLayer);
    
    ConnectionWidget conn = new ConnectionWidget(scene);
    conn.setSourceAnchor(AnchorFactory.createRectangularAnchor(w1));
    conn.setTargetAnchor(AnchorFactory.createRectangularAnchor(w2));
    connLayer.addChild(conn);
    
    Color color = (Color) (new DefaultLookFeel()).getBackground();
    assertScene (scene, color,
            new Rectangle (99, 99, 42, 22),
            new Rectangle (199, 99, 42, 22),
            new Rectangle (138, 108, 64, 4)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:BasicTest.java

示例7: createSelectionWidget

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public Widget createSelectionWidget() {
    Widget widget = new Widget(this);
    widget.setOpaque(false);
    widget.setBorder(BorderFactory.createLineBorder(Color.black, 2));
    widget.setForeground(Color.red);
    return widget;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ControlFlowScene.java

示例8: initContent

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
@Messages("ACT_FixVersionConflict=Fix Version Conflict...")
private void initContent (DependencyGraphScene scene, GraphNodeImplementation impl, Icon icon) {
    contentW = new LevelOfDetailsWidget(scene, 0.05, 0.1, Double.MAX_VALUE, Double.MAX_VALUE);
    contentW.setBorder(BorderFactory.createLineBorder(10));
    contentW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 1));

    //Artifact name (with optional project icon on the left)
    nodeW = new IconNodeWidget(scene, TextOrientation.RIGHT_CENTER);
    nodeW.setLabel(node.getImpl().getQualifiedName() + "  ");

    if (null != icon) {
        nodeW.setImage(ImageUtilities.icon2Image(icon));
    }

    nodeW.getLabelWidget().setUseGlyphVector(true);

    if (node.isRoot()) {
        Font defF = scene.getDefaultFont();
        nodeW.getLabelWidget().setFont(defF.deriveFont(Font.BOLD, defF.getSize() + 3f));
    }
    contentW.addChild(nodeW);
    
    if(getDependencyGraphScene().supportsVersions()) {
        Widget versionDetW = new LevelOfDetailsWidget(scene, 0.5, 0.7, Double.MAX_VALUE, Double.MAX_VALUE);
        versionDetW.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 2));
        contentW.addChild(versionDetW);
        versionW = new LabelWidget(scene);
        versionW.setLabel(scene.getVersion(node.getImpl()));
        versionW.setUseGlyphVector(true);
        int mngState = node.getManagedState();
        if (mngState != GraphNode.UNMANAGED) { 
             lockW = new ImageWidget(scene,
                    mngState == GraphNode.MANAGED ? ImageUtilities.loadImage(LOCK_ICON) : ImageUtilities.loadImage(LOCK_BROKEN_ICON));
        }
        versionDetW.addChild(versionW);
        if (lockW != null) {
            versionDetW.addChild(lockW);
        }
    }

    // fix hint
    if (fixConflictAction != null) {
        Widget rootW = new Widget(scene);
        rootW.setLayout(LayoutFactory.createOverlayLayout());
        fixHintW = new ImageWidget(scene, ImageUtilities.loadImage(BULB_ICON));
        fixHintW.setVisible(false);
        fixHintW.setToolTipText(ACT_FixVersionConflict());
        fixHintW.getActions().addAction(sceneHoverActionAction);
        fixHintW.getActions().addAction(fixConflictAction);
        Widget panelW = new Widget(scene);
        panelW.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 0));
        panelW.setBorder(BorderFactory.createEmptyBorder(0, 3));
        panelW.addChild(fixHintW);
        rootW.addChild(panelW);
        rootW.addChild(contentW);
        addChild(rootW);
    } else {
        addChild(contentW);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:62,代码来源:NodeWidget.java

示例9: createSelectionWidget

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public Widget createSelectionWidget () {
    Widget widget = new Widget (scene);
    widget.setBorder (scene.getLookFeel ().getMiniBorder (ObjectState.createNormal ().deriveSelected (true)));
    return widget;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:DefaultRectangularSelectDecorator.java


注:本文中的org.netbeans.api.visual.widget.Widget.setBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。