Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.gui
Class ScaleFactorConstraints

java.lang.Object
  extended by ch.randelshofer.gui.ScaleFactorConstraints

public class ScaleFactorConstraints
extends java.lang.Object

The ScaleFactorConstraints class specifies constraints for components that are laid out using the ScaleFactorLayout class.

Version:
1.3 2006-07-23 Support for Pixel Aspect Ratio added.
1.2 2002-02-06 'Scale to fit' property added.
1.1 2000-09-27 Setter for factorX, factorY and maintainAspectRatio added.
1.0.1 2000-06-12 Reworked.
1.0 1999-10-19
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland

Field Summary
 double factorX
           
 double factorY
           
 boolean maintainAspectRatio
           
 double pixelAspectRatio
          Pixel width divided by pixel height.
 boolean scaleToFit
           
 
Constructor Summary
ScaleFactorConstraints()
          Creates a ScaleFactorConstraints object with all of its set to the default values.
ScaleFactorConstraints(double factorX, double factorY, boolean maintainAspectRatio)
          Creates a ScaleFactorConstraints object with all of its fields set to the passed-in arguments.
 
Method Summary
 double getFactorX()
           
 double getFactorY()
           
 double getPixelAspectRatio()
           
 boolean isMaintainAspectRatio()
           
 boolean isScaleToFit()
           
 void setConstraints(double factorX, double factorY, boolean maintainAspectRatio)
           
 void setFactorX(double d)
           
 void setFactorY(double d)
           
 void setMaintainAspectRatio(boolean b)
           
 void setPixelAspectRatio(double d)
           
 void setScaleToFit(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factorX

public double factorX

factorY

public double factorY

pixelAspectRatio

public double pixelAspectRatio
Pixel width divided by pixel height. 1.0 is quadratic.


maintainAspectRatio

public boolean maintainAspectRatio

scaleToFit

public boolean scaleToFit
Constructor Detail

ScaleFactorConstraints

public ScaleFactorConstraints()
Creates a ScaleFactorConstraints object with all of its set to the default values.


ScaleFactorConstraints

public ScaleFactorConstraints(double factorX,
                              double factorY,
                              boolean maintainAspectRatio)
Creates a ScaleFactorConstraints object with all of its fields set to the passed-in arguments.

Parameters:
factorX - the scale factor for the x axis of the component.
factorY - the scale factor for the y axis of the component.
maintainAspectRatio - set to true if the aspect ratio of the component shall be maintained.
Method Detail

setConstraints

public void setConstraints(double factorX,
                           double factorY,
                           boolean maintainAspectRatio)

getFactorX

public double getFactorX()

getFactorY

public double getFactorY()

setFactorX

public void setFactorX(double d)

setFactorY

public void setFactorY(double d)

setPixelAspectRatio

public void setPixelAspectRatio(double d)

getPixelAspectRatio

public double getPixelAspectRatio()

isMaintainAspectRatio

public boolean isMaintainAspectRatio()

setMaintainAspectRatio

public void setMaintainAspectRatio(boolean b)

isScaleToFit

public boolean isScaleToFit()

setScaleToFit

public void setScaleToFit(boolean b)

Copyright 2012-02-25 Werner Randelshofer