欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

alignsupport.java

PIY(Program It Yourself)是一个基于Java的应用程序开发环境
JAVA
字号:
package piy.support;

import java.awt.event.*;
import java.awt.*;
import piy.*;
import javax.swing.*;
import java.util.Vector;
import java.awt.Dimension;

/**
* Support for properties of Align type.
* @author David Vivash
* @version 1.0, 25/02/01
*/
public class AlignSupport extends ClassSupport implements ActionListener
{
	private Align value = null;

	protected static Vector list = new Vector(6);

	static {
		list.add(Align.NONE);
		list.add(Align.TOP);
		list.add(Align.BOTTOM);
		list.add(Align.LEFT);
		list.add(Align.RIGHT);
		list.add(Align.CLIENT);
	}

	private JComboBox choice = null;

	public AlignSupport(Property property) {
		super(property);
	
		choice = new JComboBox(list);

		value = (Align)property.getValue();

		choice.setSelectedIndex(list.indexOf(value.getAlign()));
		choice.addActionListener(this);

		setLayout(new BorderLayout());
		add(choice, BorderLayout.CENTER);
	}

	public static Class getSupportedClass() { return Align.class; }

	public Dimension getMinimumSize() { return new Dimension(10, 20); }
	public Dimension getPreferredSize() { return new Dimension(100, 20); }
	public Dimension getMaximumSize() { return new Dimension(10000, 20); }

	//---- ActionListener method -----
	public void actionPerformed(ActionEvent e) {
		ProjectHandler.getInstance().projectChanged();
		property.setValue(new Align((String)choice.getSelectedItem()));
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -