/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Creates a new instance of AbstractPainter. * @param cacheable indicates if this painter should be cacheable */ public AbstractPainter(boolean cacheable) { setCacheable(cacheable); }
/** * Ensures that setting cacheable makes shouldUseCache return true. */ @Test public void testSetCacheableEnablesCache() { p.setCacheable(true); assertThat(p.shouldUseCache(), is(true)); }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Issue #??-swingx: clearCache has no detectable effect. Test was poorly designed. It has had * an effect for a long time, but the member is not bound, so the test was failing erroneously. */ @Test public void testClearCacheDetectable() { p.setCacheable(true); p.paint(g, null, 10, 10); // sanity //when caching we get a different graphics object verify(p).doPaint(any(Graphics2D.class), isNull(), eq(10), eq(10)); assertThat("clean after paint", false, is(p.isDirty())); assertThat("cacheable is enabled", true, is(p.isCacheable())); assertThat("has a cached image", false, is(p.isCacheCleared())); p.clearCache(); assertThat("has a cached image", true, is(p.isCacheCleared())); }