Revision 2669 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/DefaultDialogPanel.java

View differences:

DefaultDialogPanel.java
1 1
/*
2 2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 * 
4
 * Copyright (C) 2004-5. 
5 3
 *
4
 * Copyright (C) 2004-5.
5
 *
6 6
 * This program is free software; you can redistribute it and/or
7 7
 * modify it under the terms of the GNU General Public License
8 8
 * as published by the Free Software Foundation; either version 2
......
18 18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19 19
 *
20 20
 * For more information, contact:
21
 * 
21
 *
22 22
 * cresques@gmail.com
23 23
 */
24 24
package org.cresques.ui;
......
29 29
import javax.swing.JLabel;
30 30
import javax.swing.JPanel;
31 31

  
32

  
32 33
/**
33 34
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
34 35
 */
35 36
public class DefaultDialogPanel extends JPanel {
36
	final private static long serialVersionUID = -3370601314380922368L;
37
	protected JPanel contentPane = null;
38
	private JPanel tabPane = null;
39
	private JPanel buttonPane = null;
40
	private JButton acceptButton = null;
41
	private JButton cancelButton = null;
42
	private JButton applyButton = null;
37
    final private static long serialVersionUID = -3370601314380922368L;
38
    protected JPanel contentPane = null;
39
    private JPanel tabPane = null;
40
    private JPanel buttonPane = null;
41
    private JButton acceptButton = null;
42
    private JButton cancelButton = null;
43
    private JButton applyButton = null;
43 44

  
44
	/**
45
	 * 
46
	 */
47
	public DefaultDialogPanel() {
48
		super();
49
		initialize();
50
	}
45
    /**
46
     *
47
     */
48
    public DefaultDialogPanel() {
49
        super();
50
        initialize();
51
    }
51 52

  
52
	/**
53
	 * This method initializes this
54
	 * 
55
	 * @return void
56
	 */
57
	private void initialize() {
58
		//setBounds(0,0,321,230);
59
		//javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS);
60
		//jContentPane.setLayout(new java.awt.GridLayout(2,1));
61
		setLayout(new FlowLayout());
62
		setBorder(javax.swing.BorderFactory.createEmptyBorder(5,5,5,5));
63
		//jContentPane.setSize(30, 24);
64
		this.setPreferredSize(new java.awt.Dimension(320,165));
65
		add(getTabPanel(), null);
66
		add(getButtonPanel(), null);
67
	}
68
	
69
	protected JPanel getContentPanel(){
70
		if (contentPane == null) {
71
			contentPane = new JPanel();
72
			contentPane.setBounds(6, 200, 309, 125);
73
			contentPane.setPreferredSize(new java.awt.Dimension(310,100));
74
		}
75
		return contentPane;
76
	}
77
	
78
	private JPanel getTabPanel() {
79
		if (tabPane == null){
80
			tabPane = new JPanel();
81
			setLayout(new FlowLayout());
82
			//tabPane.setBounds(6, 7, 309, 189);
83
			tabPane.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
84
			tabPane.add(getContentPanel(), null);
85
		}
86
		return tabPane;
87
	}
88
	
89
	protected JPanel getButtonPanel() {
90
		if (buttonPane == null) {
91
			java.awt.FlowLayout flowLayout2 = new FlowLayout();
92
			buttonPane = new JPanel();
93
			buttonPane.setLayout(flowLayout2);
94
			buttonPane.setSize(309, 25);
95
			buttonPane.setBounds(6, 200, 309, 25);
96
			flowLayout2.setHgap(0);
97
			flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
98
			flowLayout2.setVgap(1);
99
			buttonPane.add(getAcceptButton(), null);
100
			JLabel lbl1 = new JLabel();
101
			lbl1.setPreferredSize(new java.awt.Dimension(18,23));
102
			buttonPane.add(lbl1);
103
			buttonPane.add(getCancelButton(), null);
104
			JLabel lbl2 = new JLabel();
105
			lbl2.setPreferredSize(new java.awt.Dimension(18,23));
106
			buttonPane.add(lbl2);
107
			buttonPane.add(getApplyButton(), null);
108
		}
109
		return buttonPane;
110
	}
111
	/**
112
	 * This method initializes jButton	
113
	 * 	
114
	 * @return javax.swing.JButton	
115
	 */    
116
	public JButton getAcceptButton() {
117
		if (acceptButton == null) {
118
			acceptButton = new JButton("Aceptar");
119
			acceptButton.setText("Aceptar");
120
		}
121
		return acceptButton;
122
	}
123
	/**
124
	 * This method initializes jButton	
125
	 * 	
126
	 * @return javax.swing.JButton	
127
	 */    
128
	public JButton getCancelButton() {
129
		if (cancelButton == null) {
130
			cancelButton = new JButton("Cancelar");
131
			cancelButton.setText("Cancelar");
132
		}
133
		return cancelButton;
134
	}
135
	/**
136
	 * This method initializes jButton	
137
	 * 	
138
	 * @return javax.swing.JButton	
139
	 */    
140
	public JButton getApplyButton() {
141
		if (applyButton == null) {
142
			applyButton = new JButton("Aplicar");
143
		}
144
		return applyButton;
145
	}
53
    /**
54
     * This method initializes this
55
     *
56
     * @return void
57
     */
58
    private void initialize() {
59
        //setBounds(0,0,321,230);
60
        //javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS);
61
        //jContentPane.setLayout(new java.awt.GridLayout(2,1));
62
        setLayout(new FlowLayout());
63
        setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
64

  
65
        //jContentPane.setSize(30, 24);
66
        this.setPreferredSize(new java.awt.Dimension(320, 165));
67
        add(getTabPanel(), null);
68
        add(getButtonPanel(), null);
69
    }
70

  
71
    protected JPanel getContentPanel() {
72
        if (contentPane == null) {
73
            contentPane = new JPanel();
74
            contentPane.setBounds(6, 200, 309, 125);
75
            contentPane.setPreferredSize(new java.awt.Dimension(310, 100));
76
        }
77

  
78
        return contentPane;
79
    }
80

  
81
    private JPanel getTabPanel() {
82
        if (tabPane == null) {
83
            tabPane = new JPanel();
84
            setLayout(new FlowLayout());
85

  
86
            //tabPane.setBounds(6, 7, 309, 189);
87
            tabPane.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
88
            tabPane.add(getContentPanel(), null);
89
        }
90

  
91
        return tabPane;
92
    }
93

  
94
    protected JPanel getButtonPanel() {
95
        if (buttonPane == null) {
96
            java.awt.FlowLayout flowLayout2 = new FlowLayout();
97
            buttonPane = new JPanel();
98
            buttonPane.setLayout(flowLayout2);
99
            buttonPane.setSize(309, 25);
100
            buttonPane.setBounds(6, 200, 309, 25);
101
            flowLayout2.setHgap(0);
102
            flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
103
            flowLayout2.setVgap(1);
104
            buttonPane.add(getAcceptButton(), null);
105

  
106
            JLabel lbl1 = new JLabel();
107
            lbl1.setPreferredSize(new java.awt.Dimension(18, 23));
108
            buttonPane.add(lbl1);
109
            buttonPane.add(getCancelButton(), null);
110

  
111
            JLabel lbl2 = new JLabel();
112
            lbl2.setPreferredSize(new java.awt.Dimension(18, 23));
113
            buttonPane.add(lbl2);
114
            buttonPane.add(getApplyButton(), null);
115
        }
116

  
117
        return buttonPane;
118
    }
119

  
120
    /**
121
     * This method initializes jButton
122
     *
123
     * @return javax.swing.JButton
124
     */
125
    public JButton getAcceptButton() {
126
        if (acceptButton == null) {
127
            acceptButton = new JButton("Aceptar");
128
            acceptButton.setText("Aceptar");
129
        }
130

  
131
        return acceptButton;
132
    }
133

  
134
    /**
135
     * This method initializes jButton
136
     *
137
     * @return javax.swing.JButton
138
     */
139
    public JButton getCancelButton() {
140
        if (cancelButton == null) {
141
            cancelButton = new JButton("Cancelar");
142
            cancelButton.setText("Cancelar");
143
        }
144

  
145
        return cancelButton;
146
    }
147

  
148
    /**
149
     * This method initializes jButton
150
     *
151
     * @return javax.swing.JButton
152
     */
153
    public JButton getApplyButton() {
154
        if (applyButton == null) {
155
            applyButton = new JButton("Aplicar");
156
        }
157

  
158
        return applyButton;
159
    }
146 160
}

Also available in: Unified diff