fop svn-trunk

org.apache.fop.layoutmgr
Class KeepUtil

java.lang.Object
  extended by org.apache.fop.layoutmgr.KeepUtil

public class KeepUtil
extends java.lang.Object

Utility class for working with keeps.


Constructor Summary
KeepUtil()
           
 
Method Summary
static int getCombinedBlockLevelKeepStrength(KeepProperty keep)
          Returns the combined block-level keep strength from a keep property.
static int getKeepStrength(Property keep)
          Converts a keep property into an integer value.
static int getPenaltyForKeep(int keepStrength)
          Returns the penalty value to be used for a certain keep strength.
static boolean hasKeep(int strength)
          Indicates whether a keep strength indicates a keep constraint.
static java.lang.String keepStrengthToString(int keepStrength)
          Returns a string representation of a keep strength value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeepUtil

public KeepUtil()
Method Detail

getKeepStrength

public static int getKeepStrength(Property keep)
Converts a keep property into an integer value.

Note: The conversion restricts the effectively available integer range by two values. Integer.MIN_VALUE is used to represent the value "auto" and Integer.MAX_VALUE is used to represebt the value "always".

Parameters:
keep - the keep property
Returns:
the keep value as an integer

getCombinedBlockLevelKeepStrength

public static int getCombinedBlockLevelKeepStrength(KeepProperty keep)
Returns the combined block-level keep strength from a keep property.

Note: This is a temporary method to be used until it is possible to differentiate between page and column keeps!

Parameters:
keep - the keep property
Returns:
the combined keep strength

hasKeep

public static boolean hasKeep(int strength)
Indicates whether a keep strength indicates a keep constraint.

Parameters:
strength - the keep strength
Returns:
true if the keep is not "auto"

getPenaltyForKeep

public static int getPenaltyForKeep(int keepStrength)
Returns the penalty value to be used for a certain keep strength.

Parameters:
keepStrength - the keep strength
Returns:
the penalty value

keepStrengthToString

public static java.lang.String keepStrengthToString(int keepStrength)
Returns a string representation of a keep strength value.

Parameters:
keepStrength - the keep strength
Returns:
the string representation

fop svn-trunk

Copyright 1999-2009 The Apache Software Foundation. All Rights Reserved.