/** * @param color The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedComboBoxArrowButtonPainter(Color color, int state) { // super(color, Themes.currentTheme.buttonBackground(), state); super(Color.RED, Color.BLUE, state); Insets insets = new Insets(8, 1, 8, 8); this.ctx = new AbstractRegionPainter.PaintContext(insets, new Dimension(20, 24), false); }
private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); private Path2D path = new Path2D.Float(); private PaintContext ctx = new PaintContext(new Insets(5, 5, 5, 5), new Dimension(29, 19), false); @Override public void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { path = decodePath1();
super(); this.state = state; this.ctx = new AbstractRegionPainter.PaintContext( new Insets(5, 5, 5, 5), new Dimension(9, 10), false, null, 1.0, 1.0);
@Override protected AbstractRegionPainter.PaintContext getPaintContext() { return new AbstractRegionPainter.PaintContext(null, null, false); @Override protected AbstractRegionPainter.PaintContext getPaintContext() { return new AbstractRegionPainter.PaintContext(null, null, false); @Override protected AbstractRegionPainter.PaintContext getPaintContext() { return new AbstractRegionPainter.PaintContext(null, null, false);
throw new IllegalStateException("Unknown state:" + state); this.ctx = new AbstractRegionPainter.PaintContext(insets, new Dimension(10, 20), false);
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); defaults.put("TextPane[Enabled].backgroundPainter", new javax.swing.plaf.nimbus.AbstractRegionPainter() { @Override protected AbstractRegionPainter.PaintContext getPaintContext() { return new AbstractRegionPainter.PaintContext(null, null, false); } @Override protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { g.setColor(bgColor); g.fillRect(0, 0, width, height); } }); jtxtPane.putClientProperty("Nimbus.Overrides", defaults); jtxtPane.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
private static class Painter extends javax.swing.plaf.nimbus.AbstractRegionPainter { private final Color color; private Painter(Color color) { this.color = color; } @Override protected AbstractRegionPainter.PaintContext getPaintContext() { return new AbstractRegionPainter.PaintContext(null, null, false); } @Override protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { g.setColor(c.isEnabled() ? c.getBackground() : color); g.fillRect(0, 0, width, height); } }
/** * @param color The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedProgressBarRegionPainter(Color color, int state) { super(color, Themes.currentTheme.detailPanelBackground(), state); Insets insets = new Insets(7, 7, 7, 7); this.ctx = new PaintContext(insets, new Dimension(10, 20), false); }
/** * @param color The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedComboBoxPainter(Color color, int state) { // super(color, Themes.currentTheme.buttonBackground(), state); super(Color.RED, Color.BLUE, state); Insets insets = new Insets(8, 9, 8, 19); this.ctx = new AbstractRegionPainter.PaintContext(insets, new Dimension(83, 24), false); }
/** * @param color The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedTabbedPaneTabAreaPainter(Color color, int state) { super(color, Themes.currentTheme.detailPanelBackground(), state); this.ctx = new AbstractRegionPainter.PaintContext(new Insets(0, 5, 6, 5), new Dimension(5, 24), false); }
/** * @param foregroundBasisColor The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedButtonRegionPainter(Color foregroundBasisColor, int state) { super(foregroundBasisColor, Themes.currentTheme.detailPanelBackground(), state); Insets insets = new Insets(7, 7, 7, 7); this.ctx = new AbstractRegionPainter.PaintContext(insets, new Dimension(10, 20), false); }
/** * @param color The color to use as the basis for the painter * @param state The state of the button to which this painter will apply */ public NamedComboBoxTextFieldPainter(Color color, int state) { super(Color.RED, Color.BLUE, state); Insets insets = new Insets(8, 1, 8, 8); this.ctx = new PaintContext(insets, new Dimension(20, 24), false); }
super(); this.state = state; this.ctx = new AbstractRegionPainter.PaintContext(new Insets(0, 5, 6, 5), new Dimension(5, 24), false );
case BACKGROUND_SELECTED_PRESSED_FOCUSED: insets = new Insets(7, 9, 3, 9); break; this.ctx = new AbstractRegionPainter.PaintContext(insets, new Dimension( 10 , 20 ), false );