@Override protected void paintComponent(Graphics g) { if (isAquaLaF && g instanceof Graphics2D) { Graphics2D g2d = (Graphics2D) g; if (alwaysShown) { g2d.setColor(component.getBackground()); g2d.fillRect(0, 0, getWidth(), getHeight()); } else { g2d.setPaint(new GradientPaint(0, 0, UIManager.getColor("NbExplorerView.quicksearch.background.top"), //NOI18N 0, getHeight(), UIManager.getColor("NbExplorerView.quicksearch.background.bottom")));//NOI18N g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.setColor(UIManager.getColor("NbExplorerView.quicksearch.border")); //NOI18N g2d.drawLine(0, 0, getWidth(), 0); } } else { super.paintComponent(g); } } }
@Override public void actionPerformed(ActionEvent e) { if (showingDetails) { main.remove(details); main.validate(); main.setPreferredSize(MESSAGE_SIZE); } else { if (details == null) { details = createDetailedMessage(error); StringBuilder buffer = new StringBuilder(); stacktrace.setText(generateStackTrace(error, buffer).toString()); stacktrace.setCaretPosition(0); stacktrace.setBackground(main.getBackground()); stacktrace.setPreferredSize(STACKTRACE_SIZE); } main.add(details, BorderLayout.CENTER); main.validate(); main.setPreferredSize(TOTAL_SIZE); } showingDetails = !showingDetails; showDetails.setText(showingDetails ? "<< Hide Details" : "Show Details >>"); ErrorDialog.this.pack(); } });
searchPanel.setBackground(component.getBackground()); lbl.setLabelFor(searchTextField); searchTextField.setColumns(10);
@Override public void paint(java.awt.Graphics g, JComponent c) { g.setColor(c.getBackground()); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } };
public void paintCollapsiblePaneTitlePaneBackgroundEmphasized(JComponent c, Graphics g, Rectangle rect, int orientation, int state) { if (!(c.getBackground() instanceof UIResource)) { g.setColor(c.getBackground()); } else { g.setColor(UIDefaultsLookup.getColor("CollapsiblePane.emphasizedBackground")); } g.fillRect(rect.x, rect.y, rect.width, rect.height); }
/** * Paints the background of this component using the background colour of the delegate */ @Override public void paintComponent(Graphics g) { Dimension size = getSize(); g.setColor(delegate.getBackground()); g.fillRect(0, 0, size.width, size.height); }
public void paintBackground(Graphics g, JComponent c) { if (c.isOpaque()) { if (c.getBackground() instanceof ColorUIResource) { g.setColor(AbstractLookAndFeel.getBackgroundColor()); } else { g.setColor(c.getBackground()); } g.fillRect(0, 0, c.getWidth(), c.getHeight()); } }
@Override public void paintCollapsiblePaneTitlePaneBackgroundEmphasized(JComponent c, Graphics g, Rectangle rect, int orientation, int state) { Graphics2D g2d = (Graphics2D) g; Color gradientBot = XertoUtils.getEmBaseColor(c.getBackground()); Color gradientTop = c.getBackground(); JideSwingUtilities.fillGradient(g2d, rect, gradientTop, gradientBot, true); }
private void paintBackground (Graphics g, JComponent c) { g.setColor (c.getBackground ()); g.fillRoundRect (0, 0, c.getWidth (), c.getHeight (), 7, 7); } }
public void paintBackground(Graphics g, JComponent c) { if (c.isOpaque()) { if ((c.getBackground() instanceof ColorUIResource) && c.getBackground().equals(AbstractLookAndFeel.getBackgroundColor())) { HiFiUtils.fillComponent(g, c); } else { g.setColor(c.getBackground()); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } } } }
public void update(Graphics g, JComponent c) { g.setColor(c.getBackground()); boolean margin = shouldPaintMargin(); int leftEdge = margin ? marginWidth : 0; g.fillRect(leftEdge, 0, c.getWidth() - leftEdge, c.getHeight()); if (margin) { g.setColor(marginColor); g.fillRect(0, 0, marginWidth, c.getHeight()); } paint(g, c); }
public void paint( Graphics g, JComponent c) { super.paint( g, c); g.setColor( c.getBackground()); g.fillRect( 2,3, c.getWidth()-4, c.getHeight()-6); g.drawLine( 3,2, c.getWidth()-4, 2); g.drawLine( 3,c.getHeight()-3, c.getWidth()-4, c.getHeight()-3); JComponent editor = spinner.getEditor(); if ( editor instanceof JSpinner.DefaultEditor ) { JTextField text = ((JSpinner.DefaultEditor)editor).getTextField(); text.setBackground( c.getBackground()); } }
private void paintFlashingFocus(Graphics g, JComponent c) { g.setColor(!((TentackleLookAndFeel) UIManager.getLookAndFeel()).isFocusAnimated() || TFlasherListener.isFlasherVisible() ? getFocusColor() : c.getBackground()); g.drawRect(0, 0, c.getWidth() - 1, c.getHeight() - 2); }
/** @param g graphics * @param c component * */ public void paint(final Graphics g, final JComponent c) { Dimension size = c.getSize(); textArea.setBackground(c.getBackground()); rendererPane.paintComponent(g, textArea, c, 1, 1, size.width - 1, size.height - 1, true); }
public void setupMorphing() { startComponent = (currentComponent == component1) ? component1 : component2; endComponent = (currentComponent == component1) ? component2 : component1; startComponentImage = getComponentImage(startComponent); endComponentImage = getComponentImage(endComponent); heightDelta = (float) (endComponentImage.getHeight(null) - startComponentImage.getHeight(null)) / (float) morphingSteps; blenderPanel = new ImageBlenderPanel(startComponentImage, endComponentImage, component1.getBackground(), 0); blenderPanel.setPreferredSize(new Dimension(startComponentImage.getWidth(null), startComponentImage.getHeight(null))); morphingStep = 0; isMorphing = true; }
/** * Returns the background color of the renderered component or null if the * component is null * <p> * * PENDING: fallback to UI properties if comp == null? * * @return the background color of the rendered component. */ protected Color getBackground() { return getComponent() != null ? getComponent().getBackground() : null; }
/** * <p>Makes a Swing component inverted by swapping its foreground * and background colors. Hint: Depending on your needs it might * also be a good idea to call <tt>c.setOpaque(true)</tt>.</p> */ public static void invert(JComponent c) { Color invBackground = c.getForeground(); Color invForeground = c.getBackground(); c.setBackground(invBackground); c.setForeground(invForeground); } }
/** * <p>Makes a Swing component inverted by swapping its foreground * and background colors. Hint: Depending on your needs it might * also be a good idea to call <tt>c.setOpaque(true)</tt>.</p> */ public static void invert(JComponent c) { Color invBackground = c.getForeground(); Color invForeground = c.getBackground(); c.setBackground(invBackground); c.setForeground(invForeground); } }
public void update(Graphics g, JComponent c) { if (c.isOpaque() && c.getBackground() instanceof ColorUIResource && c.getClientProperty("backgroundTexture") == null) { TextureUtils.fillComponent(g, c, TextureUtils.getTextureType(c)); } else { super.update(g, c); } } }
protected void installDefaults() { JComponent contentPane = (JComponent) _popup.getContentPane(); if (contentPane != null) { Color bg = contentPane.getBackground(); if (bg instanceof UIResource) contentPane.setBackground(null); } _popup.setLayout(_dockableFrameLayout = createLayoutManager()); _popup.setBackground(UIDefaultsLookup.getColor("JideButton.background")); LookAndFeel.installBorder(_popup, "Popup.border"); }