|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.essex.common.gui.panel.ResizePolicy
public class ResizePolicy
The class to define the resizing policy of an uk.ac.essex.common.gui.pane.ImagePane
.
When the size of an uk.ac.essex.common.gui.pane.ImagePane
is changed, the position
of the image needs to be adjusted adequately. A policy is defined
to indicate how to allign the image region displayed in the
uk.ac.essex.common.gui.pane.ImagePane
with the pane: for example, keep a fixed
pixel at the center of the uk.ac.essex.common.gui.pane.ImagePane
. The supported
policies are: center-fixed, leftup-corner fixed, rightup-corner
fixed, leftbottom-fixed and rightbottom-fixed.
Field Summary | |
---|---|
static int |
POLICY_CENTER
The defined resizing policies |
static int |
POLICY_LEFTBOTTOM
|
static int |
POLICY_LEFTUP
|
static int |
POLICY_RIGHTBOTTOM
|
static int |
POLICY_RIGHTUP
|
Constructor Summary | |
---|---|
ResizePolicy(int policy)
The constructor. |
Method Summary | |
---|---|
java.awt.Point |
computeOrigin(int referenceX,
int referenceY,
int w,
int h)
Compute the origin from the reference point and the size of the image display pane. |
java.awt.Point |
computeReference(int imageWidth,
int imageHeight,
int w,
int h)
Compute the reference based on the image size and the image display pane size. |
int |
getPolicy()
Return the policy. |
java.awt.Point |
shiftReference(int dx,
int dy)
Return the shift based on the delta values. |
java.awt.Point |
shiftReference(int minx,
int miny,
int maxx,
int maxy,
int width,
int height)
Move the reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int POLICY_CENTER
public static int POLICY_LEFTUP
public static int POLICY_RIGHTUP
public static int POLICY_LEFTBOTTOM
public static int POLICY_RIGHTBOTTOM
Constructor Detail |
---|
public ResizePolicy(int policy)
Method Detail |
---|
public int getPolicy()
public java.awt.Point computeOrigin(int referenceX, int referenceY, int w, int h)
public java.awt.Point computeReference(int imageWidth, int imageHeight, int w, int h)
public java.awt.Point shiftReference(int dx, int dy)
public java.awt.Point shiftReference(int minx, int miny, int maxx, int maxy, int width, int height)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |