bugfixproxygraphics2d.java
来自「swing编写的库存管理程序。毕业设计类」· Java 代码 · 共 1,607 行 · 第 1/5 页
JAVA
1,607 行
* <code>Shape</code> during the rendering process
*/
public void setStroke(final Stroke s)
{
parent.setStroke(s);
}
/**
* Forwards the call to the parent.
*
* @param hintKey the key of the hint to be set.
* @param hintValue the value indicating preferences for the specified
* hint category.
*/
public void setRenderingHint(final RenderingHints.Key hintKey, final Object hintValue)
{
parent.setRenderingHint(hintKey, hintValue);
}
/**
* Forwards the call to the parent.
*
* @param hintKey the key corresponding to the hint to get.
* @return an object representing the value for the specified hint key.
* Some of the keys and their associated values are defined in the
* <code>RenderingHints</code> class.
*/
public Object getRenderingHint(final RenderingHints.Key hintKey)
{
return parent.getRenderingHint(hintKey);
}
/**
* Forwards the call to the parent.
*
* @param hints the rendering hints to be set
*/
public void setRenderingHints(final Map hints)
{
parent.setRenderingHints(hints);
}
/**
* Forwards the call to the parent.
*
* @param hints the rendering hints to be set
*/
public void addRenderingHints(final Map hints)
{
parent.addRenderingHints(hints);
}
/**
* Forwards the call to the parent.
*
* @return a reference to an instance of <code>RenderingHints</code>
* that contains the current preferences.
*/
public RenderingHints getRenderingHints()
{
return parent.getRenderingHints();
}
/**
* Forwards the call to the parent.
*
* @param x coords.
* @param y the specified coordinates
* @since JDK1.0
*/
public void translate(final int x, final int y)
{
parent.translate(x, y);
}
/**
* Concatenates the current
* <code>Graphics2D</code> <code>Transform</code>
* with a translation transform.
* Subsequent rendering is translated by the specified
* distance relative to the previous position.
* This is equivalent to calling transform(T), where T is an
* <code>AffineTransform</code> represented by the following matrix:
* <pre>
* [ 1 0 tx ]
* [ 0 1 ty ]
* [ 0 0 1 ]
* </pre>
* @param tx the distance to translate along the x-axis
* @param ty the distance to translate along the y-axis
*/
public void translate(final double tx, final double ty)
{
parent.translate(tx, ty);
}
/**
* Concatenates the current <code>Graphics2D</code>
* <code>Transform</code> with a rotation transform.
* Subsequent rendering is rotated by the specified radians relative
* to the previous origin.
* This is equivalent to calling <code>transform(R)</code>, where R is an
* <code>AffineTransform</code> represented by the following matrix:
* <pre>
* [ cos(theta) -sin(theta) 0 ]
* [ sin(theta) cos(theta) 0 ]
* [ 0 0 1 ]
* </pre>
* Rotating with a positive angle theta rotates points on the positive
* x axis toward the positive y axis.
* @param theta the angle of rotation in radians
*/
public void rotate(final double theta)
{
parent.rotate (theta);
}
/**
* Concatenates the current <code>Graphics2D</code>
* <code>Transform</code> with a translated rotation
* transform. Subsequent rendering is transformed by a transform
* which is constructed by translating to the specified location,
* rotating by the specified radians, and translating back by the same
* amount as the original translation. This is equivalent to the
* following sequence of calls:
* <pre>
* translate(x, y);
* rotate(theta);
* translate(-x, -y);
* </pre>
* Rotating with a positive angle theta rotates points on the positive
* x axis toward the positive y axis.
* @param theta the angle of rotation in radians
* @param x coords.
* @param y coordinates of the origin of the rotation
*/
public void rotate(final double theta, final double x, final double y)
{
parent.rotate(theta, x, y);
}
/**
* Concatenates the current <code>Graphics2D</code>
* <code>Transform</code> with a scaling transformation
* Subsequent rendering is resized according to the specified scaling
* factors relative to the previous scaling.
* This is equivalent to calling <code>transform(S)</code>, where S is an
* <code>AffineTransform</code> represented by the following matrix:
* <pre>
* [ sx 0 0 ]
* [ 0 sy 0 ]
* [ 0 0 1 ]
* </pre>
* @param sx the amount by which X coordinates in subsequent
* rendering operations are multiplied relative to previous
* rendering operations.
* @param sy the amount by which Y coordinates in subsequent
* rendering operations are multiplied relative to previous
* rendering operations.
*/
public void scale(final double sx, final double sy)
{
parent.scale (sx, sy);
}
/**
* Concatenates the current <code>Graphics2D</code>
* <code>Transform</code> with a shearing transform.
* Subsequent renderings are sheared by the specified
* multiplier relative to the previous position.
* This is equivalent to calling <code>transform(SH)</code>, where SH
* is an <code>AffineTransform</code> represented by the following
* matrix:
* <pre>
* [ 1 shx 0 ]
* [ shy 1 0 ]
* [ 0 0 1 ]
* </pre>
* @param shx the multiplier by which coordinates are shifted in
* the positive X axis direction as a function of their Y coordinate
* @param shy the multiplier by which coordinates are shifted in
* the positive Y axis direction as a function of their X coordinate
*/
public void shear(final double shx, final double shy)
{
parent.shear(shx, shy);
}
/**
* Composes an <code>AffineTransform</code> object with the
* <code>Transform</code> in this <code>Graphics2D</code> according
* to the rule last-specified-first-applied. If the current
* <code>Transform</code> is Cx, the result of composition
* with Tx is a new <code>Transform</code> Cx'. Cx' becomes the
* current <code>Transform</code> for this <code>Graphics2D</code>.
* Transforming a point p by the updated <code>Transform</code> Cx' is
* equivalent to first transforming p by Tx and then transforming
* the result by the original <code>Transform</code> Cx. In other
* words, Cx'(p) = Cx(Tx(p)). A copy of the Tx is made, if necessary,
* so further modifications to Tx do not affect rendering.
* @param tx the <code>AffineTransform</code> object to be composed with
* the current <code>Transform</code>
* @see #setTransform
* @see AffineTransform
*/
public void transform(final AffineTransform tx)
{
parent.transform(tx);
}
/**
* Overwrites the Transform in the <code>Graphics2D</code> context.
* WARNING: This method should <b>never</b> be used to apply a new
* coordinate transform on top of an existing transform because the
* <code>Graphics2D</code> might already have a transform that is
* needed for other purposes, such as rendering Swing
* components or applying a scaling transformation to adjust for the
* resolution of a printer.
* <p>To add a coordinate transform, use the
* <code>transform</code>, <code>rotate</code>, <code>scale</code>,
* or <code>shear</code> methods. The <code>setTransform</code>
* method is intended only for restoring the original
* <code>Graphics2D</code> transform after rendering, as shown in this
* example:
* <pre><blockquote>
* // Get the current transform
* AffineTransform saveAT = g2.getTransform();
* // Perform transformation
* g2d.transform(...);
* // Render
* g2d.draw(...);
* // Restore original transform
* g2d.setTransform(saveAT);
* </blockquote></pre>
*
* @param tx the <code>AffineTransform</code> that was retrieved
* from the <code>getTransform</code> method
* @see #transform
* @see #getTransform
* @see AffineTransform
*/
public void setTransform(final AffineTransform tx)
{
parent.setTransform(tx);
}
/**
* Returns a copy of the current <code>Transform</code> in the
* <code>Graphics2D</code> context.
* @return the current <code>AffineTransform</code> in the
* <code>Graphics2D</code> context.
* @see #transform
* @see #setTransform
*/
public AffineTransform getTransform()
{
return parent.getTransform();
}
/**
* Returns the current <code>Paint</code> of the
* <code>Graphics2D</code> context.
* @return the current <code>Graphics2D</code> <code>Paint</code>,
* which defines a color or pattern.
* @see #setPaint
* @see Graphics#setColor
*/
public Paint getPaint()
{
return parent.getPaint();
}
/**
* Returns the current <code>Composite</code> in the
* <code>Graphics2D</code> context.
* @return the current <code>Graphics2D</code> <code>Composite</code>,
* which defines a compositing style.
* @see #setComposite
*/
public Composite getComposite()
{
return parent.getComposite();
}
/**
* Sets the background color for the <code>Graphics2D</code> context.
* The background color is used for clearing a region.
* When a <code>Graphics2D</code> is constructed for a
* <code>Component</code>, the background color is
* inherited from the <code>Component</code>. Setting the background color
* in the <code>Graphics2D</code> context only affects the subsequent
* <code>clearRect</code> calls and not the background color of the
* <code>Component</code>. To change the background
* of the <code>Component</code>, use appropriate methods of
* the <code>Component</code>.
* @param color the background color that isused in
* subsequent calls to <code>clearRect</code>
* @see #getBackground
* @see Graphics#clearRect
*/
public void setBackground(final Color color)
{
parent.setBackground(color);
}
/**
* Returns the background color used for clearing a region.
* @return the current <code>Graphics2D</code> <code>Color</code>,
* which defines the background color.
* @see #setBackground
*/
public Color getBackground()
{
return parent.getBackground();
}
/**
* Returns the current <code>Stroke</code> in the
* <code>Graphics2D</code> context.
* @return the current <code>Graphics2D</code> <code>Stroke</code>,
* which defines the line style.
* @see #setStroke
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?