/** * {@inheritDoc} */ @Override protected MattePainter createTestingPainter() { return new MattePainter(); } }
protected Painter createBackgroundPainter() { MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor)); p.setPaintStretched(true); return new PainterUIResource(p); }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }
/** * {@inheritDoc} */ protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { if(isPaintStretched()) { p = calculateSnappedPaint(p,width,height); } g.setPaint(p); g.fillRect(0, 0, width, height); } }
/** * Create a new MattePainter for the given Paint. This can be a GradientPaint * (the gradient will not grow when the component becomes larger unless * you use the paintStretched boolean property), * TexturePaint, Color, or other Paint instance. * * @param paint Paint to fill with * @param paintStretched indicates if the paint should be stretched */ public MattePainter(Paint paint, boolean paintStretched) { super(paint); this.setPaintStretched(paintStretched); }
/** * Create a new MattePainter for the given Paint. This can be a GradientPaint * (the gradient will not grow when the component becomes larger unless * you use the paintStretched boolean property), * TexturePaint, Color, or other Paint instance. * * @param paint Paint to fill with * @param paintStretched indicates if the paint should be stretched */ public MattePainter(Paint paint, boolean paintStretched) { super(paint); this.setPaintStretched(paintStretched); }
/** * Gets a MattePainter object. * * @param width * the width * @param height * the height * @param fractions * the fractions * @param colors * the colors * @return the MattePainter object */ public static MattePainter getMattePainter(final int width, final int height, final float[] fractions, final Color... colors) { final LinearGradientPaint gradientPaint = new LinearGradientPaint(0.0f, 0.0f, width, height, fractions, colors); final MattePainter mattePainter = new MattePainter(gradientPaint); return mattePainter; } }
protected Painter createBackgroundPainter() { MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor)); p.setPaintStretched(true); return new PainterUIResource(p); }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }
/** * Create a new MattePainter for the given Paint. This can be a GradientPaint * (the gradient will not grow when the component becomes larger unless * you use the paintStretched boolean property), * TexturePaint, Color, or other Paint instance. * * @param paint Paint to fill with * @param paintStretched indicates if the paint should be stretched */ public MattePainter(Paint paint, boolean paintStretched) { super(paint); this.setPaintStretched(paintStretched); }
/** Creates a new instance of JXImageView */ public JXImageView() { // fix for: java.net/jira/browse/SWINGX-1479 setBackgroundPainter(new MattePainter(PaintUtils.getCheckerPaint(Color.white,new Color(250,250,250),50))); setEditable(true); }
protected Painter createBackgroundPainter() { MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor)); p.setPaintStretched(true); return new PainterUIResource(p); }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }
/** * Create a new MattePainter for the given Paint. This can be a GradientPaint * (the gradient will not grow when the component becomes larger unless * you use the paintStretched boolean property), * TexturePaint, Color, or other Paint instance. * * @param paint Paint to fill with * @param paintStretched indicates if the paint should be stretched */ public MattePainter(Paint paint, boolean paintStretched) { super(paint); this.setPaintStretched(paintStretched); }
/** Creates a new instance of JXImageView */ public JXImageView() { // fix for: java.net/jira/browse/SWINGX-1479 setBackgroundPainter(new MattePainter(PaintUtils.getCheckerPaint(Color.white,new Color(250,250,250),50))); setEditable(true); }
protected Painter createBackgroundPainter() { MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor)); p.setPaintStretched(true); return new PainterUIResource(p); }
/** Creates a new instance of JXImageView */ public JXImageView() { // fix for: java.net/jira/browse/SWINGX-1479 setBackgroundPainter(new MattePainter(PaintUtils.getCheckerPaint(Color.white,new Color(250,250,250),50))); setEditable(true); }
protected Painter createBackgroundPainter() { MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor)); p.setPaintStretched(true); return new PainterUIResource(p); }
/** Creates a new instance of JXImageView */ public JXImageView() { // fix for: java.net/jira/browse/SWINGX-1479 setBackgroundPainter(new MattePainter(PaintUtils.getCheckerPaint(Color.white,new Color(250,250,250),50))); setEditable(true); }
/** * {@inheritDoc} */ @Override protected void addMetalDefaults(LookAndFeelAddons addon, DefaultsList defaults) { super.addMetalDefaults(addon, defaults); if (isPlastic()) { defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE)); defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>( new MattePainter(new GradientPaint(0, 0, new Color(49, 121, 242), 0, 1, new Color(198, 211, 247)), true))); } else { defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE)); defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>( new MattePainter(new GradientPaint(0, 0, MetalLookAndFeel.getCurrentTheme().getPrimaryControl(), 0, 1, MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow()),true))); } }