private Paint calculateStrokePaint(Object component, int width, int height) { Paint p = getForegroundPaint(getBorderPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
/** * Convenience constructor for creating a CompoundPainter for an array * of painters. A defensive copy of the given array is made, so that future * modification to the array does not result in changes to the CompoundPainter. * * @param painters array of painters, which will be painted in order */ public CompoundPainter(Painter... painters) { handler = new Handler(this); setPainters(painters); }
private Paint calculateFillPaint(Object component, int width, int height) { //set the fillPaint Paint p = getBackgroundPaint(getFillPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
@Override protected void setDirty(boolean d) { boolean old = super.isDirty(); boolean ours = isDirty(); super.setDirty(d); //must perform this check to ensure we do not double notify if (d != old && d == ours) { firePropertyChange("dirty", old, isDirty()); } }
/** * Sets length of the trail in points. Bound property. * @param trailLength Trail length in points. */ public void setTrailLength(int trailLength) { int old = getTrailLength(); this.trailLength = trailLength; firePropertyChange("trailLength", old, getTrailLength()); }
/** * Sets new spinning direction. * @param dir Spinning direction. */ public void setDirection(Direction dir) { Direction old = getDirection(); this.direction = dir; firePropertyChange("direction", old, getDirection()); } }
/** * Sets the spacing between pinstripes * * @param spacing * spacing between pinstripes */ public void setSpacing(double spacing) { double old = getSpacing(); this.spacing = spacing; firePropertyChange("spacing", old, getSpacing()); }
/** * {@inheritDoc} */ @Override protected boolean shouldUseCache() { return (isCacheable() && painters != null && painters.length > 0) || super.shouldUseCache(); } }
/** * Initializes painter to the specified trajectory and and point shape. Bounds are dynamically calculated to so the specified trajectory fits in. * @param point Point shape. * @param trajectory Trajectory shape. */ public BusyPainter(Shape point, Shape trajectory) { init(point, trajectory, Color.LIGHT_GRAY, Color.BLACK); }
/** * {@inheritDoc} */ @Override protected void setDirty(boolean d) { boolean old = super.isDirty(); boolean ours = isDirty(); super.setDirty(d); //must perform this check to ensure we do not double notify if (d != old && d == ours) { firePropertyChange("dirty", old, isDirty()); } }
private Paint calculateStrokePaint(Object component, int width, int height) { Paint p = getForegroundPaint(getBorderPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
private Paint calculateFillPaint(Object component, int width, int height) { //set the fillPaint Paint p = getBackgroundPaint(getFillPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
/** * Convenience constructor for creating a CompoundPainter for an array * of painters. A defensive copy of the given array is made, so that future * modification to the array does not result in changes to the CompoundPainter. * * @param painters array of painters, which will be painted in order */ public CompoundPainter(Painter<T>... painters) { handler = new Handler(this); setPainters(painters); }
/** * {@inheritDoc} */ @Override protected void setDirty(boolean d) { boolean old = super.isDirty(); boolean ours = isDirty(); super.setDirty(d); //must perform this check to ensure we do not double notify if (d != old && d == ours) { firePropertyChange("dirty", old, isDirty()); } }
private Paint calculateStrokePaint(Object component, int width, int height) { Paint p = getForegroundPaint(getBorderPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
private Paint calculateFillPaint(Object component, int width, int height) { //set the fillPaint Paint p = getBackgroundPaint(getFillPaint(), component); if(isPaintStretched()) { p = calculateSnappedPaint(p, width, height); } return p; }
/** * Convenience constructor for creating a CompoundPainter for an array * of painters. A defensive copy of the given array is made, so that future * modification to the array does not result in changes to the CompoundPainter. * * @param painters array of painters, which will be painted in order */ public CompoundPainter(Painter... painters) { handler = new Handler(this); setPainters(painters); }
/** * {@inheritDoc} */ @Override protected void setDirty(boolean d) { boolean old = super.isDirty(); boolean ours = isDirty(); super.setDirty(d); //must perform this check to ensure we do not double notify if (d != old && d == ours) { firePropertyChange("dirty", old, isDirty()); } }
/** * Convenience constructor for creating a CompoundPainter for an array * of painters. A defensive copy of the given array is made, so that future * modification to the array does not result in changes to the CompoundPainter. * * @param painters array of painters, which will be painted in order */ public CompoundPainter(Painter... painters) { handler = new Handler(this); setPainters(painters); }
/** * Convenience constructor for creating a CompoundPainter for a list * of painters. A defensive copy of the given array is made, so that future * modification to the list does not result in changes to the CompoundPainter. * * @param painters array of painters, which will be painted in order */ public CompoundPainter(List<? extends Painter<T>> painters) { handler = new Handler(this); setPainters(painters); } /**