📄 tddialog.java
字号:
package net.sf.memoranda.ui.htmleditor;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Component;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.Frame;import java.awt.GridLayout;import java.awt.event.ActionEvent;import javax.swing.BorderFactory;import javax.swing.Box;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JCheckBox;import javax.swing.JColorChooser;import javax.swing.JComboBox;import javax.swing.JDialog;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JSpinner;import javax.swing.JTabbedPane;import javax.swing.JTextField;import javax.swing.SpinnerNumberModel;import javax.swing.border.Border;import net.sf.memoranda.ui.htmleditor.util.Local;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class TdDialog extends JDialog { JPanel panel1 = new JPanel(); BorderLayout borderLayout1 = new BorderLayout(); JPanel buttonsPanel = new JPanel(); JButton cancelB = new JButton(); JButton okB = new JButton(); FlowLayout flowLayout1 = new FlowLayout(); Border border1; String[] aligns = {"", "left", "center", "right"}; String[] valigns = {"", "top", "center", "bottom"}; String[] tdvaligns = {"", "top", "middle", "bottom", "baseline"}; Border border2; JPanel headerPanel = new JPanel(); JLabel header = new JLabel(); FlowLayout flowLayout7 = new FlowLayout(); public boolean CANCELLED = false; Border border3; Border border4; JTabbedPane jTabbedPane1 = new JTabbedPane(); JLabel jLabel4 = new JLabel(); FlowLayout flowLayout5 = new FlowLayout(); JTextField tdHeightField = new JTextField(); FlowLayout flowLayout2 = new FlowLayout(); JLabel jLabel7 = new JLabel(); FlowLayout flowLayout6 = new FlowLayout(); Component component1; JPanel jPanel7 = new JPanel(); JPanel tdPanel = new JPanel(); JTextField tdWidthField = new JTextField(); Component component2; JPanel jPanel6 = new JPanel(); JComboBox tdAlignCB = new JComboBox(aligns); JLabel jLabel6 = new JLabel(); GridLayout gridLayout2 = new GridLayout(); JPanel jPanel5 = new JPanel(); JLabel jLabel9 = new JLabel(); JLabel jLabel5 = new JLabel(); JPanel trPanel = new JPanel(); GridLayout gridLayout4 = new GridLayout(); JLabel jLabel20 = new JLabel(); JComboBox tdValignCB = new JComboBox(tdvaligns); FlowLayout flowLayout12 = new FlowLayout(); JTextField tdBgcolorField = new JTextField(); JPanel jPanel14 = new JPanel(); JLabel jLabel21 = new JLabel(); JButton tdBgcolorB = new JButton(); Component component11; JCheckBox tdNowrapChB = new JCheckBox(); JComboBox trAlignCB = new JComboBox(aligns); JComboBox trValignCB = new JComboBox(tdvaligns); Component component12; JLabel jLabel22 = new JLabel(); Component component7; FlowLayout flowLayout10 = new FlowLayout(); JLabel jLabel16 = new JLabel(); JPanel jPanel11 = new JPanel(); JTextField trBgcolorField = new JTextField(); JLabel jLabel23 = new JLabel(); JPanel jPanel15 = new JPanel(); FlowLayout flowLayout13 = new FlowLayout(); JButton trBgcolorB = new JButton(); JSpinner tdColspan = new JSpinner(new SpinnerNumberModel(0,0,999,1)); JSpinner tdRowspan = new JSpinner(new SpinnerNumberModel(0,0,999,1)); JLabel jLabel8 = new JLabel(); JLabel jLabel12 = new JLabel(); JSpinner cellpadding = new JSpinner(new SpinnerNumberModel(0,0,999,1)); FlowLayout flowLayout8 = new FlowLayout(); FlowLayout flowLayout4 = new FlowLayout(); Component component3; JLabel jLabel24 = new JLabel(); JPanel tablePanel = new JPanel(); GridLayout gridLayout3 = new GridLayout(); JSpinner border = new JSpinner(new SpinnerNumberModel(1,0,999,1)); JPanel jPanel10 = new JPanel(); JPanel jPanel12 = new JPanel(); JComboBox vAlignCB = new JComboBox(valigns); JTextField bgcolorField = new JTextField(); JTextField heightField = new JTextField(); JLabel jLabel13 = new JLabel(); JSpinner cellspacing = new JSpinner(new SpinnerNumberModel(0,0,999,1)); JLabel jLabel17 = new JLabel(); JLabel jLabel25 = new JLabel(); JButton bgColorB = new JButton(); Component component5; JTextField widthField = new JTextField(); FlowLayout flowLayout11 = new FlowLayout(); JPanel jPanel13 = new JPanel(); JComboBox alignCB = new JComboBox(aligns); JLabel jLabel14 = new JLabel(); Component component6; JPanel jPanel9 = new JPanel(); FlowLayout flowLayout9 = new FlowLayout(); JLabel jLabel15 = new JLabel(); Border border5; public TdDialog(Frame frame) { super(frame, Local.getString("Table properties"), true); try { jbInit(); pack(); } catch(Exception ex) { ex.printStackTrace(); } } public TdDialog() { this(null); } void jbInit() throws Exception { border1 = BorderFactory.createEmptyBorder(5,5,5,5); border2 = BorderFactory.createEtchedBorder(Color.white,new Color(142, 142, 142)); border3 = BorderFactory.createEmptyBorder(0,0,10,0); border4 = BorderFactory.createEmptyBorder(0,5,0,5); component1 = Box.createHorizontalStrut(8); component2 = Box.createHorizontalStrut(8); component11 = Box.createHorizontalStrut(8); component12 = Box.createHorizontalStrut(8); component7 = Box.createHorizontalStrut(8); component3 = Box.createHorizontalStrut(8); component5 = Box.createHorizontalStrut(8); component6 = Box.createHorizontalStrut(8); border5 = BorderFactory.createEmptyBorder(); panel1.setLayout(borderLayout1); cancelB.setMaximumSize(new Dimension(100, 26)); cancelB.setMinimumSize(new Dimension(100, 26)); cancelB.setPreferredSize(new Dimension(100, 26)); cancelB.setText(Local.getString("Cancel")); cancelB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { cancelB_actionPerformed(e); } }); okB.setMaximumSize(new Dimension(100, 26)); okB.setMinimumSize(new Dimension(100, 26)); okB.setPreferredSize(new Dimension(100, 26)); okB.setText("Ok"); okB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { okB_actionPerformed(e); } }); this.getRootPane().setDefaultButton(okB); buttonsPanel.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.RIGHT); panel1.setBorder(border1); headerPanel.setBackground(Color.WHITE); headerPanel.setBorder(border4); headerPanel.setMinimumSize(new Dimension(159, 52)); headerPanel.setPreferredSize(new Dimension(159, 52)); headerPanel.setLayout(flowLayout7); header.setFont(new java.awt.Font("Dialog", 0, 20)); header.setForeground(new Color(0, 0, 124)); header.setText(Local.getString("Table properties")); header.setIcon(new ImageIcon(net.sf.memoranda.ui.htmleditor.ImageDialog.class.getResource("resources/icons/tablebig.png"))); flowLayout7.setAlignment(FlowLayout.LEFT); flowLayout7.setHgap(2); flowLayout7.setVgap(2); jLabel4.setMaximumSize(new Dimension(70, 16)); jLabel4.setMinimumSize(new Dimension(50, 16)); jLabel4.setPreferredSize(new Dimension(70, 16)); jLabel4.setText(Local.getString("Width")); flowLayout5.setAlignment(FlowLayout.LEFT); tdHeightField.setMinimumSize(new Dimension(30, 25)); tdHeightField.setPreferredSize(new Dimension(50, 25)); flowLayout2.setAlignment(FlowLayout.LEFT); jLabel7.setMaximumSize(new Dimension(70, 16)); jLabel7.setMinimumSize(new Dimension(40, 16)); jLabel7.setPreferredSize(new Dimension(70, 16)); jLabel7.setText(Local.getString("Row span")); flowLayout6.setAlignment(FlowLayout.LEFT); jPanel7.setLayout(flowLayout6); tdPanel.setLayout(gridLayout2); tdPanel.setBorder(border2); tdWidthField.setPreferredSize(new Dimension(50, 25)); tdWidthField.setMinimumSize(new Dimension(30, 25)); jPanel6.setLayout(flowLayout5); tdAlignCB.setBackground(new Color(230, 230, 230)); tdAlignCB.setFont(new java.awt.Font("Dialog", 1, 10)); tdAlignCB.setPreferredSize(new Dimension(63, 25)); jLabel6.setText(Local.getString("Col span")); jLabel6.setPreferredSize(new Dimension(70, 16)); jLabel6.setMinimumSize(new Dimension(50, 16)); jLabel6.setMaximumSize(new Dimension(70, 16)); gridLayout2.setColumns(1); gridLayout2.setRows(4); jPanel5.setLayout(flowLayout2); jLabel9.setMaximumSize(new Dimension(70, 16)); jLabel9.setMinimumSize(new Dimension(40, 16)); jLabel9.setPreferredSize(new Dimension(70, 16)); jLabel9.setText(Local.getString("Vert. align")); jLabel5.setMaximumSize(new Dimension(70, 16)); jLabel5.setMinimumSize(new Dimension(40, 16)); jLabel5.setPreferredSize(new Dimension(70, 16)); jLabel5.setText(Local.getString("Height")); trPanel.setLayout(gridLayout4);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -