Java Code Examples for org.netbeans.api.visual.widget.LabelWidget#setOpaque()

The following examples show how to use org.netbeans.api.visual.widget.LabelWidget#setOpaque() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableWidget.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void createTableHeader() {
    Scene scene = getScene();
    int noCols = model.getColumnCount();
    Widget headerWidget = new RowWidget(scene,noCols,null);
    addChild(headerWidget);
    
    for (int i = 0; i<noCols;i++) {
        LabelWidget columnHeader = new LabelWidget(scene, model.getColumnName(i));
        if(i!=0) {
            columnHeader.setBorder(new LineBorder(0, 1, 0, 0, BORDER_COLOR));
        }
        columnHeader.setAlignment(LabelWidget.Alignment.CENTER);
        columnHeader.setBackground(HEADER_COLOR);
        columnHeader.setOpaque(true);
        headerWidget.addChild(columnHeader);
    }
}
 
Example 2
Source File: VMDOriginalColorScheme.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static Widget createPinCategoryWidgetCore (VMDNodeWidget widget, String categoryDisplayName, boolean changeFont) {
    Scene scene = widget.getScene ();
    LabelWidget label = new LabelWidget (scene, categoryDisplayName);
    label.setOpaque (true);
    label.setBackground (BORDER_CATEGORY_BACKGROUND);
    label.setForeground (Color.GRAY);
    if (changeFont) {
        Font fontPinCategory = scene.getDefaultFont ().deriveFont (10.0f);
        label.setFont (fontPinCategory);
    }
    label.setAlignment (LabelWidget.Alignment.CENTER);
    label.setCheckClipping (true);
    return label;
}
 
Example 3
Source File: LabelOrientationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static LabelWidget createLabel (LayerWidget layer, String label, int x, int y, LabelWidget.Orientation orientation, LabelWidget.Alignment alignment, LabelWidget.VerticalAlignment verticalAlignment) {
    LabelWidget widget = new LabelWidget (layer.getScene (), label);
    widget.setOpaque (true);
    widget.setBackground (Color.YELLOW);
    widget.setPreferredLocation (new Point (x, y));
    widget.setPreferredBounds (new Rectangle (-20, -30, 180, 180));
    widget.setOrientation (orientation);
    widget.setAlignment (alignment);
    widget.setVerticalAlignment (verticalAlignment);
    layer.addChild (widget);
    return widget;
}
 
Example 4
Source File: GraphColorScheme.java    From Llunatic with GNU General Public License v3.0 5 votes vote down vote up
static Widget createPinCategoryWidgetCore(VMDNodeWidget widget, String categoryDisplayName, boolean changeFont) {
    Scene scene = widget.getScene();
    LabelWidget label = new LabelWidget(scene, categoryDisplayName);
    label.setOpaque(true);
    label.setBackground(BORDER_CATEGORY_BACKGROUND);
    label.setForeground(Color.GRAY);
    if (changeFont) {
        Font fontPinCategory = scene.getDefaultFont().deriveFont(10.0f);
        label.setFont(fontPinCategory);
    }
    label.setAlignment(LabelWidget.Alignment.CENTER);
    label.setCheckClipping(true);
    return label;
}