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: * HighLowDatasetPanel.java
028: *
029: * Created on 15 agosto 2005, 17.55
030: *
031: */
032:
033: package it.businesslogic.ireport.chart;
034:
035: import it.businesslogic.ireport.SubDataset;
036: import it.businesslogic.ireport.util.I18n;
037: import it.businesslogic.ireport.util.Misc;
038:
039: /**
040: *
041: * @author Administrator
042: */
043: public class HighLowDatasetPanel extends javax.swing.JPanel implements
044: ChartDatasetPanel {
045:
046: private HighLowDataset highLowDataset = null;
047:
048: /** Creates new form PieDatasetPanel */
049: public HighLowDatasetPanel() {
050: initComponents();
051:
052: applyI18n();
053:
054: this .jRTextExpressionSeries.getDocument().addDocumentListener(
055: new javax.swing.event.DocumentListener() {
056: public void changedUpdate(
057: javax.swing.event.DocumentEvent evt) {
058: jRTextExpressionSeriesTextChanged();
059: }
060:
061: public void insertUpdate(
062: javax.swing.event.DocumentEvent evt) {
063: jRTextExpressionSeriesTextChanged();
064: }
065:
066: public void removeUpdate(
067: javax.swing.event.DocumentEvent evt) {
068: jRTextExpressionSeriesTextChanged();
069: }
070: });
071:
072: this .jRTextExpressionDate.getDocument().addDocumentListener(
073: new javax.swing.event.DocumentListener() {
074: public void changedUpdate(
075: javax.swing.event.DocumentEvent evt) {
076: jRTextExpressionDateTextChanged();
077: }
078:
079: public void insertUpdate(
080: javax.swing.event.DocumentEvent evt) {
081: jRTextExpressionDateTextChanged();
082: }
083:
084: public void removeUpdate(
085: javax.swing.event.DocumentEvent evt) {
086: jRTextExpressionDateTextChanged();
087: }
088: });
089:
090: this .jRTextExpressionVolume.getDocument().addDocumentListener(
091: new javax.swing.event.DocumentListener() {
092: public void changedUpdate(
093: javax.swing.event.DocumentEvent evt) {
094: jRTextExpressionVolumeTextChanged();
095: }
096:
097: public void insertUpdate(
098: javax.swing.event.DocumentEvent evt) {
099: jRTextExpressionVolumeTextChanged();
100: }
101:
102: public void removeUpdate(
103: javax.swing.event.DocumentEvent evt) {
104: jRTextExpressionVolumeTextChanged();
105: }
106: });
107:
108: this .jRTextExpressionHigh.getDocument().addDocumentListener(
109: new javax.swing.event.DocumentListener() {
110: public void changedUpdate(
111: javax.swing.event.DocumentEvent evt) {
112: jRTextExpressionHighTextChanged();
113: }
114:
115: public void insertUpdate(
116: javax.swing.event.DocumentEvent evt) {
117: jRTextExpressionHighTextChanged();
118: }
119:
120: public void removeUpdate(
121: javax.swing.event.DocumentEvent evt) {
122: jRTextExpressionHighTextChanged();
123: }
124: });
125:
126: this .jRTextExpressionLow.getDocument().addDocumentListener(
127: new javax.swing.event.DocumentListener() {
128: public void changedUpdate(
129: javax.swing.event.DocumentEvent evt) {
130: jRTextExpressionLowTextChanged();
131: }
132:
133: public void insertUpdate(
134: javax.swing.event.DocumentEvent evt) {
135: jRTextExpressionLowTextChanged();
136: }
137:
138: public void removeUpdate(
139: javax.swing.event.DocumentEvent evt) {
140: jRTextExpressionLowTextChanged();
141: }
142: });
143:
144: this .jRTextExpressionOpen.getDocument().addDocumentListener(
145: new javax.swing.event.DocumentListener() {
146: public void changedUpdate(
147: javax.swing.event.DocumentEvent evt) {
148: jRTextExpressionOpenTextChanged();
149: }
150:
151: public void insertUpdate(
152: javax.swing.event.DocumentEvent evt) {
153: jRTextExpressionOpenTextChanged();
154: }
155:
156: public void removeUpdate(
157: javax.swing.event.DocumentEvent evt) {
158: jRTextExpressionOpenTextChanged();
159: }
160: });
161:
162: this .jRTextExpressionClose.getDocument().addDocumentListener(
163: new javax.swing.event.DocumentListener() {
164: public void changedUpdate(
165: javax.swing.event.DocumentEvent evt) {
166: jRTextExpressionCloseTextChanged();
167: }
168:
169: public void insertUpdate(
170: javax.swing.event.DocumentEvent evt) {
171: jRTextExpressionCloseTextChanged();
172: }
173:
174: public void removeUpdate(
175: javax.swing.event.DocumentEvent evt) {
176: jRTextExpressionCloseTextChanged();
177: }
178: });
179: }
180:
181: public HighLowDataset getHighLowDataset() {
182: return highLowDataset;
183: }
184:
185: /**
186: * this method is used to pass the correct subdataset to the expression editor
187: */
188: public void setSubDataset(SubDataset sds) {
189: jRTextExpressionSeries.setSubDataset(sds);
190: jRTextExpressionDate.setSubDataset(sds);
191: jRTextExpressionHigh.setSubDataset(sds);
192: jRTextExpressionLow.setSubDataset(sds);
193: jRTextExpressionOpen.setSubDataset(sds);
194: jRTextExpressionClose.setSubDataset(sds);
195: jRTextExpressionVolume.setSubDataset(sds);
196: sectionItemHyperlinkPanel1.setSubDataset(sds);
197: }
198:
199: public void setHighLowDataset(HighLowDataset highLowDataset) {
200: this .highLowDataset = highLowDataset;
201: jRTextExpressionSeries.setText(highLowDataset
202: .getSeriesExpression());
203: jRTextExpressionDate
204: .setText(highLowDataset.getDateExpression());
205: jRTextExpressionHigh
206: .setText(highLowDataset.getHighExpression());
207: jRTextExpressionLow.setText(highLowDataset.getLowExpression());
208: jRTextExpressionOpen
209: .setText(highLowDataset.getOpenExpression());
210: jRTextExpressionClose.setText(highLowDataset
211: .getCloseExpression());
212: jRTextExpressionVolume.setText(highLowDataset
213: .getVolumeExpression());
214: sectionItemHyperlinkPanel1
215: .setSectionItemHyperlink(highLowDataset
216: .getItemHyperLink());
217: }
218:
219: public void jRTextExpressionSeriesTextChanged() {
220: highLowDataset.setSeriesExpression(jRTextExpressionSeries
221: .getText());
222: }
223:
224: public void jRTextExpressionDateTextChanged() {
225: highLowDataset
226: .setDateExpression(jRTextExpressionDate.getText());
227: }
228:
229: public void jRTextExpressionHighTextChanged() {
230: highLowDataset
231: .setHighExpression(jRTextExpressionHigh.getText());
232: }
233:
234: public void jRTextExpressionLowTextChanged() {
235: highLowDataset.setLowExpression(jRTextExpressionLow.getText());
236: }
237:
238: public void jRTextExpressionOpenTextChanged() {
239: highLowDataset
240: .setOpenExpression(jRTextExpressionOpen.getText());
241: }
242:
243: public void jRTextExpressionCloseTextChanged() {
244: highLowDataset.setCloseExpression(jRTextExpressionClose
245: .getText());
246: }
247:
248: public void jRTextExpressionVolumeTextChanged() {
249: highLowDataset.setVolumeExpression(jRTextExpressionVolume
250: .getText());
251: }
252:
253: /** This method is called from within the constructor to
254: * initialize the form.
255: * WARNING: Do NOT modify this code. The content of this method is
256: * always regenerated by the Form Editor.
257: */
258: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
259: private void initComponents() {
260: java.awt.GridBagConstraints gridBagConstraints;
261:
262: jTabbedPane2 = new javax.swing.JTabbedPane();
263: jPanel2 = new javax.swing.JPanel();
264: jLabelSeriesExpression = new javax.swing.JLabel();
265: jLabelDateExpression = new javax.swing.JLabel();
266: jRTextExpressionSeries = new it.businesslogic.ireport.gui.JRTextExpressionArea();
267: jRTextExpressionDate = new it.businesslogic.ireport.gui.JRTextExpressionArea();
268: jTabbedPane1 = new javax.swing.JTabbedPane();
269: jPanelHL = new javax.swing.JPanel();
270: jLabelHighExpression = new javax.swing.JLabel();
271: jRTextExpressionHigh = new it.businesslogic.ireport.gui.JRTextExpressionArea();
272: jLabelLowExpression = new javax.swing.JLabel();
273: jRTextExpressionLow = new it.businesslogic.ireport.gui.JRTextExpressionArea();
274: jPanelOC = new javax.swing.JPanel();
275: jLabelOpenExpression = new javax.swing.JLabel();
276: jRTextExpressionOpen = new it.businesslogic.ireport.gui.JRTextExpressionArea();
277: jLabelCloseExpression = new javax.swing.JLabel();
278: jRTextExpressionClose = new it.businesslogic.ireport.gui.JRTextExpressionArea();
279: jPanel1 = new javax.swing.JPanel();
280: jLabelVolumeExpression = new javax.swing.JLabel();
281: jRTextExpressionVolume = new it.businesslogic.ireport.gui.JRTextExpressionArea();
282: sectionItemHyperlinkPanel1 = new it.businesslogic.ireport.chart.gui.SectionItemHyperlinkPanel();
283:
284: setLayout(new java.awt.GridBagLayout());
285:
286: jPanel2.setLayout(new java.awt.GridBagLayout());
287:
288: jLabelSeriesExpression.setText("Series expression");
289: gridBagConstraints = new java.awt.GridBagConstraints();
290: gridBagConstraints.gridx = 0;
291: gridBagConstraints.gridy = 0;
292: gridBagConstraints.gridwidth = 2;
293: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
294: gridBagConstraints.weightx = 1.0;
295: jPanel2.add(jLabelSeriesExpression, gridBagConstraints);
296:
297: jLabelDateExpression.setText("Date expression");
298: gridBagConstraints = new java.awt.GridBagConstraints();
299: gridBagConstraints.gridx = 0;
300: gridBagConstraints.gridy = 2;
301: gridBagConstraints.gridwidth = 2;
302: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
303: gridBagConstraints.weightx = 1.0;
304: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
305: jPanel2.add(jLabelDateExpression, gridBagConstraints);
306:
307: jRTextExpressionSeries.setBorder(javax.swing.BorderFactory
308: .createEtchedBorder());
309: jRTextExpressionSeries.setElectricScroll(0);
310: jRTextExpressionSeries.setMinimumSize(new java.awt.Dimension(
311: 10, 10));
312: jRTextExpressionSeries.setPreferredSize(new java.awt.Dimension(
313: 10, 10));
314: gridBagConstraints = new java.awt.GridBagConstraints();
315: gridBagConstraints.gridx = 0;
316: gridBagConstraints.gridy = 1;
317: gridBagConstraints.gridwidth = 2;
318: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
319: gridBagConstraints.weightx = 1.0;
320: gridBagConstraints.weighty = 0.5;
321: jPanel2.add(jRTextExpressionSeries, gridBagConstraints);
322:
323: jRTextExpressionDate.setBorder(javax.swing.BorderFactory
324: .createEtchedBorder());
325: jRTextExpressionDate.setElectricScroll(0);
326: jRTextExpressionDate.setMinimumSize(new java.awt.Dimension(10,
327: 10));
328: jRTextExpressionDate.setPreferredSize(new java.awt.Dimension(
329: 10, 10));
330: gridBagConstraints = new java.awt.GridBagConstraints();
331: gridBagConstraints.gridx = 0;
332: gridBagConstraints.gridy = 3;
333: gridBagConstraints.gridwidth = 2;
334: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
335: gridBagConstraints.weightx = 1.0;
336: gridBagConstraints.weighty = 0.5;
337: jPanel2.add(jRTextExpressionDate, gridBagConstraints);
338:
339: jPanelHL.setLayout(new java.awt.GridBagLayout());
340:
341: jLabelHighExpression.setText("High expression");
342: gridBagConstraints = new java.awt.GridBagConstraints();
343: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
344: gridBagConstraints.weightx = 1.0;
345: jPanelHL.add(jLabelHighExpression, gridBagConstraints);
346:
347: jRTextExpressionHigh.setBorder(javax.swing.BorderFactory
348: .createEtchedBorder());
349: jRTextExpressionHigh.setElectricScroll(0);
350: jRTextExpressionHigh.setMinimumSize(new java.awt.Dimension(10,
351: 10));
352: jRTextExpressionHigh.setPreferredSize(new java.awt.Dimension(
353: 10, 10));
354: gridBagConstraints = new java.awt.GridBagConstraints();
355: gridBagConstraints.gridy = 1;
356: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
357: gridBagConstraints.weightx = 1.0;
358: gridBagConstraints.weighty = 1.0;
359: jPanelHL.add(jRTextExpressionHigh, gridBagConstraints);
360:
361: jLabelLowExpression.setText("Low expression");
362: gridBagConstraints = new java.awt.GridBagConstraints();
363: gridBagConstraints.gridx = 0;
364: gridBagConstraints.gridy = 5;
365: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
366: gridBagConstraints.weightx = 0.5;
367: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 0);
368: jPanelHL.add(jLabelLowExpression, gridBagConstraints);
369:
370: jRTextExpressionLow.setBorder(javax.swing.BorderFactory
371: .createEtchedBorder());
372: jRTextExpressionLow.setElectricScroll(0);
373: jRTextExpressionLow.setMinimumSize(new java.awt.Dimension(10,
374: 10));
375: jRTextExpressionLow.setPreferredSize(new java.awt.Dimension(10,
376: 10));
377: gridBagConstraints = new java.awt.GridBagConstraints();
378: gridBagConstraints.gridx = 0;
379: gridBagConstraints.gridy = 6;
380: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
381: gridBagConstraints.weightx = 0.5;
382: gridBagConstraints.weighty = 1.0;
383: jPanelHL.add(jRTextExpressionLow, gridBagConstraints);
384:
385: jTabbedPane1.addTab("High/Low", jPanelHL);
386:
387: jPanelOC.setLayout(new java.awt.GridBagLayout());
388:
389: jLabelOpenExpression.setText("Open expression");
390: gridBagConstraints = new java.awt.GridBagConstraints();
391: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
392: gridBagConstraints.weightx = 1.0;
393: jPanelOC.add(jLabelOpenExpression, gridBagConstraints);
394:
395: jRTextExpressionOpen.setBorder(javax.swing.BorderFactory
396: .createEtchedBorder());
397: jRTextExpressionOpen.setElectricScroll(0);
398: jRTextExpressionOpen.setMinimumSize(new java.awt.Dimension(10,
399: 10));
400: jRTextExpressionOpen.setPreferredSize(new java.awt.Dimension(
401: 10, 10));
402: gridBagConstraints = new java.awt.GridBagConstraints();
403: gridBagConstraints.gridy = 1;
404: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
405: gridBagConstraints.weightx = 1.0;
406: gridBagConstraints.weighty = 1.0;
407: jPanelOC.add(jRTextExpressionOpen, gridBagConstraints);
408:
409: jLabelCloseExpression.setText("Close expression");
410: gridBagConstraints = new java.awt.GridBagConstraints();
411: gridBagConstraints.gridx = 0;
412: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
413: gridBagConstraints.weightx = 1.0;
414: jPanelOC.add(jLabelCloseExpression, gridBagConstraints);
415:
416: jRTextExpressionClose.setBorder(javax.swing.BorderFactory
417: .createEtchedBorder());
418: jRTextExpressionClose.setElectricScroll(0);
419: jRTextExpressionClose.setMinimumSize(new java.awt.Dimension(10,
420: 10));
421: jRTextExpressionClose.setPreferredSize(new java.awt.Dimension(
422: 10, 10));
423: gridBagConstraints = new java.awt.GridBagConstraints();
424: gridBagConstraints.gridx = 0;
425: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
426: gridBagConstraints.weightx = 1.0;
427: gridBagConstraints.weighty = 1.0;
428: jPanelOC.add(jRTextExpressionClose, gridBagConstraints);
429:
430: jTabbedPane1.addTab("Open/Close", jPanelOC);
431:
432: jPanel1.setLayout(new java.awt.GridBagLayout());
433:
434: jLabelVolumeExpression.setText("Volume expression");
435: gridBagConstraints = new java.awt.GridBagConstraints();
436: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
437: gridBagConstraints.weightx = 1.0;
438: jPanel1.add(jLabelVolumeExpression, gridBagConstraints);
439:
440: jRTextExpressionVolume.setBorder(javax.swing.BorderFactory
441: .createEtchedBorder());
442: jRTextExpressionVolume.setElectricScroll(0);
443: jRTextExpressionVolume.setMinimumSize(new java.awt.Dimension(
444: 10, 10));
445: jRTextExpressionVolume.setPreferredSize(new java.awt.Dimension(
446: 10, 10));
447: gridBagConstraints = new java.awt.GridBagConstraints();
448: gridBagConstraints.gridy = 1;
449: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
450: gridBagConstraints.weightx = 1.0;
451: gridBagConstraints.weighty = 1.0;
452: jPanel1.add(jRTextExpressionVolume, gridBagConstraints);
453:
454: jTabbedPane1.addTab("Volume", jPanel1);
455:
456: gridBagConstraints = new java.awt.GridBagConstraints();
457: gridBagConstraints.gridy = 5;
458: gridBagConstraints.gridwidth = 2;
459: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
460: gridBagConstraints.weightx = 2.0;
461: gridBagConstraints.weighty = 2.0;
462: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
463: jPanel2.add(jTabbedPane1, gridBagConstraints);
464:
465: jTabbedPane2.addTab("Data", jPanel2);
466:
467: jTabbedPane2.addTab("Item hyperlink",
468: sectionItemHyperlinkPanel1);
469:
470: gridBagConstraints = new java.awt.GridBagConstraints();
471: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
472: gridBagConstraints.weightx = 1.0;
473: gridBagConstraints.weighty = 1.0;
474: add(jTabbedPane2, gridBagConstraints);
475:
476: }// </editor-fold>//GEN-END:initComponents
477:
478: // Variables declaration - do not modify//GEN-BEGIN:variables
479: private javax.swing.JLabel jLabelCloseExpression;
480: private javax.swing.JLabel jLabelDateExpression;
481: private javax.swing.JLabel jLabelHighExpression;
482: private javax.swing.JLabel jLabelLowExpression;
483: private javax.swing.JLabel jLabelOpenExpression;
484: private javax.swing.JLabel jLabelSeriesExpression;
485: private javax.swing.JLabel jLabelVolumeExpression;
486: private javax.swing.JPanel jPanel1;
487: private javax.swing.JPanel jPanel2;
488: private javax.swing.JPanel jPanelHL;
489: private javax.swing.JPanel jPanelOC;
490: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionClose;
491: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionDate;
492: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionHigh;
493: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionLow;
494: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionOpen;
495: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionSeries;
496: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionVolume;
497: private javax.swing.JTabbedPane jTabbedPane1;
498: private javax.swing.JTabbedPane jTabbedPane2;
499: private it.businesslogic.ireport.chart.gui.SectionItemHyperlinkPanel sectionItemHyperlinkPanel1;
500:
501: // End of variables declaration//GEN-END:variables
502:
503: public void applyI18n() {
504: // Start autogenerated code ----------------------
505: // End autogenerated code ----------------------
506: jLabelSeriesExpression
507: .setText(it.businesslogic.ireport.util.I18n.getString(
508: "charts.seriesExpression", "Series expression"));
509: jLabelDateExpression.setText(it.businesslogic.ireport.util.I18n
510: .getString("charts.dateExpression", "Date expression"));
511: jLabelHighExpression.setText(it.businesslogic.ireport.util.I18n
512: .getString("charts.highExpression", "High expression"));
513: jLabelLowExpression.setText(it.businesslogic.ireport.util.I18n
514: .getString("charts.lowExpression", "Low expression"));
515: jLabelOpenExpression.setText(it.businesslogic.ireport.util.I18n
516: .getString("charts.openExpression", "Open expression"));
517: jLabelCloseExpression
518: .setText(it.businesslogic.ireport.util.I18n.getString(
519: "charts.closeExpression", "Close expression"));
520: jLabelVolumeExpression
521: .setText(it.businesslogic.ireport.util.I18n.getString(
522: "charts.volumeExpression", "Volume expression"));
523:
524: jTabbedPane1.setTitleAt(0, I18n.getString(
525: "chartSeries.tab.HighLow", "High/Low"));
526: jTabbedPane1.setTitleAt(1, I18n.getString(
527: "chartSeries.tab.OpenClose", "Open/Close"));
528: jTabbedPane1.setTitleAt(2, I18n.getString(
529: "chartSeries.tab.Volume", "Volume"));
530:
531: jTabbedPane2.setTitleAt(0, I18n.getString(
532: "chartSeries.tab.Data", "Data"));
533: jTabbedPane2.setTitleAt(1, I18n.getString(
534: "chartSeries.tab.ItemHyperlink", "Item hyperlink"));
535:
536: this .updateUI();
537:
538: }
539:
540: public static final int COMPONENT_NONE = 0;
541: public static final int COMPONENT_SERIES_EXPRESSION = 1;
542: public static final int COMPONENT_DATA_EXPRESSION = 2;
543: public static final int COMPONENT_HIGH_EXPRESSION = 3;
544: public static final int COMPONENT_LOW_EXPRESSION = 4;
545: public static final int COMPONENT_OPEN_EXPRESSION = 5;
546: public static final int COMPONENT_CLOSE_EXPRESSION = 6;
547: public static final int COMPONENT_VOLUME_EXPRESSION = 7;
548: public static final int COMPONENT_HYPERLINK = 100;
549:
550: /**
551: * This method set the focus on a specific component.
552: * Valid constants are something like:
553: * COMPONENT_KEY_EXPRESSION, COMPONENT_VALUE_EXPRESSION, ...
554: * otherInfo is used here only for COMPONENT_HYPERLINK
555: * otherInfo[0] = expression ID
556: * otherInfo[1] = parameter #
557: * otherInfo[2] = parameter expression ID
558: */
559: public void setFocusedExpression(Object[] expressionInfo) {
560: int expID = ((Integer) expressionInfo[0]).intValue();
561: switch (expID) {
562: case COMPONENT_SERIES_EXPRESSION:
563: Misc.selectTextAndFocusArea(jRTextExpressionSeries);
564: break;
565: case COMPONENT_DATA_EXPRESSION:
566: Misc.selectTextAndFocusArea(jRTextExpressionDate);
567: break;
568: case COMPONENT_HIGH_EXPRESSION:
569: jTabbedPane1.setSelectedComponent(jPanelHL);
570: Misc.selectTextAndFocusArea(jRTextExpressionHigh);
571: break;
572: case COMPONENT_LOW_EXPRESSION:
573: jTabbedPane1.setSelectedComponent(jPanelHL);
574: Misc.selectTextAndFocusArea(jRTextExpressionLow);
575: break;
576: case COMPONENT_OPEN_EXPRESSION:
577: jTabbedPane1.setSelectedComponent(jPanelOC);
578: Misc.selectTextAndFocusArea(jRTextExpressionOpen);
579: break;
580: case COMPONENT_CLOSE_EXPRESSION:
581: jTabbedPane1.setSelectedComponent(jPanelOC);
582: Misc.selectTextAndFocusArea(jRTextExpressionClose);
583: break;
584: case COMPONENT_VOLUME_EXPRESSION:
585: jTabbedPane1.setSelectedComponent(jPanel1);
586: Misc.selectTextAndFocusArea(jRTextExpressionVolume);
587: break;
588: case COMPONENT_HYPERLINK:
589: jTabbedPane2
590: .setSelectedComponent(sectionItemHyperlinkPanel1);
591: Object newInfo[] = new Object[expressionInfo.length - 1];
592: for (int i = 1; i < expressionInfo.length; ++i)
593: newInfo[i - 1] = expressionInfo[i];
594: sectionItemHyperlinkPanel1.setFocusedExpression(newInfo);
595: break;
596: }
597: }
598:
599: public void containerWindowOpened() {
600: sectionItemHyperlinkPanel1.openExtraWindows();
601: }
602:
603: }
|