/** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent evt) { CompoundPainter<?> painter = ref.get(); if (painter == null) { AbstractPainter<?> src = (AbstractPainter<?>) evt.getSource(); src.removePropertyChangeListener(this); } else { String property = evt.getPropertyName(); if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) { return; } painter.setDirty(true); } } }
/** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent evt) { CompoundPainter<?> painter = ref.get(); if (painter == null) { AbstractPainter<?> src = (AbstractPainter<?>) evt.getSource(); src.removePropertyChangeListener(this); } else { String property = evt.getPropertyName(); if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) { return; } painter.setDirty(true); } } }
/** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent evt) { CompoundPainter<?> painter = ref.get(); if (painter == null) { AbstractPainter<?> src = (AbstractPainter<?>) evt.getSource(); src.removePropertyChangeListener(this); } else { String property = evt.getPropertyName(); if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) { return; } painter.setDirty(true); } } }
/** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent evt) { CompoundPainter<?> painter = ref.get(); if (painter == null) { AbstractPainter<?> src = (AbstractPainter<?>) evt.getSource(); src.removePropertyChangeListener(this); } else { String property = evt.getPropertyName(); if ("dirty".equals(property) && evt.getNewValue() == Boolean.FALSE) { return; } painter.setDirty(true); } } }
/** * Set a transform to be applied to all painters contained in this CompoundPainter * @param transform a new AffineTransform */ public void setTransform(AffineTransform transform) { AffineTransform old = getTransform(); this.transform = transform; setDirty(true); firePropertyChange("transform",old,transform); }
/** * Set a transform to be applied to all painters contained in this CompoundPainter * @param transform a new AffineTransform */ public void setTransform(AffineTransform transform) { AffineTransform old = getTransform(); this.transform = transform; setDirty(true); firePropertyChange("transform",old,transform); }
/** * Set a transform to be applied to all painters contained in this CompoundPainter * @param transform a new AffineTransform */ public void setTransform(AffineTransform transform) { AffineTransform old = getTransform(); this.transform = transform; setDirty(true); firePropertyChange("transform", old, transform); }
/** * Set a transform to be applied to all painters contained in this CompoundPainter * @param transform a new AffineTransform */ public void setTransform(AffineTransform transform) { AffineTransform old = getTransform(); this.transform = transform; setDirty(true); firePropertyChange("transform",old,transform); }
/** * Set a transform to be applied to all painters contained in this CompoundPainter * @param transform a new AffineTransform */ public void setTransform(AffineTransform transform) { AffineTransform old = getTransform(); this.transform = transform; setDirty(true); firePropertyChange("transform",old,transform); }
/** * Sets if the clip should be preserved. * Normally the clip will be reset between each painter. Setting clipPreserved to * true can be used to let one painter mask other painters that come after it. * * @param shouldRestoreState new value of the clipPreserved property * @see #isClipPreserved() */ public void setClipPreserved(boolean shouldRestoreState) { boolean oldShouldRestoreState = isClipPreserved(); this.clipPreserved = shouldRestoreState; setDirty(true); firePropertyChange("clipPreserved",oldShouldRestoreState,shouldRestoreState); }
/** * Sets if the clip should be preserved. * Normally the clip will be reset between each painter. Setting clipPreserved to * true can be used to let one painter mask other painters that come after it. * * @param shouldRestoreState new value of the clipPreserved property * @see #isClipPreserved() */ public void setClipPreserved(boolean shouldRestoreState) { boolean oldShouldRestoreState = isClipPreserved(); this.clipPreserved = shouldRestoreState; setDirty(true); firePropertyChange("clipPreserved",oldShouldRestoreState,shouldRestoreState); }
/** * Sets if the clip should be preserved. * Normally the clip will be reset between each painter. Setting clipPreserved to * true can be used to let one painter mask other painters that come after it. * * @param shouldRestoreState new value of the clipPreserved property * @see #isClipPreserved() */ public void setClipPreserved(boolean shouldRestoreState) { boolean oldShouldRestoreState = isClipPreserved(); this.clipPreserved = shouldRestoreState; setDirty(true); firePropertyChange("clipPreserved",oldShouldRestoreState,shouldRestoreState); }
/** * Sets if the clip should be preserved. * Normally the clip will be reset between each painter. Setting clipPreserved to * true can be used to let one painter mask other painters that come after it. * * @param shouldRestoreState new value of the clipPreserved property * @see #isClipPreserved() */ public void setClipPreserved(boolean shouldRestoreState) { boolean oldShouldRestoreState = isClipPreserved(); this.clipPreserved = shouldRestoreState; setDirty(true); firePropertyChange("clipPreserved",oldShouldRestoreState,shouldRestoreState); }
/** * Sets if the clip should be preserved. * Normally the clip will be reset between each painter. Setting clipPreserved to * true can be used to let one painter mask other painters that come after it. * * @param shouldRestoreState new value of the clipPreserved property * @see #isClipPreserved() */ public void setClipPreserved(boolean shouldRestoreState) { boolean oldShouldRestoreState = isClipPreserved(); this.clipPreserved = shouldRestoreState; setDirty(true); firePropertyChange("clipPreserved", oldShouldRestoreState, shouldRestoreState); }
/** * Adds a painter to the queue of painters * @param painter the painter that is added */ public void addPainter(Painter<T> painter) { Collection<Painter<T>> old = new ArrayList<Painter<T>>(getPainters()); this.painters.add(painter); if (painter instanceof AbstractPainter) { ((AbstractPainter<?>) painter).addPropertyChangeListener(handler); } setDirty(true); firePropertyChange("painters", old, getPainters()); }
/** * Sets the array of Painters to use. These painters will be executed in * order. A null value will be treated as an empty array. To prevent unexpected * behavior all values in provided array are copied to internally held array. * Any changes to the original array will not be reflected. * * @param painters array of painters, which will be painted in order */ public void setPainters(Painter... painters) { Painter[] old = getPainters(); this.painters = new Painter[painters == null ? 0 : painters.length]; if (painters != null) { System.arraycopy(painters, 0, this.painters, 0, this.painters.length); } setDirty(true); firePropertyChange("painters", old, getPainters()); }
/** * <p>Iterates over all child <code>Painter</code>s and gives them a chance * to validate themselves. If any of the child painters are dirty, then * this <code>CompoundPainter</code> marks itself as dirty.</p> * * {@inheritDoc} */ @Override protected void validate(T object) { boolean dirty = false; for (Painter p : painters) { if (p instanceof AbstractPainter) { AbstractPainter ap = (AbstractPainter)p; ap.validate(object); if (ap.isDirty()) { dirty = true; break; } } } clearLocalCacheOnly = true; setDirty(dirty); //super will call clear cache clearLocalCacheOnly = false; }
/** * <p>Iterates over all child <code>Painter</code>s and gives them a chance * to validate themselves. If any of the child painters are dirty, then * this <code>CompoundPainter</code> marks itself as dirty.</p> * * {@inheritDoc} */ @Override protected void validate(T object) { boolean dirty = false; for (Painter<?> p : painters) { if (p instanceof AbstractPainter) { AbstractPainter ap = (AbstractPainter) p; ap.validate(object); if (ap.isDirty()) { dirty = true; break; } } } clearLocalCacheOnly = true; setDirty(dirty); //super will call clear cache clearLocalCacheOnly = false; }
/** * <p>Iterates over all child <code>Painter</code>s and gives them a chance * to validate themselves. If any of the child painters are dirty, then * this <code>CompoundPainter</code> marks itself as dirty.</p> * * {@inheritDoc} */ @Override protected void validate(T object) { boolean dirty = false; for (Painter<?> p : painters) { if (p instanceof AbstractPainter) { AbstractPainter ap = (AbstractPainter) p; ap.validate(object); if (ap.isDirty()) { dirty = true; break; } } } clearLocalCacheOnly = true; setDirty(dirty); //super will call clear cache clearLocalCacheOnly = false; }
/** * Removes a painter from the queue of painters * @param painter the painter that is added */ public void removePainter(Painter<T> painter) { Collection<Painter<T>> old = new ArrayList<Painter<T>>(getPainters()); this.painters.remove(painter); if (painter instanceof AbstractPainter) { ((AbstractPainter<?>) painter).removePropertyChangeListener(handler); } setDirty(true); firePropertyChange("painters", old, getPainters()); }