/** * Sets the paintBorderInsets property. * Set to true if the background painter should paint where the border is * or false if it should only paint inside the border. This property is true by default. * This property affects the width, height, * and intial transform passed to the background painter. * * This is a bound property. */ public void setPaintBorderInsets(boolean paintBorderInsets) { boolean old = this.isPaintBorderInsets(); this.paintBorderInsets = paintBorderInsets; firePropertyChange("paintBorderInsets", old, isPaintBorderInsets()); }
/** * Sets the paintBorderInsets property. * Set to true if the background painter should paint where the border is * or false if it should only paint inside the border. This property is true by default. * This property affects the width, height, * and initial transform passed to the background painter. * * This is a bound property. */ @Override public void setPaintBorderInsets(boolean paintBorderInsets) { boolean old = this.isPaintBorderInsets(); this.paintBorderInsets = paintBorderInsets; firePropertyChange("paintBorderInsets", old, isPaintBorderInsets()); }
/** * Sets the paintBorderInsets property. * Set to true if the background painter should paint where the border is * or false if it should only paint inside the border. This property is true by default. * This property affects the width, height, * and initial transform passed to the background painter. * * This is a bound property. */ @Override public void setPaintBorderInsets(boolean paintBorderInsets) { boolean old = this.isPaintBorderInsets(); this.paintBorderInsets = paintBorderInsets; firePropertyChange("paintBorderInsets", old, isPaintBorderInsets()); }
/** * Sets the paintBorderInsets property. * Set to true if the background painter should paint where the border is * or false if it should only paint inside the border. This property is true by default. * This property affects the width, height, * and initial transform passed to the background painter. * * This is a bound property. */ @Override public void setPaintBorderInsets(boolean paintBorderInsets) { boolean old = this.isPaintBorderInsets(); this.paintBorderInsets = paintBorderInsets; firePropertyChange("paintBorderInsets", old, isPaintBorderInsets()); }
/** * Sets the paintBorderInsets property. * Set to true if the background painter should paint where the border is * or false if it should only paint inside the border. This property is true by default. * This property affects the width, height, * and initial transform passed to the background painter. * * This is a bound property. */ @Override public void setPaintBorderInsets(boolean paintBorderInsets) { boolean old = this.isPaintBorderInsets(); this.paintBorderInsets = paintBorderInsets; firePropertyChange("paintBorderInsets", old, isPaintBorderInsets()); }
/** * Overridden to provide Painter support. It will call backgroundPainter.paint() * if it is not null, else it will call super.paintComponent(). */ @Override protected void paintComponent(Graphics g) { if(backgroundPainter != null) { if (isOpaque()) super.paintComponent(g); Graphics2D g2 = (Graphics2D)g.create(); try { // account for the insets if(isPaintBorderInsets()) { backgroundPainter.paint(g2, this, this.getWidth(), this.getHeight()); } else { Insets ins = this.getInsets(); g2.translate(ins.left, ins.top); backgroundPainter.paint(g2, this, this.getWidth() - ins.left - ins.right, this.getHeight() - ins.top - ins.bottom); } } finally { g2.dispose(); } } else { super.paintComponent(g); } }
if (isPaintBorderInsets()) { getBackgroundPainter().paint(g2, this, getWidth(), getHeight()); } else {
if (isPaintBorderInsets()) { getBackgroundPainter().paint(g2, this, getWidth(), getHeight()); } else {
if (isPaintBorderInsets()) { getBackgroundPainter().paint(g2, this, getWidth(), getHeight()); } else {
if (isPaintBorderInsets()) { getBackgroundPainter().paint(g2, this, getWidth(), getHeight()); } else {