/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
/** * <p>Sets the visible property. This controls if the painter should * paint itself. It is true by default. Setting visible to false * is good when you want to temporarily turn off a painter. An example * of this is a painter that you only use when a button is highlighted.</p> * * @param visible New value of visible property. */ public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter //or other aggregate painter won't know that it is now invalid //there might be a tricky solution but that is a performance optimization firePropertyChange("visible", old, isVisible()); }
if(!isVisible() || width < 1 || height < 1) { return;
if(!isVisible() || width < 1 || height < 1) { return;
if(!isVisible() || width < 1 || height < 1) { return;
if(!isVisible() || width < 1 || height < 1) { return;
if(!isVisible() || width < 1 || height < 1) { return;
if (!isVisible() || width < 1 || height < 1) { return;
/** * TODO remove when the compound painter does not start dirty */ private void copyOfSuper_testDefaultsWithCorrectedValues() { assertThat(p.getFilters().length, is(0)); assertThat(p.getInterpolation(), is(AbstractPainter.Interpolation.NearestNeighbor)); assertThat(p.isAntialiasing(), is(true)); assertThat(p.isCacheable(), is(false)); assertThat(p.isCacheCleared(), is(true)); //TODO why does CompoundPainter start dirty? assertThat(p.isDirty(), is(true)); assertThat(p.isInPaintContext(), is(false)); assertThat(p.isVisible(), is(true)); assertThat(p.shouldUseCache(), is(false)); }
@Test public void testDefaults() { assertThat(p.getFilters().length, is(0)); assertThat(p.getInterpolation(), is(AbstractPainter.Interpolation.NearestNeighbor)); assertThat(p.isAntialiasing(), is(true)); assertThat(p.isCacheable(), is(false)); assertThat(p.isCacheCleared(), is(true)); assertThat(p.isDirty(), is(false)); assertThat(p.isInPaintContext(), is(false)); assertThat(p.isVisible(), is(true)); assertThat(p.shouldUseCache(), is(p.isCacheable())); }
/** * TODO remove when the compound painter does not start dirty */ private void copyOfSuper_testDefaultsWithCorrectedValues() { assertThat(p.getFilters().length, is(0)); assertThat(p.getInterpolation(), is(AbstractPainter.Interpolation.NearestNeighbor)); assertThat(p.isAntialiasing(), is(true)); assertThat(p.isCacheable(), is(false)); assertThat(p.isCacheCleared(), is(true)); //TODO this is because the constructor calls the setters assertThat(p.isDirty(), is(true)); assertThat(p.isInPaintContext(), is(false)); assertThat(p.isVisible(), is(true)); assertThat(p.shouldUseCache(), is(false)); }
assertThat(p.isDirty(), is(false)); assertThat(p.isInPaintContext(), is(false)); assertThat(p.isVisible(), is(true)); assertThat(p.shouldUseCache(), is(p.isCacheable()));
assertThat(p.isDirty(), is(false)); assertThat(p.isInPaintContext(), is(false)); assertThat(p.isVisible(), is(true)); assertThat(p.shouldUseCache(), is(p.isCacheable()));