001package icy.gui.sequence.tools;
002
003import icy.image.IcyBufferedImageUtil.FilterType;
004import icy.sequence.Sequence;
005
006import java.awt.GridBagConstraints;
007import java.awt.Insets;
008import java.awt.event.ActionEvent;
009import java.awt.event.ActionListener;
010
011import javax.swing.JLabel;
012
013public class SequenceCanvasResizePanel extends SequenceBaseResizePanel
014{
015    /**
016     * 
017     */
018    private static final long serialVersionUID = 1607237098458182628L;
019    
020    private JLabel lblNewLabel_1;
021    private PositionAlignmentPanel positionAlignmentPanel;
022
023    public SequenceCanvasResizePanel(Sequence sequence)
024    {
025        super(sequence);
026
027        keepRatioCheckBox.setSelected(false);
028
029        positionAlignmentPanel.addActionListener(new ActionListener()
030        {
031            @Override
032            public void actionPerformed(ActionEvent e)
033            {
034                updatePreview();
035            }
036        });
037    }
038
039    @Override
040    protected void initialize()
041    {
042        super.initialize();
043
044        lblNewLabel_1 = new JLabel("Content alignment");
045        GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints();
046        gbc_lblNewLabel_1.fill = GridBagConstraints.BOTH;
047        gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 0);
048        gbc_lblNewLabel_1.gridx = 5;
049        gbc_lblNewLabel_1.gridy = 0;
050        settingPanel.add(lblNewLabel_1, gbc_lblNewLabel_1);
051
052        positionAlignmentPanel = new PositionAlignmentPanel();
053        GridBagConstraints gbc_positionAlignmentPanel = new GridBagConstraints();
054        gbc_positionAlignmentPanel.gridheight = 4;
055        gbc_positionAlignmentPanel.insets = new Insets(0, 0, 5, 5);
056        gbc_positionAlignmentPanel.fill = GridBagConstraints.BOTH;
057        gbc_positionAlignmentPanel.gridx = 5;
058        gbc_positionAlignmentPanel.gridy = 1;
059        settingPanel.add(positionAlignmentPanel, gbc_positionAlignmentPanel);
060    }
061
062    @Override
063    public FilterType getFilterType()
064    {
065        return null;
066    }
067
068    @Override
069    public boolean getResizeContent()
070    {
071        return false;
072    }
073
074    @Override
075    public int getXAlign()
076    {
077        return positionAlignmentPanel.getXAlign();
078    }
079
080    @Override
081    public int getYAlign()
082    {
083        return positionAlignmentPanel.getYAlign();
084    }
085}