Java Code Examples for org.netbeans.api.visual.widget.Widget#setBackground()
The following examples show how to use
org.netbeans.api.visual.widget.Widget#setBackground() .
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: LayerWidget103528Test.java From netbeans with Apache License 2.0 | 6 votes |
public void testLayerPreferredLocation () { Scene scene = new Scene (); scene.addChild (new LayerWidget (scene)); LayerWidget layer = new LayerWidget (scene); layer.setPreferredLocation (new Point (100, 100)); scene.addChild (layer); Widget widget = new Widget (scene); widget.setPreferredBounds (new Rectangle (-20, -10, 100, 50)); widget.setOpaque (true); widget.setBackground (Color.RED); layer.addChild (widget); Color color = (Color) (new DefaultLookFeel()).getBackground(); assertScene (scene, color, new Rectangle (80, 90, 100, 50)); }
Example 2
Source File: ParametersWidget.java From netbeans with Apache License 2.0 | 6 votes |
private void createContent() { model = new ParametersTableModel(method, nameEditable); populateContentWidget(getContentWidget()); getContentWidget().setBorder(BorderFactory.createEmptyBorder(0,1,1,1)); headerLabelWidget = new ImageLabelWidget(getScene(), getIcon(), getTitle(), "("+method.getParams().size()+")"); headerLabelWidget.setLabelFont(getScene().getFont().deriveFont(Font.BOLD)); getHeaderWidget().addChild(new Widget(getScene()),5); getHeaderWidget().addChild(headerLabelWidget); getHeaderWidget().addChild(new Widget(getScene()),4); buttons = new Widget(getScene()); buttons.setLayout(LayoutFactory.createHorizontalFlowLayout( LayoutFactory.SerialAlignment.CENTER, 8)); buttons.addChild(getExpanderWidget()); buttons.setOpaque(true); buttons.setBackground(TITLE_COLOR_BRIGHT); getHeaderWidget().addChild(buttons); }
Example 3
Source File: DBColorScheme.java From jeddict with Apache License 2.0 | 6 votes |
@Override public void installUI(IPNodeWidget widget) { widget.setBorder(WIDGET_BORDER); Widget header = widget.getHeader(); Rectangle bound = widget.getHeader().getBounds(); if (bound == null) { bound = HEADER_BOUND; } GradientPaint gp = new GradientPaint(bound.x + bound.width / 2, bound.y, WIDGET_LBACKGROUND, bound.x + bound.width / 2, bound.y + bound.height, WIDGET_BACKGROUND); header.setBackground(gp); header.setBorder(OPAQUE_BORDER); widget.getHeader().setOpaque(true); widget.getNodeNameWidget().setForeground(Color.WHITE); Font font = widget.getNodeNameWidget().getFont()!=null?widget.getNodeNameWidget().getFont():widget.getScene().getDefaultFont(); widget.getNodeNameWidget().setFont(font.deriveFont(Font.BOLD, 12)); Widget pinsSeparator = widget.getPinsSeparator(); pinsSeparator.setForeground(PIN_SEPERATOR_WIDGET_BACKGROUND); widget.getMinimizeButton().setImage(this.getMinimizeWidgetImage(widget)); }
Example 4
Source File: GraphColorScheme.java From Llunatic with GNU General Public License v3.0 | 6 votes |
@Override public void installUI(VMDNodeWidget widget) { widget.setBorder(VMDFactory.createVMDNodeBorder()); widget.setOpaque(false); Widget header = widget.getHeader(); header.setBorder(HEADER_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); }
Example 5
Source File: VMDOriginalColorScheme.java From netbeans with Apache License 2.0 | 5 votes |
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); }
Example 6
Source File: VMDNetBeans60ColorScheme.java From netbeans with Apache License 2.0 | 5 votes |
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); }
Example 7
Source File: FlowLayout105400Test.java From netbeans with Apache License 2.0 | 5 votes |
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)); }
Example 8
Source File: QBGraphScene.java From netbeans with Apache License 2.0 | 4 votes |
public void unsetHovering(Widget widget) { widget.setBackground(Color.WHITE); }
Example 9
Source File: QBGraphScene.java From netbeans with Apache License 2.0 | 4 votes |
public void setHovering(Widget widget) { widget.setBackground(Color.CYAN); }
Example 10
Source File: StringGraphScene.java From opensim-gui with Apache License 2.0 | 4 votes |
public void unsetHovering (Widget widget) { widget.setBackground (Color.WHITE); }
Example 11
Source File: StringGraphScene.java From opensim-gui with Apache License 2.0 | 4 votes |
public void setHovering (Widget widget) { widget.setBackground (Color.CYAN); }