001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Igor V. Stolyarov
019: * @version $Revision$
020: */package java.awt.image.renderable;
021:
022: import java.awt.RenderingHints;
023: import java.awt.Shape;
024: import java.awt.geom.AffineTransform;
025:
026: public class RenderContext implements Cloneable {
027:
028: AffineTransform transform;
029: Shape aoi;
030: RenderingHints hints;
031:
032: public RenderContext(AffineTransform usr2dev, Shape aoi,
033: RenderingHints hints) {
034: this .transform = (AffineTransform) usr2dev.clone();
035: this .aoi = aoi;
036: this .hints = hints;
037: }
038:
039: public RenderContext(AffineTransform usr2dev, Shape aoi) {
040: this (usr2dev, aoi, null);
041: }
042:
043: public RenderContext(AffineTransform usr2dev, RenderingHints hints) {
044: this (usr2dev, null, hints);
045: }
046:
047: public RenderContext(AffineTransform usr2dev) {
048: this (usr2dev, null, null);
049: }
050:
051: @Override
052: public Object clone() {
053: return new RenderContext(transform, aoi, hints);
054: }
055:
056: public void setTransform(AffineTransform newTransform) {
057: transform = (AffineTransform) newTransform.clone();
058: }
059:
060: /**
061: * @deprecated
062: */
063: @Deprecated
064: public void preConcetenateTransform(AffineTransform modTransform) {
065: preConcatenateTransform(modTransform);
066: }
067:
068: public void preConcatenateTransform(AffineTransform modTransform) {
069: transform.preConcatenate(modTransform);
070: }
071:
072: /**
073: * @deprecated
074: */
075: @Deprecated
076: public void concetenateTransform(AffineTransform modTransform) {
077: concatenateTransform(modTransform);
078: }
079:
080: public void concatenateTransform(AffineTransform modTransform) {
081: transform.concatenate(modTransform);
082: }
083:
084: public AffineTransform getTransform() {
085: return (AffineTransform) transform.clone();
086: }
087:
088: public void setAreaOfInterest(Shape newAoi) {
089: aoi = newAoi;
090: }
091:
092: public Shape getAreaOfInterest() {
093: return aoi;
094: }
095:
096: public void setRenderingHints(RenderingHints hints) {
097: this .hints = hints;
098: }
099:
100: public RenderingHints getRenderingHints() {
101: return hints;
102: }
103: }
|