- java.lang.Object
-
- java.awt.image.renderable.RenderContext
-
- All Implemented Interfaces:
- Cloneable
public class RenderContext extends Object implements Cloneable
A RenderContext encapsulates the information needed to produce a specific rendering from a RenderableImage. It contains the area to be rendered specified in rendering-independent terms, the resolution at which the rendering is to be performed, and hints used to control the rendering process.Users create RenderContexts and pass them to the RenderableImage via the createRendering method. Most of the methods of RenderContexts are not meant to be used directly by applications, but by the RenderableImage and operator classes to which it is passed.
The AffineTransform parameter passed into and out of this class are cloned. The RenderingHints and Shape parameters are not necessarily cloneable and are therefore only reference copied. Altering RenderingHints or Shape instances that are in use by instances of RenderContext may have undesired side effects.
-
-
Constructor Summary
Constructors Constructor and Description RenderContext(AffineTransform usr2dev)
Constructs a RenderContext with a given transform.RenderContext(AffineTransform usr2dev, RenderingHints hints)
Constructs a RenderContext with a given transform and rendering hints.RenderContext(AffineTransform usr2dev, Shape aoi)
Constructs a RenderContext with a given transform and area of interest.RenderContext(AffineTransform usr2dev, Shape aoi, RenderingHints hints)
Constructs a RenderContext with a given transform.
-
Method Summary
Methods Modifier and Type Method and Description Object
clone()
Makes a copy of a RenderContext.void
concatenateTransform(AffineTransform modTransform)
Modifies the current user-to-device transform by appending another transform.void
concetenateTransform(AffineTransform modTransform)
Deprecated.replaced byconcatenateTransform(AffineTransform)
.Shape
getAreaOfInterest()
Gets the ares of interest currently contained in the RenderContext.RenderingHints
getRenderingHints()
Gets the rendering hints of thisRenderContext
.AffineTransform
getTransform()
Gets the current user-to-device AffineTransform.void
preConcatenateTransform(AffineTransform modTransform)
Modifies the current user-to-device transform by prepending another transform.void
preConcetenateTransform(AffineTransform modTransform)
Deprecated.replaced bypreConcatenateTransform(AffineTransform)
.void
setAreaOfInterest(Shape newAoi)
Sets the current area of interest.void
setRenderingHints(RenderingHints hints)
Sets the rendering hints of thisRenderContext
.void
setTransform(AffineTransform newTransform)
Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.
-
-
-
Constructor Detail
-
RenderContext
public RenderContext(AffineTransform usr2dev, Shape aoi, RenderingHints hints)
Constructs a RenderContext with a given transform. The area of interest is supplied as a Shape, and the rendering hints are supplied as a RenderingHints object.- Parameters:
usr2dev
- an AffineTransform.aoi
- a Shape representing the area of interest.hints
- a RenderingHints object containing rendering hints.
-
RenderContext
public RenderContext(AffineTransform usr2dev)
Constructs a RenderContext with a given transform. The area of interest is taken to be the entire renderable area. No rendering hints are used.- Parameters:
usr2dev
- an AffineTransform.
-
RenderContext
public RenderContext(AffineTransform usr2dev, RenderingHints hints)
Constructs a RenderContext with a given transform and rendering hints. The area of interest is taken to be the entire renderable area.- Parameters:
usr2dev
- an AffineTransform.hints
- a RenderingHints object containing rendering hints.
-
RenderContext
public RenderContext(AffineTransform usr2dev, Shape aoi)
Constructs a RenderContext with a given transform and area of interest. The area of interest is supplied as a Shape. No rendering hints are used.- Parameters:
usr2dev
- an AffineTransform.aoi
- a Shape representing the area of interest.
-
-
Method Detail
-
getRenderingHints
public RenderingHints getRenderingHints()
Gets the rendering hints of thisRenderContext
.- Returns:
- a
RenderingHints
object that represents the rendering hints of thisRenderContext
. - See Also:
setRenderingHints(RenderingHints)
-
setRenderingHints
public void setRenderingHints(RenderingHints hints)
Sets the rendering hints of thisRenderContext
.- Parameters:
hints
- aRenderingHints
object that represents the rendering hints to assign to thisRenderContext
.- See Also:
getRenderingHints()
-
setTransform
public void setTransform(AffineTransform newTransform)
Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.- Parameters:
newTransform
- the new AffineTransform.- See Also:
getTransform()
-
preConcatenateTransform
public void preConcatenateTransform(AffineTransform modTransform)
Modifies the current user-to-device transform by prepending another transform. In matrix notation the operation is:[this] = [modTransform] x [this]
- Parameters:
modTransform
- the AffineTransform to prepend to the current usr2dev transform.- Since:
- 1.3
-
preConcetenateTransform
@Deprecated public void preConcetenateTransform(AffineTransform modTransform)
Deprecated. replaced bypreConcatenateTransform(AffineTransform)
.Modifies the current user-to-device transform by prepending another transform. In matrix notation the operation is:[this] = [modTransform] x [this]
This method does the same thing as the preConcatenateTransform method. It is here for backward compatibility with previous releases which misspelled the method name.- Parameters:
modTransform
- the AffineTransform to prepend to the current usr2dev transform.
-
concatenateTransform
public void concatenateTransform(AffineTransform modTransform)
Modifies the current user-to-device transform by appending another transform. In matrix notation the operation is:[this] = [this] x [modTransform]
- Parameters:
modTransform
- the AffineTransform to append to the current usr2dev transform.- Since:
- 1.3
-
concetenateTransform
@Deprecated public void concetenateTransform(AffineTransform modTransform)
Deprecated. replaced byconcatenateTransform(AffineTransform)
.Modifies the current user-to-device transform by appending another transform. In matrix notation the operation is:[this] = [this] x [modTransform]
This method does the same thing as the concatenateTransform method. It is here for backward compatibility with previous releases which misspelled the method name.- Parameters:
modTransform
- the AffineTransform to append to the current usr2dev transform.
-
getTransform
public AffineTransform getTransform()
Gets the current user-to-device AffineTransform.- Returns:
- a reference to the current AffineTransform.
- See Also:
setTransform(AffineTransform)
-
setAreaOfInterest
public void setAreaOfInterest(Shape newAoi)
Sets the current area of interest. The old area is discarded.- Parameters:
newAoi
- The new area of interest.- See Also:
getAreaOfInterest()
-
getAreaOfInterest
public Shape getAreaOfInterest()
Gets the ares of interest currently contained in the RenderContext.- Returns:
- a reference to the area of interest of the RenderContext, or null if none is specified.
- See Also:
setAreaOfInterest(Shape)
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/awt/image/renderable/RenderContext.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.