org.apache.batik.ext.swing

Class JAffineTransformChooser

public class JAffineTransformChooser extends JGridBagPanel

The JAffineTransformChooser is a pane that contains controls to let a user select the various components that make up an AffineTransform
Nested Class Summary
static classJAffineTransformChooser.Dialog
Field Summary
static StringCONFIG_BOTTOM_PAD
static StringCONFIG_LEFT_PAD
static StringCONFIG_RIGHT_PAD
static StringCONFIG_TEXT_FIELD_WIDTH
static StringCONFIG_TOP_PAD
protected static doubleDEG_TO_RAD
static StringLABEL_ANGLE
static StringLABEL_DEGREE
static StringLABEL_PERCENT
static StringLABEL_ROTATE
static StringLABEL_RX
static StringLABEL_RY
static StringLABEL_SCALE
static StringLABEL_SX
static StringLABEL_SY
static StringLABEL_TRANSLATE
static StringLABEL_TX
static StringLABEL_TY
protected DoubleDocumentrotateModel
The Model for the rotation
protected DoubleDocumentrxModel
The Model for the x-axis rotation center
protected DoubleDocumentryModel
The Model for the y-axis rotation center
protected static doubleRAD_TO_DEG
protected DoubleDocumentsxModel
The Model for the x-axis scale component
protected DoubleDocumentsyModel
The Model for the y-axis scale component
protected AffineTransformtxf
The AffineTransform value represented by the chooser
protected DoubleDocumenttxModel
The Model for the x-axis translate component
protected DoubleDocumenttyModel
The Model for the y-axis translate component
Constructor Summary
JAffineTransformChooser()
Default constructor
Method Summary
protected voidaddToPanelAtRow(String label, Document model, String suffix, JGridBagPanel p, int row)
protected voidbuild()
Adds the control components into this panel.
protected ComponentbuildPanel(String panelName, String tfALabel, Document tfAModel, String tfBLabel, Document tfBModel, String tfASuffix, String tfBSuffix, boolean setBorder)
protected ComponentbuildRotatePanel()
static JAffineTransformChooser.DialogcreateDialog(Component cmp, String title)
Creates a new modal dialog box that can be used to configure an AffineTransform
AffineTransformgetAffineTransform()
static voidmain(String[] args)
voidsetAffineTransform(AffineTransform txf)
voidsetPanelBorder(JComponent panel, String panelName)
static AffineTransformshowDialog(Component cmp, String title)
Displays the panel in a modal dialog box.

Field Detail

CONFIG_BOTTOM_PAD

public static final String CONFIG_BOTTOM_PAD

CONFIG_LEFT_PAD

public static final String CONFIG_LEFT_PAD

CONFIG_RIGHT_PAD

public static final String CONFIG_RIGHT_PAD

CONFIG_TEXT_FIELD_WIDTH

public static final String CONFIG_TEXT_FIELD_WIDTH

CONFIG_TOP_PAD

public static final String CONFIG_TOP_PAD

DEG_TO_RAD

protected static final double DEG_TO_RAD

LABEL_ANGLE

public static final String LABEL_ANGLE

LABEL_DEGREE

public static final String LABEL_DEGREE

LABEL_PERCENT

public static final String LABEL_PERCENT

LABEL_ROTATE

public static final String LABEL_ROTATE

LABEL_RX

public static final String LABEL_RX

LABEL_RY

public static final String LABEL_RY

LABEL_SCALE

public static final String LABEL_SCALE

LABEL_SX

public static final String LABEL_SX

LABEL_SY

public static final String LABEL_SY

LABEL_TRANSLATE

public static final String LABEL_TRANSLATE

LABEL_TX

public static final String LABEL_TX

LABEL_TY

public static final String LABEL_TY

rotateModel

protected DoubleDocument rotateModel
The Model for the rotation

rxModel

protected DoubleDocument rxModel
The Model for the x-axis rotation center

ryModel

protected DoubleDocument ryModel
The Model for the y-axis rotation center

RAD_TO_DEG

protected static final double RAD_TO_DEG

sxModel

protected DoubleDocument sxModel
The Model for the x-axis scale component

syModel

protected DoubleDocument syModel
The Model for the y-axis scale component

txf

protected AffineTransform txf
The AffineTransform value represented by the chooser

txModel

protected DoubleDocument txModel
The Model for the x-axis translate component

tyModel

protected DoubleDocument tyModel
The Model for the y-axis translate component

Constructor Detail

JAffineTransformChooser

public JAffineTransformChooser()
Default constructor

Method Detail

addToPanelAtRow

protected void addToPanelAtRow(String label, Document model, String suffix, JGridBagPanel p, int row)

build

protected void build()
Adds the control components into this panel.

buildPanel

protected Component buildPanel(String panelName, String tfALabel, Document tfAModel, String tfBLabel, Document tfBModel, String tfASuffix, String tfBSuffix, boolean setBorder)

buildRotatePanel

protected Component buildRotatePanel()

createDialog

public static JAffineTransformChooser.Dialog createDialog(Component cmp, String title)
Creates a new modal dialog box that can be used to configure an AffineTransform

Parameters: cmp the dialog's parent component title the dialog's title

getAffineTransform

public AffineTransform getAffineTransform()

main

public static void main(String[] args)

setAffineTransform

public void setAffineTransform(AffineTransform txf)

setPanelBorder

public void setPanelBorder(JComponent panel, String panelName)

showDialog

public static AffineTransform showDialog(Component cmp, String title)
Displays the panel in a modal dialog box.

Parameters: cmp the dialog's parent component title the dialog's title

Returns: null if the dialog was cancelled. Otherwise, the value entered by the user.

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.