Class TransformingGraphics
- java.lang.Object
-
- org.jungrapht.visualization.transform.shape.Graphics2DWrapper
-
- org.jungrapht.visualization.transform.shape.GraphicsDecorator
-
- org.jungrapht.visualization.transform.shape.TransformingGraphics
-
- Direct Known Subclasses:
TransformingFlatnessGraphics
public class TransformingGraphics extends GraphicsDecorator
subclassed to pass certain operations thru the Function before the base class method is applied This is useful when you want to apply non-affine transformations to the Graphics2D used to draw elements of the graph.- Author:
- Tom Nelson
-
-
Field Summary
Fields Modifier and Type Field Description protected BidirectionalTransformertransformerthe Function to apply-
Fields inherited from class org.jungrapht.visualization.transform.shape.Graphics2DWrapper
delegate
-
-
Constructor Summary
Constructors Constructor Description TransformingGraphics(BidirectionalTransformer transformer)TransformingGraphics(BidirectionalTransformer Function, Graphics2D delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Graphicscreate()voiddispose()voiddraw(Shape s)transform the shape before letting the delegate draw itvoiddraw(Shape s, float flatness)booleandrawImage(Image img, int x, int y, ImageObserver observer)booleandrawImage(Image img, AffineTransform at, ImageObserver observer)voidfill(Shape s)transform the shape before letting the delegate fill itvoidfill(Shape s, float flatness)BidirectionalTransformergetTransformer()booleanhit(Rectangle rect, Shape s, boolean onStroke)transform the shape before letting the delegate apply 'hit' with itvoidsetTransformer(BidirectionalTransformer Function)-
Methods inherited from class org.jungrapht.visualization.transform.shape.GraphicsDecorator
draw, draw
-
Methods inherited from class org.jungrapht.visualization.transform.shape.Graphics2DWrapper
addRenderingHints, clearRect, clip, clipRect, copyArea, create, draw3DRect, drawArc, drawBytes, drawChars, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawString, drawString, drawString, drawString, equals, fill3DRect, fillArc, fillOval, fillPolygon, fillPolygon, fillRect, fillRoundRect, finalize, getBackground, getClip, getClipBounds, getClipBounds, getClipRect, getColor, getComposite, getDelegate, getDeviceConfiguration, getFont, getFontMetrics, getFontMetrics, getFontRenderContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hashCode, hitClip, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setDelegate, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, toString, transform, translate, translate
-
-
-
-
Field Detail
-
transformer
protected BidirectionalTransformer transformer
the Function to apply
-
-
Constructor Detail
-
TransformingGraphics
public TransformingGraphics(BidirectionalTransformer transformer)
-
TransformingGraphics
public TransformingGraphics(BidirectionalTransformer Function, Graphics2D delegate)
-
-
Method Detail
-
getTransformer
public BidirectionalTransformer getTransformer()
- Returns:
- Returns the Function.
-
setTransformer
public void setTransformer(BidirectionalTransformer Function)
- Parameters:
Function- The Function to set.
-
draw
public void draw(Shape s)
transform the shape before letting the delegate draw it- Overrides:
drawin classGraphics2DWrapper
-
draw
public void draw(Shape s, float flatness)
-
fill
public void fill(Shape s)
transform the shape before letting the delegate fill it- Overrides:
fillin classGraphics2DWrapper
-
fill
public void fill(Shape s, float flatness)
-
drawImage
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
- Overrides:
drawImagein classGraphics2DWrapper
-
drawImage
public boolean drawImage(Image img, AffineTransform at, ImageObserver observer)
- Overrides:
drawImagein classGraphics2DWrapper
-
hit
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
transform the shape before letting the delegate apply 'hit' with it- Overrides:
hitin classGraphics2DWrapper
-
create
public Graphics create()
- Overrides:
createin classGraphics2DWrapper
-
dispose
public void dispose()
- Overrides:
disposein classGraphics2DWrapper
-
-