Browse Source

Superseded by Block-specific versions


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197808 13f79535-47bb-0310-9956-ffa450edef68
tags/Defoe_export
Peter Bernard West 20 years ago
parent
commit
1cf5306a83

+ 0
- 138
src/java/org/apache/fop/area/AbstractReferenceArea.java View File

@@ -1,138 +0,0 @@
/*
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Created on 21/02/2004
* $Id$
*/
package org.apache.fop.area;

import java.awt.geom.AffineTransform;
import org.apache.fop.datastructs.Node;
import org.apache.fop.datatypes.IntegerType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.flow.FoPageSequence;

/**
* @author pbw
* @version $Revision$ $Name$
*/
public abstract class AbstractReferenceArea
extends Area
implements ReferenceArea {

private static final String tag = "$Name$";
private static final String revision = "$Revision$";

// Set up as identity matrix
protected AffineTransform transformer = new AffineTransform();

/**
* @param pageSeq through which this area was generated
* @param generatedBy the given <code>FONode</code> generated this
* @param parent area of this
* @param sync object on which operations in this are synchronized
*/
public AbstractReferenceArea(
FoPageSequence pageSeq,
FONode generatedBy,
Node parent,
Object sync) {
super(pageSeq, generatedBy, parent, sync);
contentOrientation = setContentOrientation();
frameOrientation = setFrameOrientation();
// What transform is required?
// TODO work out the transformation
// TODO check for reference-area rotational transformation
// in interactions between AreaFrames and ContentAreas
}

private int contentOrientation;
private int frameOrientation;

/**
* Set the Coordinate Transformation Matrix which transforms content
* coordinates in this reference area which are specified in
* terms of "start" and "before" into coordinates in a system which
* is positioned in "absolute" directions (with origin at lower left of
* the reference area.
*
* @param transformer to position this reference area
*/
public void setCoordTransformer(AffineTransform transformer) {
synchronized (sync) {
this.transformer = transformer;
}
}

/**
* Get the current transformer of this reference area.
*
* @return the current transformer to position this reference area
*/
public AffineTransform getCoordTransformer() {
synchronized (sync) {
return this.transformer;
}
}

private int setContentOrientation() {
try {
return IntegerType.getIntValue(
generatedBy.getPropertyValue(
PropNames.REFERENCE_ORIENTATION));
} catch (PropertyException e) {
throw new RuntimeException(e);
}
}

public int getContentOrientation() {
return contentOrientation;
}

private int setFrameOrientation() {
try {
return IntegerType.getIntValue(
((FONode)generatedBy.getParent()).getPropertyValue(
PropNames.REFERENCE_ORIENTATION));
} catch (PropertyException e) {
throw new RuntimeException(e);
}
}

public int getFrameOrientation() {
return frameOrientation;
}

/**
* Clone this reference area.
*
* @return a copy of this reference area
*/
public Object clone() {
AbstractReferenceArea absRefArea;
try {
absRefArea = (RegionRefArea)(super.clone());
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new InternalError();
}
absRefArea.transformer = transformer;
return absRefArea;
}
}

+ 0
- 94
src/java/org/apache/fop/area/AbstractViewport.java View File

@@ -1,94 +0,0 @@
/*
*
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Created on 27/02/2004
* $Id$
*/
package org.apache.fop.area;

import org.apache.fop.datastructs.Node;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.FoPageSequence;

/**
* @author pbw
* @version $Revision$ $Name$
*/
public class AbstractViewport
extends Area
implements Viewport {
/** Does the viewport rectange clip the reference-area? */
protected boolean clip = true;

/** The reference-area of the viewport/reference pair */
protected ReferenceArea refArea;
/**
* @param pageSeq
* @param generatedBy
* @param parent
* @param sync
*/
public AbstractViewport(
FoPageSequence pageSeq,
FONode generatedBy,
Node parent,
Object sync) {
super(pageSeq, generatedBy, parent, sync);
}
/**
* @param pageSeq
* @param generatedBy
*/
public AbstractViewport(
FoPageSequence pageSeq,
FONode generatedBy) {
super(pageSeq, generatedBy);
}
/* (non-Javadoc)
* @see org.apache.fop.area.Viewport#setReferenceArea(org.apache.fop.area.ReferenceArea)
*/
public void setReferenceArea(ReferenceArea ref) {
synchronized (sync) {
refArea = ref;
}
}
/* (non-Javadoc)
* @see org.apache.fop.area.Viewport#getReferenceArea()
*/
public ReferenceArea getReferenceArea() {
synchronized (sync) {
return refArea;
}
}
/* (non-Javadoc)
* @see org.apache.fop.area.Viewport#setClip(boolean)
*/
public void setClip(boolean clip) {
synchronized (sync) {
this.clip = clip;
}
}
/* (non-Javadoc)
* @see org.apache.fop.area.Viewport#getClip()
*/
public boolean getClip() {
synchronized (sync) {
return clip;
}
}
}

Loading…
Cancel
Save