001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * JQueryDesigner.java
028: *
029: * Created on 20 maggio 2003, 18.58
030: *
031: */
032:
033: package it.businesslogic.ireport.gui;
034:
035: import it.businesslogic.ireport.util.I18n;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class JQueryDesigner extends javax.swing.JFrame {
042:
043: /** Creates new form JQueryDesigner */
044: public JQueryDesigner() {
045: initComponents();
046: applyI18n();
047: }
048:
049: /** This method is called from within the constructor to
050: * initialize the form.
051: * WARNING: Do NOT modify this code. The content of this method is
052: * always regenerated by the Form Editor.
053: */
054: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
055: private void initComponents() {
056: jPanel1 = new javax.swing.JPanel();
057: jSplitPane1 = new javax.swing.JSplitPane();
058: jScrollPane1 = new javax.swing.JScrollPane();
059: jTree1 = new javax.swing.JTree();
060: jPanel2 = new javax.swing.JPanel();
061: jTabbedPane1 = new javax.swing.JTabbedPane();
062: jPanel5 = new javax.swing.JPanel();
063: jTabbedPane2 = new javax.swing.JTabbedPane();
064: jPanel7 = new javax.swing.JPanel();
065: jScrollPane2 = new javax.swing.JScrollPane();
066: jTable1 = new javax.swing.JTable();
067: jPanel11 = new javax.swing.JPanel();
068: jButton1 = new javax.swing.JButton();
069: jButton2 = new javax.swing.JButton();
070: jPanel8 = new javax.swing.JPanel();
071: jPanel12 = new javax.swing.JPanel();
072: jButton3 = new javax.swing.JButton();
073: jButton4 = new javax.swing.JButton();
074: jScrollPane3 = new javax.swing.JScrollPane();
075: jList1 = new javax.swing.JList();
076: jPanel13 = new javax.swing.JPanel();
077: jPanel9 = new javax.swing.JPanel();
078: jPanel10 = new javax.swing.JPanel();
079: jPanel4 = new javax.swing.JPanel();
080: jTextArea1 = new javax.swing.JTextArea();
081: jPanel6 = new javax.swing.JPanel();
082: jSQLTablesPane1 = new it.businesslogic.ireport.gui.JSQLTablesPane();
083: jTableFrame1 = new it.businesslogic.ireport.gui.JTableFrame();
084: jTableFrame2 = new it.businesslogic.ireport.gui.JTableFrame();
085:
086: addWindowListener(new java.awt.event.WindowAdapter() {
087: public void windowClosing(java.awt.event.WindowEvent evt) {
088: exitForm(evt);
089: }
090: });
091:
092: jPanel1.setMinimumSize(new java.awt.Dimension(10, 40));
093: jPanel1.setPreferredSize(new java.awt.Dimension(10, 40));
094: getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
095:
096: jScrollPane1.setMinimumSize(new java.awt.Dimension(150, 22));
097: jScrollPane1.setPreferredSize(new java.awt.Dimension(150, 3));
098: jTree1.setPreferredSize(new java.awt.Dimension(150, 72));
099: jTree1.setMinimumSize(new java.awt.Dimension(150, 0));
100: jScrollPane1.setViewportView(jTree1);
101:
102: jSplitPane1.setLeftComponent(jScrollPane1);
103:
104: jPanel2.setLayout(new java.awt.BorderLayout());
105:
106: jTabbedPane1.setPreferredSize(new java.awt.Dimension(8, 250));
107: jPanel5.setLayout(new java.awt.BorderLayout());
108:
109: jTabbedPane2.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);
110: jPanel7.setLayout(new java.awt.BorderLayout());
111:
112: jTable1.setModel(new javax.swing.table.DefaultTableModel(
113: new Object[][] { { null, null, null, null, null },
114: { null, null, null, null, null },
115: { null, null, null, null, null },
116: { null, null, null, null, null } },
117: new String[] { "Field name/Expression", "View",
118: "Alias", "Formula", "..." }) {
119: Class[] types = new Class[] { java.lang.Object.class,
120: java.lang.Boolean.class, java.lang.Object.class,
121: java.lang.Object.class, java.lang.Object.class };
122:
123: public Class getColumnClass(int columnIndex) {
124: return types[columnIndex];
125: }
126: });
127: jScrollPane2.setViewportView(jTable1);
128:
129: jPanel7.add(jScrollPane2, java.awt.BorderLayout.CENTER);
130:
131: jPanel11.setLayout(null);
132:
133: jPanel11.setMinimumSize(new java.awt.Dimension(10, 30));
134: jPanel11.setPreferredSize(new java.awt.Dimension(10, 30));
135: jButton1.setText("Add expression field");
136: jPanel11.add(jButton1);
137: jButton1.setBounds(2, 2, 162, 23);
138:
139: jButton2.setText("Remove");
140: jPanel11.add(jButton2);
141: jButton2.setBounds(168, 2, 82, 23);
142:
143: jPanel7.add(jPanel11, java.awt.BorderLayout.SOUTH);
144:
145: jTabbedPane2.addTab("Fields", jPanel7);
146:
147: jPanel8.setLayout(new java.awt.BorderLayout());
148:
149: jPanel12.setLayout(null);
150:
151: jPanel12.setMinimumSize(new java.awt.Dimension(10, 30));
152: jPanel12.setPreferredSize(new java.awt.Dimension(10, 30));
153: jButton3.setText("Add condition");
154: jPanel12.add(jButton3);
155: jButton3.setBounds(2, 2, 162, 23);
156:
157: jButton4.setText("Remove");
158: jPanel12.add(jButton4);
159: jButton4.setBounds(168, 2, 82, 23);
160:
161: jPanel8.add(jPanel12, java.awt.BorderLayout.SOUTH);
162:
163: jScrollPane3.setPreferredSize(new java.awt.Dimension(200, 3));
164: jScrollPane3.setViewportView(jList1);
165:
166: jPanel8.add(jScrollPane3, java.awt.BorderLayout.WEST);
167:
168: jPanel13.setBorder(javax.swing.BorderFactory
169: .createTitledBorder(javax.swing.BorderFactory
170: .createEtchedBorder(), "Condition"));
171: jPanel8.add(jPanel13, java.awt.BorderLayout.CENTER);
172:
173: jTabbedPane2.addTab("Conditions", jPanel8);
174:
175: jTabbedPane2.addTab("Sort", jPanel9);
176:
177: jTabbedPane2.addTab("Grouping", jPanel10);
178:
179: jPanel5.add(jTabbedPane2, java.awt.BorderLayout.CENTER);
180:
181: jTabbedPane1.addTab("Structure", jPanel5);
182:
183: jPanel4.setLayout(new java.awt.BorderLayout());
184:
185: jPanel4.add(jTextArea1, java.awt.BorderLayout.CENTER);
186:
187: jTabbedPane1.addTab("SQL", jPanel4);
188:
189: jTabbedPane1.addTab("Preview", jPanel6);
190:
191: jPanel2.add(jTabbedPane1, java.awt.BorderLayout.SOUTH);
192:
193: jTableFrame1.setVisible(true);
194: jTableFrame1.setBounds(40, 30, 120, 169);
195: jSQLTablesPane1.add(jTableFrame1,
196: javax.swing.JLayeredPane.DEFAULT_LAYER);
197:
198: jTableFrame2.setVisible(true);
199: jTableFrame2.setBounds(240, 80, 65, 169);
200: jSQLTablesPane1.add(jTableFrame2,
201: javax.swing.JLayeredPane.DEFAULT_LAYER);
202:
203: jPanel2.add(jSQLTablesPane1, java.awt.BorderLayout.CENTER);
204:
205: jSplitPane1.setRightComponent(jPanel2);
206:
207: getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
208:
209: pack();
210: }// </editor-fold>//GEN-END:initComponents
211:
212: /** Exit the Application */
213: private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
214: System.exit(0);
215: }//GEN-LAST:event_exitForm
216:
217: /**
218: * @param args the command line arguments
219: */
220: public static void main(String args[]) {
221: new JQueryDesigner().setVisible(true);
222: }
223:
224: // Variables declaration - do not modify//GEN-BEGIN:variables
225: private javax.swing.JButton jButton1;
226: private javax.swing.JButton jButton2;
227: private javax.swing.JButton jButton3;
228: private javax.swing.JButton jButton4;
229: private javax.swing.JList jList1;
230: private javax.swing.JPanel jPanel1;
231: private javax.swing.JPanel jPanel10;
232: private javax.swing.JPanel jPanel11;
233: private javax.swing.JPanel jPanel12;
234: private javax.swing.JPanel jPanel13;
235: private javax.swing.JPanel jPanel2;
236: private javax.swing.JPanel jPanel4;
237: private javax.swing.JPanel jPanel5;
238: private javax.swing.JPanel jPanel6;
239: private javax.swing.JPanel jPanel7;
240: private javax.swing.JPanel jPanel8;
241: private javax.swing.JPanel jPanel9;
242: private it.businesslogic.ireport.gui.JSQLTablesPane jSQLTablesPane1;
243: private javax.swing.JScrollPane jScrollPane1;
244: private javax.swing.JScrollPane jScrollPane2;
245: private javax.swing.JScrollPane jScrollPane3;
246: private javax.swing.JSplitPane jSplitPane1;
247: private javax.swing.JTabbedPane jTabbedPane1;
248: private javax.swing.JTabbedPane jTabbedPane2;
249: private javax.swing.JTable jTable1;
250: private it.businesslogic.ireport.gui.JTableFrame jTableFrame1;
251: private it.businesslogic.ireport.gui.JTableFrame jTableFrame2;
252: private javax.swing.JTextArea jTextArea1;
253: private javax.swing.JTree jTree1;
254:
255: // End of variables declaration//GEN-END:variables
256:
257: public void applyI18n() {
258: // Start autogenerated code ----------------------
259: jButton1.setText(I18n.getString("jQueryDesigner.button1",
260: "Add expression field"));
261: jButton2.setText(I18n.getString("jQueryDesigner.button2",
262: "Remove"));
263: jButton3.setText(I18n.getString("jQueryDesigner.button3",
264: "Add condition"));
265: jButton4.setText(I18n.getString("jQueryDesigner.button4",
266: "Remove"));
267: // End autogenerated code ----------------------
268: jTable1.getColumnModel().getColumn(0).setHeaderValue(
269: I18n.getString("jQueryDesigner.tablecolumn.fieldName",
270: "Field name/Expression"));
271: jTable1.getColumnModel().getColumn(1).setHeaderValue(
272: I18n.getString("jQueryDesigner.tablecolumn.view",
273: "View"));
274: jTable1.getColumnModel().getColumn(2).setHeaderValue(
275: I18n.getString("jQueryDesigner.tablecolumn.alias",
276: "Alias"));
277: jTable1.getColumnModel().getColumn(3).setHeaderValue(
278: I18n.getString("jQueryDesigner.tablecolumn.formula",
279: "Formula"));
280: jTable1.getColumnModel().getColumn(4).setHeaderValue(
281: I18n
282: .getString("jQueryDesigner.tablecolumn.more",
283: "..."));
284: jTabbedPane2.setTitleAt(0, it.businesslogic.ireport.util.I18n
285: .getString("jQueryDesigner.tab.fields", "Fields"));
286: jTabbedPane2.setTitleAt(1, it.businesslogic.ireport.util.I18n
287: .getString("jQueryDesigner.tab.conditions",
288: "Conditions"));
289: jTabbedPane2.setTitleAt(2, it.businesslogic.ireport.util.I18n
290: .getString("jQueryDesigner.tab.sort", "Sort"));
291: jTabbedPane2.setTitleAt(3, it.businesslogic.ireport.util.I18n
292: .getString("jQueryDesigner.tab.grouping", "Grouping"));
293: jTabbedPane1
294: .setTitleAt(0, it.businesslogic.ireport.util.I18n
295: .getString("jQueryDesigner.tab.structure",
296: "Structure"));
297: jTabbedPane1.setTitleAt(1, it.businesslogic.ireport.util.I18n
298: .getString("jQueryDesigner.tab.sql", "SQL"));
299: jTabbedPane1.setTitleAt(2, it.businesslogic.ireport.util.I18n
300: .getString("jQueryDesigner.tab.preview", "Preview"));
301: ((javax.swing.border.TitledBorder) jPanel13.getBorder())
302: .setTitle(I18n.getString(
303: "jQueryDesigner.panelBorder.condition",
304: "Condition"));
305:
306: }
307: }
|