00001: /*
00002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
00003: * http://www.jaspersoft.com.
00004: *
00005: * Unless you have purchased a commercial license agreement from JasperSoft,
00006: * the following license terms apply:
00007: *
00008: * This program is free software; you can redistribute it and/or modify
00009: * it under the terms of the GNU General Public License version 2 as published by
00010: * the Free Software Foundation.
00011: *
00012: * This program is distributed WITHOUT ANY WARRANTY; and without the
00013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00014: * See the GNU General Public License for more details.
00015: *
00016: * You should have received a copy of the GNU General Public License
00017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
00018: * or write to:
00019: *
00020: * Free Software Foundation, Inc.,
00021: * 59 Temple Place - Suite 330,
00022: * Boston, MA USA 02111-1307
00023: *
00024: *
00025: *
00026: *
00027: * MainFrame.java
00028: *
00029: * Created on 5 febbraio 2003, 12.45
00030: *
00031: */
00032:
00033: package it.businesslogic.ireport.gui;
00034:
00035: import it.businesslogic.ireport.TextReportElement;
00036: import it.businesslogic.ireport.crosstab.gui.CrosstabMeasuresView;
00037: import it.businesslogic.ireport.gui.box.JBoxButton;
00038: import it.businesslogic.ireport.gui.event.*;
00039: import it.businesslogic.ireport.gui.event.ReportElementsSelectionEvent;
00040: import it.businesslogic.ireport.gui.fonts.FontLoaderDialog;
00041: import it.businesslogic.ireport.gui.fonts.FontsPathDialog;
00042: import it.businesslogic.ireport.gui.logpane.*;
00043: import it.businesslogic.ireport.gui.library.*;
00044: import it.businesslogic.ireport.gui.locale.*;
00045: import it.businesslogic.ireport.gui.documentstructure.*;
00046: import it.businesslogic.ireport.gui.queryexecuters.QueryExecuterDef;
00047: import it.businesslogic.ireport.gui.queryexecuters.QueryExecutersDialog;
00048: import it.businesslogic.ireport.gui.style.StylesView;
00049: import it.businesslogic.ireport.gui.wizard.ReportGroupWizard;
00050: import it.businesslogic.ireport.gui.wizard.UserChoicesWizardTemplate;
00051: import it.businesslogic.ireport.gui.wizard.UserTemplatesDialog;
00052: import it.businesslogic.ireport.rmi.IReportServerImpl;
00053: import it.businesslogic.ireport.undo.*;
00054: import it.businesslogic.ireport.*;
00055: import it.businesslogic.ireport.crosstab.gui.CrosstabEditorPanel;
00056: import it.businesslogic.ireport.gui.command.FormatCommand;
00057: import it.businesslogic.ireport.gui.docking.GenericDragTargetListener;
00058: import it.businesslogic.ireport.gui.sheet.DocumentSheetPanel;
00059: import it.businesslogic.ireport.gui.style.StylesDialog;
00060: import it.businesslogic.ireport.gui.subdataset.SubDatasetsDialog;
00061: import it.businesslogic.ireport.util.*;
00062: import java.awt.Dimension;
00063: import javax.swing.tree.*;
00064: import java.util.*;
00065: import java.io.*;
00066: import javax.swing.*;
00067: import java.awt.event.*;
00068: import java.awt.Point;
00069: import java.awt.dnd.DropTarget;
00070:
00071: import jcmdline.*;
00072:
00073: import org.apache.xerces.parsers.DOMParser;
00074: import org.flexdock.docking.Dockable;
00075: import org.flexdock.docking.DockingPort;
00076: import org.flexdock.plaf.PlafManager;
00077: import org.w3c.dom.Document;
00078: import org.w3c.dom.Node;
00079: import org.w3c.dom.NodeList;
00080: import org.w3c.dom.NamedNodeMap;
00081:
00082: import java.awt.BorderLayout;
00083: import java.awt.Component;
00084: import javax.swing.border.LineBorder;
00085:
00086: import org.flexdock.docking.DockingConstants;
00087: import org.flexdock.docking.DockingManager;
00088: import org.flexdock.view.View;
00089:
00090: import org.xml.sax.SAXException;
00091:
00092: /**
00093: * This class is the core of the GUI of iReport. From this class we control all
00094: * events related to the open and close files, handling of properties files,
00095: * handling JMDIDestopPane, Menus....
00096: *
00097: * @author Administrator
00098: */
00099: public class MainFrame extends javax.swing.JFrame implements
00100: ReportListener, Runnable, LanguageChangedListener,
00101: StyleChangedListener, ReportDocumentStatusChangedListener {
00102:
00103: ////////////////////////////
00104:
00105: //iR20 GhostGlassPane glassPane = null;
00106:
00107: //iR20 public void installLayer()
00108: //iR20 {
00109: //iR20 glassPane = new GhostGlassPane();
00110: //iR20 setGlassPane(glassPane);
00111: //iR20
00112: //iR20
00113: //iR20 desktop.getContentPane().add( new IRLayerPane((JComponent)desktop.getContentPane(), glassPane), new Integer(230));
00114: //iR20 }
00115:
00116: /////////////////////////////
00117:
00118: public int docCounter = 0;
00119:
00120: private boolean noExit = false;
00121:
00122: private Thread checkModifiedFielsThread = null;
00123: /**
00124: * "iReport " + version
00125: * To get the version, MainFrame.constTitle.substring(8);
00126: * To show the title of a window, use the rebranded title
00127: * with getRebrandedTitle();
00128: */
00129: public static String constTitle = "iReport 2.0.5 ";
00130:
00131: public static String getRebrandedTitle() {
00132: String s = getBrandingProperties().getProperty("ireport.title");
00133: if (s == null) {
00134: s = constTitle;
00135: }
00136:
00137: String newVersion = getBrandingProperties().getProperty(
00138: "ireport.version");
00139:
00140: java.text.MessageFormat mf = null;
00141: if (newVersion.indexOf("{0}") >= 0) {
00142: mf = new java.text.MessageFormat(newVersion, I18n
00143: .getCurrentLocale());
00144: newVersion = mf.format(new Object[] { constTitle
00145: .substring(8) });
00146: getBrandingProperties().setProperty("ireport.version",
00147: newVersion);
00148: }
00149:
00150: mf = new java.text.MessageFormat(s, I18n.getCurrentLocale());
00151: return mf.format(new Object[] {
00152: getBrandingProperties().getProperty("ireport.version"),
00153: constTitle,
00154: getBrandingProperties().getProperty("ireport.name") });
00155: }
00156:
00157: private String homeDirectory = ".";
00158: private java.util.Vector toolBarControls;
00159: private java.util.HashMap pluginEntries;
00160: private ElementPropertiesDialog elementPropertiesDialog;
00161: private EventsForm eventsForm;
00162: private ValuesDialog valuesDialog;
00163: private GroupsDialog groupsDialog;
00164: private BandsDialog bandsDialog;
00165: private FontsDialog fontsDialog;
00166: private LocaleResourceFilesDialog localeFilesDialog;
00167: private ReportQueryDialog reportQueryDialog;
00168: private PluginConfigurationDialog pluginConfigurationDialog = null;
00169: private ToolbarFormatPanel jToolbarFormatPanel = null;
00170: private ToolbarConnectionPanel jToolbarConnectionPanel = null;
00171:
00172: private Vector ttfFonts;
00173: private Vector connections;
00174: private Properties properties;
00175: private Vector recentFilesList;
00176: private Vector favoriteFilesList;
00177: private Vector recentProjectsList;
00178: private Vector clipboards[];
00179: private Vector classpath;
00180: private Vector fontspath;
00181:
00182: private List userChoicesWizardTemplates = null;
00183:
00184: private it.businesslogic.ireport.ReportElement styleClipboards[];
00185: private int activeClipboard = 0;
00186: private int activeStyleClipboard = 0;
00187: private boolean catchFormActivated = true;
00188: private boolean embeddedIreport = false;
00189: private boolean usingWS = false;
00190:
00191: private LibraryPanel libraryPanel = null;
00192: private CrosstabMeasuresView crosstabMeasuresView = null;
00193:
00194: private DocumentStructurePanel documentStructurePanel = null;
00195: private CrosstabStructurePanel crosstabStructurePanel = null;
00196: private DocumentSheetPanel reportSheetPanel = null;
00197: //private ReportElementSheetPanel reportElementSheetPanel = null;
00198: private StylesView stylesView = null;
00199:
00200: public static ReportClassLoader reportClassLoader = null;
00201:
00202: private static MainFrame mainInstance = null;
00203:
00204: private boolean dontHandleEvent;
00205:
00206: private StringBuffer outputBuffer;
00207:
00208: private javax.swing.event.EventListenerList listenerList = null;
00209:
00210: private int rightColumnWidth = 0;
00211:
00212: private Vector chartSeriesClipBoard = new Vector();
00213: private it.businesslogic.ireport.chart.Dataset chartDatasetClipBoard = null;
00214: private Vector measuresClipBoard = new Vector();
00215: private Vector queryExecuters = new Vector();
00216: private Vector linkTypes = new Vector();
00217:
00218: private boolean magnetEnabled = true;
00219:
00220: private static java.util.Properties brandingProperties = new java.util.Properties();
00221:
00222: static {
00223:
00224: loadRebrandingProperties();
00225: }
00226:
00227: /**
00228: * Variable currentZoomFactor is used to remember the zoomFactor
00229: * while reloading a file after changing it from outside or
00230: * via the option Edit XML source.
00231: */
00232: private double currentZoomFactor = 1.0;
00233:
00234: public static String IREPORT_HOME_DIR;
00235:
00236: public static String IREPORT_USER_HOME_DIR;
00237:
00238: public static String IREPORT_TMP_DIR;
00239:
00240: public static String IREPORT_RECENT_FILES_FILE;
00241:
00242: public static String IREPORT_EXPRESSIONS_FILE;
00243:
00244: public static String IREPORT_FAVORITE_FILES_FILE;
00245:
00246: public static String IREPORT_RECENT_PROJECTS_FILE;
00247:
00248: public static String IREPORT_CONFIG_FILE;
00249:
00250: public static String IREPORT_STYLE_LIBRARY;
00251:
00252: public static String IREPORT_DEFAULT_HOME_DIR;
00253:
00254: public static final int IREPORT_JAVA_VIEWER = 1;
00255:
00256: public static final int IREPORT_PDF_VIEWER = 2;
00257:
00258: public static final int IREPORT_HTML_VIEWER = 4;
00259:
00260: public static final int IREPORT_XLS_VIEWER = 8;
00261:
00262: public static final int IREPORT_CSV_VIEWER = 16;
00263:
00264: public static final int IREPORT_JASPER_VIEWER = 32;
00265:
00266: public static final int IREPORT_TXT_VIEWER = 64;
00267:
00268: public static final int IREPORT_TXT_JR_VIEWER = 128;
00269:
00270: public static final int IREPORT_RTF_VIEWER = 256;
00271:
00272: public static final int IREPORT_XLS2_VIEWER = 512;
00273:
00274: public static final int IREPORT_ODF_VIEWER = 1024;
00275:
00276: public static final int IREPORT_FLASH_VIEWER = 2048;
00277:
00278: private LogPane logPane = null;
00279: private JBoxButton jBoxButton = null;
00280:
00281: private java.util.List connectionImplementations = new java.util.ArrayList();
00282:
00283: /**
00284: * Viewes ....
00285: */
00286: View viewFiles = null;
00287: View viewDocumentStructure = null;
00288: View viewPropertySheet = null;
00289: View viewThreads = null;
00290: View viewLibrary = null;
00291: View logPaneView = null;
00292: View stylesPanleView = null;
00293: View crosstabStructureView = null;
00294: View crosstabMeasuresPanelView = null;
00295:
00296: View desktop = null;
00297:
00298: /**
00299: * This is the set of style availables in the library...
00300: */
00301: private Vector styleLibrarySet = new Vector();
00302:
00303: /**
00304: * Return the main instance of the MainFrame. This method assume that there is only
00305: * one iReport instanced per JVM, so the first istance of MainFrame is the only possible.
00306: */
00307: public static MainFrame getMainInstance() {
00308: return mainInstance;
00309: }
00310:
00311: static {
00312:
00313: reportClassLoader = new ReportClassLoader();
00314:
00315: } //end static section for simple init
00316:
00317: /*
00318: * You can override ireport home setting ireport.home variable or using line command options.
00319: *
00320: */
00321: public void setiReportPaths(String ireport_home,
00322: String ireport_user_home, String ireport_tmp_dir) {
00323:
00324: // Setting User home directory
00325: if (ireport_user_home == null) {
00326: ireport_user_home = System.getProperty("user.home")
00327: + File.separator + ".ireport";
00328: IREPORT_USER_HOME_DIR = ireport_user_home;
00329:
00330: //setHomeDirectory(Misc.nvl(System.getProperty("ireport.home"), IREPORT_DEFAULT_HOME_DIR));
00331: } else {
00332: if (ireport_user_home.endsWith(File.separator)) {
00333: ireport_user_home = ireport_user_home.substring(0,
00334: ireport_user_home.length() - 1);
00335: }
00336: IREPORT_USER_HOME_DIR = ireport_user_home;
00337: }
00338:
00339: // Setting iReport directory
00340: if (ireport_home == null) {
00341: ireport_home = System.getProperty("ireport.home", ".");
00342: IREPORT_HOME_DIR = ireport_home;
00343: setHomeDirectory(IREPORT_HOME_DIR);
00344: } else {
00345: if (ireport_home.endsWith(File.separator)) {
00346: ireport_home = ireport_home.substring(0, ireport_home
00347: .length() - 1);
00348: }
00349: IREPORT_HOME_DIR = ireport_home;
00350: }
00351:
00352: // Setting temp dir...
00353: if (IREPORT_TMP_DIR == null
00354: || IREPORT_TMP_DIR.trim().length() == 0) {
00355: if (ireport_tmp_dir == null) {
00356: ireport_user_home = System.getProperty("user.home")
00357: + File.separator + ".ireport";
00358: IREPORT_TMP_DIR = ireport_home;
00359:
00360: //setHomeDirectory(Misc.nvl(System.getProperty("ireport.home"), IREPORT_DEFAULT_HOME_DIR));
00361: } else {
00362: if (ireport_tmp_dir.endsWith(File.separator)) {
00363: ireport_tmp_dir = ireport_tmp_dir.substring(0,
00364: ireport_tmp_dir.length() - 1);
00365: }
00366: IREPORT_TMP_DIR = ireport_tmp_dir;
00367: }
00368: }
00369:
00370: IREPORT_DEFAULT_HOME_DIR = IREPORT_HOME_DIR;
00371: setHomeDirectory(IREPORT_HOME_DIR);
00372:
00373: IREPORT_RECENT_FILES_FILE = IREPORT_USER_HOME_DIR
00374: + File.separator + "recentFiles.xml";
00375: IREPORT_EXPRESSIONS_FILE = IREPORT_USER_HOME_DIR
00376: + File.separator + "expressions.xml";
00377: IREPORT_RECENT_PROJECTS_FILE = IREPORT_USER_HOME_DIR
00378: + File.separator + "recentProjects.xml";
00379: IREPORT_FAVORITE_FILES_FILE = IREPORT_USER_HOME_DIR
00380: + File.separator + "favoriteFiles.xml";
00381: IREPORT_CONFIG_FILE = IREPORT_USER_HOME_DIR + File.separator
00382: + "config.xml";
00383: IREPORT_STYLE_LIBRARY = IREPORT_USER_HOME_DIR + File.separator
00384: + "styleLibrary.xml";
00385: //System.out.println(IREPORT_DEFAULT_HOME_DIR);
00386: //System.out.println(IREPORT_HOME_DIR);
00387:
00388: getReportClassLoader().addNoRelodablePath(
00389: IREPORT_USER_HOME_DIR + File.separator + "classes");
00390:
00391: try {
00392: //nothing in here yet.
00393: } catch (Throwable e) {
00394: e.printStackTrace(System.err);
00395: }
00396: }
00397:
00398: public MainFrame() {
00399: this (new HashMap());
00400: }
00401:
00402: /** Creates new form MainFrame */
00403: public MainFrame(final Map args) {
00404:
00405: if (mainInstance == null) {
00406: mainInstance = this ;
00407: }
00408:
00409: // loading rebranding stuff...
00410:
00411: //Thread.currentThread().setContextClassLoader(this.getReportClassLoader());
00412:
00413: final SplashDialog sp;
00414:
00415: if (args.get("splash") != null) {
00416: sp = (SplashDialog) args.get("splash");
00417: } else {
00418: sp = null;
00419: }
00420:
00421: properties = new Properties();
00422: outputBuffer = new StringBuffer();
00423: connections = new Vector();
00424: recentFilesList = new Vector();
00425: favoriteFilesList = new Vector();
00426: recentProjectsList = new Vector();
00427: pluginEntries = new java.util.HashMap();
00428:
00429: setiReportPaths((String) args.get("ireport-home"),
00430: (String) args.get("user-home"), (String) args
00431: .get("tmp-dir"));
00432:
00433: if (args.get("embedded") != null
00434: && args.get("embedded").equals("true"))
00435: this .setNoExit(true);
00436:
00437: if (args.get("webstart") != null
00438: && args.get("webstart").equals("true"))
00439: this .setUsingWS(true);
00440:
00441: //Added by Felix Firgau for I18n on Feb 10th 2006
00442: //it.businesslogic.ireport.util.I18n.setCurrentLocale( properties.getProperty("Language"), properties.getProperty("Country") );
00443: //Modified by Felix Firgau for I18n on Feb 8th 2006
00444:
00445: // Set the classloader...
00446: //Thread.currentThread().setContextClassLoader( reportClassLoader );
00447: //Modified by Felix Firgau for I18n on Feb 8th 2006
00448: //if (sp!=null) sp.updateLoadingStatus(10,"Loading iReport configuration");
00449: if (sp != null)
00450: sp.updateLoadingStatus(10,
00451: it.businesslogic.ireport.util.I18n.getString(
00452: "loadingIReportConfig",
00453: "Loading iReport configuration"));
00454: //Modification end
00455:
00456: addDefaultConnectionImplementations();
00457:
00458: if (args.containsKey("config-file")) {
00459: loadiReportConfiguration((String) args.get("config-file"));
00460: } else {
00461: loadiReportConfiguration();
00462: }
00463:
00464: it.businesslogic.ireport.util.I18n.setCurrentLocale(properties
00465: .getProperty("Language"), properties
00466: .getProperty("Country"));
00467:
00468: if (args.get("beanClass") != null) {
00469: getProperties().put("beanClass",
00470: (String) args.get("beanClass"));
00471: }
00472:
00473: //Modified by Felix Firgau for I18n on Feb 8th 2006
00474: //if (sp!=null) sp.updateLoadingStatus(20,"Setting locale");
00475: if (sp != null)
00476: sp.updateLoadingStatus(20,
00477: it.businesslogic.ireport.util.I18n.getString(
00478: "setLocale", "Setting locale"));
00479: //it.businesslogic.ireport.util.I18n.setCurrentLocale( properties.getProperty("Language"), properties.getProperty("Country") );
00480: //Modification end
00481:
00482: //Misc.setPLAF( properties.getProperty("LookAndFeel") );
00483:
00484: //Modified by Felix Firgau for faster loading on Oct 11th 2006
00485: /* if (args.get("noPlaf") == null || args.get("noPlaf").equals("false"))
00486: PlafManager.setPreferredTheme("win32");*/
00487: if (args.get("noPlaf") == null
00488: || args.get("noPlaf").equals("false")) {
00489: Misc.setPLAF(properties.getProperty("LookAndFeel"));
00490: PlafManager.setPreferredTheme("win32");
00491: }
00492:
00493: //Modified by Felix Firgau for I18n on Feb 8th 2006
00494: //if (sp!=null) sp.updateLoadingStatus(30,"Init main frame components");
00495: if (sp != null)
00496: sp.updateLoadingStatus(30,
00497: it.businesslogic.ireport.util.I18n.getString(
00498: "initMainFrame",
00499: "Init main frame components"));
00500: //Modification end
00501:
00502: jToolbarFormatPanel = new ToolbarFormatPanel(this );
00503: jToolbarConnectionPanel = new ToolbarConnectionPanel(this );
00504:
00505: initComponents();
00506:
00507: this .setTitle(this .getRebrandedTitle());
00508: //getDockingContainerRight().setPosition( DockingContainer.POSITION_RIGHT);
00509: logPane = new LogPane();
00510: //jPanelSouth.add(logPane, java.awt.BorderLayout.CENTER);
00511:
00512: this .jCheckBoxMenuItemGrid.setSelected(properties.getProperty(
00513: "showGrid", "false").equals("true"));
00514: this .jCheckBoxMenuItemSnapToGrid.setSelected(properties
00515: .getProperty("snapToGrid", "false").equals("true"));
00516: this .jCheckBoxMenuItemEMM.setSelected(properties.getProperty(
00517: "EMM", "false").equals("true"));
00518: this .jCheckBoxMenuItemReportVirtualizer.setSelected(properties
00519: .getProperty("ReportVirtualizer", "false").equals(
00520: "true"));
00521: this .jCheckBoxMenuItemIgnorePagination.setSelected(properties
00522: .getProperty("IgnorePagination", "false")
00523: .equals("true"));
00524: this .jListThreads.setModel(new javax.swing.DefaultListModel());
00525: this .jListThreads.setPreferredSize(new Dimension(10, 10));
00526: I18n.addOnLanguageChangedListener(this );
00527:
00528: //Modified by Felix Firgau for I18n on Feb 8th 2006
00529: //if (sp!=null) sp.updateLoadingStatus(60,"Loading fonts");
00530:
00531: if (properties.getProperty("LoadFontOnStartup", "true").equals(
00532: "true")) {
00533: if (sp != null)
00534: sp.updateLoadingStatus(60,
00535: it.businesslogic.ireport.util.I18n.getString(
00536: "loadingFonts", "Loading fonts"));
00537: //Modification end
00538: this .ttfFonts = FontListLoader.loadTTFFonts();
00539: }
00540: if (ttfFonts == null)
00541: ttfFonts = new Vector();
00542:
00543: System.setProperty("org.xml.sax.driver",
00544: "org.apache.xerces.parsers.SAXParser");
00545:
00546: //Modified by Felix Firgau for I18n on Feb 8th 2006
00547: //if (sp!=null) sp.updateLoadingStatus(75,"Configuring GUI components");
00548: if (sp != null)
00549: sp.updateLoadingStatus(70,
00550: it.businesslogic.ireport.util.I18n.getString(
00551: "configGUIComponents",
00552: "Configuring GUI components"));
00553:
00554: //Modification end of Felix Firgau
00555:
00556: //jMDIDesktopPane.addInternalFrameActivatedListener(this);
00557:
00558: this .setTitle(getRebrandedTitle()
00559: + " - (c) 2002-2008 by JasperSoft Corp.");
00560:
00561: toolBarControls = new java.util.Vector();
00562:
00563: elementPropertiesDialog = new ElementPropertiesDialog(this ,
00564: false);
00565: elementPropertiesDialog.updateFonts();
00566: valuesDialog = new ValuesDialog(this , false);
00567: groupsDialog = new GroupsDialog(this , false);
00568: bandsDialog = new BandsDialog(this , false);
00569: fontsDialog = new FontsDialog(this , false);
00570: reportQueryDialog = new ReportQueryDialog(this , false);
00571: localeFilesDialog = new LocaleResourceFilesDialog(this , false);
00572: eventsForm = new EventsForm();
00573:
00574: addDefaultLinkTypes();
00575:
00576: jNumberComboBoxZoom
00577: .addValueChangedListener(new ValueChangedListener() {
00578: public void valueChanged(ValueChangedEvent evt) {
00579: jNumberComboBoxZoomValueChanged(evt);
00580: }
00581: });
00582:
00583: //user pressed enter
00584: jNumberComboBoxZoom.addActionListener(new ActionListener() {
00585: public void actionPerformed(ActionEvent evt) {
00586: //simulate focus lost to force zoom update
00587: jNumberComboBoxZoom.focusLost(new FocusEvent(
00588: MainFrame.this , FocusEvent.COMPONENT_SHOWN));
00589: }
00590: });
00591:
00592: jMDIDesktopPane
00593: .addInternalFrameActivatedListener(new InternalFrameActivatedListener() {
00594: public void internalFrameActivated(
00595: InternalFrameActivatedEvent evt) {
00596: jMDIDesktopPaneInternalFrameActivated(evt);
00597: }
00598: });
00599:
00600: getToolBarControls().addElement(this .jButtonNew);
00601: getToolBarControls().addElement(this .jButtonOpen);
00602: getToolBarControls().addElement(this .jButtonSave);
00603: getToolBarControls().addElement(null);
00604: getToolBarControls().addElement(this .jButtonCut);
00605: getToolBarControls().addElement(this .jButtonCopy);
00606: getToolBarControls().addElement(this .jButtonPaste);
00607: getToolBarControls().addElement(null);
00608: getToolBarControls().addElement(this .jToggleButtonPointer);
00609: getToolBarControls().addElement(this .jToggleButtonLineTool);
00610: getToolBarControls().addElement(this .jToggleButtonRectTool);
00611: //getToolBarControls().addElement( this.jToggleButtonRectRoundTool);
00612: getToolBarControls().addElement(this .jToggleButtonEllipseTool);
00613: getToolBarControls().addElement(this .jToggleButtonImageTool);
00614: getToolBarControls().addElement(
00615: this .jToggleButtonStaticTextTool);
00616: getToolBarControls()
00617: .addElement(this .jToggleButtonTextFieldTool);
00618: getToolBarControls().addElement(this .jToggleButtonFrameTool);
00619: getToolBarControls()
00620: .addElement(this .jToggleButtonSubreportTool);
00621: getToolBarControls().addElement(this .jToggleButtonCrosstabTool);
00622: getToolBarControls().addElement(this .jToggleButtonChartTool);
00623: getToolBarControls().addElement(this .jToggleButtonBarcodeTool);
00624: getToolBarControls().addElement(null);
00625: getToolBarControls().addElement(this .jButtonParameters);
00626: getToolBarControls().addElement(this .jButtonGroups);
00627: getToolBarControls().addElement(this .jButtonBands);
00628: getToolBarControls().addElement(this .jButtonDatabase);
00629: getToolBarControls().addElement(null);
00630: getToolBarControls().addElement(this .jPanelZoom);
00631: getToolBarControls().addElement(this .jButtonLens1);
00632: getToolBarControls().addElement(this .jButtonLens2);
00633: getToolBarControls().addElement(null);
00634: getToolBarControls().addElement(this .jButtonCompiler);
00635:
00636: getToolBarControls().addElement(this .jButtonRun1);
00637: getToolBarControls().addElement(this .jButtonRun2);
00638: getToolBarControls().addElement(null);
00639: //toolBarControls.addElement(this.jButtonAlignLeft);
00640: //toolBarControls.addElement(this.jButtonAlignCenter);
00641: //toolBarControls.addElement(this.jButtonAlignRight);
00642: //toolBarControls.addElement(this.jButtonAlignJustify);
00643:
00644: jBoxButton = new JBoxButton();
00645: jBoxButton.setMinimumSize(new java.awt.Dimension(36, 22));
00646: jBoxButton.setMaximumSize(new java.awt.Dimension(36, 22));
00647: jBoxButton.setPreferredSize(new java.awt.Dimension(36, 22));
00648: jBoxButton.setEnabled(false);
00649: jBoxButton
00650: .addActionListener(new java.awt.event.ActionListener() {
00651: public void actionPerformed(
00652: java.awt.event.ActionEvent evt) {
00653: jBoxButtonActionPerformed(evt);
00654: }
00655: });
00656:
00657: jToolBarText.add(jBoxButton,
00658: jToolBarText.getComponentCount() - 1);
00659:
00660: jNumberComboBoxZoom.addEntry("50%", 50);
00661: jNumberComboBoxZoom.addEntry("75%", 75);
00662: jNumberComboBoxZoom.addEntry("100%", 100);
00663: jNumberComboBoxZoom.addEntry("150%", 150);
00664: jNumberComboBoxZoom.addEntry("200%", 200);
00665: jNumberComboBoxZoom.addEntry("400%", 400);
00666: jNumberComboBoxZoom.addEntry("800%", 800);
00667: jNumberComboBoxZoom.addEntry("Width", 100);
00668: jNumberComboBoxZoom.addEntry("Height", 100);
00669: jNumberComboBoxZoom.addEntry("Whole page", 100);
00670: //jNumberComboBoxZoom.addEntry("Fit to page",100); // deactivate since July 16 2004
00671:
00672: //java.awt.Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
00673: //this.setSize(dim);
00674:
00675: //Modified by Felix Firgau for I18n on Feb 8th 2006
00676: //if (sp!=null) sp.updateLoadingStatus(80,"Loading available font family names");
00677: if (sp != null)
00678: sp.updateLoadingStatus(75,
00679: it.businesslogic.ireport.util.I18n.getString(
00680: "loadingAvFontFamNames",
00681: "Loading available font family names"));
00682: //Modification end
00683:
00684: String[] fontFamilies = java.awt.GraphicsEnvironment
00685: .getLocalGraphicsEnvironment()
00686: .getAvailableFontFamilyNames();
00687: jComboBoxFont.addItem("");
00688: for (int i = 0; i < fontFamilies.length; ++i) {
00689: jComboBoxFont.addItem(fontFamilies[i]);
00690: if (fontFamilies[i].equalsIgnoreCase("SansSerif")) {
00691: jComboBoxFont.setSelectedIndex(i);
00692: }
00693: }
00694:
00695: jNumberComboBoxSize.addEntry("3", 3);
00696: jNumberComboBoxSize.addEntry("5", 5);
00697: jNumberComboBoxSize.addEntry("8", 8);
00698: jNumberComboBoxSize.addEntry("10", 10);
00699: jNumberComboBoxSize.addEntry("12", 12);
00700: jNumberComboBoxSize.addEntry("14", 14);
00701: jNumberComboBoxSize.addEntry("18", 18);
00702: jNumberComboBoxSize.addEntry("24", 24);
00703: jNumberComboBoxSize.addEntry("36", 36);
00704: jNumberComboBoxSize.addEntry("48", 48);
00705:
00706: jNumberComboBoxSize.setSelectedIndex(5);
00707:
00708: //jPanelToolBarComponentResized(new java.awt.event.ComponentEvent(jPanelToolBar,0));
00709:
00710: java.awt.Image def = Misc
00711: .loadImageFromResources("it/businesslogic/ireport/icons/layout/img.gif");
00712: try {
00713: java.awt.MediaTracker mt = new java.awt.MediaTracker(
00714: new javax.swing.JPanel());
00715: mt.addImage(def, 0);
00716: mt.waitForID(0);
00717: } catch (Exception ex) {
00718: /* Do nothing */
00719: }
00720: ImageReportElement.setImgDef(def);
00721: //jNumberComboBoxZoom.setPostfix("%");
00722: //Modified by Felix Firgau for I18n on Feb 9th 2006
00723: javax.swing.tree.DefaultMutableTreeNode root = new javax.swing.tree.DefaultMutableTreeNode(
00724: it.businesslogic.ireport.util.I18n.getString(
00725: "openedFiles", "Opened files"));//End
00726: javax.swing.tree.DefaultTreeModel model = new javax.swing.tree.DefaultTreeModel(
00727: root);
00728:
00729: javax.swing.ToolTipManager.sharedInstance().registerComponent(
00730: jTreeFiles);
00731: jTreeFiles.setModel(model);
00732: jTreeFiles
00733: .setCellRenderer(new ProjectExplorerTreeCellRenderer());
00734:
00735: jTreeFiles.setDropTarget(new DropTarget(jTreeFiles,
00736: new GenericDragTargetListener()));
00737: //Modified by Felix Firgau for I18n on Feb 8th 2006
00738: //--- dockingContainerLeft.addPanel(it.businesslogic.ireport.util.I18n.getString("files", "Files"),jPanelFiles,true);//Modification end
00739:
00740: documentStructurePanel = new DocumentStructurePanel();
00741: //Modified by Felix Firgau for I18n on Feb 8th 2006
00742: //--- dockingContainerLeft.addPanel(it.businesslogic.ireport.util.I18n.getString("documentStructure", "Documentstructure"),documentStructurePanel,true);//Modification end
00743: this .addReportListener(documentStructurePanel);
00744:
00745: crosstabStructurePanel = new CrosstabStructurePanel();
00746: //--- jTabbedPaneExplorer.addTab("Document structure",crosstabStructurePanel);
00747: this .addReportListener(crosstabStructurePanel);
00748:
00749: reportSheetPanel = new DocumentSheetPanel();
00750:
00751: //dockingContainerRight.addPanel(it.businesslogic.ireport.util.I18n.getString("elementProperties","Element properties"),reportElementSheetPanel, true);
00752:
00753: libraryPanel = new LibraryPanel();
00754: //jTabbedPaneRight.addTab("Library",libraryPanel);
00755: //Modified by Felix Firgau for I18n on Feb 8th 2006
00756: //--- dockingContainerRight.addPanel(it.businesslogic.ireport.util.I18n.getString("library"),libraryPanel,true);//Modification end
00757:
00758: stylesView = new StylesView();
00759:
00760: //dockingContainerRight.insertPanel(1,it.businesslogic.ireport.util.I18n.getString("stylesLibrary","Styles Library"),stylesView, dockingContainerRight.INSERT_MODE_SHAREDPOSTION, true);
00761:
00762: crosstabMeasuresView = new CrosstabMeasuresView();
00763:
00764: // New docking code
00765:
00766: final org.flexdock.docking.defaults.DefaultDockingPort defaultDockingPort = new org.flexdock.docking.defaults.DefaultDockingPort();
00767:
00768: desktop = createDesktopPage();
00769:
00770: viewFiles = createView("Files",
00771: it.businesslogic.ireport.util.I18n.getString("files",
00772: "Files"), true, true, jPanelFiles);
00773: viewDocumentStructure = createView("Structure",
00774: it.businesslogic.ireport.util.I18n.getString(
00775: "documentStructure", "Document structure"),
00776: true, true, documentStructurePanel);
00777: viewPropertySheet = createView("Props",
00778: it.businesslogic.ireport.util.I18n.getString(
00779: "properties", "Properties"), true, true,
00780: getReportSheetPanel());
00781: jScrollProcesses.setSize(100, 100);
00782: viewThreads = createView("Threads",
00783: it.businesslogic.ireport.util.I18n.getString("threads",
00784: "Threads"), true, true, jScrollProcesses);
00785: viewLibrary = createView("Library",
00786: it.businesslogic.ireport.util.I18n.getString("library",
00787: "Library"), true, true, libraryPanel);
00788: logPaneView = createView("logPane",
00789: it.businesslogic.ireport.util.I18n.getString("output",
00790: "Output"), true, true, logPane);
00791: stylesPanleView = createView("Styles",
00792: it.businesslogic.ireport.util.I18n.getString(
00793: "stylesLibrary", "Styles Library"), true, true,
00794: stylesView);
00795: crosstabMeasuresPanelView = createView("crosstabObjects",
00796: it.businesslogic.ireport.util.I18n.getString(
00797: "crosstabObjects", "Crosstab objects"), false,
00798: true, crosstabMeasuresView);
00799: crosstabStructureView = createView("crosstabStructure",
00800: it.businesslogic.ireport.util.I18n.getString(
00801: "crosstabStructure", "Crosstab structure"),
00802: false, true, crosstabStructurePanel);
00803:
00804: jPanelMaster.add(defaultDockingPort, BorderLayout.CENTER);
00805:
00806: jPanelMaster.updateUI();
00807:
00808: // ------------- ALL TASK THAT DOES NOT NEED TO BE IN THE EDT
00809:
00810: //if (sp!=null) sp.updateLoadingStatus(80,"Loading styles"); // I18N Done on 6th April 06
00811: if (sp != null)
00812: sp.updateLoadingStatus(80,
00813: it.businesslogic.ireport.util.I18n.getString(
00814: "loadingStyles", "Loading styles"));
00815: loadStyleLibrary();
00816: stylesView.loadLibraryStyles();
00817:
00818: //if (sp!=null) sp.updateLoadingStatus(85,"Loading file lists"); // I18N Done on 6th April 06
00819:
00820: if (sp != null)
00821: sp.updateLoadingStatus(85,
00822: it.businesslogic.ireport.util.I18n.getString(
00823: "loadingFileLists",
00824: "Loading Loading file lists"));
00825:
00826: loadFileLists();
00827: loadExpressionsList();
00828:
00829: updateRecentFileMenu(jMenuRecentFiles, getRecentFilesList());
00830: //updateRecentProjectMenu(jMenuRecentProjects, getRecentProjectsList());
00831:
00832: //IRCompilerDocument doc = new IRCompilerDocument();
00833:
00834: jMenuItemUndo.setAccelerator(javax.swing.KeyStroke
00835: .getKeyStroke(KeyEvent.VK_Z, KeyEvent.CTRL_DOWN_MASK));
00836: jMenuItemRedo.setAccelerator(javax.swing.KeyStroke
00837: .getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_DOWN_MASK));
00838: jCheckBoxMenuItemEMM.setAccelerator(javax.swing.KeyStroke
00839: .getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_DOWN_MASK));
00840: jMenuItemCut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
00841: KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK));
00842: jMenuItemCopy.setAccelerator(javax.swing.KeyStroke
00843: .getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK));
00844: jMenuItemPaste.setAccelerator(javax.swing.KeyStroke
00845: .getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK));
00846:
00847: jMenuItemSave.setAccelerator(javax.swing.KeyStroke
00848: .getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_DOWN_MASK));
00849: jMenuItemOpen.setAccelerator(javax.swing.KeyStroke
00850: .getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK));
00851: jMenuItemNewDocument.setAccelerator(javax.swing.KeyStroke
00852: .getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK));
00853: jMenuItemPrint.setAccelerator(javax.swing.KeyStroke
00854: .getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK));
00855:
00856: jToolbarConnectionPanel.updateConnections();
00857:
00858: clipboards = new Vector[5];
00859: for (int i = 0; i < 5; ++i) {
00860: clipboards[i] = new Vector();
00861: }
00862:
00863: styleClipboards = new it.businesslogic.ireport.ReportElement[5];
00864: for (int i = 0; i < 5; ++i) {
00865: styleClipboards[i] = null;
00866: }
00867:
00868: MainFrame.this
00869: .setReportViewer(MainFrame.this .getReportViewer());
00870: MainFrame.this .disableSaveAllSpecific();
00871: MainFrame.this .disableSaveSpecific();
00872:
00873: String irHomeMessageKey = "messages.ireportHome";
00874: String irHomeMessageDefault = "iReport home (ireport.home system property): {0}";
00875: if (args.containsKey("ireport-home")) {
00876: irHomeMessageKey = "messages.ireportHome2";
00877: irHomeMessageDefault = "iReport home (from command line): {0}";
00878: }
00879:
00880: getLogPane().getMainLogTextArea().logOnConsole(
00881: I18n.getFormattedString(irHomeMessageKey,
00882: irHomeMessageDefault, new Object[] { ""
00883: + MainFrame.this .IREPORT_HOME_DIR }),
00884: JOptionPane.INFORMATION_MESSAGE);
00885:
00886: irHomeMessageKey = "messages.userHome";
00887: irHomeMessageDefault = "User home (user.home system property): {0}";
00888: if (args.containsKey("ireport-home")) {
00889: irHomeMessageKey = "messages.userHome2";
00890: irHomeMessageDefault = "User home (from command line): {0}";
00891: }
00892:
00893: getLogPane()
00894: .getMainLogTextArea()
00895: .logOnConsole(
00896: I18n
00897: .getFormattedString(
00898: irHomeMessageKey,
00899: irHomeMessageDefault,
00900: new Object[] { ""
00901: + MainFrame.this .IREPORT_USER_HOME_DIR }),
00902: JOptionPane.INFORMATION_MESSAGE);
00903:
00904: getLogPane()
00905: .getMainLogTextArea()
00906: .logOnConsole(
00907: I18n
00908: .getFormattedString(
00909: "messages.compileDir",
00910: "iReport default compile directory: {0}",
00911: new Object[] { ""
00912: + MainFrame.this
00913: .getDefaultCompilationDirectory() }),
00914: JOptionPane.INFORMATION_MESSAGE);
00915:
00916: getLogPane()
00917: .getMainLogTextArea()
00918: .logOnConsole(
00919: I18n
00920: .getFormattedString(
00921: "messages.userHome3",
00922: "iReport user home directory (iReport compiles here if there are no settings or the user hasn\'t selected to compile to the report directory): {0}",
00923: new Object[] { IREPORT_DEFAULT_HOME_DIR }),
00924: JOptionPane.INFORMATION_MESSAGE);
00925:
00926: if (isUsingWS()) {
00927: getLogPane().getMainLogTextArea().logOnConsole(
00928: I18n.getString("messages.jwsactive",
00929: "JWS mode is active"),
00930: JOptionPane.INFORMATION_MESSAGE);
00931: }
00932:
00933: jToolBarText
00934: .setVisible(getProperties().getProperty(
00935: "toolbarTextVisible", "false")
00936: .equalsIgnoreCase("true"));
00937: jToolBarFormat.setVisible(getProperties().getProperty(
00938: "toolbarFormattingVisible", "false").equalsIgnoreCase(
00939: "true"));
00940: jToolBarConnections.setVisible(getProperties().getProperty(
00941: "toolbarConnectionsVisible", "true").equalsIgnoreCase(
00942: "true"));
00943:
00944: jCheckBoxMenuItemElementsFormatting.setSelected(getProperties()
00945: .getProperty("toolbarFormattingVisible", "false")
00946: .equalsIgnoreCase("true"));
00947: jCheckBoxMenuItemTextFormatting.setSelected(getProperties()
00948: .getProperty("toolbarTextVisible", "false")
00949: .equalsIgnoreCase("true"));
00950:
00951: try {
00952:
00953: SwingUtilities.invokeLater(new Runnable() {
00954: public void run() {
00955:
00956: jPanelMaster.updateUI();
00957: defaultDockingPort.updateUI();
00958: DockingManager.dock(desktop,
00959: (DockingPort) defaultDockingPort);
00960:
00961: boolean createLayout = true;
00962:
00963: try {
00964: if (getProperties().getProperty(
00965: "RestoreLayout", "true").equals("true")
00966: && DockingManager
00967: .loadLayoutModel(false)) {
00968: createLayout = false;
00969: DockingManager
00970: .registerDockable((Dockable) logPaneView);
00971: DockingManager
00972: .registerDockable((Dockable) viewThreads);
00973: DockingManager
00974: .registerDockable((Dockable) viewPropertySheet);
00975: DockingManager
00976: .registerDockable((Dockable) viewDocumentStructure);
00977: DockingManager
00978: .registerDockable((Dockable) viewLibrary);
00979: DockingManager
00980: .registerDockable((Dockable) stylesPanleView);
00981:
00982: }
00983: } catch (Exception ex) {
00984:
00985: }
00986:
00987: if (createLayout) {
00988: //org.flexdock.docking.DockingManager.dock(desktop, (org.flexdock.docking.DockingPort)defaultDockingPort);
00989:
00990: DockingManager.dock((Dockable) logPaneView,
00991: (Dockable) desktop,
00992: DockingConstants.SOUTH_REGION, 0.3f);
00993: //desktop.dock(logPaneView, DockingConstants.SOUTH_REGION); //, .01f);
00994: //org.flexdock.docking.DockingManager.setSplitProportion(desktop.getComponent(), 0.2f);
00995:
00996: DockingManager.dock((Dockable) viewThreads,
00997: (Dockable) logPaneView,
00998: DockingConstants.EAST_REGION, 0.2f);
00999: //logPaneView.dock(viewThreads, DockingConstants.EAST_REGION, 0.8f);
01000: //org.flexdock.docking.DockingManager.setSplitProportion(viewThreads.getComponent(), 0.8f);
01001:
01002: DockingManager.dock(
01003: (Dockable) viewPropertySheet,
01004: (Dockable) desktop,
01005: DockingConstants.EAST_REGION, 0.25f);
01006: //desktop.dock(viewPropertySheet, DockingConstants.EAST_REGION);
01007: //org.flexdock.docking.DockingManager.setSplitProportion(viewPropertySheet.getComponent(), 0.75f);
01008:
01009: DockingManager.dock((Dockable) viewFiles,
01010: (Dockable) desktop,
01011: DockingConstants.WEST_REGION, 0.25f);
01012: //desktop.dock(viewFiles, DockingConstants.WEST_REGION);
01013: //org.flexdock.docking.DockingManager.setSplitProportion(viewFiles.getComponent(), 0.1f);
01014:
01015: DockingManager.dock(
01016: (Dockable) viewDocumentStructure,
01017: (Dockable) viewFiles,
01018: DockingConstants.SOUTH_REGION, 0.5f);
01019: //viewFiles.dock(viewDocumentStructure, DockingConstants.SOUTH_REGION);
01020: //org.flexdock.docking.DockingManager.setSplitProportion(viewDocumentStructure.getComponent(), 0.5f);
01021:
01022: DockingManager.dock((Dockable) viewLibrary,
01023: (Dockable) viewPropertySheet,
01024: DockingConstants.SOUTH_REGION, 0.5f);
01025: //viewPropertySheet.dock(viewLibrary, DockingConstants.SOUTH_REGION);
01026: //org.flexdock.docking.DockingManager.setSplitProportion(viewLibrary.getComponent(), 0.5f);
01027: //defaultDockingPort.doLayout();
01028:
01029: DockingManager.dock((Dockable) stylesPanleView,
01030: (Dockable) viewLibrary,
01031: DockingConstants.CENTER_REGION);
01032: //viewLibrary.dock(stylesPanleView, DockingConstants.CENTER_REGION);
01033: }
01034:
01035: DockingManager.setAutoPersist(true);
01036:
01037: viewLibrary.setActive(true);
01038: viewFiles.setActive(true);
01039:
01040: // -----------
01041:
01042: //Modified by Felix Firgau for I18n on Feb 8th 2006
01043: //if (sp!=null) sp.updateLoadingStatus(90,"Loading plugins");
01044: if (sp != null)
01045: sp.updateLoadingStatus(90,
01046: it.businesslogic.ireport.util.I18n
01047: .getString("loadingPlugIns",
01048: "Loading plugins"));
01049: //Modification end
01050:
01051: loadPlugins(IREPORT_HOME_DIR + File.separator
01052: + "plugins");
01053:
01054: //it.businesslogic.ireport.util.I18n.setCurrentLocale( properties.getProperty("Language"), properties.getProperty("Country") );
01055:
01056: //Modified by Felix Firgau for I18n on Feb 8th 2006
01057: //if (sp!=null) sp.updateLoadingStatus(95,"Opening files");
01058: if (sp != null)
01059: sp.updateLoadingStatus(95,
01060: it.businesslogic.ireport.util.I18n
01061: .getString("openingFiles",
01062: "Opening files"));
01063: //Modification end
01064:
01065: JReportFrame jrf = null;
01066: if (args.containsKey("files")) {
01067: Iterator iter = ((Collection) args.get("files"))
01068: .iterator();
01069: while (iter.hasNext()) {
01070: try {
01071: File f = (File) iter.next();
01072: //Modified by Felix Firgau for I18n on Feb 8th 2006
01073: //if (sp!=null) sp.updateLoadingStatus(98,"Opening " + f.getName());
01074: if (sp != null)
01075: sp
01076: .updateLoadingStatus(
01077: 98,
01078: it.businesslogic.ireport.util.I18n
01079: .getString(
01080: "opening",
01081: "Opening ")
01082: + f
01083: .getName());
01084: //Modification end
01085:
01086: Report report = new Report(f.getPath());
01087: jrf = openNewReportWindow(report);
01088:
01089: } catch (Exception ex) {
01090: }
01091: }
01092: }
01093:
01094: //jSplitPaneHelp.setDividerSize(6);
01095: //if (rightColumnWidth > 0) jSplitPaneHelp.setDividerLocation(jSplitPaneHelp.getWidth()-8-200);
01096: //dockingContainerRight.setVisible(true);
01097: //dockingContainerRight.setPreferredDividerLocation(jSplitPaneHelp.getDividerLocation());
01098:
01099: try {
01100: if (jrf != null) {
01101: jrf.setSelected(true);
01102: setActiveReportForm(jrf);
01103: } else {
01104: setActiveReportForm(null);
01105: }
01106: } catch (Exception ex) {
01107: }
01108:
01109: if (MainFrame.getMainInstance().getProperties()
01110: .getProperty("enableRMIServer", "false")
01111: .equals("true")
01112: || (args.get("embedded") != null && args
01113: .get("embedded").equals("true"))) {
01114: if (sp != null)
01115: sp
01116: .updateLoadingStatus(
01117: 99,
01118: it.businesslogic.ireport.util.I18n
01119: .getString(
01120: "runningRMIServer",
01121: "Running RMI server... "));
01122: IReportServerImpl.runServer();
01123: //IReportTCPServer.runServer();
01124: }
01125: setCrosstabActive(null);
01126: it.businesslogic.ireport.util.I18n
01127: .setCurrentLocale(properties
01128: .getProperty("Language"),
01129: properties.getProperty("Country"));
01130:
01131: //iR20 installLayer();
01132: if (sp != null)
01133: sp.setVisible(false);
01134:
01135: // Load previous docking state
01136: //try {
01137: // DockingManager.loadLayoutModel();
01138: // DockingManager.restoreLayout();
01139: //} catch(Exception ex) {
01140: // ex.printStackTrace();
01141: //}
01142:
01143: }
01144: }); // End later invocation
01145: //} catch (InvocationTargetException ex) {
01146: // ex.printStackTrace();
01147: //} catch (InterruptedException ex) {
01148: // ex.printStackTrace();
01149: //} // End later invocation
01150:
01151: } catch (Exception ex) {
01152: ex.printStackTrace();
01153: }
01154:
01155: // Other stuffs....
01156: net.sf.jasperreports.engine.util.JRProperties
01157: .setProperty(
01158: "net.sf.jasperreports.query.executer.factory.xmla-mdx",
01159: "net.sf.jasperreports.engine.query.JRXmlaQueryExecuterFactory");
01160:
01161: this .getRootPane().updateUI();
01162:
01163: }
01164:
01165: /**
01166: * Retrieve the first unused mane like untitled_report_XXX
01167: */
01168: public String getFirstNameFree() {
01169: JInternalFrame[] frames = jMDIDesktopPane.getAllFrames();
01170:
01171: for (int k = 1;; k++) {
01172: String name = it.businesslogic.ireport.util.I18n.getString(
01173: "untitledReport", "untitled_report_")
01174: + k;//I18N on April 28th 2006
01175: boolean found = false;
01176: for (int i = 0; i < frames.length; ++i) {
01177: if (frames[i] instanceof JReportFrame) {
01178: JReportFrame jrf = (JReportFrame) frames[i];
01179: if (jrf.getReport().getName()
01180: .equalsIgnoreCase(name)) {
01181: found = true;
01182: break;
01183: }
01184: }
01185: }
01186: if (!found) {
01187: return name;
01188: }
01189: }
01190: }
01191:
01192: public void setFileListActivatedFrame(JReportFrame jrf) {
01193: // remove the frame from the documnets list....
01194: DefaultTreeModel dtm = (DefaultTreeModel) jTreeFiles.getModel();
01195: Enumeration opened_entries = ((DefaultMutableTreeNode) dtm
01196: .getRoot()).children();
01197: while (opened_entries.hasMoreElements()) {
01198: DefaultMutableTreeNode documentEntryNode = (DefaultMutableTreeNode) opened_entries
01199: .nextElement();
01200: if (documentEntryNode.getUserObject() instanceof DocumentTreeEntry) {
01201: DocumentTreeEntry dte = (DocumentTreeEntry) documentEntryNode
01202: .getUserObject();
01203: if (dte.getJrf() == jrf) {
01204: jTreeFiles.setSelectionPath(new TreePath(
01205: new Object[] { dtm.getRoot(),
01206: documentEntryNode }));
01207: jTreeFiles.updateUI();
01208: break;
01209: }
01210: }
01211:
01212: }
01213: }
01214:
01215: public void updateMenuWindowList() {
01216: // Remove all menus...
01217: java.awt.Component[] menus = this .jMenuWindow
01218: .getMenuComponents();
01219: int i = 0;
01220: for (int k = 0; k < menus.length; ++k) {
01221: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
01222: this .jMenuWindow.remove((JMenuItem) menus[k]);
01223: buttonGroupFramesList.remove((JMenuItem) menus[k]);
01224: }
01225: /*&&
01226: ((JRadioButtonMenuItemMDIFrame)menus[k]).getFrame() != null &&
01227: ((JRadioButtonMenuItemMDIFrame)menus[k]).getFrame().isValid() &&
01228: ((JRadioButtonMenuItemMDIFrame)menus[k]).getFrame().isVisible()) {
01229: JRadioButtonMenuItemMDIFrame menuItem = (JRadioButtonMenuItemMDIFrame)menus[k];
01230: menuItem.setText( (i+1) + ".*** " + menuItem.getFrame().getTitle() );
01231: menuItem.setMnemonic((int)(((i+1)+"").charAt(0)) );
01232: menuItem.setFont(new java.awt.Font("Tahoma", 0, 11));
01233: menuItem.setAccelerator( javax.swing.KeyStroke.getKeyStroke((int)(((i+1)+"").charAt(0)),java.awt.Event.META_MASK));
01234: menuItem.updateUI();
01235: i++;
01236:
01237: System.out.println("Menu "+ menuItem.getFrame().getTitle());
01238: }
01239: */
01240: }
01241:
01242: i = 0;
01243: JInternalFrame[] frames = jMDIDesktopPane.getAllFrames();
01244: for (int k = 0; k < frames.length; ++k) {
01245: JRadioButtonMenuItemMDIFrame menuItem = new JRadioButtonMenuItemMDIFrame(
01246: (JMDIFrame) frames[k], frames[k].getTitle());
01247: menuItem.setText((i + 1) + ". "
01248: + menuItem.getFrame().getTitle());
01249: menuItem.setMnemonic((int) (((i + 1) + "").charAt(0)));
01250: menuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
01251: (int) (((i + 1) + "").charAt(0)),
01252: java.awt.Event.META_MASK));
01253: menuItem.updateUI();
01254: menuItem.setSelected(frames[i].isSelected());
01255: this .jMenuWindow.insert(menuItem, this .jMenuWindow
01256: .getMenuComponentCount());
01257: menuItem
01258: .addActionListener(new java.awt.event.ActionListener() {
01259: public void actionPerformed(
01260: java.awt.event.ActionEvent evt) {
01261: jMenuWindowListActionPerformed(evt);
01262: }
01263: });
01264: buttonGroupFramesList.add(menuItem);
01265: i++;
01266: }
01267:
01268: }
01269:
01270: public void jMenuWindowListActionPerformed(
01271: java.awt.event.ActionEvent evt) {
01272: if (evt.getSource() != null
01273: && evt.getSource() instanceof JRadioButtonMenuItemMDIFrame) {
01274: JRadioButtonMenuItemMDIFrame mdm = (JRadioButtonMenuItemMDIFrame) evt
01275: .getSource();
01276: try {
01277:
01278: mdm.getFrame().setSelected(true);
01279: } catch (Exception ex) {
01280: }
01281: }
01282:
01283: }
01284:
01285: public void jMDIDesktopPaneInternalFrameActivated(
01286: InternalFrameActivatedEvent evt) {
01287: if (evt.getJMDIFrame() != null
01288: && evt.getAction() == InternalFrameActivatedEvent.CLOSED) {
01289: // remove the frame from the documnets list....
01290: DefaultTreeModel dtm = (DefaultTreeModel) jTreeFiles
01291: .getModel();
01292: Enumeration opened_entries = ((DefaultMutableTreeNode) dtm
01293: .getRoot()).children();
01294: while (opened_entries.hasMoreElements()) {
01295: DefaultMutableTreeNode documentEntryNode = (DefaultMutableTreeNode) opened_entries
01296: .nextElement();
01297: if (documentEntryNode.getUserObject() instanceof DocumentTreeEntry) {
01298: DocumentTreeEntry dte = (DocumentTreeEntry) documentEntryNode
01299: .getUserObject();
01300: if (dte.getJrf() == evt.getJMDIFrame()) {
01301: ((DefaultMutableTreeNode) dtm.getRoot())
01302: .remove(documentEntryNode);
01303: jTreeFiles.updateUI();
01304:
01305: break;
01306: }
01307: }
01308:
01309: }
01310: // Remove from window list...
01311: java.awt.Component[] menus = this .jMenuWindow
01312: .getMenuComponents();
01313: for (int k = menus.length - 1; k >= 0; --k) {
01314: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame
01315: && ((JRadioButtonMenuItemMDIFrame) menus[k])
01316: .getFrame() == evt.getJMDIFrame()) {
01317: this .jMenuWindow.remove(menus[k]);
01318: }
01319: }
01320: updateMenuWindowList();
01321: return;
01322: }
01323:
01324: if (evt.getJMDIFrame() == null) {
01325: this .setTitle(getRebrandedTitle());
01326: setCrosstabActive(null);
01327: setActiveReportForm(null);
01328: updateMenuWindowList();
01329: return;
01330: }
01331:
01332: this .setTitle(getRebrandedTitle() + " ["
01333: + evt.getJMDIFrame().getTitle() + "]");
01334: jMDIMenuBar.restoreButtonsPosition();
01335: //System.out.println("Value setted!");
01336: if (evt.getJMDIFrame() instanceof JReportFrame) {
01337:
01338: JReportFrame jrf = (JReportFrame) evt.getJMDIFrame();
01339:
01340: if (jrf.getSelectedCrosstabEditorPanel() != null) {
01341: this .jNumberComboBoxZoom.setValue(jrf
01342: .getSelectedCrosstabEditorPanel()
01343: .getZoomFactor() * 100);
01344: } else {
01345: this .jNumberComboBoxZoom
01346: .setValue(jrf.getZoomFactor() * 100);
01347: }
01348:
01349: // Set the fit to page value...
01350: setFileListActivatedFrame(jrf);
01351: //updateFitToPage(jrf);
01352:
01353: // Enable all buttons and menus...
01354: setActiveReportForm(jrf);
01355: if (jrf.getSelectedCrosstabEditorPanel() != null) {
01356: setCrosstabActive(jrf.getSelectedCrosstabEditorPanel()
01357: .getCrosstabElement());
01358: } else {
01359: setCrosstabActive(null);
01360: }
01361: } else {
01362: //System.out.println("Chiusetutte lengthfinestre!");
01363: setCrosstabActive(null);
01364: setActiveReportForm(null);
01365: }
01366: }
01367:
01368: public void renewTitle(JReportFrame jrf) {
01369:
01370: //String title = jrf.getReport().getName() + " "+
01371: // jrf.getReport().getWidth()+"x"+jrf.getReport().getHeight()+" "+
01372: // "(" + (jrf.getReport().getReportChanges()>0 ?"Modified" : "Unchanged") + ") " +
01373: // jrf.getReport().getFilename()+(jrf.getReport().isReadOnly()?" (READ ONLY) ":"");
01374:
01375: // composition of title WxH ( Modified | Unchanged ) [(READ ONLY)]
01376: String title = jrf.getReport().getName()
01377: + " "
01378: + jrf.getReport().getWidth()
01379: + "x"
01380: + jrf.getReport().getHeight()
01381: + " "
01382: + "("
01383: + (jrf.getReport().getReportChanges() > 0 ? I18n
01384: .getString("mainFrame.report.modified",
01385: "Modified") : I18n.getString(
01386: "mainFrame.report.unchanged", "Unchanged"))
01387: + ") "
01388: +
01389: //?"Modified"
01390: //: "Unchanged") + ") " +
01391: jrf.getReport().getFilename()
01392: + (jrf.getReport().isReadOnly() ? " ("
01393: + I18n.getString("mainFrame.report.readOnly",
01394: "READ ONLY") + ") "
01395: //?" (READ ONLY) "
01396: : "");
01397:
01398: this .setTitle(getRebrandedTitle() + " [" + title + "]");
01399: }
01400:
01401: public void setActiveReportForm(JReportFrame jrf) {
01402: boolean enabled = true;
01403: if (jrf == null) {
01404: enabled = false;
01405: } else {
01406: renewTitle(jrf);
01407: }
01408: if (jrf != null && jrf.getReport().isReadOnly()) {
01409: enabled = false;
01410: }
01411:
01412: if (jrf != null) {
01413: java.awt.Component[] menus = this .jMenuWindow
01414: .getMenuComponents();
01415: for (int k = menus.length - 1; k >= 0; --k) {
01416: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame
01417: && ((JRadioButtonMenuItemMDIFrame) menus[k])
01418: .getFrame() == jrf) {
01419: ((JRadioButtonMenuItemMDIFrame) menus[k])
01420: .setSelected(true);
01421: }
01422: }
01423:
01424: }
01425:
01426: this .elementPropertiesDialog.setJReportFrame(jrf);
01427: this .valuesDialog.setJReportFrame(jrf);
01428: this .groupsDialog.setJReportFrame(jrf);
01429: this .bandsDialog.setJReportFrame(jrf);
01430: this .fontsDialog.setJReportFrame(jrf);
01431: this .eventsForm.setJReportFrame(jrf);
01432:
01433: if (jrf == null)
01434: this .reportQueryDialog.setVisible(false);
01435: else
01436: this .reportQueryDialog.setSubDataset(jrf.getReport());
01437:
01438: this .libraryPanel.setJReportFrame(jrf);
01439: this .localeFilesDialog.setJReportFrame(jrf);
01440: //getDocumentStructurePanel().updateDocumentStructureTree( jrf);
01441:
01442: updateUndoMenu(jrf);
01443: updateCutAndPasteMenu(jrf);
01444: // Toolbar...
01445: this .jButtonBands.setEnabled(enabled);
01446: this .jButtonDatabase.setEnabled(enabled);
01447: this .jMenuItemReportQuery2.setEnabled(enabled);
01448: this .jButtonParameters.setEnabled(enabled);
01449: this .jButtonGroups.setEnabled(enabled);
01450: this .jButtonCompiler.setEnabled(enabled);
01451: this .jButtonRun1.setEnabled(enabled);
01452: this .jButtonRun2.setEnabled(enabled);
01453:
01454: boolean frameOpened = false;
01455: if (jrf != null)
01456: frameOpened = true;
01457:
01458: jMenuItemSave.setEnabled(enabled);
01459: jMenuItemSaveAs.setEnabled(frameOpened);
01460: jMenuAdd.setEnabled(enabled);
01461: jMenuItemClose.setEnabled(frameOpened);
01462: jMenuItemCloseAll.setEnabled(frameOpened);
01463: jMenuItemCloseAllExceptThis.setEnabled(frameOpened);
01464: jMenuItemCloseAllExceptThisFromList.setEnabled(frameOpened);
01465: jMenuItemCloseAllFromList.setEnabled(frameOpened);
01466: jMenuItemCloseFromList.setEnabled(frameOpened);
01467: jMenuItemRevertToSaved.setEnabled(enabled);
01468: jMenuItemCompile.setEnabled(frameOpened);
01469: jMenuItemExecute.setEnabled(frameOpened);
01470: jMenuItemExecuteDB.setEnabled(frameOpened);
01471: jMenuWindow.setEnabled(frameOpened);
01472: jButtonLens1.setEnabled(frameOpened);
01473: jButtonLens2.setEnabled(frameOpened);
01474: jNumberComboBoxZoom.setEnabled(frameOpened);
01475: jMenuItemPrint.setEnabled(frameOpened);
01476:
01477: // Enable or disable all element in toolbars...
01478: for (int cc = 0; cc < jToolBarText.getComponentCount(); ++cc) {
01479: java.awt.Component component = jToolBarText
01480: .getComponentAtIndex(cc);
01481: if (component instanceof javax.swing.JButton) {
01482: ((javax.swing.JButton) component).setEnabled(enabled);
01483: } else if (component instanceof javax.swing.JComboBox) {
01484: ((javax.swing.JComboBox) component).setEnabled(enabled);
01485: } else if (component instanceof JBoxButton) {
01486: ((JBoxButton) component).setEnabled(enabled);
01487: }
01488: }
01489:
01490: // Enable or disable all element in toolbars...
01491: for (int cc = 0; cc < jToolBarFormat.getComponentCount(); ++cc) {
01492: java.awt.Component component = jToolBarFormat
01493: .getComponentAtIndex(cc);
01494: if (component instanceof javax.swing.JButton) {
01495: ((javax.swing.JButton) component).setEnabled(enabled);
01496: } else if (component instanceof javax.swing.JComboBox) {
01497: ((javax.swing.JComboBox) component).setEnabled(enabled);
01498: } else if (component instanceof javax.swing.JToggleButton) {
01499: ((javax.swing.JToggleButton) component)
01500: .setEnabled(enabled);
01501: }
01502: }
01503: /*
01504: this.jButtonAlignLeft.setEnabled(enabled);
01505: this.jButtonAlignCenter.setEnabled(enabled);
01506: this.jButtonAlignRight.setEnabled(enabled);
01507: this.jButtonAlignJustify.setEnabled(enabled);
01508: */
01509:
01510: this .jToggleButtonEllipseTool.setEnabled(enabled);
01511: this .jToggleButtonImageTool.setEnabled(enabled);
01512: this .jToggleButtonLineTool.setEnabled(enabled);
01513:
01514: this .jToggleButtonPointer.setEnabled(enabled);
01515: //this.jToggleButtonRectRoundTool.setEnabled(enabled);
01516: this .jToggleButtonRectTool.setEnabled(enabled);
01517: this .jButtonSave.setEnabled(enabled);
01518: this .jToggleButtonStaticTextTool.setEnabled(enabled);
01519: this .jToggleButtonFrameTool.setEnabled(enabled);
01520: this .jToggleButtonSubreportTool.setEnabled(enabled);
01521: this .jToggleButtonCrosstabTool.setEnabled(enabled);
01522: this .jToggleButtonChartTool.setEnabled(enabled);
01523: this .jToggleButtonBarcodeTool.setEnabled(enabled);
01524: this .jToggleButtonTextFieldTool.setEnabled(enabled);
01525: this .jMenuItemXMLSource.setEnabled(enabled);
01526: this .jCheckBoxMenuItemEMM.setEnabled(enabled);
01527: this .jCheckBoxMenuItemReportVirtualizer.setEnabled(enabled);
01528: this .jCheckBoxMenuItemIgnorePagination.setEnabled(enabled);
01529: this .jCheckBoxMenuItemGrid.setEnabled(enabled);
01530: this .jCheckBoxMenuItemSnapToGrid.setEnabled(enabled);
01531: this .jMenuAdd.setEnabled(enabled);
01532:
01533: this .jMenuItemInsertPageBreak.setEnabled(enabled);
01534: this .jMenuItemBands.setEnabled(enabled);
01535: this .jMenuItemGroups.setEnabled(enabled);
01536: this .jMenuItemReportProperties.setEnabled(enabled);
01537: this .jMenuItemProperties.setEnabled(enabled);
01538: this .jMenuItemElementProperties.setEnabled(enabled);
01539: this .jMenuItemFields.setEnabled(enabled);
01540: this .jMenuItemAddGroup.setEnabled(enabled);
01541: this .jMenuItemVariables.setEnabled(enabled);
01542: this .jMenuItemSubDataset.setEnabled(enabled);
01543: this .jMenuItemSubDataset1.setEnabled(enabled);
01544: this .jMenuItemParameters.setEnabled(enabled);
01545: this .jMenuItemReportQuery.setEnabled(enabled);
01546: this .jMenuItemReportQuery2.setEnabled(enabled);
01547: this .jMenuItemFonts.setEnabled(enabled);
01548: this .jMenuItemStyles.setEnabled(enabled);
01549: this .jMenuItemScriptletEditor.setEnabled(enabled);
01550: //this.jMenuItemReportSeries.setEnabled(enabled);
01551: this .jMenuItemReportImports.setEnabled(enabled);
01552: this .jMenuInternationalization.setEnabled(enabled);
01553: this .jMenuItemRemoveMargins.setEnabled(enabled);
01554:
01555: jMDIDesktopPane
01556: .setPreferredSize(new java.awt.Dimension(100, 10));
01557: jMDIDesktopPane.setMinimumSize(new java.awt.Dimension(100, 10));
01558: //jMDIDesktopPane.setPreferredSize(new Dimension(100,100));
01559: setActiveTool(this .jToggleButtonPointer);
01560: if (!enabled) {
01561: this .jToggleButtonPointer.setSelected(false);
01562: }
01563: if (jrf != null) {
01564: Report r = jrf.getReport();
01565: if (r.isModified()) {
01566: this .enableSaveSpecific();
01567: this .enableSaveAllSpecific();
01568: //end if report modified
01569: } else {
01570: this .disableSaveSpecific();
01571: if (this .isSaveAllRequired()) {
01572: this .enableSaveAllSpecific();
01573: } else {
01574: this .disableSaveAllSpecific();
01575: }
01576: //end else report modified
01577: }
01578: }//end if jrf is null
01579:
01580: fireReportFrameActivatedListenerReportFrameActivated(new ReportFrameActivatedEvent(
01581: this , jrf));
01582:
01583: }//end setActiveReportForm
01584:
01585: public boolean isEMMActive() {
01586: return this .jCheckBoxMenuItemEMM.isSelected();
01587: }
01588:
01589: public boolean isUseReportVirtualizer() {
01590: return this .jCheckBoxMenuItemReportVirtualizer.isSelected();
01591: }
01592:
01593: public boolean isIgnorePagination() {
01594: return this .jCheckBoxMenuItemIgnorePagination.isSelected();
01595: }
01596:
01597: public void setActiveTool(int tool) {
01598: if (tool == 0)
01599: setActiveTool(this .jToggleButtonPointer);
01600: }
01601:
01602: private void setActiveTool(java.awt.Component tool) {
01603: try {
01604: this .jToggleButtonEllipseTool
01605: .setSelected((tool == this .jToggleButtonEllipseTool));
01606: this .jToggleButtonImageTool
01607: .setSelected((tool == this .jToggleButtonImageTool));
01608: this .jToggleButtonLineTool
01609: .setSelected((tool == this .jToggleButtonLineTool));
01610: this .jToggleButtonPointer
01611: .setSelected((tool == this .jToggleButtonPointer));
01612: //this.jToggleButtonRectRoundTool.setSelected( (tool ==this.jToggleButtonRectRoundTool) );
01613: this .jToggleButtonRectTool
01614: .setSelected((tool == this .jToggleButtonRectTool));
01615: this .jToggleButtonStaticTextTool
01616: .setSelected((tool == this .jToggleButtonStaticTextTool));
01617: this .jToggleButtonFrameTool
01618: .setSelected((tool == this .jToggleButtonFrameTool));
01619: this .jToggleButtonSubreportTool
01620: .setSelected((tool == this .jToggleButtonSubreportTool));
01621: this .jToggleButtonCrosstabTool
01622: .setSelected((tool == this .jToggleButtonCrosstabTool));
01623: this .jToggleButtonChartTool
01624: .setSelected((tool == this .jToggleButtonChartTool));
01625: this .jToggleButtonBarcodeTool
01626: .setSelected((tool == this .jToggleButtonBarcodeTool));
01627: this .jToggleButtonTextFieldTool
01628: .setSelected((tool == this .jToggleButtonTextFieldTool));
01629: } catch (Exception ex) {
01630: /* Do nothing */
01631: }
01632: }
01633:
01634: // Robert says:
01635: // As Fit To Page is calculated every time is it called,
01636: // There is not need for this method
01637: // Giulio do you agree?
01638:
01639: public void updateFitToPage(JReportFrame jrf) {
01640: int w = jrf.getReport().getWidth();
01641: double s = (jrf.getReportPanel().getWidth() - 20) / (double) w;
01642: jNumberComboBoxZoom.addEntry("Fit to page", s * 100);
01643: }
01644:
01645: /** This method is called from within the constructor to
01646: * initialize the form.
01647: * WARNING: Do NOT modify this code. The content of this method is
01648: * always regenerated by the Form Editor.
01649: */
01650: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
01651: private void initComponents() {
01652:
01653: buttonGroupExportType = new javax.swing.ButtonGroup();
01654: buttonGroupFramesList = new javax.swing.ButtonGroup();
01655: jPopupMenuThreads = new javax.swing.JPopupMenu();
01656: jMenuItemKill = new javax.swing.JMenuItem();
01657: jPopupMenuFiles = new javax.swing.JPopupMenu();
01658: jMenuItemSaveFromList = new javax.swing.JMenuItem();
01659: jMenuItemSaveAsFromList = new javax.swing.JMenuItem();
01660: jMenuItemSaveAllFromList = new javax.swing.JMenuItem();
01661: jSeparator24 = new javax.swing.JSeparator();
01662: jMenuItemCloseFromList = new javax.swing.JMenuItem();
01663: jMenuItemCloseAllFromList = new javax.swing.JMenuItem();
01664: jMenuItemCloseAllExceptThisFromList = new javax.swing.JMenuItem();
01665: jSeparator27 = new javax.swing.JSeparator();
01666: jMenuItemRevertToSavedFromList = new javax.swing.JMenuItem();
01667: jPanelFiles = new javax.swing.JPanel();
01668: jScrollPaneFiles = new javax.swing.JScrollPane();
01669: jTreeFiles = new javax.swing.JTree();
01670: jMDIDesktopPane = new it.businesslogic.ireport.gui.JMDIDesktopPane();
01671: jScrollProcesses = new javax.swing.JScrollPane();
01672: jListThreads = new javax.swing.JList();
01673: jPanel1 = new javax.swing.JPanel();
01674: jToolBarText = new javax.swing.JToolBar();
01675: jComboBoxFont = new javax.swing.JComboBox();
01676: jNumberComboBoxSize = new it.businesslogic.ireport.gui.JNumberComboBox();
01677: jButtonIncreaseSize = new javax.swing.JButton();
01678: jButtonDecreaseSize = new javax.swing.JButton();
01679: jButtonBold = new javax.swing.JButton();
01680: jButtonItalic = new javax.swing.JButton();
01681: jButtonUnderline = new javax.swing.JButton();
01682: jButtonStrikethrought = new javax.swing.JButton();
01683: jButtonAlignLeft = new javax.swing.JButton();
01684: jButtonAlignJustify = new javax.swing.JButton();
01685: jButtonAlignCenter = new javax.swing.JButton();
01686: jButtonAlignRight = new javax.swing.JButton();
01687: jButtonAlignTop = new javax.swing.JButton();
01688: jButtonAlignMiddle = new javax.swing.JButton();
01689: jButtonAlignBottom = new javax.swing.JButton();
01690: jToolBarConnections = jToolbarConnectionPanel.getToolBar();
01691: Filler1 = new javax.swing.JButton();
01692: jPanel2 = new javax.swing.JPanel();
01693: jToolBarFormat = jToolbarFormatPanel.getToolBar();
01694: Filler = new javax.swing.JButton();
01695: jPanelMaster = new javax.swing.JPanel();
01696: jToolBar1 = new javax.swing.JToolBar();
01697: jButtonNew = new javax.swing.JButton();
01698: jButtonWizard = new javax.swing.JButton();
01699: jButtonOpen = new javax.swing.JButton();
01700: jButtonSave = new javax.swing.JButton();
01701: jButtonSaveAll = new javax.swing.JButton();
01702: jSeparator22 = new javax.swing.JSeparator();
01703: jButtonCut = new javax.swing.JButton();
01704: jButtonCopy = new javax.swing.JButton();
01705: jButtonPaste = new javax.swing.JButton();
01706: jSeparator23 = new javax.swing.JSeparator();
01707: jToggleButtonPointer = new javax.swing.JToggleButton();
01708: jToggleButtonLineTool = new javax.swing.JToggleButton();
01709: jToggleButtonRectTool = new javax.swing.JToggleButton();
01710: jToggleButtonEllipseTool = new javax.swing.JToggleButton();
01711: jToggleButtonStaticTextTool = new javax.swing.JToggleButton();
01712: jToggleButtonTextFieldTool = new javax.swing.JToggleButton();
01713: jToggleButtonImageTool = new javax.swing.JToggleButton();
01714: jToggleButtonBarcodeTool = new javax.swing.JToggleButton();
01715: jToggleButtonFrameTool = new javax.swing.JToggleButton();
01716: jToggleButtonChartTool = new javax.swing.JToggleButton();
01717: jToggleButtonSubreportTool = new javax.swing.JToggleButton();
01718: jToggleButtonCrosstabTool = new javax.swing.JToggleButton();
01719: jSeparator30 = new javax.swing.JSeparator();
01720: jButtonParameters = new javax.swing.JButton();
01721: jButtonBands = new javax.swing.JButton();
01722: jButtonGroups = new javax.swing.JButton();
01723: jButtonDatabase = new javax.swing.JButton();
01724: jSeparator31 = new javax.swing.JSeparator();
01725: jPanelZoom = new javax.swing.JPanel();
01726: jNumberComboBoxZoom = new it.businesslogic.ireport.gui.JNumberComboBox();
01727: jButtonLens1 = new javax.swing.JButton();
01728: jButtonLens2 = new javax.swing.JButton();
01729: jSeparator32 = new javax.swing.JSeparator();
01730: jButtonCompiler = new javax.swing.JButton();
01731: jButtonRun1 = new javax.swing.JButton();
01732: jButtonRun2 = new javax.swing.JButton();
01733: jMDIMenuBar = new it.businesslogic.ireport.gui.JMDIMenuBar();
01734: jMenuFile = new javax.swing.JMenu();
01735: jMenuItemNewDocument = new javax.swing.JMenuItem();
01736: jMenuItemWizard = new javax.swing.JMenuItem();
01737: jMenuItemOpen = new javax.swing.JMenuItem();
01738: jMenuItemSave = new javax.swing.JMenuItem();
01739: jMenuItemSaveAs = new javax.swing.JMenuItem();
01740: jMenuItemSaveAll = new javax.swing.JMenuItem();
01741: jMenuItemClose = new javax.swing.JMenuItem();
01742: jMenuItemCloseAll = new javax.swing.JMenuItem();
01743: jMenuItemCloseAllExceptThis = new javax.swing.JMenuItem();
01744: jSeparator3 = new javax.swing.JSeparator();
01745: jMenuItemPrint = new javax.swing.JMenuItem();
01746: jMenuItemRevertToSaved = new javax.swing.JMenuItem();
01747: jSeparator16 = new javax.swing.JSeparator();
01748: jMenuRecentFiles = new javax.swing.JMenu();
01749: jSeparator15 = new javax.swing.JSeparator();
01750: jMenuItemQuit = new javax.swing.JMenuItem();
01751: jMenuEdit = new javax.swing.JMenu();
01752: jMenuItemUndo = new javax.swing.JMenuItem();
01753: jMenuItemRedo = new javax.swing.JMenuItem();
01754: jSeparator1 = new javax.swing.JSeparator();
01755: jMenuItemCut = new javax.swing.JMenuItem();
01756: jMenuItemCopy = new javax.swing.JMenuItem();
01757: jMenuItemPaste = new javax.swing.JMenuItem();
01758: jMenuItemDelete = new javax.swing.JMenuItem();
01759: jSeparator2 = new javax.swing.JSeparator();
01760: jMenuItemInsertPageBreak = new javax.swing.JMenuItem();
01761: jMenuAdd = new javax.swing.JMenu();
01762: jMenuItemLine = new javax.swing.JMenuItem();
01763: jMenuItemRectangle = new javax.swing.JMenuItem();
01764: jMenuItemRoundRectangle = new javax.swing.JMenuItem();
01765: jMenuItemEllipse = new javax.swing.JMenuItem();
01766: jMenuItemImage = new javax.swing.JMenuItem();
01767: jMenuItemStaticText = new javax.swing.JMenuItem();
01768: jMenuItemTextField = new javax.swing.JMenuItem();
01769: jMenuItemChart = new javax.swing.JMenuItem();
01770: jMenuItemSubreport = new javax.swing.JMenuItem();
01771: jMenuItemAddGroup = new javax.swing.JMenuItem();
01772: jMenuItemElementProperties = new javax.swing.JMenuItem();
01773: jMenuItemXMLSource = new javax.swing.JMenuItem();
01774: jMenuInternationalization = new javax.swing.JMenu();
01775: jMenuLocaleFiles = new javax.swing.JMenuItem();
01776: jSeparator25 = new javax.swing.JSeparator();
01777: jMenuItemReportProperties = new javax.swing.JMenuItem();
01778: jMenuItemProperties = new javax.swing.JMenuItem();
01779: jMenuItemReportImports = new javax.swing.JMenuItem();
01780: jMenuItemScriptletEditor = new javax.swing.JMenuItem();
01781: jSeparator26 = new javax.swing.JSeparator();
01782: jMenuItemReportQuery = new javax.swing.JMenuItem();
01783: jMenuItemSubDataset = new javax.swing.JMenuItem();
01784: jSeparator28 = new javax.swing.JSeparator();
01785: jMenuItemRemoveMargins = new javax.swing.JMenuItem();
01786: jMenuView = new javax.swing.JMenu();
01787: jCheckBoxMenuItemGrid = new javax.swing.JCheckBoxMenuItem();
01788: jSeparator4 = new javax.swing.JSeparator();
01789: jMenuPanels = new javax.swing.JMenu();
01790: jCheckBoxMenuItemExplorer = new javax.swing.JCheckBoxMenuItem();
01791: jCheckBoxMenuItemDocumentStructure = new javax.swing.JCheckBoxMenuItem();
01792: jCheckBoxMenuItemElementProperties = new javax.swing.JCheckBoxMenuItem();
01793: jCheckBoxMenuItemLibrary = new javax.swing.JCheckBoxMenuItem();
01794: jCheckBoxMenuItemStylesLibrary = new javax.swing.JCheckBoxMenuItem();
01795: jCheckBoxMenuItemOutput = new javax.swing.JCheckBoxMenuItem();
01796: jCheckBoxMenuItemThreadList = new javax.swing.JCheckBoxMenuItem();
01797: jMenuToolBars = new javax.swing.JMenu();
01798: jCheckBoxMenuItemTextFormatting = new javax.swing.JCheckBoxMenuItem();
01799: jCheckBoxMenuItemElementsFormatting = new javax.swing.JCheckBoxMenuItem();
01800: jSeparator12 = new javax.swing.JSeparator();
01801: jMenuItemFields = new javax.swing.JMenuItem();
01802: jMenuItemVariables = new javax.swing.JMenuItem();
01803: jMenuItemParameters = new javax.swing.JMenuItem();
01804: jSeparator6 = new javax.swing.JSeparator();
01805: jMenuItemBands = new javax.swing.JMenuItem();
01806: jMenuItemGroups = new javax.swing.JMenuItem();
01807: jMenuFormat = new javax.swing.JMenu();
01808: jMenuItemStyles = new javax.swing.JMenuItem();
01809: jMenuItemFonts = new javax.swing.JMenuItem();
01810: jSeparator29 = new javax.swing.JSeparator();
01811: jMenuAlign = new javax.swing.JMenu();
01812: jMenuItemAlignLeft = new javax.swing.JMenuItem();
01813: jMenuItemAlignRight = new javax.swing.JMenuItem();
01814: jMenuItemAlignTop = new javax.swing.JMenuItem();
01815: jMenuItemAlignBottom = new javax.swing.JMenuItem();
01816: jSeparator19 = new javax.swing.JSeparator();
01817: jMenuItemAlignVerticalAxis = new javax.swing.JMenuItem();
01818: jMenuItemAlignHorizontalAxis = new javax.swing.JMenuItem();
01819: jSeparator20 = new javax.swing.JSeparator();
01820: jMenuItemAlignToBandTop = new javax.swing.JMenuItem();
01821: jMenuItemAlignToBandBottom = new javax.swing.JMenuItem();
01822: jMenuSize = new javax.swing.JMenu();
01823: jMenuItemSameWidth = new javax.swing.JMenuItem();
01824: jMenuItemSameWidthMax = new javax.swing.JMenuItem();
01825: jMenuItemSameWidthMin = new javax.swing.JMenuItem();
01826: jSeparator17 = new javax.swing.JSeparator();
01827: jMenuItemSameHeight = new javax.swing.JMenuItem();
01828: jMenuItemSameHeightMin = new javax.swing.JMenuItem();
01829: jMenuItemSameHeightMax = new javax.swing.JMenuItem();
01830: jSeparator18 = new javax.swing.JSeparator();
01831: jMenuItemSameSize = new javax.swing.JMenuItem();
01832: jMenuPosition = new javax.swing.JMenu();
01833: jMenuItemCenterH = new javax.swing.JMenuItem();
01834: jMenuItemCenterV = new javax.swing.JMenuItem();
01835: jMenuItemCenterInBand = new javax.swing.JMenuItem();
01836: jMenuItemCenterBackground = new javax.swing.JMenuItem();
01837: jMenuItemJoinLeft = new javax.swing.JMenuItem();
01838: jMenuItemJoinRight = new javax.swing.JMenuItem();
01839: jMenuItemLeftMargin = new javax.swing.JMenuItem();
01840: jMenuItemRightMargin = new javax.swing.JMenuItem();
01841: jSeparator5 = new javax.swing.JSeparator();
01842: jMenuHSpacing = new javax.swing.JMenu();
01843: jMenuItemHSMakeEqual = new javax.swing.JMenuItem();
01844: jMenuItemHSIncrease = new javax.swing.JMenuItem();
01845: jMenuItemHSDecrease = new javax.swing.JMenuItem();
01846: jMenuItemHSRemove = new javax.swing.JMenuItem();
01847: jMenuVSpacing = new javax.swing.JMenu();
01848: jMenuItemVSMakeEqual = new javax.swing.JMenuItem();
01849: jMenuItemVSIncrease = new javax.swing.JMenuItem();
01850: jMenuItemVSDecrease = new javax.swing.JMenuItem();
01851: jMenuItemVSRemove = new javax.swing.JMenuItem();
01852: jMenuItemOrganize = new javax.swing.JMenuItem();
01853: jSeparator8 = new javax.swing.JSeparator();
01854: jMenuItemBringToFront = new javax.swing.JMenuItem();
01855: jMenuItemSendToBack = new javax.swing.JMenuItem();
01856: jMenuDatabase = new javax.swing.JMenu();
01857: jMenuItemConnections = new javax.swing.JMenuItem();
01858: jMenuItemActiveConnection = new javax.swing.JMenuItem();
01859: jSeparator9 = new javax.swing.JSeparator();
01860: jMenuItemReportQuery2 = new javax.swing.JMenuItem();
01861: jMenuItemSubDataset1 = new javax.swing.JMenuItem();
01862: jMenuBuild = new javax.swing.JMenu();
01863: jMenuItemCompile = new javax.swing.JMenuItem();
01864: jSeparator10 = new javax.swing.JSeparator();
01865: jMenuItemExecute = new javax.swing.JMenuItem();
01866: jMenuItemExecuteDB = new javax.swing.JMenuItem();
01867: jSeparator33 = new javax.swing.JSeparator();
01868: jMenuItemCreateFromTemplate = new javax.swing.JMenuItem();
01869: jSeparator11 = new javax.swing.JSeparator();
01870: jRadioButtonMenuItemPreviewPDF = new javax.swing.JRadioButtonMenuItem();
01871: jRadioButtonMenuItemPreviewHTML = new javax.swing.JRadioButtonMenuItem();
01872: jRadioButtonMenuItemPreviewJAVA = new javax.swing.JRadioButtonMenuItem();
01873: jRadioButtonMenuItemPreviewXLS = new javax.swing.JRadioButtonMenuItem();
01874: jRadioButtonMenuItemPreviewXLS2 = new javax.swing.JRadioButtonMenuItem();
01875: jRadioButtonMenuItemPreviewCSV = new javax.swing.JRadioButtonMenuItem();
01876: jRadioButtonMenuItemPreviewTXT = new javax.swing.JRadioButtonMenuItem();
01877: jRadioButtonMenuItemPreviewTXTJR = new javax.swing.JRadioButtonMenuItem();
01878: jRadioButtonMenuItemPreviewRTF = new javax.swing.JRadioButtonMenuItem();
01879: jRadioButtonMenuItemPreviewODF = new javax.swing.JRadioButtonMenuItem();
01880: jRadioButtonMenuItemPreviewFLASH = new javax.swing.JRadioButtonMenuItem();
01881: jRadioButtonMenuItemPreviewInternalViewer = new javax.swing.JRadioButtonMenuItem();
01882: jSeparator14 = new javax.swing.JSeparator();
01883: jMenuItemActiveConnection1 = new javax.swing.JMenuItem();
01884: jMenuItemReportLocale = new javax.swing.JMenuItem();
01885: jMenuItemReportTimeZone = new javax.swing.JMenuItem();
01886: jCheckBoxMenuItemIgnorePagination = new javax.swing.JCheckBoxMenuItem();
01887: jMenuItemMaxRecords = new javax.swing.JMenuItem();
01888: jCheckBoxMenuItemReportVirtualizer = new javax.swing.JCheckBoxMenuItem();
01889: jMenuTools = new javax.swing.JMenu();
01890: jCheckBoxMenuItemSnapToGrid = new javax.swing.JCheckBoxMenuItem();
01891: jCheckBoxMenuItemEMM = new javax.swing.JCheckBoxMenuItem();
01892: jSeparator13 = new javax.swing.JSeparator();
01893: jMenuItemOptions = new javax.swing.JMenuItem();
01894: jMenuItemCompatibility = new javax.swing.JMenuItem();
01895: jMenuItemClasspath = new javax.swing.JMenuItem();
01896: jMenuItemFontspath = new javax.swing.JMenuItem();
01897: jMenuItemReloadFonts = new javax.swing.JMenuItem();
01898: jMenuItemExpressions = new javax.swing.JMenuItem();
01899: jMenuItemExportOptions = new javax.swing.JMenuItem();
01900: jMenuItemQueryExecuters = new javax.swing.JMenuItem();
01901: jSeparator7 = new javax.swing.JSeparator();
01902: jMenuItemPluginConfig = new javax.swing.JMenuItem();
01903: jMenuPlugins = new javax.swing.JMenu();
01904: jMenuWindow = new javax.swing.JMenu();
01905: jMenuItemCascade = new javax.swing.JMenuItem();
01906: jMenuItemTileHorizontal = new javax.swing.JMenuItem();
01907: jMenuItemTileVertical = new javax.swing.JMenuItem();
01908: jMenuItemtileAnodine = new javax.swing.JMenuItem();
01909: jMenuItemNextWin = new javax.swing.JMenuItem();
01910: jMenuItemPrevWin = new javax.swing.JMenuItem();
01911: jMenuItemRightSide = new javax.swing.JMenuItem();
01912: jSeparator21 = new javax.swing.JSeparator();
01913: jMenuHelp = new javax.swing.JMenu();
01914: jMenuItemHomePage = new javax.swing.JMenuItem();
01915: jMenuItemHelp = new javax.swing.JMenuItem();
01916: jMenuItemForum = new javax.swing.JMenuItem();
01917: jMenuItemAbout = new javax.swing.JMenuItem();
01918:
01919: jMenuItemKill.setText("Kill this thread");
01920: jMenuItemKill
01921: .addActionListener(new java.awt.event.ActionListener() {
01922: public void actionPerformed(
01923: java.awt.event.ActionEvent evt) {
01924: jMenuItemKillActionPerformed(evt);
01925: }
01926: });
01927: jPopupMenuThreads.add(jMenuItemKill);
01928:
01929: jMenuItemSaveFromList
01930: .setIcon(new javax.swing.ImageIcon(
01931: getClass()
01932: .getResource(
01933: "/it/businesslogic/ireport/icons/menu/save.png"))); // NOI18N
01934: jMenuItemSaveFromList.setMnemonic('s');
01935: jMenuItemSaveFromList.setText("Save");
01936: jMenuItemSaveFromList
01937: .addActionListener(new java.awt.event.ActionListener() {
01938: public void actionPerformed(
01939: java.awt.event.ActionEvent evt) {
01940: jMenuItemSaveFromListActionPerformed(evt);
01941: }
01942: });
01943: jPopupMenuFiles.add(jMenuItemSaveFromList);
01944:
01945: jMenuItemSaveAsFromList
01946: .setIcon(new javax.swing.ImageIcon(
01947: getClass()
01948: .getResource(
01949: "/it/businesslogic/ireport/icons/menu/save.png"))); // NOI18N
01950: jMenuItemSaveAsFromList.setText("Save as...");
01951: jMenuItemSaveAsFromList
01952: .addActionListener(new java.awt.event.ActionListener() {
01953: public void actionPerformed(
01954: java.awt.event.ActionEvent evt) {
01955: jMenuItemSaveAsFromListActionPerformed(evt);
01956: }
01957: });
01958: jPopupMenuFiles.add(jMenuItemSaveAsFromList);
01959:
01960: jMenuItemSaveAllFromList
01961: .setIcon(new javax.swing.ImageIcon(
01962: getClass()
01963: .getResource(
01964: "/it/businesslogic/ireport/icons/menu/saveall.png"))); // NOI18N
01965: jMenuItemSaveAllFromList.setText("Save all");
01966: jMenuItemSaveAllFromList
01967: .addActionListener(new java.awt.event.ActionListener() {
01968: public void actionPerformed(
01969: java.awt.event.ActionEvent evt) {
01970: jMenuItemSaveAllFromListActionPerformed(evt);
01971: }
01972: });
01973: jPopupMenuFiles.add(jMenuItemSaveAllFromList);
01974: jPopupMenuFiles.add(jSeparator24);
01975:
01976: jMenuItemCloseFromList.setText("Close");
01977: jMenuItemCloseFromList
01978: .addActionListener(new java.awt.event.ActionListener() {
01979: public void actionPerformed(
01980: java.awt.event.ActionEvent evt) {
01981: jMenuItemCloseFromListActionPerformed(evt);
01982: }
01983: });
01984: jPopupMenuFiles.add(jMenuItemCloseFromList);
01985:
01986: jMenuItemCloseAllFromList.setText("Close all");
01987: jMenuItemCloseAllFromList
01988: .addActionListener(new java.awt.event.ActionListener() {
01989: public void actionPerformed(
01990: java.awt.event.ActionEvent evt) {
01991: jMenuItemCloseAllFromListActionPerformed(evt);
01992: }
01993: });
01994: jPopupMenuFiles.add(jMenuItemCloseAllFromList);
01995:
01996: jMenuItemCloseAllExceptThisFromList
01997: .setText("Close all except this");
01998: jMenuItemCloseAllExceptThisFromList
01999: .addActionListener(new java.awt.event.ActionListener() {
02000: public void actionPerformed(
02001: java.awt.event.ActionEvent evt) {
02002: jMenuItemCloseAllExceptThisFromListActionPerformed(evt);
02003: }
02004: });
02005: jPopupMenuFiles.add(jMenuItemCloseAllExceptThisFromList);
02006: jPopupMenuFiles.add(jSeparator27);
02007:
02008: jMenuItemRevertToSavedFromList.setText("Revert to saved");
02009: jMenuItemRevertToSavedFromList
02010: .addActionListener(new java.awt.event.ActionListener() {
02011: public void actionPerformed(
02012: java.awt.event.ActionEvent evt) {
02013: jMenuItemRevertToSavedFromListActionPerformed(evt);
02014: }
02015: });
02016: jPopupMenuFiles.add(jMenuItemRevertToSavedFromList);
02017:
02018: jPanelFiles.setBackground(new java.awt.Color(255, 255, 255));
02019: jPanelFiles.setLayout(new java.awt.BorderLayout());
02020:
02021: jScrollPaneFiles
02022: .setBackground(new java.awt.Color(255, 255, 255));
02023: jScrollPaneFiles.setMinimumSize(new java.awt.Dimension(0, 0));
02024: jScrollPaneFiles
02025: .addMouseListener(new java.awt.event.MouseAdapter() {
02026: public void mousePressed(
02027: java.awt.event.MouseEvent evt) {
02028: jScrollPaneFilesMousePressed(evt);
02029: }
02030: });
02031:
02032: jTreeFiles
02033: .addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
02034: public void valueChanged(
02035: javax.swing.event.TreeSelectionEvent evt) {
02036: jTreeFilesValueChanged(evt);
02037: }
02038: });
02039: jTreeFiles.addMouseListener(new java.awt.event.MouseAdapter() {
02040: public void mouseClicked(java.awt.event.MouseEvent evt) {
02041: jTreeFilesMouseClicked(evt);
02042: }
02043:
02044: public void mousePressed(java.awt.event.MouseEvent evt) {
02045: jTreeFilesMousePressed(evt);
02046: }
02047: });
02048: jScrollPaneFiles.setViewportView(jTreeFiles);
02049:
02050: jPanelFiles.add(jScrollPaneFiles, java.awt.BorderLayout.CENTER);
02051:
02052: jListThreads
02053: .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
02054: jListThreads
02055: .addMouseListener(new java.awt.event.MouseAdapter() {
02056: public void mouseClicked(
02057: java.awt.event.MouseEvent evt) {
02058: jListThreadsMouseClicked(evt);
02059: }
02060: });
02061: jScrollProcesses.setViewportView(jListThreads);
02062:
02063: setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
02064: setIconImage(getIconImage());
02065: addWindowStateListener(new java.awt.event.WindowStateListener() {
02066: public void windowStateChanged(
02067: java.awt.event.WindowEvent evt) {
02068: formWindowStateChanged(evt);
02069: }
02070: });
02071: addWindowListener(new java.awt.event.WindowAdapter() {
02072: public void windowActivated(java.awt.event.WindowEvent evt) {
02073: formWindowActivated(evt);
02074: }
02075:
02076: public void windowClosing(java.awt.event.WindowEvent evt) {
02077: exitForm(evt);
02078: }
02079:
02080: public void windowOpened(java.awt.event.WindowEvent evt) {
02081: formWindowOpened(evt);
02082: }
02083: });
02084:
02085: jPanel1.setLayout(new java.awt.BorderLayout());
02086:
02087: jToolBarText.setMinimumSize(new java.awt.Dimension(26, 26));
02088: jToolBarText.setPreferredSize(new java.awt.Dimension(26, 26));
02089:
02090: jComboBoxFont.setFont(new java.awt.Font("Arial", 0, 11));
02091: jComboBoxFont.setEnabled(false);
02092: jComboBoxFont
02093: .setMaximumSize(new java.awt.Dimension(200, 32767));
02094: jComboBoxFont.setPreferredSize(new java.awt.Dimension(200, 20));
02095: jComboBoxFont
02096: .addItemListener(new java.awt.event.ItemListener() {
02097: public void itemStateChanged(
02098: java.awt.event.ItemEvent evt) {
02099: jComboBoxFontItemStateChanged(evt);
02100: }
02101: });
02102: jToolBarText.add(jComboBoxFont);
02103:
02104: jNumberComboBoxSize.setEnabled(false);
02105: jNumberComboBoxSize.setMaximumSize(new java.awt.Dimension(60,
02106: 32767));
02107: jNumberComboBoxSize.setMinimumSize(new java.awt.Dimension(40,
02108: 22));
02109: jNumberComboBoxSize.setPreferredSize(new java.awt.Dimension(40,
02110: 22));
02111: jNumberComboBoxSize
02112: .addItemListener(new java.awt.event.ItemListener() {
02113: public void itemStateChanged(
02114: java.awt.event.ItemEvent evt) {
02115: jNumberComboBoxSizeItemStateChanged(evt);
02116: }
02117: });
02118: jNumberComboBoxSize
02119: .addActionListener(new java.awt.event.ActionListener() {
02120: public void actionPerformed(
02121: java.awt.event.ActionEvent evt) {
02122: jNumberComboBoxSizeActionPerformed(evt);
02123: }
02124: });
02125: jToolBarText.add(jNumberComboBoxSize);
02126:
02127: jButtonIncreaseSize
02128: .setIcon(new javax.swing.ImageIcon(
02129: getClass()
02130: .getResource(
02131: "/it/businesslogic/ireport/icons/toolbars/text/increase_font_size.png"))); // NOI18N
02132: jButtonIncreaseSize.setBorder(null);
02133: jButtonIncreaseSize.setBorderPainted(false);
02134: jButtonIncreaseSize.setEnabled(false);
02135: jButtonIncreaseSize.setFocusPainted(false);
02136: jButtonIncreaseSize.setMargin(new java.awt.Insets(0, 0, 0, 0));
02137: jButtonIncreaseSize.setMinimumSize(new java.awt.Dimension(22,
02138: 22));
02139: jButtonIncreaseSize.setPreferredSize(new java.awt.Dimension(22,
02140: 22));
02141: jButtonIncreaseSize
02142: .addActionListener(new java.awt.event.ActionListener() {
02143: public void actionPerformed(
02144: java.awt.event.ActionEvent evt) {
02145: jButtonIncreaseSizeActionPerformed(evt);
02146: }
02147: });
02148: jToolBarText.add(jButtonIncreaseSize);
02149:
02150: jButtonDecreaseSize
02151: .setIcon(new javax.swing.ImageIcon(
02152: getClass()
02153: .getResource(
02154: "/it/businesslogic/ireport/icons/toolbars/text/decrease_font_size.png"))); // NOI18N
02155: jButtonDecreaseSize.setBorder(null);
02156: jButtonDecreaseSize.setBorderPainted(false);
02157: jButtonDecreaseSize.setEnabled(false);
02158: jButtonDecreaseSize.setFocusPainted(false);
02159: jButtonDecreaseSize.setMargin(new java.awt.Insets(0, 0, 0, 0));
02160: jButtonDecreaseSize.setMinimumSize(new java.awt.Dimension(22,
02161: 22));
02162: jButtonDecreaseSize.setPreferredSize(new java.awt.Dimension(22,
02163: 22));
02164: jButtonDecreaseSize
02165: .addActionListener(new java.awt.event.ActionListener() {
02166: public void actionPerformed(
02167: java.awt.event.ActionEvent evt) {
02168: jButtonDecreaseSizeActionPerformed(evt);
02169: }
02170: });
02171: jToolBarText.add(jButtonDecreaseSize);
02172:
02173: jToolBarText.addSeparator();
02174: jButtonBold
02175: .setIcon(new javax.swing.ImageIcon(
02176: getClass()
02177: .getResource(
02178: "/it/businesslogic/ireport/icons/toolbars/text/bold.png"))); // NOI18N
02179: jButtonBold.setBorder(null);
02180: jButtonBold.setBorderPainted(false);
02181: jButtonBold.setEnabled(false);
02182: jButtonBold.setFocusPainted(false);
02183: jButtonBold.setMargin(new java.awt.Insets(0, 0, 0, 0));
02184: jButtonBold.setMinimumSize(new java.awt.Dimension(22, 22));
02185: jButtonBold.setPreferredSize(new java.awt.Dimension(22, 22));
02186: jButtonBold
02187: .addActionListener(new java.awt.event.ActionListener() {
02188: public void actionPerformed(
02189: java.awt.event.ActionEvent evt) {
02190: jButtonBoldActionPerformed(evt);
02191: }
02192: });
02193: jToolBarText.add(jButtonBold);
02194:
02195: jButtonItalic
02196: .setIcon(new javax.swing.ImageIcon(
02197: getClass()
02198: .getResource(
02199: "/it/businesslogic/ireport/icons/toolbars/text/italic.png"))); // NOI18N
02200: jButtonItalic.setBorder(null);
02201: jButtonItalic.setBorderPainted(false);
02202: jButtonItalic.setEnabled(false);
02203: jButtonItalic.setFocusPainted(false);
02204: jButtonItalic.setMargin(new java.awt.Insets(0, 0, 0, 0));
02205: jButtonItalic.setMinimumSize(new java.awt.Dimension(22, 22));
02206: jButtonItalic.setPreferredSize(new java.awt.Dimension(22, 22));
02207: jButtonItalic
02208: .addActionListener(new java.awt.event.ActionListener() {
02209: public void actionPerformed(
02210: java.awt.event.ActionEvent evt) {
02211: jButtonItalicActionPerformed(evt);
02212: }
02213: });
02214: jToolBarText.add(jButtonItalic);
02215:
02216: jButtonUnderline
02217: .setIcon(new javax.swing.ImageIcon(
02218: getClass()
02219: .getResource(
02220: "/it/businesslogic/ireport/icons/toolbars/text/underline.png"))); // NOI18N
02221: jButtonUnderline.setBorder(null);
02222: jButtonUnderline.setBorderPainted(false);
02223: jButtonUnderline.setEnabled(false);
02224: jButtonUnderline.setFocusPainted(false);
02225: jButtonUnderline.setMargin(new java.awt.Insets(0, 0, 0, 0));
02226: jButtonUnderline.setMinimumSize(new java.awt.Dimension(22, 22));
02227: jButtonUnderline
02228: .setPreferredSize(new java.awt.Dimension(22, 22));
02229: jButtonUnderline
02230: .addActionListener(new java.awt.event.ActionListener() {
02231: public void actionPerformed(
02232: java.awt.event.ActionEvent evt) {
02233: jButtonUnderlineActionPerformed(evt);
02234: }
02235: });
02236: jToolBarText.add(jButtonUnderline);
02237:
02238: jButtonStrikethrought
02239: .setIcon(new javax.swing.ImageIcon(
02240: getClass()
02241: .getResource(
02242: "/it/businesslogic/ireport/icons/toolbars/text/strikethrought.png"))); // NOI18N
02243: jButtonStrikethrought.setBorder(null);
02244: jButtonStrikethrought.setBorderPainted(false);
02245: jButtonStrikethrought.setEnabled(false);
02246: jButtonStrikethrought.setFocusPainted(false);
02247: jButtonStrikethrought
02248: .setMargin(new java.awt.Insets(0, 0, 0, 0));
02249: jButtonStrikethrought.setMinimumSize(new java.awt.Dimension(22,
02250: 22));
02251: jButtonStrikethrought.setPreferredSize(new java.awt.Dimension(
02252: 22, 22));
02253: jButtonStrikethrought
02254: .addActionListener(new java.awt.event.ActionListener() {
02255: public void actionPerformed(
02256: java.awt.event.ActionEvent evt) {
02257: jButtonStrikethroughtActionPerformed(evt);
02258: }
02259: });
02260: jToolBarText.add(jButtonStrikethrought);
02261:
02262: jButtonAlignLeft
02263: .setIcon(new javax.swing.ImageIcon(
02264: getClass()
02265: .getResource(
02266: "/it/businesslogic/ireport/icons/toolbars/text/align_left.png"))); // NOI18N
02267: jButtonAlignLeft.setBorder(null);
02268: jButtonAlignLeft.setBorderPainted(false);
02269: jButtonAlignLeft.setEnabled(false);
02270: jButtonAlignLeft.setFocusPainted(false);
02271: jButtonAlignLeft.setMargin(new java.awt.Insets(0, 0, 0, 0));
02272: jButtonAlignLeft.setMinimumSize(new java.awt.Dimension(22, 22));
02273: jButtonAlignLeft
02274: .setPreferredSize(new java.awt.Dimension(22, 22));
02275: jButtonAlignLeft
02276: .addActionListener(new java.awt.event.ActionListener() {
02277: public void actionPerformed(
02278: java.awt.event.ActionEvent evt) {
02279: jButtonAlignLeftActionPerformed(evt);
02280: }
02281: });
02282: jToolBarText.add(jButtonAlignLeft);
02283:
02284: jButtonAlignJustify
02285: .setIcon(new javax.swing.ImageIcon(
02286: getClass()
02287: .getResource(
02288: "/it/businesslogic/ireport/icons/toolbars/text/align_justified.png"))); // NOI18N
02289: jButtonAlignJustify.setBorder(null);
02290: jButtonAlignJustify.setBorderPainted(false);
02291: jButtonAlignJustify.setEnabled(false);
02292: jButtonAlignJustify.setFocusPainted(false);
02293: jButtonAlignJustify.setMargin(new java.awt.Insets(0, 0, 0, 0));
02294: jButtonAlignJustify.setMinimumSize(new java.awt.Dimension(22,
02295: 22));
02296: jButtonAlignJustify.setPreferredSize(new java.awt.Dimension(22,
02297: 22));
02298: jButtonAlignJustify
02299: .addActionListener(new java.awt.event.ActionListener() {
02300: public void actionPerformed(
02301: java.awt.event.ActionEvent evt) {
02302: jButtonAlignJustifyActionPerformed(evt);
02303: }
02304: });
02305: jToolBarText.add(jButtonAlignJustify);
02306:
02307: jButtonAlignCenter
02308: .setIcon(new javax.swing.ImageIcon(
02309: getClass()
02310: .getResource(
02311: "/it/businesslogic/ireport/icons/toolbars/text/align_center.png"))); // NOI18N
02312: jButtonAlignCenter.setBorder(null);
02313: jButtonAlignCenter.setBorderPainted(false);
02314: jButtonAlignCenter.setEnabled(false);
02315: jButtonAlignCenter.setFocusPainted(false);
02316: jButtonAlignCenter.setMargin(new java.awt.Insets(0, 0, 0, 0));
02317: jButtonAlignCenter
02318: .setMinimumSize(new java.awt.Dimension(22, 22));
02319: jButtonAlignCenter.setPreferredSize(new java.awt.Dimension(22,
02320: 22));
02321: jButtonAlignCenter
02322: .addActionListener(new java.awt.event.ActionListener() {
02323: public void actionPerformed(
02324: java.awt.event.ActionEvent evt) {
02325: jButtonAlignCenterActionPerformed(evt);
02326: }
02327: });
02328: jToolBarText.add(jButtonAlignCenter);
02329:
02330: jButtonAlignRight
02331: .setIcon(new javax.swing.ImageIcon(
02332: getClass()
02333: .getResource(
02334: "/it/businesslogic/ireport/icons/toolbars/text/align_right.png"))); // NOI18N
02335: jButtonAlignRight.setBorder(null);
02336: jButtonAlignRight.setBorderPainted(false);
02337: jButtonAlignRight.setEnabled(false);
02338: jButtonAlignRight.setFocusPainted(false);
02339: jButtonAlignRight.setMargin(new java.awt.Insets(0, 0, 0, 0));
02340: jButtonAlignRight
02341: .setMinimumSize(new java.awt.Dimension(22, 22));
02342: jButtonAlignRight.setPreferredSize(new java.awt.Dimension(22,
02343: 22));
02344: jButtonAlignRight
02345: .addActionListener(new java.awt.event.ActionListener() {
02346: public void actionPerformed(
02347: java.awt.event.ActionEvent evt) {
02348: jButtonAlignRightActionPerformed(evt);
02349: }
02350: });
02351: jToolBarText.add(jButtonAlignRight);
02352:
02353: jToolBarText.addSeparator();
02354: jButtonAlignTop
02355: .setIcon(new javax.swing.ImageIcon(
02356: getClass()
02357: .getResource(
02358: "/it/businesslogic/ireport/icons/toolbars/text/align_top.png"))); // NOI18N
02359: jButtonAlignTop.setBorder(null);
02360: jButtonAlignTop.setBorderPainted(false);
02361: jButtonAlignTop.setEnabled(false);
02362: jButtonAlignTop.setFocusPainted(false);
02363: jButtonAlignTop.setMargin(new java.awt.Insets(0, 0, 0, 0));
02364: jButtonAlignTop.setMinimumSize(new java.awt.Dimension(22, 22));
02365: jButtonAlignTop
02366: .setPreferredSize(new java.awt.Dimension(22, 22));
02367: jButtonAlignTop
02368: .addActionListener(new java.awt.event.ActionListener() {
02369: public void actionPerformed(
02370: java.awt.event.ActionEvent evt) {
02371: jButtonAlignTopActionPerformed(evt);
02372: }
02373: });
02374: jToolBarText.add(jButtonAlignTop);
02375:
02376: jButtonAlignMiddle
02377: .setIcon(new javax.swing.ImageIcon(
02378: getClass()
02379: .getResource(
02380: "/it/businesslogic/ireport/icons/toolbars/text/align_middle.png"))); // NOI18N
02381: jButtonAlignMiddle.setBorder(null);
02382: jButtonAlignMiddle.setBorderPainted(false);
02383: jButtonAlignMiddle.setEnabled(false);
02384: jButtonAlignMiddle.setFocusPainted(false);
02385: jButtonAlignMiddle.setMargin(new java.awt.Insets(0, 0, 0, 0));
02386: jButtonAlignMiddle
02387: .setMinimumSize(new java.awt.Dimension(22, 22));
02388: jButtonAlignMiddle.setPreferredSize(new java.awt.Dimension(22,
02389: 22));
02390: jButtonAlignMiddle
02391: .addActionListener(new java.awt.event.ActionListener() {
02392: public void actionPerformed(
02393: java.awt.event.ActionEvent evt) {
02394: jButtonAlignMiddleActionPerformed(evt);
02395: }
02396: });
02397: jToolBarText.add(jButtonAlignMiddle);
02398:
02399: jButtonAlignBottom
02400: .setIcon(new javax.swing.ImageIcon(
02401: getClass()
02402: .getResource(
02403: "/it/businesslogic/ireport/icons/toolbars/text/align_bottom.png"))); // NOI18N
02404: jButtonAlignBottom.setBorder(null);
02405: jButtonAlignBottom.setBorderPainted(false);
02406: jButtonAlignBottom.setEnabled(false);
02407: jButtonAlignBottom.setFocusPainted(false);
02408: jButtonAlignBottom.setMargin(new java.awt.Insets(0, 0, 0, 0));
02409: jButtonAlignBottom
02410: .setMinimumSize(new java.awt.Dimension(22, 22));
02411: jButtonAlignBottom.setPreferredSize(new java.awt.Dimension(22,
02412: 22));
02413: jButtonAlignBottom
02414: .addActionListener(new java.awt.event.ActionListener() {
02415: public void actionPerformed(
02416: java.awt.event.ActionEvent evt) {
02417: jButtonAlignBottomActionPerformed(evt);
02418: }
02419: });
02420: jToolBarText.add(jButtonAlignBottom);
02421:
02422: Filler1.setBackground(new java.awt.Color(255, 255, 255));
02423: Filler1
02424: .setIcon(new javax.swing.ImageIcon(
02425: getClass()
02426: .getResource(
02427: "/it/businesslogic/ireport/icons/menu/null.gif"))); // NOI18N
02428: Filler1.setBorderPainted(false);
02429: Filler1.setContentAreaFilled(false);
02430: Filler1.setEnabled(false);
02431: Filler1.setFocusPainted(false);
02432: Filler1.setFocusable(false);
02433: Filler1.setMargin(new java.awt.Insets(0, 0, 0, 0));
02434: Filler1.setMaximumSize(new java.awt.Dimension(0, 22));
02435: Filler1.setMinimumSize(new java.awt.Dimension(0, 22));
02436: Filler1.setPreferredSize(new java.awt.Dimension(0, 22));
02437: jToolBarConnections.add(Filler1);
02438:
02439: jToolBarText.add(jToolBarConnections);
02440:
02441: jPanel1.add(jToolBarText, java.awt.BorderLayout.NORTH);
02442:
02443: jPanel2.setLayout(new java.awt.BorderLayout());
02444:
02445: Filler.setBackground(new java.awt.Color(255, 255, 255));
02446: Filler
02447: .setIcon(new javax.swing.ImageIcon(
02448: getClass()
02449: .getResource(
02450: "/it/businesslogic/ireport/icons/menu/null.gif"))); // NOI18N
02451: Filler.setBorderPainted(false);
02452: Filler.setContentAreaFilled(false);
02453: Filler.setEnabled(false);
02454: Filler.setFocusPainted(false);
02455: Filler.setFocusable(false);
02456: Filler.setMargin(new java.awt.Insets(0, 0, 0, 0));
02457: Filler.setMaximumSize(new java.awt.Dimension(0, 22));
02458: Filler.setMinimumSize(new java.awt.Dimension(0, 22));
02459: Filler.setPreferredSize(new java.awt.Dimension(0, 22));
02460: jToolBarFormat.add(Filler);
02461:
02462: jPanel2.add(jToolBarFormat, java.awt.BorderLayout.NORTH);
02463:
02464: jPanelMaster.setMinimumSize(new java.awt.Dimension(750, 100));
02465: jPanelMaster.setPreferredSize(new java.awt.Dimension(750, 550));
02466: jPanelMaster
02467: .addMouseListener(new java.awt.event.MouseAdapter() {
02468: public void mouseClicked(
02469: java.awt.event.MouseEvent evt) {
02470: jPanelMasterMouseClicked(evt);
02471: }
02472: });
02473: jPanelMaster.setLayout(new java.awt.BorderLayout());
02474: jPanel2.add(jPanelMaster, java.awt.BorderLayout.CENTER);
02475:
02476: jPanel1.add(jPanel2, java.awt.BorderLayout.CENTER);
02477:
02478: getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
02479:
02480: jButtonNew
02481: .setIcon(new javax.swing.ImageIcon(
02482: getClass()
02483: .getResource(
02484: "/it/businesslogic/ireport/icons/newtoolbar/new.png"))); // NOI18N
02485: jButtonNew.setToolTipText("New report");
02486: jButtonNew.setBorder(null);
02487: jButtonNew.setBorderPainted(false);
02488: jButtonNew.setMaximumSize(new java.awt.Dimension(22, 22));
02489: jButtonNew.setMinimumSize(new java.awt.Dimension(22, 22));
02490: jButtonNew.setPreferredSize(new java.awt.Dimension(22, 22));
02491: jButtonNew
02492: .addActionListener(new java.awt.event.ActionListener() {
02493: public void actionPerformed(
02494: java.awt.event.ActionEvent evt) {
02495: jButtonNewActionPerformed(evt);
02496: }
02497: });
02498: jToolBar1.add(jButtonNew);
02499:
02500: jButtonWizard
02501: .setIcon(new javax.swing.ImageIcon(
02502: getClass()
02503: .getResource(
02504: "/it/businesslogic/ireport/icons/newtoolbar/wizard.png"))); // NOI18N
02505: jButtonWizard.setToolTipText("New report");
02506: jButtonWizard.setBorder(null);
02507: jButtonWizard.setBorderPainted(false);
02508: jButtonWizard.setMaximumSize(new java.awt.Dimension(22, 22));
02509: jButtonWizard.setMinimumSize(new java.awt.Dimension(22, 22));
02510: jButtonWizard.setPreferredSize(new java.awt.Dimension(22, 22));
02511: jButtonWizard
02512: .addActionListener(new java.awt.event.ActionListener() {
02513: public void actionPerformed(
02514: java.awt.event.ActionEvent evt) {
02515: jButtonNewActionPerformed1(evt);
02516: }
02517: });
02518: jToolBar1.add(jButtonWizard);
02519:
02520: jButtonOpen
02521: .setIcon(new javax.swing.ImageIcon(
02522: getClass()
02523: .getResource(
02524: "/it/businesslogic/ireport/icons/newtoolbar/open.png"))); // NOI18N
02525: jButtonOpen.setToolTipText("Open report");
02526: jButtonOpen.setBorder(null);
02527: jButtonOpen.setBorderPainted(false);
02528: jButtonOpen.setMaximumSize(new java.awt.Dimension(22, 22));
02529: jButtonOpen.setMinimumSize(new java.awt.Dimension(22, 22));
02530: jButtonOpen.setPreferredSize(new java.awt.Dimension(22, 22));
02531: jButtonOpen
02532: .addActionListener(new java.awt.event.ActionListener() {
02533: public void actionPerformed(
02534: java.awt.event.ActionEvent evt) {
02535: jButtonOpenActionPerformed(evt);
02536: }
02537: });
02538: jToolBar1.add(jButtonOpen);
02539:
02540: jButtonSave
02541: .setIcon(new javax.swing.ImageIcon(
02542: getClass()
02543: .getResource(
02544: "/it/businesslogic/ireport/icons/newtoolbar/save.png"))); // NOI18N
02545: jButtonSave.setToolTipText("Save report");
02546: jButtonSave.setBorder(null);
02547: jButtonSave.setBorderPainted(false);
02548: jButtonSave.setEnabled(false);
02549: jButtonSave.setMaximumSize(new java.awt.Dimension(22, 22));
02550: jButtonSave.setMinimumSize(new java.awt.Dimension(22, 22));
02551: jButtonSave.setPreferredSize(new java.awt.Dimension(22, 22));
02552: jButtonSave
02553: .addActionListener(new java.awt.event.ActionListener() {
02554: public void actionPerformed(
02555: java.awt.event.ActionEvent evt) {
02556: jButtonSaveActionPerformed(evt);
02557: }
02558: });
02559: jToolBar1.add(jButtonSave);
02560:
02561: jButtonSaveAll
02562: .setIcon(new javax.swing.ImageIcon(
02563: getClass()
02564: .getResource(
02565: "/it/businesslogic/ireport/icons/newtoolbar/saveall.png"))); // NOI18N
02566: jButtonSaveAll.setToolTipText("Save report");
02567: jButtonSaveAll.setBorder(null);
02568: jButtonSaveAll.setBorderPainted(false);
02569: jButtonSaveAll.setEnabled(false);
02570: jButtonSaveAll.setMaximumSize(new java.awt.Dimension(22, 22));
02571: jButtonSaveAll.setMinimumSize(new java.awt.Dimension(22, 22));
02572: jButtonSaveAll.setPreferredSize(new java.awt.Dimension(22, 22));
02573: jButtonSaveAll
02574: .addActionListener(new java.awt.event.ActionListener() {
02575: public void actionPerformed(
02576: java.awt.event.ActionEvent evt) {
02577: jButtonSaveActionPerformed1(evt);
02578: }
02579: });
02580: jToolBar1.add(jButtonSaveAll);
02581:
02582: jSeparator22
02583: .setOrientation(javax.swing.SwingConstants.VERTICAL);
02584: jSeparator22.setMaximumSize(new java.awt.Dimension(2, 20));
02585: jSeparator22.setMinimumSize(new java.awt.Dimension(2, 2));
02586: jSeparator22.setPreferredSize(new java.awt.Dimension(2, 20));
02587: jToolBar1.add(jSeparator22);
02588:
02589: jButtonCut
02590: .setIcon(new javax.swing.ImageIcon(
02591: getClass()
02592: .getResource(
02593: "/it/businesslogic/ireport/icons/newtoolbar/cut.png"))); // NOI18N
02594: jButtonCut.setToolTipText("Cut");
02595: jButtonCut.setBorder(null);
02596: jButtonCut.setBorderPainted(false);
02597: jButtonCut.setEnabled(false);
02598: jButtonCut.setMaximumSize(new java.awt.Dimension(22, 22));
02599: jButtonCut.setMinimumSize(new java.awt.Dimension(22, 22));
02600: jButtonCut.setPreferredSize(new java.awt.Dimension(22, 22));
02601: jButtonCut
02602: .addActionListener(new java.awt.event.ActionListener() {
02603: public void actionPerformed(
02604: java.awt.event.ActionEvent evt) {
02605: jButtonCutActionPerformed(evt);
02606: }
02607: });
02608: jToolBar1.add(jButtonCut);
02609:
02610: jButtonCopy
02611: .setIcon(new javax.swing.ImageIcon(
02612: getClass()
02613: .getResource(
02614: "/it/businesslogic/ireport/icons/newtoolbar/copy.png"))); // NOI18N
02615: jButtonCopy.setToolTipText("Copy");
02616: jButtonCopy.setBorder(null);
02617: jButtonCopy.setBorderPainted(false);
02618: jButtonCopy.setEnabled(false);
02619: jButtonCopy.setMaximumSize(new java.awt.Dimension(22, 22));
02620: jButtonCopy.setMinimumSize(new java.awt.Dimension(22, 22));
02621: jButtonCopy.setPreferredSize(new java.awt.Dimension(22, 22));
02622: jButtonCopy
02623: .addActionListener(new java.awt.event.ActionListener() {
02624: public void actionPerformed(
02625: java.awt.event.ActionEvent evt) {
02626: jButtonCopyActionPerformed(evt);
02627: }
02628: });
02629: jToolBar1.add(jButtonCopy);
02630:
02631: jButtonPaste
02632: .setIcon(new javax.swing.ImageIcon(
02633: getClass()
02634: .getResource(
02635: "/it/businesslogic/ireport/icons/newtoolbar/paste.png"))); // NOI18N
02636: jButtonPaste.setToolTipText("Paste");
02637: jButtonPaste.setBorder(null);
02638: jButtonPaste.setBorderPainted(false);
02639: jButtonPaste.setEnabled(false);
02640: jButtonPaste.setMaximumSize(new java.awt.Dimension(22, 22));
02641: jButtonPaste.setMinimumSize(new java.awt.Dimension(22, 22));
02642: jButtonPaste.setPreferredSize(new java.awt.Dimension(22, 22));
02643: jButtonPaste
02644: .addActionListener(new java.awt.event.ActionListener() {
02645: public void actionPerformed(
02646: java.awt.event.ActionEvent evt) {
02647: jButtonPasteActionPerformed(evt);
02648: }
02649: });
02650: jToolBar1.add(jButtonPaste);
02651:
02652: jSeparator23
02653: .setOrientation(javax.swing.SwingConstants.VERTICAL);
02654: jSeparator23.setMaximumSize(new java.awt.Dimension(2, 20));
02655: jSeparator23.setMinimumSize(new java.awt.Dimension(2, 2));
02656: jSeparator23.setPreferredSize(new java.awt.Dimension(2, 20));
02657: jToolBar1.add(jSeparator23);
02658:
02659: jToggleButtonPointer
02660: .setIcon(new javax.swing.ImageIcon(
02661: getClass()
02662: .getResource(
02663: "/it/businesslogic/ireport/icons/newtoolbar/pointer.png"))); // NOI18N
02664: jToggleButtonPointer.setToolTipText("Pointer");
02665: jToggleButtonPointer.setBorder(null);
02666: jToggleButtonPointer.setBorderPainted(false);
02667: jToggleButtonPointer.setEnabled(false);
02668: jToggleButtonPointer.setMaximumSize(new java.awt.Dimension(22,
02669: 22));
02670: jToggleButtonPointer.setMinimumSize(new java.awt.Dimension(22,
02671: 22));
02672: jToggleButtonPointer.setPreferredSize(new java.awt.Dimension(
02673: 22, 22));
02674: jToggleButtonPointer
02675: .addItemListener(new java.awt.event.ItemListener() {
02676: public void itemStateChanged(
02677: java.awt.event.ItemEvent evt) {
02678: jToggleButtonPointerItemStateChanged(evt);
02679: }
02680: });
02681: jToggleButtonPointer
02682: .addActionListener(new java.awt.event.ActionListener() {
02683: public void actionPerformed(
02684: java.awt.event.ActionEvent evt) {
02685: jToggleButtonPointerActionPerformed(evt);
02686: }
02687: });
02688: jToolBar1.add(jToggleButtonPointer);
02689:
02690: jToggleButtonLineTool
02691: .setIcon(new javax.swing.ImageIcon(
02692: getClass()
02693: .getResource(
02694: "/it/businesslogic/ireport/icons/newtoolbar/line.png"))); // NOI18N
02695: jToggleButtonLineTool.setToolTipText("Line tool");
02696: jToggleButtonLineTool.setBorder(null);
02697: jToggleButtonLineTool.setBorderPainted(false);
02698: jToggleButtonLineTool.setEnabled(false);
02699: jToggleButtonLineTool.setFocusPainted(false);
02700: jToggleButtonLineTool.setMaximumSize(new java.awt.Dimension(22,
02701: 22));
02702: jToggleButtonLineTool.setMinimumSize(new java.awt.Dimension(22,
02703: 22));
02704: jToggleButtonLineTool.setPreferredSize(new java.awt.Dimension(
02705: 22, 22));
02706: jToggleButtonLineTool
02707: .addItemListener(new java.awt.event.ItemListener() {
02708: public void itemStateChanged(
02709: java.awt.event.ItemEvent evt) {
02710: jToggleButtonLineToolItemStateChanged(evt);
02711: }
02712: });
02713: jToggleButtonLineTool
02714: .addActionListener(new java.awt.event.ActionListener() {
02715: public void actionPerformed(
02716: java.awt.event.ActionEvent evt) {
02717: jToggleButtonLineToolActionPerformed(evt);
02718: }
02719: });
02720: jToolBar1.add(jToggleButtonLineTool);
02721:
02722: jToggleButtonRectTool
02723: .setIcon(new javax.swing.ImageIcon(
02724: getClass()
02725: .getResource(
02726: "/it/businesslogic/ireport/icons/newtoolbar/rectangle.png"))); // NOI18N
02727: jToggleButtonRectTool.setToolTipText("Rectangle tool");
02728: jToggleButtonRectTool.setBorder(null);
02729: jToggleButtonRectTool.setBorderPainted(false);
02730: jToggleButtonRectTool.setEnabled(false);
02731: jToggleButtonRectTool.setMaximumSize(new java.awt.Dimension(22,
02732: 22));
02733: jToggleButtonRectTool.setMinimumSize(new java.awt.Dimension(22,
02734: 22));
02735: jToggleButtonRectTool.setPreferredSize(new java.awt.Dimension(
02736: 22, 22));
02737: jToggleButtonRectTool
02738: .addItemListener(new java.awt.event.ItemListener() {
02739: public void itemStateChanged(
02740: java.awt.event.ItemEvent evt) {
02741: jToggleButtonRectToolItemStateChanged(evt);
02742: }
02743: });
02744: jToggleButtonRectTool
02745: .addActionListener(new java.awt.event.ActionListener() {
02746: public void actionPerformed(
02747: java.awt.event.ActionEvent evt) {
02748: jToggleButtonRectToolActionPerformed(evt);
02749: }
02750: });
02751: jToolBar1.add(jToggleButtonRectTool);
02752:
02753: jToggleButtonEllipseTool
02754: .setIcon(new javax.swing.ImageIcon(
02755: getClass()
02756: .getResource(
02757: "/it/businesslogic/ireport/icons/newtoolbar/circle.png"))); // NOI18N
02758: jToggleButtonEllipseTool.setToolTipText("Ellipse tool");
02759: jToggleButtonEllipseTool.setBorder(null);
02760: jToggleButtonEllipseTool.setBorderPainted(false);
02761: jToggleButtonEllipseTool.setEnabled(false);
02762: jToggleButtonEllipseTool.setMaximumSize(new java.awt.Dimension(
02763: 22, 22));
02764: jToggleButtonEllipseTool.setMinimumSize(new java.awt.Dimension(
02765: 22, 22));
02766: jToggleButtonEllipseTool
02767: .setPreferredSize(new java.awt.Dimension(22, 22));
02768: jToggleButtonEllipseTool
02769: .addItemListener(new java.awt.event.ItemListener() {
02770: public void itemStateChanged(
02771: java.awt.event.ItemEvent evt) {
02772: jToggleButtonEllipseToolItemStateChanged(evt);
02773: }
02774: });
02775: jToggleButtonEllipseTool
02776: .addActionListener(new java.awt.event.ActionListener() {
02777: public void actionPerformed(
02778: java.awt.event.ActionEvent evt) {
02779: jToggleButtonEllipseToolActionPerformed(evt);
02780: }
02781: });
02782: jToolBar1.add(jToggleButtonEllipseTool);
02783:
02784: jToggleButtonStaticTextTool
02785: .setIcon(new javax.swing.ImageIcon(
02786: getClass()
02787: .getResource(
02788: "/it/businesslogic/ireport/icons/newtoolbar/text.png"))); // NOI18N
02789: jToggleButtonStaticTextTool.setToolTipText("Static text tool");
02790: jToggleButtonStaticTextTool.setBorder(null);
02791: jToggleButtonStaticTextTool.setBorderPainted(false);
02792: jToggleButtonStaticTextTool.setEnabled(false);
02793: jToggleButtonStaticTextTool
02794: .setMaximumSize(new java.awt.Dimension(22, 22));
02795: jToggleButtonStaticTextTool
02796: .setMinimumSize(new java.awt.Dimension(22, 22));
02797: jToggleButtonStaticTextTool
02798: .setPreferredSize(new java.awt.Dimension(22, 22));
02799: jToggleButtonStaticTextTool
02800: .addItemListener(new java.awt.event.ItemListener() {
02801: public void itemStateChanged(
02802: java.awt.event.ItemEvent evt) {
02803: jToggleButtonStaticTextToolItemStateChanged(evt);
02804: }
02805: });
02806: jToggleButtonStaticTextTool
02807: .addActionListener(new java.awt.event.ActionListener() {
02808: public void actionPerformed(
02809: java.awt.event.ActionEvent evt) {
02810: jToggleButtonStaticTextToolActionPerformed(evt);
02811: }
02812: });
02813: jToolBar1.add(jToggleButtonStaticTextTool);
02814:
02815: jToggleButtonTextFieldTool
02816: .setIcon(new javax.swing.ImageIcon(
02817: getClass()
02818: .getResource(
02819: "/it/businesslogic/ireport/icons/newtoolbar/field.png"))); // NOI18N
02820: jToggleButtonTextFieldTool.setToolTipText("Textfield tool");
02821: jToggleButtonTextFieldTool.setBorder(null);
02822: jToggleButtonTextFieldTool.setBorderPainted(false);
02823: jToggleButtonTextFieldTool.setEnabled(false);
02824: jToggleButtonTextFieldTool
02825: .setMaximumSize(new java.awt.Dimension(22, 22));
02826: jToggleButtonTextFieldTool
02827: .setMinimumSize(new java.awt.Dimension(22, 22));
02828: jToggleButtonTextFieldTool
02829: .setPreferredSize(new java.awt.Dimension(22, 22));
02830: jToggleButtonTextFieldTool
02831: .addItemListener(new java.awt.event.ItemListener() {
02832: public void itemStateChanged(
02833: java.awt.event.ItemEvent evt) {
02834: jToggleButtonTextFieldToolItemStateChanged(evt);
02835: }
02836: });
02837: jToggleButtonTextFieldTool
02838: .addActionListener(new java.awt.event.ActionListener() {
02839: public void actionPerformed(
02840: java.awt.event.ActionEvent evt) {
02841: jToggleButtonTextFieldToolActionPerformed(evt);
02842: }
02843: });
02844: jToolBar1.add(jToggleButtonTextFieldTool);
02845:
02846: jToggleButtonImageTool
02847: .setIcon(new javax.swing.ImageIcon(
02848: getClass()
02849: .getResource(
02850: "/it/businesslogic/ireport/icons/newtoolbar/picture.png"))); // NOI18N
02851: jToggleButtonImageTool.setToolTipText("Image tool");
02852: jToggleButtonImageTool.setBorder(null);
02853: jToggleButtonImageTool.setBorderPainted(false);
02854: jToggleButtonImageTool.setEnabled(false);
02855: jToggleButtonImageTool.setMaximumSize(new java.awt.Dimension(
02856: 22, 22));
02857: jToggleButtonImageTool.setMinimumSize(new java.awt.Dimension(
02858: 22, 22));
02859: jToggleButtonImageTool.setPreferredSize(new java.awt.Dimension(
02860: 22, 22));
02861: jToggleButtonImageTool
02862: .addItemListener(new java.awt.event.ItemListener() {
02863: public void itemStateChanged(
02864: java.awt.event.ItemEvent evt) {
02865: jToggleButtonImageToolItemStateChanged(evt);
02866: }
02867: });
02868: jToggleButtonImageTool
02869: .addActionListener(new java.awt.event.ActionListener() {
02870: public void actionPerformed(
02871: java.awt.event.ActionEvent evt) {
02872: jToggleButtonImageToolActionPerformed(evt);
02873: }
02874: });
02875: jToolBar1.add(jToggleButtonImageTool);
02876:
02877: jToggleButtonBarcodeTool
02878: .setIcon(new javax.swing.ImageIcon(
02879: getClass()
02880: .getResource(
02881: "/it/businesslogic/ireport/icons/newtoolbar/barcode.png"))); // NOI18N
02882: jToggleButtonBarcodeTool.setToolTipText("Barcode tool");
02883: jToggleButtonBarcodeTool.setBorder(null);
02884: jToggleButtonBarcodeTool.setBorderPainted(false);
02885: jToggleButtonBarcodeTool.setEnabled(false);
02886: jToggleButtonBarcodeTool.setMaximumSize(new java.awt.Dimension(
02887: 22, 22));
02888: jToggleButtonBarcodeTool.setMinimumSize(new java.awt.Dimension(
02889: 22, 22));
02890: jToggleButtonBarcodeTool
02891: .setPreferredSize(new java.awt.Dimension(22, 22));
02892: jToggleButtonBarcodeTool
02893: .addItemListener(new java.awt.event.ItemListener() {
02894: public void itemStateChanged(
02895: java.awt.event.ItemEvent evt) {
02896: jToggleButtonBarcodeToolItemStateChanged(evt);
02897: }
02898: });
02899: jToggleButtonBarcodeTool
02900: .addActionListener(new java.awt.event.ActionListener() {
02901: public void actionPerformed(
02902: java.awt.event.ActionEvent evt) {
02903: jToggleButtonBarcodeToolActionPerformed(evt);
02904: }
02905: });
02906: jToolBar1.add(jToggleButtonBarcodeTool);
02907:
02908: jToggleButtonFrameTool
02909: .setIcon(new javax.swing.ImageIcon(
02910: getClass()
02911: .getResource(
02912: "/it/businesslogic/ireport/icons/newtoolbar/frame.png"))); // NOI18N
02913: jToggleButtonFrameTool.setToolTipText("Frame tool");
02914: jToggleButtonFrameTool.setBorder(null);
02915: jToggleButtonFrameTool.setBorderPainted(false);
02916: jToggleButtonFrameTool.setEnabled(false);
02917: jToggleButtonFrameTool.setMaximumSize(new java.awt.Dimension(
02918: 22, 22));
02919: jToggleButtonFrameTool.setMinimumSize(new java.awt.Dimension(
02920: 22, 22));
02921: jToggleButtonFrameTool.setPreferredSize(new java.awt.Dimension(
02922: 22, 22));
02923: jToggleButtonFrameTool
02924: .addItemListener(new java.awt.event.ItemListener() {
02925: public void itemStateChanged(
02926: java.awt.event.ItemEvent evt) {
02927: jToggleButtonFrameToolItemStateChanged(evt);
02928: }
02929: });
02930: jToggleButtonFrameTool
02931: .addActionListener(new java.awt.event.ActionListener() {
02932: public void actionPerformed(
02933: java.awt.event.ActionEvent evt) {
02934: jToggleButtonFrameToolActionPerformed(evt);
02935: }
02936: });
02937: jToolBar1.add(jToggleButtonFrameTool);
02938:
02939: jToggleButtonChartTool
02940: .setIcon(new javax.swing.ImageIcon(
02941: getClass()
02942: .getResource(
02943: "/it/businesslogic/ireport/icons/newtoolbar/chart.png"))); // NOI18N
02944: jToggleButtonChartTool.setToolTipText("Chart tool");
02945: jToggleButtonChartTool.setBorder(null);
02946: jToggleButtonChartTool.setBorderPainted(false);
02947: jToggleButtonChartTool.setEnabled(false);
02948: jToggleButtonChartTool.setMaximumSize(new java.awt.Dimension(
02949: 22, 22));
02950: jToggleButtonChartTool.setMinimumSize(new java.awt.Dimension(
02951: 22, 22));
02952: jToggleButtonChartTool.setPreferredSize(new java.awt.Dimension(
02953: 22, 22));
02954: jToggleButtonChartTool
02955: .addItemListener(new java.awt.event.ItemListener() {
02956: public void itemStateChanged(
02957: java.awt.event.ItemEvent evt) {
02958: jToggleButtonChartToolItemStateChanged(evt);
02959: }
02960: });
02961: jToggleButtonChartTool
02962: .addActionListener(new java.awt.event.ActionListener() {
02963: public void actionPerformed(
02964: java.awt.event.ActionEvent evt) {
02965: jToggleButtonChartToolActionPerformed(evt);
02966: }
02967: });
02968: jToolBar1.add(jToggleButtonChartTool);
02969:
02970: jToggleButtonSubreportTool
02971: .setIcon(new javax.swing.ImageIcon(
02972: getClass()
02973: .getResource(
02974: "/it/businesslogic/ireport/icons/newtoolbar/subreport.png"))); // NOI18N
02975: jToggleButtonSubreportTool.setToolTipText("Subreport tool");
02976: jToggleButtonSubreportTool.setBorder(null);
02977: jToggleButtonSubreportTool.setBorderPainted(false);
02978: jToggleButtonSubreportTool.setEnabled(false);
02979: jToggleButtonSubreportTool
02980: .setMaximumSize(new java.awt.Dimension(22, 22));
02981: jToggleButtonSubreportTool
02982: .setMinimumSize(new java.awt.Dimension(22, 22));
02983: jToggleButtonSubreportTool
02984: .setPreferredSize(new java.awt.Dimension(22, 22));
02985: jToggleButtonSubreportTool
02986: .addItemListener(new java.awt.event.ItemListener() {
02987: public void itemStateChanged(
02988: java.awt.event.ItemEvent evt) {
02989: jToggleButtonSubreportToolItemStateChanged(evt);
02990: }
02991: });
02992: jToggleButtonSubreportTool
02993: .addActionListener(new java.awt.event.ActionListener() {
02994: public void actionPerformed(
02995: java.awt.event.ActionEvent evt) {
02996: jToggleButtonSubreportToolActionPerformed(evt);
02997: }
02998: });
02999: jToolBar1.add(jToggleButtonSubreportTool);
03000:
03001: jToggleButtonCrosstabTool
03002: .setIcon(new javax.swing.ImageIcon(
03003: getClass()
03004: .getResource(
03005: "/it/businesslogic/ireport/icons/newtoolbar/crosstab.png"))); // NOI18N
03006: jToggleButtonCrosstabTool.setToolTipText("Crosstab tool");
03007: jToggleButtonCrosstabTool.setBorder(null);
03008: jToggleButtonCrosstabTool.setBorderPainted(false);
03009: jToggleButtonCrosstabTool.setEnabled(false);
03010: jToggleButtonCrosstabTool
03011: .setMaximumSize(new java.awt.Dimension(22, 22));
03012: jToggleButtonCrosstabTool
03013: .setMinimumSize(new java.awt.Dimension(22, 22));
03014: jToggleButtonCrosstabTool
03015: .setPreferredSize(new java.awt.Dimension(22, 22));
03016: jToggleButtonCrosstabTool
03017: .addItemListener(new java.awt.event.ItemListener() {
03018: public void itemStateChanged(
03019: java.awt.event.ItemEvent evt) {
03020: jToggleButtonCrosstabToolItemStateChanged(evt);
03021: }
03022: });
03023: jToggleButtonCrosstabTool
03024: .addActionListener(new java.awt.event.ActionListener() {
03025: public void actionPerformed(
03026: java.awt.event.ActionEvent evt) {
03027: jToggleButtonCrosstabToolActionPerformed(evt);
03028: }
03029: });
03030: jToolBar1.add(jToggleButtonCrosstabTool);
03031:
03032: jSeparator30
03033: .setOrientation(javax.swing.SwingConstants.VERTICAL);
03034: jSeparator30.setMaximumSize(new java.awt.Dimension(2, 20));
03035: jSeparator30.setMinimumSize(new java.awt.Dimension(2, 2));
03036: jSeparator30.setPreferredSize(new java.awt.Dimension(2, 20));
03037: jToolBar1.add(jSeparator30);
03038:
03039: jButtonParameters
03040: .setIcon(new javax.swing.ImageIcon(
03041: getClass()
03042: .getResource(
03043: "/it/businesslogic/ireport/icons/newtoolbar/values.png"))); // NOI18N
03044: jButtonParameters.setToolTipText("Parameters");
03045: jButtonParameters.setBorder(null);
03046: jButtonParameters.setBorderPainted(false);
03047: jButtonParameters.setEnabled(false);
03048: jButtonParameters
03049: .setMaximumSize(new java.awt.Dimension(22, 22));
03050: jButtonParameters
03051: .setMinimumSize(new java.awt.Dimension(22, 22));
03052: jButtonParameters.setPreferredSize(new java.awt.Dimension(22,
03053: 22));
03054: jButtonParameters
03055: .addActionListener(new java.awt.event.ActionListener() {
03056: public void actionPerformed(
03057: java.awt.event.ActionEvent evt) {
03058: jButtonParametersActionPerformed(evt);
03059: }
03060: });
03061: jToolBar1.add(jButtonParameters);
03062:
03063: jButtonBands
03064: .setIcon(new javax.swing.ImageIcon(
03065: getClass()
03066: .getResource(
03067: "/it/businesslogic/ireport/icons/newtoolbar/bands.png"))); // NOI18N
03068: jButtonBands.setToolTipText("Bands");
03069: jButtonBands.setBorder(null);
03070: jButtonBands.setBorderPainted(false);
03071: jButtonBands.setEnabled(false);
03072: jButtonBands.setMaximumSize(new java.awt.Dimension(22, 22));
03073: jButtonBands.setMinimumSize(new java.awt.Dimension(22, 22));
03074: jButtonBands.setPreferredSize(new java.awt.Dimension(22, 22));
03075: jButtonBands
03076: .addActionListener(new java.awt.event.ActionListener() {
03077: public void actionPerformed(
03078: java.awt.event.ActionEvent evt) {
03079: jButtonBandsActionPerformed(evt);
03080: }
03081: });
03082: jToolBar1.add(jButtonBands);
03083:
03084: jButtonGroups
03085: .setIcon(new javax.swing.ImageIcon(
03086: getClass()
03087: .getResource(
03088: "/it/businesslogic/ireport/icons/newtoolbar/groups.png"))); // NOI18N
03089: jButtonGroups.setToolTipText("Groups");
03090: jButtonGroups.setBorder(null);
03091: jButtonGroups.setBorderPainted(false);
03092: jButtonGroups.setEnabled(false);
03093: jButtonGroups.setMaximumSize(new java.awt.Dimension(22, 22));
03094: jButtonGroups.setMinimumSize(new java.awt.Dimension(22, 22));
03095: jButtonGroups.setPreferredSize(new java.awt.Dimension(22, 22));
03096: jButtonGroups
03097: .addActionListener(new java.awt.event.ActionListener() {
03098: public void actionPerformed(
03099: java.awt.event.ActionEvent evt) {
03100: jButtonGroupsActionPerformed(evt);
03101: }
03102: });
03103: jToolBar1.add(jButtonGroups);
03104:
03105: jButtonDatabase
03106: .setIcon(new javax.swing.ImageIcon(
03107: getClass()
03108: .getResource(
03109: "/it/businesslogic/ireport/icons/newtoolbar/database.png"))); // NOI18N
03110: jButtonDatabase.setToolTipText("Database");
03111: jButtonDatabase.setBorder(null);
03112: jButtonDatabase.setBorderPainted(false);
03113: jButtonDatabase.setEnabled(false);
03114: jButtonDatabase.setMaximumSize(new java.awt.Dimension(22, 22));
03115: jButtonDatabase.setMinimumSize(new java.awt.Dimension(22, 22));
03116: jButtonDatabase
03117: .setPreferredSize(new java.awt.Dimension(22, 22));
03118: jButtonDatabase
03119: .addActionListener(new java.awt.event.ActionListener() {
03120: public void actionPerformed(
03121: java.awt.event.ActionEvent evt) {
03122: jButtonDatabaseActionPerformed(evt);
03123: }
03124: });
03125: jToolBar1.add(jButtonDatabase);
03126:
03127: jSeparator31
03128: .setOrientation(javax.swing.SwingConstants.VERTICAL);
03129: jSeparator31.setMaximumSize(new java.awt.Dimension(2, 20));
03130: jSeparator31.setMinimumSize(new java.awt.Dimension(2, 2));
03131: jSeparator31.setPreferredSize(new java.awt.Dimension(2, 20));
03132: jSeparator31.setRequestFocusEnabled(false);
03133: jToolBar1.add(jSeparator31);
03134:
03135: jPanelZoom.setMaximumSize(new java.awt.Dimension(70, 22));
03136: jPanelZoom.setMinimumSize(new java.awt.Dimension(70, 22));
03137: jPanelZoom.setPreferredSize(new java.awt.Dimension(70, 22));
03138: jPanelZoom.setLayout(new java.awt.BorderLayout());
03139:
03140: jNumberComboBoxZoom.setMaximumRowCount(12);
03141: jNumberComboBoxZoom.setMinimumSize(new java.awt.Dimension(70,
03142: 18));
03143: jNumberComboBoxZoom.setPostfix("%");
03144: jNumberComboBoxZoom.setPreferredSize(new java.awt.Dimension(70,
03145: 22));
03146: jNumberComboBoxZoom
03147: .addActionListener(new java.awt.event.ActionListener() {
03148: public void actionPerformed(
03149: java.awt.event.ActionEvent evt) {
03150: jNumberComboBoxZoomActionPerformed(evt);
03151: }
03152: });
03153: jPanelZoom.add(jNumberComboBoxZoom,
03154: java.awt.BorderLayout.CENTER);
03155:
03156: jToolBar1.add(jPanelZoom);
03157:
03158: jButtonLens1
03159: .setIcon(new javax.swing.ImageIcon(
03160: getClass()
03161: .getResource(
03162: "/it/businesslogic/ireport/icons/newtoolbar/lens_in.png"))); // NOI18N
03163: jButtonLens1.setToolTipText("Zoom in");
03164: jButtonLens1.setBorder(null);
03165: jButtonLens1.setBorderPainted(false);
03166: jButtonLens1.setMaximumSize(new java.awt.Dimension(22, 22));
03167: jButtonLens1.setMinimumSize(new java.awt.Dimension(22, 22));
03168: jButtonLens1.setPreferredSize(new java.awt.Dimension(22, 22));
03169: jButtonLens1
03170: .addActionListener(new java.awt.event.ActionListener() {
03171: public void actionPerformed(
03172: java.awt.event.ActionEvent evt) {
03173: jButtonRun2ActionPerformed1(evt);
03174: }
03175: });
03176: jToolBar1.add(jButtonLens1);
03177: jButtonLens1.getAccessibleContext()
03178: .setAccessibleDescription("");
03179:
03180: jButtonLens2
03181: .setIcon(new javax.swing.ImageIcon(
03182: getClass()
03183: .getResource(
03184: "/it/businesslogic/ireport/icons/newtoolbar/lens_out.png"))); // NOI18N
03185: jButtonLens2.setToolTipText("Zoom out");
03186: jButtonLens2.setBorder(null);
03187: jButtonLens2.setBorderPainted(false);
03188: jButtonLens2.setMaximumSize(new java.awt.Dimension(22, 22));
03189: jButtonLens2.setMinimumSize(new java.awt.Dimension(22, 22));
03190: jButtonLens2.setOpaque(false);
03191: jButtonLens2.setPreferredSize(new java.awt.Dimension(22, 22));
03192: jButtonLens2
03193: .addActionListener(new java.awt.event.ActionListener() {
03194: public void actionPerformed(
03195: java.awt.event.ActionEvent evt) {
03196: jButtonLens1jButtonRun2ActionPerformed1(evt);
03197: }
03198: });
03199: jToolBar1.add(jButtonLens2);
03200:
03201: jSeparator32
03202: .setOrientation(javax.swing.SwingConstants.VERTICAL);
03203: jSeparator32.setMaximumSize(new java.awt.Dimension(2, 20));
03204: jSeparator32.setMinimumSize(new java.awt.Dimension(2, 2));
03205: jSeparator32.setPreferredSize(new java.awt.Dimension(2, 20));
03206: jToolBar1.add(jSeparator32);
03207:
03208: jButtonCompiler
03209: .setIcon(new javax.swing.ImageIcon(
03210: getClass()
03211: .getResource(
03212: "/it/businesslogic/ireport/icons/newtoolbar/compile.png"))); // NOI18N
03213: jButtonCompiler.setToolTipText("Compile the report");
03214: jButtonCompiler.setBorder(null);
03215: jButtonCompiler.setBorderPainted(false);
03216: jButtonCompiler.setEnabled(false);
03217: jButtonCompiler.setMaximumSize(new java.awt.Dimension(22, 22));
03218: jButtonCompiler.setMinimumSize(new java.awt.Dimension(22, 22));
03219: jButtonCompiler
03220: .setPreferredSize(new java.awt.Dimension(22, 22));
03221: jButtonCompiler
03222: .addActionListener(new java.awt.event.ActionListener() {
03223: public void actionPerformed(
03224: java.awt.event.ActionEvent evt) {
03225: jButtonCompilerActionPerformed(evt);
03226: }
03227: });
03228: jToolBar1.add(jButtonCompiler);
03229:
03230: jButtonRun1
03231: .setIcon(new javax.swing.ImageIcon(
03232: getClass()
03233: .getResource(
03234: "/it/businesslogic/ireport/icons/newtoolbar/run1.png"))); // NOI18N
03235: jButtonRun1
03236: .setToolTipText("Run report using an empty datasource");
03237: jButtonRun1.setBorder(null);
03238: jButtonRun1.setBorderPainted(false);
03239: jButtonRun1.setEnabled(false);
03240: jButtonRun1.setMaximumSize(new java.awt.Dimension(22, 22));
03241: jButtonRun1.setMinimumSize(new java.awt.Dimension(22, 22));
03242: jButtonRun1.setPreferredSize(new java.awt.Dimension(22, 22));
03243: jButtonRun1
03244: .addActionListener(new java.awt.event.ActionListener() {
03245: public void actionPerformed(
03246: java.awt.event.ActionEvent evt) {
03247: jButtonRun1ActionPerformed(evt);
03248: }
03249: });
03250: jToolBar1.add(jButtonRun1);
03251:
03252: jButtonRun2
03253: .setIcon(new javax.swing.ImageIcon(
03254: getClass()
03255: .getResource(
03256: "/it/businesslogic/ireport/icons/newtoolbar/run2.png"))); // NOI18N
03257: jButtonRun2.setToolTipText("Run report using a connection");
03258: jButtonRun2.setBorder(null);
03259: jButtonRun2.setBorderPainted(false);
03260: jButtonRun2.setEnabled(false);
03261: jButtonRun2.setMaximumSize(new java.awt.Dimension(22, 22));
03262: jButtonRun2.setMinimumSize(new java.awt.Dimension(22, 22));
03263: jButtonRun2.setPreferredSize(new java.awt.Dimension(22, 22));
03264: jButtonRun2
03265: .addActionListener(new java.awt.event.ActionListener() {
03266: public void actionPerformed(
03267: java.awt.event.ActionEvent evt) {
03268: jButtonRun2ActionPerformed(evt);
03269: }
03270: });
03271: jToolBar1.add(jButtonRun2);
03272:
03273: getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
03274:
03275: jMenuFile.setMnemonic('f');
03276: jMenuFile.setText("File");
03277: jMenuFile
03278: .addActionListener(new java.awt.event.ActionListener() {
03279: public void actionPerformed(
03280: java.awt.event.ActionEvent evt) {
03281: jMenuFileActionPerformed(evt);
03282: }
03283: });
03284:
03285: jMenuItemNewDocument
03286: .setIcon(new javax.swing.ImageIcon(
03287: getClass()
03288: .getResource(
03289: "/it/businesslogic/ireport/icons/menu/new.png"))); // NOI18N
03290: jMenuItemNewDocument.setText("New document");
03291: jMenuItemNewDocument
03292: .addActionListener(new java.awt.event.ActionListener() {
03293: public void actionPerformed(
03294: java.awt.event.ActionEvent evt) {
03295: jMenuItemNewDocumentActionPerformed(evt);
03296: }
03297: });
03298: jMenuFile.add(jMenuItemNewDocument);
03299:
03300: jMenuItemWizard
03301: .setIcon(new javax.swing.ImageIcon(
03302: getClass()
03303: .getResource(
03304: "/it/businesslogic/ireport/icons/menu/wizard.png"))); // NOI18N
03305: jMenuItemWizard.setText("Report wizard...");
03306: jMenuItemWizard
03307: .setDisabledIcon(new javax.swing.ImageIcon(
03308: getClass()
03309: .getResource(
03310: "/it/businesslogic/ireport/icons/menu/wizard.png"))); // NOI18N
03311: jMenuItemWizard
03312: .addActionListener(new java.awt.event.ActionListener() {
03313: public void actionPerformed(
03314: java.awt.event.ActionEvent evt) {
03315: jMenuItemWizardActionPerformed(evt);
03316: }
03317: });
03318: jMenuFile.add(jMenuItemWizard);
03319:
03320: jMenuItemOpen
03321: .setIcon(new javax.swing.ImageIcon(
03322: getClass()
03323: .getResource(
03324: "/it/businesslogic/ireport/icons/menu/open.png"))); // NOI18N
03325: jMenuItemOpen.setText("Open");
03326: jMenuItemOpen
03327: .addActionListener(new java.awt.event.ActionListener() {
03328: public void actionPerformed(
03329: java.awt.event.ActionEvent evt) {
03330: jMenuItemOpenActionPerformed(evt);
03331: }
03332: });
03333: jMenuFile.add(jMenuItemOpen);
03334:
03335: jMenuItemSave
03336: .setIcon(new javax.swing.ImageIcon(
03337: getClass()
03338: .getResource(
03339: "/it/businesslogic/ireport/icons/menu/save.png"))); // NOI18N
03340: jMenuItemSave.setMnemonic('s');
03341: jMenuItemSave.setText("Save");
03342: jMenuItemSave
03343: .addActionListener(new java.awt.event.ActionListener() {
03344: public void actionPerformed(
03345: java.awt.event.ActionEvent evt) {
03346: jMenuItemSaveActionPerformed(evt);
03347: }
03348: });
03349: jMenuFile.add(jMenuItemSave);
03350:
03351: jMenuItemSaveAs
03352: .setIcon(new javax.swing.ImageIcon(
03353: getClass()
03354: .getResource(
03355: "/it/businesslogic/ireport/icons/menu/save.png"))); // NOI18N
03356: jMenuItemSaveAs.setText("Save as...");
03357: jMenuItemSaveAs
03358: .addActionListener(new java.awt.event.ActionListener() {
03359: public void actionPerformed(
03360: java.awt.event.ActionEvent evt) {
03361: jMenuItemSaveAsActionPerformed(evt);
03362: }
03363: });
03364: jMenuFile.add(jMenuItemSaveAs);
03365:
03366: jMenuItemSaveAll
03367: .setIcon(new javax.swing.ImageIcon(
03368: getClass()
03369: .getResource(
03370: "/it/businesslogic/ireport/icons/menu/saveall.png"))); // NOI18N
03371: jMenuItemSaveAll.setText("Save all");
03372: jMenuItemSaveAll
03373: .addActionListener(new java.awt.event.ActionListener() {
03374: public void actionPerformed(
03375: java.awt.event.ActionEvent evt) {
03376: jMenuItemSaveAllActionPerformed(evt);
03377: }
03378: });
03379: jMenuFile.add(jMenuItemSaveAll);
03380:
03381: jMenuItemClose.setText("Close");
03382: jMenuItemClose
03383: .addActionListener(new java.awt.event.ActionListener() {
03384: public void actionPerformed(
03385: java.awt.event.ActionEvent evt) {
03386: jMenuItemCloseActionPerformed(evt);
03387: }
03388: });
03389: jMenuFile.add(jMenuItemClose);
03390:
03391: jMenuItemCloseAll.setText("Close all");
03392: jMenuItemCloseAll
03393: .addActionListener(new java.awt.event.ActionListener() {
03394: public void actionPerformed(
03395: java.awt.event.ActionEvent evt) {
03396: jMenuItemCloseAllActionPerformed(evt);
03397: }
03398: });
03399: jMenuFile.add(jMenuItemCloseAll);
03400:
03401: jMenuItemCloseAllExceptThis.setText("Close all except this");
03402: jMenuItemCloseAllExceptThis
03403: .addActionListener(new java.awt.event.ActionListener() {
03404: public void actionPerformed(
03405: java.awt.event.ActionEvent evt) {
03406: jMenuItemCloseAllExceptThisActionPerformed(evt);
03407: }
03408: });
03409: jMenuFile.add(jMenuItemCloseAllExceptThis);
03410: jMenuFile.add(jSeparator3);
03411:
03412: jMenuItemPrint
03413: .setIcon(new javax.swing.ImageIcon(
03414: getClass()
03415: .getResource(
03416: "/it/businesslogic/ireport/icons/printer.png"))); // NOI18N
03417: jMenuItemPrint.setText("Print design");
03418: jMenuItemPrint
03419: .addActionListener(new java.awt.event.ActionListener() {
03420: public void actionPerformed(
03421: java.awt.event.ActionEvent evt) {
03422: jMenuItemPrintActionPerformed(evt);
03423: }
03424: });
03425: jMenuFile.add(jMenuItemPrint);
03426:
03427: jMenuItemRevertToSaved.setText("Revert to saved");
03428: jMenuItemRevertToSaved
03429: .addActionListener(new java.awt.event.ActionListener() {
03430: public void actionPerformed(
03431: java.awt.event.ActionEvent evt) {
03432: jMenuItemRevertToSavedActionPerformed(evt);
03433: }
03434: });
03435: jMenuFile.add(jMenuItemRevertToSaved);
03436: jMenuFile.add(jSeparator16);
03437:
03438: jMenuRecentFiles.setText("Recent Files");
03439: jMenuFile.add(jMenuRecentFiles);
03440: jMenuFile.add(jSeparator15);
03441:
03442: jMenuItemQuit
03443: .setIcon(new javax.swing.ImageIcon(
03444: getClass()
03445: .getResource(
03446: "/it/businesslogic/ireport/icons/menu/null.gif"))); // NOI18N
03447: jMenuItemQuit.setMnemonic('q');
03448: jMenuItemQuit.setText("Quit");
03449: jMenuItemQuit
03450: .addActionListener(new java.awt.event.ActionListener() {
03451: public void actionPerformed(
03452: java.awt.event.ActionEvent evt) {
03453: jMenuItemQuitActionPerformed(evt);
03454: }
03455: });
03456: jMenuFile.add(jMenuItemQuit);
03457:
03458: jMDIMenuBar.add(jMenuFile);
03459:
03460: jMenuEdit.setMnemonic('e');
03461: jMenuEdit.setText("Edit");
03462: jMenuEdit
03463: .addActionListener(new java.awt.event.ActionListener() {
03464: public void actionPerformed(
03465: java.awt.event.ActionEvent evt) {
03466: jMenuEditActionPerformed(evt);
03467: }
03468: });
03469:
03470: jMenuItemUndo
03471: .setIcon(new javax.swing.ImageIcon(
03472: getClass()
03473: .getResource(
03474: "/it/businesslogic/ireport/icons/menu/undo.png"))); // NOI18N
03475: jMenuItemUndo.setText("Undo");
03476: jMenuItemUndo.setEnabled(false);
03477: jMenuItemUndo
03478: .addActionListener(new java.awt.event.ActionListener() {
03479: public void actionPerformed(
03480: java.awt.event.ActionEvent evt) {
03481: jMenuItemUndoActionPerformed(evt);
03482: }
03483: });
03484: jMenuEdit.add(jMenuItemUndo);
03485:
03486: jMenuItemRedo
03487: .setIcon(new javax.swing.ImageIcon(
03488: getClass()
03489: .getResource(
03490: "/it/businesslogic/ireport/icons/menu/redo.png"))); // NOI18N
03491: jMenuItemRedo.setText("Redo");
03492: jMenuItemRedo.setEnabled(false);
03493: jMenuItemRedo
03494: .addActionListener(new java.awt.event.ActionListener() {
03495: public void actionPerformed(
03496: java.awt.event.ActionEvent evt) {
03497: jMenuItemRedoActionPerformed(evt);
03498: }
03499: });
03500: jMenuEdit.add(jMenuItemRedo);
03501: jMenuEdit.add(jSeparator1);
03502:
03503: jMenuItemCut
03504: .setIcon(new javax.swing.ImageIcon(
03505: getClass()
03506: .getResource(
03507: "/it/businesslogic/ireport/icons/menu/cut.png"))); // NOI18N
03508: jMenuItemCut.setText("Cut");
03509: jMenuItemCut.setEnabled(false);
03510: jMenuItemCut
03511: .addActionListener(new java.awt.event.ActionListener() {
03512: public void actionPerformed(
03513: java.awt.event.ActionEvent evt) {
03514: jMenuItemCutActionPerformed(evt);
03515: }
03516: });
03517: jMenuEdit.add(jMenuItemCut);
03518:
03519: jMenuItemCopy
03520: .setIcon(new javax.swing.ImageIcon(
03521: getClass()
03522: .getResource(
03523: "/it/businesslogic/ireport/icons/menu/copy.png"))); // NOI18N
03524: jMenuItemCopy.setText("Copy");
03525: jMenuItemCopy.setEnabled(false);
03526: jMenuItemCopy
03527: .addActionListener(new java.awt.event.ActionListener() {
03528: public void actionPerformed(
03529: java.awt.event.ActionEvent evt) {
03530: jMenuItemCopyActionPerformed(evt);
03531: }
03532: });
03533: jMenuEdit.add(jMenuItemCopy);
03534:
03535: jMenuItemPaste
03536: .setIcon(new javax.swing.ImageIcon(
03537: getClass()
03538: .getResource(
03539: "/it/businesslogic/ireport/icons/menu/paste.png"))); // NOI18N
03540: jMenuItemPaste.setText("Paste");
03541: jMenuItemPaste.setEnabled(false);
03542: jMenuItemPaste
03543: .addActionListener(new java.awt.event.ActionListener() {
03544: public void actionPerformed(
03545: java.awt.event.ActionEvent evt) {
03546: jMenuItemPasteActionPerformed(evt);
03547: }
03548: });
03549: jMenuEdit.add(jMenuItemPaste);
03550:
03551: jMenuItemDelete
03552: .setIcon(new javax.swing.ImageIcon(
03553: getClass()
03554: .getResource(
03555: "/it/businesslogic/ireport/icons/menu/delete.png"))); // NOI18N
03556: jMenuItemDelete.setText("Delete");
03557: jMenuItemDelete.setEnabled(false);
03558: jMenuItemDelete
03559: .addActionListener(new java.awt.event.ActionListener() {
03560: public void actionPerformed(
03561: java.awt.event.ActionEvent evt) {
03562: jMenuItemDeleteActionPerformed(evt);
03563: }
03564: });
03565: jMenuEdit.add(jMenuItemDelete);
03566: jMenuEdit.add(jSeparator2);
03567:
03568: jMenuItemInsertPageBreak.setText("Insert page/column break");
03569: jMenuItemInsertPageBreak.setEnabled(false);
03570: jMenuItemInsertPageBreak
03571: .addActionListener(new java.awt.event.ActionListener() {
03572: public void actionPerformed(
03573: java.awt.event.ActionEvent evt) {
03574: jMenuItemAddGroupActionPerformed1(evt);
03575: }
03576: });
03577: jMenuEdit.add(jMenuItemInsertPageBreak);
03578:
03579: jMenuAdd.setText("Insert element...");
03580: jMenuAdd.setEnabled(false);
03581:
03582: jMenuItemLine.setText("Line");
03583: jMenuItemLine
03584: .addActionListener(new java.awt.event.ActionListener() {
03585: public void actionPerformed(
03586: java.awt.event.ActionEvent evt) {
03587: jMenuItemLineActionPerformed(evt);
03588: }
03589: });
03590: jMenuAdd.add(jMenuItemLine);
03591:
03592: jMenuItemRectangle.setText("Rectangle");
03593: jMenuItemRectangle
03594: .addActionListener(new java.awt.event.ActionListener() {
03595: public void actionPerformed(
03596: java.awt.event.ActionEvent evt) {
03597: jMenuItemRectangleActionPerformed(evt);
03598: }
03599: });
03600: jMenuAdd.add(jMenuItemRectangle);
03601:
03602: jMenuItemRoundRectangle.setText("Rounded rectangle");
03603: jMenuItemRoundRectangle
03604: .addActionListener(new java.awt.event.ActionListener() {
03605: public void actionPerformed(
03606: java.awt.event.ActionEvent evt) {
03607: jMenuItemRoundRectangleActionPerformed(evt);
03608: }
03609: });
03610: jMenuAdd.add(jMenuItemRoundRectangle);
03611:
03612: jMenuItemEllipse.setText("Ellipse");
03613: jMenuItemEllipse
03614: .addActionListener(new java.awt.event.ActionListener() {
03615: public void actionPerformed(
03616: java.awt.event.ActionEvent evt) {
03617: jMenuItemEllipseActionPerformed(evt);
03618: }
03619: });
03620: jMenuAdd.add(jMenuItemEllipse);
03621:
03622: jMenuItemImage.setText("Image");
03623: jMenuItemImage
03624: .addActionListener(new java.awt.event.ActionListener() {
03625: public void actionPerformed(
03626: java.awt.event.ActionEvent evt) {
03627: jMenuItemImageActionPerformed(evt);
03628: }
03629: });
03630: jMenuAdd.add(jMenuItemImage);
03631:
03632: jMenuItemStaticText.setText("Static text");
03633: jMenuItemStaticText
03634: .addActionListener(new java.awt.event.ActionListener() {
03635: public void actionPerformed(
03636: java.awt.event.ActionEvent evt) {
03637: jMenuItemStaticTextActionPerformed(evt);
03638: }
03639: });
03640: jMenuAdd.add(jMenuItemStaticText);
03641:
03642: jMenuItemTextField.setText("Text field");
03643: jMenuItemTextField
03644: .addActionListener(new java.awt.event.ActionListener() {
03645: public void actionPerformed(
03646: java.awt.event.ActionEvent evt) {
03647: jMenuItemTextFieldActionPerformed(evt);
03648: }
03649: });
03650: jMenuAdd.add(jMenuItemTextField);
03651:
03652: jMenuItemChart.setText("Chart");
03653: jMenuItemChart
03654: .addActionListener(new java.awt.event.ActionListener() {
03655: public void actionPerformed(
03656: java.awt.event.ActionEvent evt) {
03657: jMenuItemChartActionPerformed(evt);
03658: }
03659: });
03660: jMenuAdd.add(jMenuItemChart);
03661:
03662: jMenuItemSubreport.setText("Subreport");
03663: jMenuItemSubreport
03664: .addActionListener(new java.awt.event.ActionListener() {
03665: public void actionPerformed(
03666: java.awt.event.ActionEvent evt) {
03667: jMenuItemSubreportActionPerformed(evt);
03668: }
03669: });
03670: jMenuAdd.add(jMenuItemSubreport);
03671:
03672: jMenuEdit.add(jMenuAdd);
03673:
03674: jMenuItemAddGroup.setText("New report group wizard");
03675: jMenuItemAddGroup.setEnabled(false);
03676: jMenuItemAddGroup
03677: .addActionListener(new java.awt.event.ActionListener() {
03678: public void actionPerformed(
03679: java.awt.event.ActionEvent evt) {
03680: jMenuItemAddGroupActionPerformed(evt);
03681: }
03682: });
03683: jMenuEdit.add(jMenuItemAddGroup);
03684:
03685: jMenuItemElementProperties.setText("Element properties");
03686: jMenuItemElementProperties.setEnabled(false);
03687: jMenuItemElementProperties
03688: .addActionListener(new java.awt.event.ActionListener() {
03689: public void actionPerformed(
03690: java.awt.event.ActionEvent evt) {
03691: jMenuItemElementPropertiesActionPerformed(evt);
03692: }
03693: });
03694: jMenuEdit.add(jMenuItemElementProperties);
03695:
03696: jMenuItemXMLSource
03697: .setIcon(new javax.swing.ImageIcon(
03698: getClass()
03699: .getResource(
03700: "/it/businesslogic/ireport/icons/menu/null.gif"))); // NOI18N
03701: jMenuItemXMLSource.setText("XML source...");
03702: jMenuItemXMLSource.setEnabled(false);
03703: jMenuItemXMLSource
03704: .addActionListener(new java.awt.event.ActionListener() {
03705: public void actionPerformed(
03706: java.awt.event.ActionEvent evt) {
03707: jMenuItemXMLSourceActionPerformed(evt);
03708: }
03709: });
03710: jMenuEdit.add(jMenuItemXMLSource);
03711:
03712: jMenuInternationalization.setText("Internationalization");
03713: jMenuInternationalization.setEnabled(false);
03714:
03715: jMenuLocaleFiles.setText("Locale resource files");
03716: jMenuLocaleFiles
03717: .addActionListener(new java.awt.event.ActionListener() {
03718: public void actionPerformed(
03719: java.awt.event.ActionEvent evt) {
03720: jMenuLocaleFilesActionPerformed(evt);
03721: }
03722: });
03723: jMenuInternationalization.add(jMenuLocaleFiles);
03724:
03725: jMenuEdit.add(jMenuInternationalization);
03726: jMenuEdit.add(jSeparator25);
03727:
03728: jMenuItemReportProperties.setText("Report properties");
03729: jMenuItemReportProperties.setEnabled(false);
03730: jMenuItemReportProperties
03731: .addActionListener(new java.awt.event.ActionListener() {
03732: public void actionPerformed(
03733: java.awt.event.ActionEvent evt) {
03734: jMenuItemReportPropertiesActionPerformed(evt);
03735: }
03736: });
03737: jMenuEdit.add(jMenuItemReportProperties);
03738:
03739: jMenuItemProperties.setText("Custom properties");
03740: jMenuItemProperties.setEnabled(false);
03741: jMenuItemProperties
03742: .addActionListener(new java.awt.event.ActionListener() {
03743: public void actionPerformed(
03744: java.awt.event.ActionEvent evt) {
03745: jMenuItemPropertiesActionPerformed(evt);
03746: }
03747: });
03748: jMenuEdit.add(jMenuItemProperties);
03749:
03750: jMenuItemReportImports.setText("Report series");
03751: jMenuItemReportImports.setEnabled(false);
03752: jMenuItemReportImports
03753: .addActionListener(new java.awt.event.ActionListener() {
03754: public void actionPerformed(
03755: java.awt.event.ActionEvent evt) {
03756: jMenuItemReportImportsActionPerformed(evt);
03757: }
03758: });
03759: jMenuEdit.add(jMenuItemReportImports);
03760:
03761: jMenuItemScriptletEditor.setText("ScriptletEditor");
03762: jMenuItemScriptletEditor.setEnabled(false);
03763: jMenuItemScriptletEditor
03764: .addActionListener(new java.awt.event.ActionListener() {
03765: public void actionPerformed(
03766: java.awt.event.ActionEvent evt) {
03767: jMenuItemScriptletEditorActionPerformed(evt);
03768: }
03769: });
03770: jMenuEdit.add(jMenuItemScriptletEditor);
03771: jMenuEdit.add(jSeparator26);
03772:
03773: jMenuItemReportQuery.setText("Report query");
03774: jMenuItemReportQuery.setEnabled(false);
03775: jMenuItemReportQuery
03776: .addActionListener(new java.awt.event.ActionListener() {
03777: public void actionPerformed(
03778: java.awt.event.ActionEvent evt) {
03779: jMenuItemReportQueryActionPerformed(evt);
03780: }
03781: });
03782: jMenuEdit.add(jMenuItemReportQuery);
03783:
03784: jMenuItemSubDataset.setText("Subdatasets");
03785: jMenuItemSubDataset.setEnabled(false);
03786: jMenuItemSubDataset
03787: .addActionListener(new java.awt.event.ActionListener() {
03788: public void actionPerformed(
03789: java.awt.event.ActionEvent evt) {
03790: jMenuItemSubDatasetActionPerformed(evt);
03791: }
03792: });
03793: jMenuEdit.add(jMenuItemSubDataset);
03794: jMenuEdit.add(jSeparator28);
03795:
03796: jMenuItemRemoveMargins.setText("Item");
03797: jMenuItemRemoveMargins
03798: .addActionListener(new java.awt.event.ActionListener() {
03799: public void actionPerformed(
03800: java.awt.event.ActionEvent evt) {
03801: jMenuItemRemoveMarginsActionPerformed(evt);
03802: }
03803: });
03804: jMenuEdit.add(jMenuItemRemoveMargins);
03805:
03806: jMDIMenuBar.add(jMenuEdit);
03807:
03808: jMenuView.setMnemonic('v');
03809: jMenuView.setText("View");
03810: jMenuView
03811: .addActionListener(new java.awt.event.ActionListener() {
03812: public void actionPerformed(
03813: java.awt.event.ActionEvent evt) {
03814: jMenuViewActionPerformed(evt);
03815: }
03816: });
03817: jMenuView
03818: .addChangeListener(new javax.swing.event.ChangeListener() {
03819: public void stateChanged(
03820: javax.swing.event.ChangeEvent evt) {
03821: jMenuViewStateChanged(evt);
03822: }
03823: });
03824:
03825: jCheckBoxMenuItemGrid.setText("Show grid");
03826: jCheckBoxMenuItemGrid.setEnabled(false);
03827: jCheckBoxMenuItemGrid
03828: .addActionListener(new java.awt.event.ActionListener() {
03829: public void actionPerformed(
03830: java.awt.event.ActionEvent evt) {
03831: jCheckBoxMenuItemGridActionPerformed(evt);
03832: }
03833: });
03834: jMenuView.add(jCheckBoxMenuItemGrid);
03835: jMenuView.add(jSeparator4);
03836:
03837: jMenuPanels.setText("Docking panes");
03838:
03839: jCheckBoxMenuItemExplorer.setSelected(true);
03840: jCheckBoxMenuItemExplorer.setText("Files");
03841: jCheckBoxMenuItemExplorer
03842: .addActionListener(new java.awt.event.ActionListener() {
03843: public void actionPerformed(
03844: java.awt.event.ActionEvent evt) {
03845: jCheckBoxMenuItemExplorerActionPerformed(evt);
03846: }
03847: });
03848: jMenuPanels.add(jCheckBoxMenuItemExplorer);
03849:
03850: jCheckBoxMenuItemDocumentStructure.setSelected(true);
03851: jCheckBoxMenuItemDocumentStructure
03852: .setText("Document structure");
03853: jCheckBoxMenuItemDocumentStructure
03854: .addActionListener(new java.awt.event.ActionListener() {
03855: public void actionPerformed(
03856: java.awt.event.ActionEvent evt) {
03857: jCheckBoxMenuItemDocumentStructureActionPerformed1(evt);
03858: }
03859: });
03860: jMenuPanels.add(jCheckBoxMenuItemDocumentStructure);
03861:
03862: jCheckBoxMenuItemElementProperties.setSelected(true);
03863: jCheckBoxMenuItemElementProperties
03864: .setText("Element properties");
03865: jCheckBoxMenuItemElementProperties
03866: .addActionListener(new java.awt.event.ActionListener() {
03867: public void actionPerformed(
03868: java.awt.event.ActionEvent evt) {
03869: jCheckBoxMenuItemElementPropertiesActionPerformed1(evt);
03870: }
03871: });
03872: jMenuPanels.add(jCheckBoxMenuItemElementProperties);
03873:
03874: jCheckBoxMenuItemLibrary.setSelected(true);
03875: jCheckBoxMenuItemLibrary.setText("Library");
03876: jCheckBoxMenuItemLibrary
03877: .addActionListener(new java.awt.event.ActionListener() {
03878: public void actionPerformed(
03879: java.awt.event.ActionEvent evt) {
03880: jCheckBoxMenuItemLibraryActionPerformed(evt);
03881: }
03882: });
03883: jMenuPanels.add(jCheckBoxMenuItemLibrary);
03884:
03885: jCheckBoxMenuItemStylesLibrary.setSelected(true);
03886: jCheckBoxMenuItemStylesLibrary.setText("Styles Library");
03887: jCheckBoxMenuItemStylesLibrary
03888: .addActionListener(new java.awt.event.ActionListener() {
03889: public void actionPerformed(
03890: java.awt.event.ActionEvent evt) {
03891: jCheckBoxMenuItemStylesLibraryActionPerformed(evt);
03892: }
03893: });
03894: jMenuPanels.add(jCheckBoxMenuItemStylesLibrary);
03895:
03896: jCheckBoxMenuItemOutput.setSelected(true);
03897: jCheckBoxMenuItemOutput.setText("Show output window");
03898: jCheckBoxMenuItemOutput
03899: .addActionListener(new java.awt.event.ActionListener() {
03900: public void actionPerformed(
03901: java.awt.event.ActionEvent evt) {
03902: jCheckBoxMenuItemOutputActionPerformed(evt);
03903: }
03904: });
03905: jMenuPanels.add(jCheckBoxMenuItemOutput);
03906:
03907: jCheckBoxMenuItemThreadList.setSelected(true);
03908: jCheckBoxMenuItemThreadList.setText("Threads list");
03909: jCheckBoxMenuItemThreadList
03910: .addActionListener(new java.awt.event.ActionListener() {
03911: public void actionPerformed(
03912: java.awt.event.ActionEvent evt) {
03913: jCheckBoxMenuItemExplorerActionPerformed1(evt);
03914: }
03915: });
03916: jMenuPanels.add(jCheckBoxMenuItemThreadList);
03917:
03918: jMenuView.add(jMenuPanels);
03919:
03920: jMenuToolBars.setText("Toolbars");
03921:
03922: jCheckBoxMenuItemTextFormatting.setSelected(true);
03923: jCheckBoxMenuItemTextFormatting.setText("Text formatting");
03924: jCheckBoxMenuItemTextFormatting
03925: .addActionListener(new java.awt.event.ActionListener() {
03926: public void actionPerformed(
03927: java.awt.event.ActionEvent evt) {
03928: jCheckBoxMenuItemTextFormattingActionPerformed(evt);
03929: }
03930: });
03931: jMenuToolBars.add(jCheckBoxMenuItemTextFormatting);
03932:
03933: jCheckBoxMenuItemElementsFormatting.setSelected(true);
03934: jCheckBoxMenuItemElementsFormatting
03935: .setText("Elements formatting");
03936: jCheckBoxMenuItemElementsFormatting
03937: .addActionListener(new java.awt.event.ActionListener() {
03938: public void actionPerformed(
03939: java.awt.event.ActionEvent evt) {
03940: jCheckBoxMenuItemElementsFormattingActionPerformed(evt);
03941: }
03942: });
03943: jMenuToolBars.add(jCheckBoxMenuItemElementsFormatting);
03944:
03945: jMenuView.add(jMenuToolBars);
03946: jMenuView.add(jSeparator12);
03947:
03948: jMenuItemFields.setText("Report fields");
03949: jMenuItemFields.setEnabled(false);
03950: jMenuItemFields
03951: .addActionListener(new java.awt.event.ActionListener() {
03952: public void actionPerformed(
03953: java.awt.event.ActionEvent evt) {
03954: jMenuItemFieldsActionPerformed(evt);
03955: }
03956: });
03957: jMenuView.add(jMenuItemFields);
03958:
03959: jMenuItemVariables.setText("Report variables");
03960: jMenuItemVariables.setEnabled(false);
03961: jMenuItemVariables
03962: .addActionListener(new java.awt.event.ActionListener() {
03963: public void actionPerformed(
03964: java.awt.event.ActionEvent evt) {
03965: jMenuItemVariablesActionPerformed(evt);
03966: }
03967: });
03968: jMenuView.add(jMenuItemVariables);
03969:
03970: jMenuItemParameters.setText("Report parameters");
03971: jMenuItemParameters.setEnabled(false);
03972: jMenuItemParameters
03973: .addActionListener(new java.awt.event.ActionListener() {
03974: public void actionPerformed(
03975: java.awt.event.ActionEvent evt) {
03976: jMenuItemParametersActionPerformed(evt);
03977: }
03978: });
03979: jMenuView.add(jMenuItemParameters);
03980: jMenuView.add(jSeparator6);
03981:
03982: jMenuItemBands.setText("Bands");
03983: jMenuItemBands.setEnabled(false);
03984: jMenuItemBands
03985: .addActionListener(new java.awt.event.ActionListener() {
03986: public void actionPerformed(
03987: java.awt.event.ActionEvent evt) {
03988: jMenuItemBandsActionPerformed(evt);
03989: }
03990: });
03991: jMenuView.add(jMenuItemBands);
03992:
03993: jMenuItemGroups.setText("Report groups");
03994: jMenuItemGroups.setEnabled(false);
03995: jMenuItemGroups
03996: .addActionListener(new java.awt.event.ActionListener() {
03997: public void actionPerformed(
03998: java.awt.event.ActionEvent evt) {
03999: jMenuItemGroupsActionPerformed(evt);
04000: }
04001: });
04002: jMenuView.add(jMenuItemGroups);
04003:
04004: jMDIMenuBar.add(jMenuView);
04005:
04006: jMenuFormat.setMnemonic('o');
04007: jMenuFormat.setText("Format");
04008:
04009: jMenuItemStyles.setText("Styles");
04010: jMenuItemStyles.setEnabled(false);
04011: jMenuItemStyles
04012: .addActionListener(new java.awt.event.ActionListener() {
04013: public void actionPerformed(
04014: java.awt.event.ActionEvent evt) {
04015: jMenuItemStylesActionPerformed(evt);
04016: }
04017: });
04018: jMenuFormat.add(jMenuItemStyles);
04019:
04020: jMenuItemFonts.setText("Report fonts");
04021: jMenuItemFonts.setEnabled(false);
04022: jMenuItemFonts
04023: .addActionListener(new java.awt.event.ActionListener() {
04024: public void actionPerformed(
04025: java.awt.event.ActionEvent evt) {
04026: jMenuItemFontsActionPerformed(evt);
04027: }
04028: });
04029: jMenuFormat.add(jMenuItemFonts);
04030: jMenuFormat.add(jSeparator29);
04031:
04032: jMenuAlign.setText("Align");
04033: jMenuAlign
04034: .addActionListener(new java.awt.event.ActionListener() {
04035: public void actionPerformed(
04036: java.awt.event.ActionEvent evt) {
04037: jMenuAlignActionPerformed(evt);
04038: }
04039: });
04040:
04041: jMenuItemAlignLeft.setAccelerator(javax.swing.KeyStroke
04042: .getKeyStroke(java.awt.event.KeyEvent.VK_LEFT,
04043: java.awt.event.InputEvent.SHIFT_MASK
04044: | java.awt.event.InputEvent.CTRL_MASK));
04045: jMenuItemAlignLeft
04046: .setIcon(new javax.swing.ImageIcon(
04047: getClass()
04048: .getResource(
04049: "/it/businesslogic/ireport/icons/menu/elem_align_left.png"))); // NOI18N
04050: jMenuItemAlignLeft.setText("Align left");
04051: jMenuItemAlignLeft
04052: .addActionListener(new java.awt.event.ActionListener() {
04053: public void actionPerformed(
04054: java.awt.event.ActionEvent evt) {
04055: jMenuItemAlignLeftActionPerformed(evt);
04056: }
04057: });
04058: jMenuAlign.add(jMenuItemAlignLeft);
04059:
04060: jMenuItemAlignRight.setAccelerator(javax.swing.KeyStroke
04061: .getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT,
04062: java.awt.event.InputEvent.SHIFT_MASK
04063: | java.awt.event.InputEvent.CTRL_MASK));
04064: jMenuItemAlignRight
04065: .setIcon(new javax.swing.ImageIcon(
04066: getClass()
04067: .getResource(
04068: "/it/businesslogic/ireport/icons/menu/elem_align_right.png"))); // NOI18N
04069: jMenuItemAlignRight.setText("Align right");
04070: jMenuItemAlignRight
04071: .addActionListener(new java.awt.event.ActionListener() {
04072: public void actionPerformed(
04073: java.awt.event.ActionEvent evt) {
04074: jMenuItemAlignRightActionPerformed(evt);
04075: }
04076: });
04077: jMenuAlign.add(jMenuItemAlignRight);
04078:
04079: jMenuItemAlignTop.setAccelerator(javax.swing.KeyStroke
04080: .getKeyStroke(java.awt.event.KeyEvent.VK_UP,
04081: java.awt.event.InputEvent.SHIFT_MASK
04082: | java.awt.event.InputEvent.CTRL_MASK));
04083: jMenuItemAlignTop
04084: .setIcon(new javax.swing.ImageIcon(
04085: getClass()
04086: .getResource(
04087: "/it/businesslogic/ireport/icons/menu/elem_align_top.png"))); // NOI18N
04088: jMenuItemAlignTop.setText("Align top");
04089: jMenuItemAlignTop
04090: .addActionListener(new java.awt.event.ActionListener() {
04091: public void actionPerformed(
04092: java.awt.event.ActionEvent evt) {
04093: jMenuItemAlignTopActionPerformed(evt);
04094: }
04095: });
04096: jMenuAlign.add(jMenuItemAlignTop);
04097:
04098: jMenuItemAlignBottom.setAccelerator(javax.swing.KeyStroke
04099: .getKeyStroke(java.awt.event.KeyEvent.VK_DOWN,
04100: java.awt.event.InputEvent.SHIFT_MASK
04101: | java.awt.event.InputEvent.CTRL_MASK));
04102: jMenuItemAlignBottom
04103: .setIcon(new javax.swing.ImageIcon(
04104: getClass()
04105: .getResource(
04106: "/it/businesslogic/ireport/icons/menu/elem_align_bottom.png"))); // NOI18N
04107: jMenuItemAlignBottom.setText("Align bottom");
04108: jMenuItemAlignBottom
04109: .addActionListener(new java.awt.event.ActionListener() {
04110: public void actionPerformed(
04111: java.awt.event.ActionEvent evt) {
04112: jMenuItemAlignBottomActionPerformed(evt);
04113: }
04114: });
04115: jMenuAlign.add(jMenuItemAlignBottom);
04116: jMenuAlign.add(jSeparator19);
04117:
04118: jMenuItemAlignVerticalAxis
04119: .setIcon(new javax.swing.ImageIcon(
04120: getClass()
04121: .getResource(
04122: "/it/businesslogic/ireport/icons/menu/elem_center_axis.png"))); // NOI18N
04123: jMenuItemAlignVerticalAxis.setText("Align vertical axis");
04124: jMenuItemAlignVerticalAxis
04125: .addActionListener(new java.awt.event.ActionListener() {
04126: public void actionPerformed(
04127: java.awt.event.ActionEvent evt) {
04128: jMenuItemAlignVerticalAxisActionPerformed(evt);
04129: }
04130: });
04131: jMenuAlign.add(jMenuItemAlignVerticalAxis);
04132:
04133: jMenuItemAlignHorizontalAxis
04134: .setIcon(new javax.swing.ImageIcon(
04135: getClass()
04136: .getResource(
04137: "/it/businesslogic/ireport/icons/menu/elem_vcenter_axis.png"))); // NOI18N
04138: jMenuItemAlignHorizontalAxis.setText("Align horizontal axis");
04139: jMenuItemAlignHorizontalAxis
04140: .addActionListener(new java.awt.event.ActionListener() {
04141: public void actionPerformed(
04142: java.awt.event.ActionEvent evt) {
04143: jMenuItemAlignHorizontalAxisActionPerformed(evt);
04144: }
04145: });
04146: jMenuAlign.add(jMenuItemAlignHorizontalAxis);
04147: jMenuAlign.add(jSeparator20);
04148:
04149: jMenuItemAlignToBandTop.setAccelerator(javax.swing.KeyStroke
04150: .getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_UP,
04151: java.awt.event.InputEvent.SHIFT_MASK
04152: | java.awt.event.InputEvent.CTRL_MASK));
04153: jMenuItemAlignToBandTop
04154: .setIcon(new javax.swing.ImageIcon(
04155: getClass()
04156: .getResource(
04157: "/it/businesslogic/ireport/icons/toolbars/format/align_top_band.png"))); // NOI18N
04158: jMenuItemAlignToBandTop.setText("Align to band top");
04159: jMenuItemAlignToBandTop
04160: .addActionListener(new java.awt.event.ActionListener() {
04161: public void actionPerformed(
04162: java.awt.event.ActionEvent evt) {
04163: jMenuItemAlignToBandTopActionPerformed(evt);
04164: }
04165: });
04166: jMenuAlign.add(jMenuItemAlignToBandTop);
04167:
04168: jMenuItemAlignToBandBottom.setAccelerator(javax.swing.KeyStroke
04169: .getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_DOWN,
04170: java.awt.event.InputEvent.SHIFT_MASK
04171: | java.awt.event.InputEvent.CTRL_MASK));
04172: jMenuItemAlignToBandBottom
04173: .setIcon(new javax.swing.ImageIcon(
04174: getClass()
04175: .getResource(
04176: "/it/businesslogic/ireport/icons/toolbars/format/align_bottom_band.png"))); // NOI18N
04177: jMenuItemAlignToBandBottom.setText("Align to band bottom");
04178: jMenuItemAlignToBandBottom
04179: .addActionListener(new java.awt.event.ActionListener() {
04180: public void actionPerformed(
04181: java.awt.event.ActionEvent evt) {
04182: jMenuItemAlignToBandBottomActionPerformed(evt);
04183: }
04184: });
04185: jMenuAlign.add(jMenuItemAlignToBandBottom);
04186:
04187: jMenuFormat.add(jMenuAlign);
04188:
04189: jMenuSize.setText("Size");
04190:
04191: jMenuItemSameWidth
04192: .setIcon(new javax.swing.ImageIcon(
04193: getClass()
04194: .getResource(
04195: "/it/businesslogic/ireport/icons/menu/elem_same_hsize.png"))); // NOI18N
04196: jMenuItemSameWidth.setText("Same width");
04197: jMenuItemSameWidth
04198: .addActionListener(new java.awt.event.ActionListener() {
04199: public void actionPerformed(
04200: java.awt.event.ActionEvent evt) {
04201: jMenuItemSameWidthActionPerformed(evt);
04202: }
04203: });
04204: jMenuSize.add(jMenuItemSameWidth);
04205:
04206: jMenuItemSameWidthMax
04207: .setIcon(new javax.swing.ImageIcon(
04208: getClass()
04209: .getResource(
04210: "/it/businesslogic/ireport/icons/menu/elem_same_hsize_plus.png"))); // NOI18N
04211: jMenuItemSameWidthMax.setText("Same width (max)");
04212: jMenuItemSameWidthMax
04213: .addActionListener(new java.awt.event.ActionListener() {
04214: public void actionPerformed(
04215: java.awt.event.ActionEvent evt) {
04216: jMenuItemSameWidthMaxActionPerformed(evt);
04217: }
04218: });
04219: jMenuSize.add(jMenuItemSameWidthMax);
04220:
04221: jMenuItemSameWidthMin
04222: .setIcon(new javax.swing.ImageIcon(
04223: getClass()
04224: .getResource(
04225: "/it/businesslogic/ireport/icons/menu/elem_same_hsize_min.png"))); // NOI18N
04226: jMenuItemSameWidthMin.setText("Same width (min)");
04227: jMenuItemSameWidthMin
04228: .addActionListener(new java.awt.event.ActionListener() {
04229: public void actionPerformed(
04230: java.awt.event.ActionEvent evt) {
04231: jMenuItemSameWidthMinActionPerformed(evt);
04232: }
04233: });
04234: jMenuSize.add(jMenuItemSameWidthMin);
04235: jMenuSize.add(jSeparator17);
04236:
04237: jMenuItemSameHeight
04238: .setIcon(new javax.swing.ImageIcon(
04239: getClass()
04240: .getResource(
04241: "/it/businesslogic/ireport/icons/menu/elem_same_vsize.png"))); // NOI18N
04242: jMenuItemSameHeight.setText("Same height");
04243: jMenuItemSameHeight
04244: .addActionListener(new java.awt.event.ActionListener() {
04245: public void actionPerformed(
04246: java.awt.event.ActionEvent evt) {
04247: jMenuItemSameHeightActionPerformed(evt);
04248: }
04249: });
04250: jMenuSize.add(jMenuItemSameHeight);
04251:
04252: jMenuItemSameHeightMin
04253: .setIcon(new javax.swing.ImageIcon(
04254: getClass()
04255: .getResource(
04256: "/it/businesslogic/ireport/icons/menu/elem_same_vsize_min.png"))); // NOI18N
04257: jMenuItemSameHeightMin.setText("Same height (min)");
04258: jMenuItemSameHeightMin
04259: .addActionListener(new java.awt.event.ActionListener() {
04260: public void actionPerformed(
04261: java.awt.event.ActionEvent evt) {
04262: jMenuItemSameHeightMinActionPerformed(evt);
04263: }
04264: });
04265: jMenuSize.add(jMenuItemSameHeightMin);
04266:
04267: jMenuItemSameHeightMax
04268: .setIcon(new javax.swing.ImageIcon(
04269: getClass()
04270: .getResource(
04271: "/it/businesslogic/ireport/icons/menu/elem_same_vsize_plus.png"))); // NOI18N
04272: jMenuItemSameHeightMax.setText("Same height (max)");
04273: jMenuItemSameHeightMax
04274: .addActionListener(new java.awt.event.ActionListener() {
04275: public void actionPerformed(
04276: java.awt.event.ActionEvent evt) {
04277: jMenuItemSameHeightMaxActionPerformed(evt);
04278: }
04279: });
04280: jMenuSize.add(jMenuItemSameHeightMax);
04281: jMenuSize.add(jSeparator18);
04282:
04283: jMenuItemSameSize
04284: .setIcon(new javax.swing.ImageIcon(
04285: getClass()
04286: .getResource(
04287: "/it/businesslogic/ireport/icons/menu/elem_same_size.png"))); // NOI18N
04288: jMenuItemSameSize.setText("Same size");
04289: jMenuItemSameSize
04290: .addActionListener(new java.awt.event.ActionListener() {
04291: public void actionPerformed(
04292: java.awt.event.ActionEvent evt) {
04293: jMenuItemSameSizeActionPerformed(evt);
04294: }
04295: });
04296: jMenuSize.add(jMenuItemSameSize);
04297:
04298: jMenuFormat.add(jMenuSize);
04299:
04300: jMenuPosition.setText("Position");
04301:
04302: jMenuItemCenterH
04303: .setIcon(new javax.swing.ImageIcon(
04304: getClass()
04305: .getResource(
04306: "/it/businesslogic/ireport/icons/menu/elem_hcenter.png"))); // NOI18N
04307: jMenuItemCenterH.setText("Center horizontally (band based)");
04308: jMenuItemCenterH
04309: .addActionListener(new java.awt.event.ActionListener() {
04310: public void actionPerformed(
04311: java.awt.event.ActionEvent evt) {
04312: jMenuItemCenterHActionPerformed(evt);
04313: }
04314: });
04315: jMenuPosition.add(jMenuItemCenterH);
04316:
04317: jMenuItemCenterV
04318: .setIcon(new javax.swing.ImageIcon(
04319: getClass()
04320: .getResource(
04321: "/it/businesslogic/ireport/icons/menu/elem_vcenter.png"))); // NOI18N
04322: jMenuItemCenterV.setText("Center vertically (band based)");
04323: jMenuItemCenterV
04324: .addActionListener(new java.awt.event.ActionListener() {
04325: public void actionPerformed(
04326: java.awt.event.ActionEvent evt) {
04327: jMenuItemCenterVActionPerformed(evt);
04328: }
04329: });
04330: jMenuPosition.add(jMenuItemCenterV);
04331:
04332: jMenuItemCenterInBand
04333: .setIcon(new javax.swing.ImageIcon(
04334: getClass()
04335: .getResource(
04336: "/it/businesslogic/ireport/icons/menu/elem_ccenter.png"))); // NOI18N
04337: jMenuItemCenterInBand.setText("Center in band");
04338: jMenuItemCenterInBand
04339: .addActionListener(new java.awt.event.ActionListener() {
04340: public void actionPerformed(
04341: java.awt.event.ActionEvent evt) {
04342: jMenuItemCenterInBandActionPerformed(evt);
04343: }
04344: });
04345: jMenuPosition.add(jMenuItemCenterInBand);
04346:
04347: jMenuItemCenterBackground
04348: .setIcon(new javax.swing.ImageIcon(
04349: getClass()
04350: .getResource(
04351: "/it/businesslogic/ireport/icons/menu/elem_bcenter.png"))); // NOI18N
04352: jMenuItemCenterBackground.setText("Center in background");
04353: jMenuItemCenterBackground
04354: .addActionListener(new java.awt.event.ActionListener() {
04355: public void actionPerformed(
04356: java.awt.event.ActionEvent evt) {
04357: jMenuItemCenterBackgroundActionPerformed(evt);
04358: }
04359: });
04360: jMenuPosition.add(jMenuItemCenterBackground);
04361:
04362: jMenuItemJoinLeft.setAccelerator(javax.swing.KeyStroke
04363: .getKeyStroke(java.awt.event.KeyEvent.VK_L,
04364: java.awt.event.InputEvent.SHIFT_MASK
04365: | java.awt.event.InputEvent.CTRL_MASK));
04366: jMenuItemJoinLeft.setText("Join sides left");
04367: jMenuItemJoinLeft
04368: .addActionListener(new java.awt.event.ActionListener() {
04369: public void actionPerformed(
04370: java.awt.event.ActionEvent evt) {
04371: jMenuItemJoinLeftActionPerformed(evt);
04372: }
04373: });
04374: jMenuPosition.add(jMenuItemJoinLeft);
04375:
04376: jMenuItemJoinRight.setAccelerator(javax.swing.KeyStroke
04377: .getKeyStroke(java.awt.event.KeyEvent.VK_R,
04378: java.awt.event.InputEvent.SHIFT_MASK
04379: | java.awt.event.InputEvent.CTRL_MASK));
04380: jMenuItemJoinRight.setText("Join sides right");
04381: jMenuItemJoinRight
04382: .addActionListener(new java.awt.event.ActionListener() {
04383: public void actionPerformed(
04384: java.awt.event.ActionEvent evt) {
04385: jMenuItemJoinRightActionPerformed(evt);
04386: }
04387: });
04388: jMenuPosition.add(jMenuItemJoinRight);
04389:
04390: jMenuItemLeftMargin.setAccelerator(javax.swing.KeyStroke
04391: .getKeyStroke(java.awt.event.KeyEvent.VK_HOME,
04392: java.awt.event.InputEvent.SHIFT_MASK
04393: | java.awt.event.InputEvent.CTRL_MASK));
04394: jMenuItemLeftMargin.setText("Join left page margin");
04395: jMenuItemLeftMargin
04396: .addActionListener(new java.awt.event.ActionListener() {
04397: public void actionPerformed(
04398: java.awt.event.ActionEvent evt) {
04399: jMenuItemLeftMarginActionPerformed(evt);
04400: }
04401: });
04402: jMenuPosition.add(jMenuItemLeftMargin);
04403:
04404: jMenuItemRightMargin.setAccelerator(javax.swing.KeyStroke
04405: .getKeyStroke(java.awt.event.KeyEvent.VK_END,
04406: java.awt.event.InputEvent.SHIFT_MASK
04407: | java.awt.event.InputEvent.CTRL_MASK));
04408: jMenuItemRightMargin.setText("Join right page margin");
04409: jMenuItemRightMargin
04410: .addActionListener(new java.awt.event.ActionListener() {
04411: public void actionPerformed(
04412: java.awt.event.ActionEvent evt) {
04413: jMenuItemRightMarginActionPerformed(evt);
04414: }
04415: });
04416: jMenuPosition.add(jMenuItemRightMargin);
04417:
04418: jMenuFormat.add(jMenuPosition);
04419: jMenuFormat.add(jSeparator5);
04420:
04421: jMenuHSpacing.setText("Horizontal spacing...");
04422:
04423: jMenuItemHSMakeEqual.setText("Make equal");
04424: jMenuItemHSMakeEqual
04425: .addActionListener(new java.awt.event.ActionListener() {
04426: public void actionPerformed(
04427: java.awt.event.ActionEvent evt) {
04428: jMenuItemHSMakeEqualActionPerformed(evt);
04429: }
04430: });
04431: jMenuHSpacing.add(jMenuItemHSMakeEqual);
04432:
04433: jMenuItemHSIncrease.setText("Increase");
04434: jMenuItemHSIncrease
04435: .addActionListener(new java.awt.event.ActionListener() {
04436: public void actionPerformed(
04437: java.awt.event.ActionEvent evt) {
04438: jMenuItemHSIncreaseActionPerformed(evt);
04439: }
04440: });
04441: jMenuHSpacing.add(jMenuItemHSIncrease);
04442:
04443: jMenuItemHSDecrease.setText("Decrease");
04444: jMenuItemHSDecrease
04445: .addActionListener(new java.awt.event.ActionListener() {
04446: public void actionPerformed(
04447: java.awt.event.ActionEvent evt) {
04448: jMenuItemHSDecreaseActionPerformed(evt);
04449: }
04450: });
04451: jMenuHSpacing.add(jMenuItemHSDecrease);
04452:
04453: jMenuItemHSRemove.setText("Remove");
04454: jMenuItemHSRemove
04455: .addActionListener(new java.awt.event.ActionListener() {
04456: public void actionPerformed(
04457: java.awt.event.ActionEvent evt) {
04458: jMenuItemHSRemoveActionPerformed(evt);
04459: }
04460: });
04461: jMenuHSpacing.add(jMenuItemHSRemove);
04462:
04463: jMenuFormat.add(jMenuHSpacing);
04464:
04465: jMenuVSpacing.setText("Vertical spacing");
04466:
04467: jMenuItemVSMakeEqual.setText("Make equal");
04468: jMenuItemVSMakeEqual
04469: .addActionListener(new java.awt.event.ActionListener() {
04470: public void actionPerformed(
04471: java.awt.event.ActionEvent evt) {
04472: jMenuItemVSMakeEqualActionPerformed(evt);
04473: }
04474: });
04475: jMenuVSpacing.add(jMenuItemVSMakeEqual);
04476:
04477: jMenuItemVSIncrease.setText("Increase");
04478: jMenuItemVSIncrease
04479: .addActionListener(new java.awt.event.ActionListener() {
04480: public void actionPerformed(
04481: java.awt.event.ActionEvent evt) {
04482: jMenuItemVSIncreaseActionPerformed(evt);
04483: }
04484: });
04485: jMenuVSpacing.add(jMenuItemVSIncrease);
04486:
04487: jMenuItemVSDecrease.setText("Decrease");
04488: jMenuItemVSDecrease
04489: .addActionListener(new java.awt.event.ActionListener() {
04490: public void actionPerformed(
04491: java.awt.event.ActionEvent evt) {
04492: jMenuItemVSDecreaseActionPerformed(evt);
04493: }
04494: });
04495: jMenuVSpacing.add(jMenuItemVSDecrease);
04496:
04497: jMenuItemVSRemove.setText("Remove");
04498: jMenuItemVSRemove
04499: .addActionListener(new java.awt.event.ActionListener() {
04500: public void actionPerformed(
04501: java.awt.event.ActionEvent evt) {
04502: jMenuItemVSRemoveActionPerformed(evt);
04503: }
04504: });
04505: jMenuVSpacing.add(jMenuItemVSRemove);
04506:
04507: jMenuFormat.add(jMenuVSpacing);
04508:
04509: jMenuItemOrganize.setAccelerator(javax.swing.KeyStroke
04510: .getKeyStroke(java.awt.event.KeyEvent.VK_O,
04511: java.awt.event.InputEvent.SHIFT_MASK
04512: | java.awt.event.InputEvent.CTRL_MASK));
04513: jMenuItemOrganize.setText("Organize as a table");
04514: jMenuItemOrganize
04515: .addActionListener(new java.awt.event.ActionListener() {
04516: public void actionPerformed(
04517: java.awt.event.ActionEvent evt) {
04518: jMenuItemOrganizeActionPerformed(evt);
04519: }
04520: });
04521: jMenuFormat.add(jMenuItemOrganize);
04522: jMenuFormat.add(jSeparator8);
04523:
04524: jMenuItemBringToFront
04525: .setIcon(new javax.swing.ImageIcon(
04526: getClass()
04527: .getResource(
04528: "/it/businesslogic/ireport/icons/menu/sendtofront.png"))); // NOI18N
04529: jMenuItemBringToFront.setText("Bring to front");
04530: jMenuItemBringToFront
04531: .addActionListener(new java.awt.event.ActionListener() {
04532: public void actionPerformed(
04533: java.awt.event.ActionEvent evt) {
04534: jMenuItemBringToFrontActionPerformed(evt);
04535: }
04536: });
04537: jMenuFormat.add(jMenuItemBringToFront);
04538:
04539: jMenuItemSendToBack
04540: .setIcon(new javax.swing.ImageIcon(
04541: getClass()
04542: .getResource(
04543: "/it/businesslogic/ireport/icons/menu/sendtoback.png"))); // NOI18N
04544: jMenuItemSendToBack.setText("Send to back");
04545: jMenuItemSendToBack
04546: .addActionListener(new java.awt.event.ActionListener() {
04547: public void actionPerformed(
04548: java.awt.event.ActionEvent evt) {
04549: jMenuItemSendToBackActionPerformed(evt);
04550: }
04551: });
04552: jMenuFormat.add(jMenuItemSendToBack);
04553:
04554: jMDIMenuBar.add(jMenuFormat);
04555:
04556: jMenuDatabase.setMnemonic('d');
04557: jMenuDatabase.setText("Data");
04558:
04559: jMenuItemConnections.setText("Connections / Datasources");
04560: jMenuItemConnections
04561: .addActionListener(new java.awt.event.ActionListener() {
04562: public void actionPerformed(
04563: java.awt.event.ActionEvent evt) {
04564: jMenuItemConnectionsActionPerformed(evt);
04565: }
04566: });
04567: jMenuDatabase.add(jMenuItemConnections);
04568:
04569: jMenuItemActiveConnection.setText("Set active connection");
04570: jMenuItemActiveConnection
04571: .setToolTipText("Set the connection that must be used to fill this report");
04572: jMenuItemActiveConnection
04573: .addActionListener(new java.awt.event.ActionListener() {
04574: public void actionPerformed(
04575: java.awt.event.ActionEvent evt) {
04576: jMenuItemActiveConnectionActionPerformed(evt);
04577: }
04578: });
04579: jMenuDatabase.add(jMenuItemActiveConnection);
04580: jMenuDatabase.add(jSeparator9);
04581:
04582: jMenuItemReportQuery2.setText("Report query");
04583: jMenuItemReportQuery2.setEnabled(false);
04584: jMenuItemReportQuery2
04585: .addActionListener(new java.awt.event.ActionListener() {
04586: public void actionPerformed(
04587: java.awt.event.ActionEvent evt) {
04588: jMenuItemReportQuery2ActionPerformed(evt);
04589: }
04590: });
04591: jMenuDatabase.add(jMenuItemReportQuery2);
04592:
04593: jMenuItemSubDataset1.setText("Subdatasets");
04594: jMenuItemSubDataset1.setEnabled(false);
04595: jMenuItemSubDataset1
04596: .addActionListener(new java.awt.event.ActionListener() {
04597: public void actionPerformed(
04598: java.awt.event.ActionEvent evt) {
04599: jMenuItemSubDatasetActionPerformed(evt);
04600: }
04601: });
04602: jMenuDatabase.add(jMenuItemSubDataset1);
04603:
04604: jMDIMenuBar.add(jMenuDatabase);
04605:
04606: jMenuBuild.setMnemonic('b');
04607: jMenuBuild.setText("Build");
04608: jMenuBuild
04609: .addActionListener(new java.awt.event.ActionListener() {
04610: public void actionPerformed(
04611: java.awt.event.ActionEvent evt) {
04612: jMenuBuildActionPerformed(evt);
04613: }
04614: });
04615:
04616: jMenuItemCompile.setText("Compile");
04617: jMenuItemCompile
04618: .addItemListener(new java.awt.event.ItemListener() {
04619: public void itemStateChanged(
04620: java.awt.event.ItemEvent evt) {
04621: jMenuItemCompileItemStateChanged(evt);
04622: }
04623: });
04624: jMenuItemCompile
04625: .addActionListener(new java.awt.event.ActionListener() {
04626: public void actionPerformed(
04627: java.awt.event.ActionEvent evt) {
04628: jMenuItemCompileActionPerformed(evt);
04629: }
04630: });
04631: jMenuBuild.add(jMenuItemCompile);
04632: jMenuBuild.add(jSeparator10);
04633:
04634: jMenuItemExecute.setText("Execute (empty datasource)");
04635: jMenuItemExecute
04636: .addActionListener(new java.awt.event.ActionListener() {
04637: public void actionPerformed(
04638: java.awt.event.ActionEvent evt) {
04639: jMenuItemExecuteActionPerformed(evt);
04640: }
04641: });
04642: jMenuBuild.add(jMenuItemExecute);
04643:
04644: jMenuItemExecuteDB
04645: .setText("Execute report (using active conn.) ");
04646: jMenuItemExecuteDB
04647: .addActionListener(new java.awt.event.ActionListener() {
04648: public void actionPerformed(
04649: java.awt.event.ActionEvent evt) {
04650: jMenuItemExecuteDBActionPerformed(evt);
04651: }
04652: });
04653: jMenuBuild.add(jMenuItemExecuteDB);
04654: jMenuBuild.add(jSeparator33);
04655:
04656: jMenuItemCreateFromTemplate.setText("Create from template");
04657: jMenuItemCreateFromTemplate
04658: .addItemListener(new java.awt.event.ItemListener() {
04659: public void itemStateChanged(
04660: java.awt.event.ItemEvent evt) {
04661: jMenuItemCompileItemStateChanged1(evt);
04662: }
04663: });
04664: jMenuItemCreateFromTemplate
04665: .addActionListener(new java.awt.event.ActionListener() {
04666: public void actionPerformed(
04667: java.awt.event.ActionEvent evt) {
04668: jMenuItemCompileActionPerformed1(evt);
04669: }
04670: });
04671: jMenuBuild.add(jMenuItemCreateFromTemplate);
04672: jMenuBuild.add(jSeparator11);
04673:
04674: buttonGroupExportType.add(jRadioButtonMenuItemPreviewPDF);
04675: jRadioButtonMenuItemPreviewPDF.setSelected(true);
04676: jRadioButtonMenuItemPreviewPDF.setText("PDF preview");
04677: jRadioButtonMenuItemPreviewPDF
04678: .addActionListener(new java.awt.event.ActionListener() {
04679: public void actionPerformed(
04680: java.awt.event.ActionEvent evt) {
04681: jRadioButtonMenuItemPreviewPDFActionPerformed(evt);
04682: }
04683: });
04684: jMenuBuild.add(jRadioButtonMenuItemPreviewPDF);
04685:
04686: buttonGroupExportType.add(jRadioButtonMenuItemPreviewHTML);
04687: jRadioButtonMenuItemPreviewHTML.setText("HTML preview");
04688: jRadioButtonMenuItemPreviewHTML
04689: .addActionListener(new java.awt.event.ActionListener() {
04690: public void actionPerformed(
04691: java.awt.event.ActionEvent evt) {
04692: jRadioButtonMenuItemPreviewHTMLActionPerformed(evt);
04693: }
04694: });
04695: jMenuBuild.add(jRadioButtonMenuItemPreviewHTML);
04696:
04697: buttonGroupExportType.add(jRadioButtonMenuItemPreviewJAVA);
04698: jRadioButtonMenuItemPreviewJAVA.setText("JAVA 2D preview");
04699: jRadioButtonMenuItemPreviewJAVA
04700: .addActionListener(new java.awt.event.ActionListener() {
04701: public void actionPerformed(
04702: java.awt.event.ActionEvent evt) {
04703: jRadioButtonMenuItemPreviewJAVAActionPerformed(evt);
04704: }
04705: });
04706: jMenuBuild.add(jRadioButtonMenuItemPreviewJAVA);
04707:
04708: buttonGroupExportType.add(jRadioButtonMenuItemPreviewXLS);
04709: jRadioButtonMenuItemPreviewXLS.setText("Excel preview");
04710: jRadioButtonMenuItemPreviewXLS
04711: .addActionListener(new java.awt.event.ActionListener() {
04712: public void actionPerformed(
04713: java.awt.event.ActionEvent evt) {
04714: jRadioButtonMenuItemPreviewXLSActionPerformed(evt);
04715: }
04716: });
04717: jMenuBuild.add(jRadioButtonMenuItemPreviewXLS);
04718:
04719: buttonGroupExportType.add(jRadioButtonMenuItemPreviewXLS2);
04720: jRadioButtonMenuItemPreviewXLS2
04721: .setText("Excel preview (using JExcelApi)");
04722: jRadioButtonMenuItemPreviewXLS2
04723: .addActionListener(new java.awt.event.ActionListener() {
04724: public void actionPerformed(
04725: java.awt.event.ActionEvent evt) {
04726: jRadioButtonMenuItemPreviewXLS2ActionPerformed(evt);
04727: }
04728: });
04729: jMenuBuild.add(jRadioButtonMenuItemPreviewXLS2);
04730:
04731: buttonGroupExportType.add(jRadioButtonMenuItemPreviewCSV);
04732: jRadioButtonMenuItemPreviewCSV.setText("CSV preview");
04733: jRadioButtonMenuItemPreviewCSV
04734: .addActionListener(new java.awt.event.ActionListener() {
04735: public void actionPerformed(
04736: java.awt.event.ActionEvent evt) {
04737: jRadioButtonMenuItemPreviewCSVActionPerformed(evt);
04738: }
04739: });
04740: jMenuBuild.add(jRadioButtonMenuItemPreviewCSV);
04741:
04742: buttonGroupExportType.add(jRadioButtonMenuItemPreviewTXT);
04743: jRadioButtonMenuItemPreviewTXT
04744: .setText("Text preview (Experimental)");
04745: jRadioButtonMenuItemPreviewTXT
04746: .addActionListener(new java.awt.event.ActionListener() {
04747: public void actionPerformed(
04748: java.awt.event.ActionEvent evt) {
04749: jRadioButtonMenuItemPreviewTXTActionPerformed(evt);
04750: }
04751: });
04752: jMenuBuild.add(jRadioButtonMenuItemPreviewTXT);
04753:
04754: buttonGroupExportType.add(jRadioButtonMenuItemPreviewTXTJR);
04755: jRadioButtonMenuItemPreviewTXTJR.setSelected(true);
04756: jRadioButtonMenuItemPreviewTXTJR.setText("TXT JR preview");
04757: jRadioButtonMenuItemPreviewTXTJR
04758: .addActionListener(new java.awt.event.ActionListener() {
04759: public void actionPerformed(
04760: java.awt.event.ActionEvent evt) {
04761: jRadioButtonMenuItemPreviewTXTJRActionPerformed(evt);
04762: }
04763: });
04764: jMenuBuild.add(jRadioButtonMenuItemPreviewTXTJR);
04765:
04766: buttonGroupExportType.add(jRadioButtonMenuItemPreviewRTF);
04767: jRadioButtonMenuItemPreviewRTF.setSelected(true);
04768: jRadioButtonMenuItemPreviewRTF.setText("RTF preview");
04769: jRadioButtonMenuItemPreviewRTF
04770: .addActionListener(new java.awt.event.ActionListener() {
04771: public void actionPerformed(
04772: java.awt.event.ActionEvent evt) {
04773: jRadioButtonMenuItemPreviewRTFActionPerformed(evt);
04774: }
04775: });
04776: jMenuBuild.add(jRadioButtonMenuItemPreviewRTF);
04777:
04778: buttonGroupExportType.add(jRadioButtonMenuItemPreviewODF);
04779: jRadioButtonMenuItemPreviewODF
04780: .setText("OpenOffice (ODF) preview");
04781: jRadioButtonMenuItemPreviewODF
04782: .addActionListener(new java.awt.event.ActionListener() {
04783: public void actionPerformed(
04784: java.awt.event.ActionEvent evt) {
04785: jRadioButtonMenuItemPreviewODFActionPerformed(evt);
04786: }
04787: });
04788: jMenuBuild.add(jRadioButtonMenuItemPreviewODF);
04789:
04790: buttonGroupExportType.add(jRadioButtonMenuItemPreviewFLASH);
04791: jRadioButtonMenuItemPreviewFLASH
04792: .setText("Flash preview (experimental)");
04793: jRadioButtonMenuItemPreviewFLASH
04794: .addActionListener(new java.awt.event.ActionListener() {
04795: public void actionPerformed(
04796: java.awt.event.ActionEvent evt) {
04797: jRadioButtonMenuItemPreviewFLASHActionPerformed(evt);
04798: }
04799: });
04800: jMenuBuild.add(jRadioButtonMenuItemPreviewFLASH);
04801:
04802: buttonGroupExportType
04803: .add(jRadioButtonMenuItemPreviewInternalViewer);
04804: jRadioButtonMenuItemPreviewInternalViewer
04805: .setText("JRViewer preview");
04806: jRadioButtonMenuItemPreviewInternalViewer
04807: .addActionListener(new java.awt.event.ActionListener() {
04808: public void actionPerformed(
04809: java.awt.event.ActionEvent evt) {
04810: jRadioButtonMenuItemPreviewInternalViewerActionPerformed(evt);
04811: }
04812: });
04813: jMenuBuild.add(jRadioButtonMenuItemPreviewInternalViewer);
04814: jMenuBuild.add(jSeparator14);
04815:
04816: jMenuItemActiveConnection1.setText("Set active connection");
04817: jMenuItemActiveConnection1
04818: .setToolTipText("Set the connection that must be used to fill this report");
04819: jMenuItemActiveConnection1
04820: .addActionListener(new java.awt.event.ActionListener() {
04821: public void actionPerformed(
04822: java.awt.event.ActionEvent evt) {
04823: jMenuItemActiveConnectionActionPerformed(evt);
04824: }
04825: });
04826: jMenuBuild.add(jMenuItemActiveConnection1);
04827:
04828: jMenuItemReportLocale.setText("Item");
04829: jMenuItemReportLocale
04830: .addActionListener(new java.awt.event.ActionListener() {
04831: public void actionPerformed(
04832: java.awt.event.ActionEvent evt) {
04833: jMenuItemReportLocaleActionPerformed(evt);
04834: }
04835: });
04836: jMenuBuild.add(jMenuItemReportLocale);
04837:
04838: jMenuItemReportTimeZone.setText("Time Zone");
04839: jMenuItemReportTimeZone
04840: .addActionListener(new java.awt.event.ActionListener() {
04841: public void actionPerformed(
04842: java.awt.event.ActionEvent evt) {
04843: jMenuItemReportTimeZoneActionPerformed(evt);
04844: }
04845: });
04846: jMenuBuild.add(jMenuItemReportTimeZone);
04847:
04848: jCheckBoxMenuItemIgnorePagination.setText("Ignore pagination");
04849: jCheckBoxMenuItemIgnorePagination
04850: .addActionListener(new java.awt.event.ActionListener() {
04851: public void actionPerformed(
04852: java.awt.event.ActionEvent evt) {
04853: jCheckBoxMenuItemIgnorePaginationActionPerformed(evt);
04854: }
04855: });
04856: jMenuBuild.add(jCheckBoxMenuItemIgnorePagination);
04857:
04858: jMenuItemMaxRecords.setText("Max records");
04859: jMenuItemMaxRecords
04860: .addActionListener(new java.awt.event.ActionListener() {
04861: public void actionPerformed(
04862: java.awt.event.ActionEvent evt) {
04863: jMenuItemMaxRecordsActionPerformed(evt);
04864: }
04865: });
04866: jMenuBuild.add(jMenuItemMaxRecords);
04867:
04868: jCheckBoxMenuItemReportVirtualizer
04869: .setText("Use Report virtualizer");
04870: jCheckBoxMenuItemReportVirtualizer
04871: .addActionListener(new java.awt.event.ActionListener() {
04872: public void actionPerformed(
04873: java.awt.event.ActionEvent evt) {
04874: jCheckBoxMenuItemReportVirtualizerActionPerformed(evt);
04875: }
04876: });
04877: jMenuBuild.add(jCheckBoxMenuItemReportVirtualizer);
04878:
04879: jMDIMenuBar.add(jMenuBuild);
04880:
04881: jMenuTools.setMnemonic('t');
04882: jMenuTools.setText("Options");
04883:
04884: jCheckBoxMenuItemSnapToGrid.setText("Snap To Grid");
04885: jCheckBoxMenuItemSnapToGrid.setEnabled(false);
04886: jCheckBoxMenuItemSnapToGrid
04887: .addActionListener(new java.awt.event.ActionListener() {
04888: public void actionPerformed(
04889: java.awt.event.ActionEvent evt) {
04890: jCheckBoxMenuItemSnapToGridActionPerformed(evt);
04891: }
04892: });
04893: jMenuTools.add(jCheckBoxMenuItemSnapToGrid);
04894:
04895: jCheckBoxMenuItemEMM.setText("Disable elements mouse move");
04896: jCheckBoxMenuItemEMM.setEnabled(false);
04897: jCheckBoxMenuItemEMM
04898: .addActionListener(new java.awt.event.ActionListener() {
04899: public void actionPerformed(
04900: java.awt.event.ActionEvent evt) {
04901: jCheckBoxMenuItemEMMActionPerformed(evt);
04902: }
04903: });
04904: jMenuTools.add(jCheckBoxMenuItemEMM);
04905: jMenuTools.add(jSeparator13);
04906:
04907: jMenuItemOptions.setText("Settings...");
04908: jMenuItemOptions
04909: .addActionListener(new java.awt.event.ActionListener() {
04910: public void actionPerformed(
04911: java.awt.event.ActionEvent evt) {
04912: jMenuItemOptionsActionPerformed(evt);
04913: }
04914: });
04915: jMenuTools.add(jMenuItemOptions);
04916:
04917: jMenuItemCompatibility.setText("Compatibility...");
04918: jMenuItemCompatibility
04919: .addActionListener(new java.awt.event.ActionListener() {
04920: public void actionPerformed(
04921: java.awt.event.ActionEvent evt) {
04922: jMenuItemCompatibilityActionPerformed(evt);
04923: }
04924: });
04925: jMenuTools.add(jMenuItemCompatibility);
04926:
04927: jMenuItemClasspath.setText("Classpath");
04928: jMenuItemClasspath
04929: .addActionListener(new java.awt.event.ActionListener() {
04930: public void actionPerformed(
04931: java.awt.event.ActionEvent evt) {
04932: jMenuItemClasspathActionPerformed(evt);
04933: }
04934: });
04935: jMenuTools.add(jMenuItemClasspath);
04936:
04937: jMenuItemFontspath.setText("Fonts path");
04938: jMenuItemFontspath
04939: .addActionListener(new java.awt.event.ActionListener() {
04940: public void actionPerformed(
04941: java.awt.event.ActionEvent evt) {
04942: jMenuItemClasspathActionPerformed1(evt);
04943: }
04944: });
04945: jMenuTools.add(jMenuItemFontspath);
04946:
04947: jMenuItemReloadFonts.setText("Reload fonts");
04948: jMenuItemReloadFonts
04949: .addActionListener(new java.awt.event.ActionListener() {
04950: public void actionPerformed(
04951: java.awt.event.ActionEvent evt) {
04952: jMenuItemReloadFontsActionPerformed(evt);
04953: }
04954: });
04955: jMenuTools.add(jMenuItemReloadFonts);
04956:
04957: jMenuItemExpressions.setText("Formulas");
04958: jMenuItemExpressions
04959: .addActionListener(new java.awt.event.ActionListener() {
04960: public void actionPerformed(
04961: java.awt.event.ActionEvent evt) {
04962: jMenuItemExportOptionsActionPerformed1(evt);
04963: }
04964: });
04965: jMenuTools.add(jMenuItemExpressions);
04966:
04967: jMenuItemExportOptions.setText("Export options");
04968: jMenuItemExportOptions
04969: .addActionListener(new java.awt.event.ActionListener() {
04970: public void actionPerformed(
04971: java.awt.event.ActionEvent evt) {
04972: jMenuItemExportOptionsActionPerformed(evt);
04973: }
04974: });
04975: jMenuTools.add(jMenuItemExportOptions);
04976:
04977: jMenuItemQueryExecuters.setText("Query executers");
04978: jMenuItemQueryExecuters
04979: .addActionListener(new java.awt.event.ActionListener() {
04980: public void actionPerformed(
04981: java.awt.event.ActionEvent evt) {
04982: jMenuItemExpressionsjMenuItemExportOptionsActionPerformed1(evt);
04983: }
04984: });
04985: jMenuTools.add(jMenuItemQueryExecuters);
04986: jMenuTools.add(jSeparator7);
04987:
04988: jMenuItemPluginConfig.setText("Configure plugins");
04989: jMenuItemPluginConfig
04990: .addActionListener(new java.awt.event.ActionListener() {
04991: public void actionPerformed(
04992: java.awt.event.ActionEvent evt) {
04993: jMenuItemPluginConfigActionPerformed(evt);
04994: }
04995: });
04996: jMenuTools.add(jMenuItemPluginConfig);
04997:
04998: jMDIMenuBar.add(jMenuTools);
04999:
05000: jMenuPlugins.setText("Plugins");
05001: jMDIMenuBar.add(jMenuPlugins);
05002:
05003: jMenuWindow.setMnemonic('w');
05004: jMenuWindow.setText("Window");
05005:
05006: jMenuItemCascade
05007: .setIcon(new javax.swing.ImageIcon(
05008: getClass()
05009: .getResource(
05010: "/it/businesslogic/ireport/icons/menu/win_cascade.gif"))); // NOI18N
05011: jMenuItemCascade.setText("Cascade");
05012: jMenuItemCascade
05013: .addActionListener(new java.awt.event.ActionListener() {
05014: public void actionPerformed(
05015: java.awt.event.ActionEvent evt) {
05016: jMenuItemCascadeActionPerformed(evt);
05017: }
05018: });
05019: jMenuWindow.add(jMenuItemCascade);
05020:
05021: jMenuItemTileHorizontal
05022: .setIcon(new javax.swing.ImageIcon(
05023: getClass()
05024: .getResource(
05025: "/it/businesslogic/ireport/icons/menu/win_htile.gif"))); // NOI18N
05026: jMenuItemTileHorizontal.setText("Tile horizontal");
05027: jMenuItemTileHorizontal
05028: .addActionListener(new java.awt.event.ActionListener() {
05029: public void actionPerformed(
05030: java.awt.event.ActionEvent evt) {
05031: jMenuItemTileHorizontalActionPerformed(evt);
05032: }
05033: });
05034: jMenuWindow.add(jMenuItemTileHorizontal);
05035:
05036: jMenuItemTileVertical
05037: .setIcon(new javax.swing.ImageIcon(
05038: getClass()
05039: .getResource(
05040: "/it/businesslogic/ireport/icons/menu/win_vtile.gif"))); // NOI18N
05041: jMenuItemTileVertical.setText("Tile vertical");
05042: jMenuItemTileVertical
05043: .addActionListener(new java.awt.event.ActionListener() {
05044: public void actionPerformed(
05045: java.awt.event.ActionEvent evt) {
05046: jMenuItemTileVerticalActionPerformed(evt);
05047: }
05048: });
05049: jMenuWindow.add(jMenuItemTileVertical);
05050:
05051: jMenuItemtileAnodine
05052: .setIcon(new javax.swing.ImageIcon(
05053: getClass()
05054: .getResource(
05055: "/it/businesslogic/ireport/icons/menu/win_atile.gif"))); // NOI18N
05056: jMenuItemtileAnodine.setText("Tile anodine");
05057: jMenuItemtileAnodine
05058: .addActionListener(new java.awt.event.ActionListener() {
05059: public void actionPerformed(
05060: java.awt.event.ActionEvent evt) {
05061: jMenuItemtileAnodineActionPerformed(evt);
05062: }
05063: });
05064: jMenuWindow.add(jMenuItemtileAnodine);
05065:
05066: jMenuItemNextWin
05067: .setIcon(new javax.swing.ImageIcon(
05068: getClass()
05069: .getResource(
05070: "/it/businesslogic/ireport/icons/menu/win_next.gif"))); // NOI18N
05071: jMenuItemNextWin.setText("Next Window");
05072: jMenuItemNextWin
05073: .addActionListener(new java.awt.event.ActionListener() {
05074: public void actionPerformed(
05075: java.awt.event.ActionEvent evt) {
05076: jMenuItemNextWinActionPerformed(evt);
05077: }
05078: });
05079: jMenuWindow.add(jMenuItemNextWin);
05080:
05081: jMenuItemPrevWin
05082: .setIcon(new javax.swing.ImageIcon(
05083: getClass()
05084: .getResource(
05085: "/it/businesslogic/ireport/icons/menu/win_prev.gif"))); // NOI18N
05086: jMenuItemPrevWin.setText("Previous Window");
05087: jMenuItemPrevWin
05088: .addActionListener(new java.awt.event.ActionListener() {
05089: public void actionPerformed(
05090: java.awt.event.ActionEvent evt) {
05091: jMenuItemPrevWinActionPerformed(evt);
05092: }
05093: });
05094: jMenuWindow.add(jMenuItemPrevWin);
05095:
05096: jMenuItemRightSide.setText("Show/Hide right side");
05097: jMenuItemRightSide
05098: .addActionListener(new java.awt.event.ActionListener() {
05099: public void actionPerformed(
05100: java.awt.event.ActionEvent evt) {
05101: jMenuItemRightSideActionPerformed(evt);
05102: }
05103: });
05104: jMenuWindow.add(jMenuItemRightSide);
05105: jMenuWindow.add(jSeparator21);
05106:
05107: jMDIMenuBar.add(jMenuWindow);
05108:
05109: jMenuHelp.setMnemonic('h');
05110: jMenuHelp.setText("Help");
05111:
05112: jMenuItemHomePage.setText("iReport home page");
05113: jMenuItemHomePage
05114: .addActionListener(new java.awt.event.ActionListener() {
05115: public void actionPerformed(
05116: java.awt.event.ActionEvent evt) {
05117: jMenuItemForumjMenuItemHelpActionPerformed1(evt);
05118: }
05119: });
05120: jMenuHelp.add(jMenuItemHomePage);
05121:
05122: jMenuItemHelp.setText("Help...");
05123: jMenuItemHelp
05124: .addActionListener(new java.awt.event.ActionListener() {
05125: public void actionPerformed(
05126: java.awt.event.ActionEvent evt) {
05127: jMenuItemHelpActionPerformed(evt);
05128: }
05129: });
05130: jMenuHelp.add(jMenuItemHelp);
05131:
05132: jMenuItemForum.setText("Forum...");
05133: jMenuItemForum
05134: .addActionListener(new java.awt.event.ActionListener() {
05135: public void actionPerformed(
05136: java.awt.event.ActionEvent evt) {
05137: jMenuItemHelpActionPerformed1(evt);
05138: }
05139: });
05140: jMenuHelp.add(jMenuItemForum);
05141:
05142: jMenuItemAbout.setText("About iReport...");
05143: jMenuItemAbout
05144: .addActionListener(new java.awt.event.ActionListener() {
05145: public void actionPerformed(
05146: java.awt.event.ActionEvent evt) {
05147: jMenuItemAboutActionPerformed(evt);
05148: }
05149: });
05150: jMenuHelp.add(jMenuItemAbout);
05151:
05152: jMDIMenuBar.add(jMenuHelp);
05153:
05154: setJMenuBar(jMDIMenuBar);
05155:
05156: pack();
05157: }// </editor-fold>//GEN-END:initComponents
05158:
05159: private void jRadioButtonMenuItemPreviewODFActionPerformed(
05160: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewODFActionPerformed
05161: this .setReportViewer(IREPORT_ODF_VIEWER);
05162: }//GEN-LAST:event_jRadioButtonMenuItemPreviewODFActionPerformed
05163:
05164: private void jPanelMasterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelMasterMouseClicked
05165:
05166: }//GEN-LAST:event_jPanelMasterMouseClicked
05167:
05168: private void formWindowStateChanged(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowStateChanged
05169:
05170: }//GEN-LAST:event_formWindowStateChanged
05171:
05172: private void jMenuItemAddGroupActionPerformed1(
05173: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAddGroupActionPerformed1
05174:
05175: JReportFrame activeFrame = this .getActiveReportFrame();
05176: if (activeFrame != null) {
05177:
05178: this .setActiveTool(null);
05179: activeFrame
05180: .setNewObjectType(ReportElementType.BREAK_ELEMENT);
05181: }
05182:
05183: }//GEN-LAST:event_jMenuItemAddGroupActionPerformed1
05184:
05185: private void jMenuItemCompileActionPerformed1(
05186: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCompileActionPerformed1
05187:
05188: UserTemplatesDialog utd = new UserTemplatesDialog(this , true);
05189: utd.setVisible(true);
05190:
05191: }//GEN-LAST:event_jMenuItemCompileActionPerformed1
05192:
05193: private void jMenuItemCompileItemStateChanged1(
05194: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jMenuItemCompileItemStateChanged1
05195: // TODO add your handling code here:
05196: }//GEN-LAST:event_jMenuItemCompileItemStateChanged1
05197:
05198: private void jMenuItemReloadFontsActionPerformed(
05199: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReloadFontsActionPerformed
05200:
05201: Thread fontsThread = new Thread(new Runnable() {
05202: public void run() {
05203: reloadFontsLists();
05204: }
05205: });
05206:
05207: fontsThread.start();
05208:
05209: }//GEN-LAST:event_jMenuItemReloadFontsActionPerformed
05210:
05211: private void jMenuItemClasspathActionPerformed1(
05212: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemClasspathActionPerformed1
05213:
05214: FontsPathDialog cpd = new FontsPathDialog(this , true);
05215: cpd.setFontspath(getFontspath(), getClasspath());
05216: cpd.setVisible(true);
05217: if (cpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
05218: setFontspath(cpd.getFontspath());
05219: }
05220: }//GEN-LAST:event_jMenuItemClasspathActionPerformed1
05221:
05222: private void jMenuItemForumjMenuItemHelpActionPerformed1(
05223: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemForumjMenuItemHelpActionPerformed1
05224: openUrl("http://jasperforge.org/sf/projects/ireport");
05225: }//GEN-LAST:event_jMenuItemForumjMenuItemHelpActionPerformed1
05226:
05227: private void jMenuItemHelpActionPerformed1(
05228: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHelpActionPerformed1
05229:
05230: openUrl("http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=showcat&catid=9");
05231:
05232: }//GEN-LAST:event_jMenuItemHelpActionPerformed1
05233:
05234: private void jButtonSaveActionPerformed1(
05235: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed1
05236:
05237: jMenuItemSaveAllActionPerformed(evt);
05238: }//GEN-LAST:event_jButtonSaveActionPerformed1
05239:
05240: private void jButtonNewActionPerformed1(
05241: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNewActionPerformed1
05242:
05243: jMenuItemWizardActionPerformed(evt);
05244: }//GEN-LAST:event_jButtonNewActionPerformed1
05245:
05246: private void jMenuItemExpressionsjMenuItemExportOptionsActionPerformed1(
05247: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExpressionsjMenuItemExportOptionsActionPerformed1
05248:
05249: QueryExecutersDialog qed = new QueryExecutersDialog(this , true);
05250: qed.setVisible(true);
05251:
05252: }//GEN-LAST:event_jMenuItemExpressionsjMenuItemExportOptionsActionPerformed1
05253:
05254: private void jCheckBoxMenuItemExplorerActionPerformed1(
05255: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemExplorerActionPerformed1
05256:
05257: if (jCheckBoxMenuItemThreadList.isSelected()) {
05258: //DockingManager.dock((Dockable)viewThreads, (Dockable)desktop, DockingConstants.EAST_REGION);
05259: Misc.dockAt(viewThreads, DockingConstants.SOUTH_REGION, 4);
05260: } else {
05261: DockingManager.close(viewThreads);
05262: }
05263: }//GEN-LAST:event_jCheckBoxMenuItemExplorerActionPerformed1
05264:
05265: private void jMenuItemReportTimeZoneActionPerformed(
05266: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportTimeZoneActionPerformed
05267:
05268: it.businesslogic.ireport.gui.locale.TimeZoneDialog fd = new it.businesslogic.ireport.gui.locale.TimeZoneDialog(
05269: this , true);
05270: fd.setReportTimeZoneId(this .getProperties().getProperty(
05271: "reportTimeZoneId", ""));
05272: fd.setVisible(true);
05273:
05274: if (fd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
05275: String reportTimeZoneId = fd.getReportTimeZoneId();
05276: if (reportTimeZoneId == null) {
05277: this .getProperties().remove("reportTimeZoneId");
05278: } else {
05279: this .getProperties().setProperty("reportTimeZoneId",
05280: reportTimeZoneId);
05281: }
05282: saveiReportConfiguration();
05283: updateJMenuItemReportTimeZone();
05284: }
05285:
05286: }//GEN-LAST:event_jMenuItemReportTimeZoneActionPerformed
05287:
05288: private void jMenuItemExportOptionsActionPerformed1(
05289: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExportOptionsActionPerformed1
05290:
05291: CustomExpressionsDialog ced = new CustomExpressionsDialog(this ,
05292: true);
05293: ced.setExpressions(ExpressionEditor.defaultExpressions);
05294: ced.setVisible(true);
05295: if (ced.getDialogResult() == JOptionPane.OK_OPTION) {
05296: saveExpressionsList(ced.getExpressions());
05297: }
05298: }//GEN-LAST:event_jMenuItemExportOptionsActionPerformed1
05299:
05300: private void jMenuItemAddGroupActionPerformed(
05301: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAddGroupActionPerformed
05302:
05303: ReportGroupWizard rgw = new ReportGroupWizard();
05304: rgw.startWizard();
05305: }//GEN-LAST:event_jMenuItemAddGroupActionPerformed
05306:
05307: private void jCheckBoxMenuItemStylesLibraryActionPerformed(
05308: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemStylesLibraryActionPerformed
05309: if (jCheckBoxMenuItemStylesLibrary.isSelected()) {
05310: Misc.dockAt(stylesPanleView, DockingConstants.EAST_REGION,
05311: 2);
05312: // this.getDockingContainerRight().addPanel("Styles library", this.stylesView, true);
05313: } else {
05314: DockingManager.close(stylesPanleView);
05315: }
05316: getProperties().put("panelStylesLibrary",
05317: "" + jCheckBoxMenuItemStylesLibrary.isSelected());
05318: this .saveiReportConfiguration();
05319: }//GEN-LAST:event_jCheckBoxMenuItemStylesLibraryActionPerformed
05320:
05321: private void jCheckBoxMenuItemLibraryActionPerformed(
05322: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemLibraryActionPerformed
05323: if (jCheckBoxMenuItemLibrary.isSelected()) {
05324: Misc.dockAt(viewLibrary, DockingConstants.EAST_REGION, 1);
05325: // this.getDockingContainerRight().addPanel("Library", this.libraryPanel, true);
05326: } else {
05327: DockingManager.close(viewLibrary);
05328: }
05329: getProperties().put("panelLibrary",
05330: "" + jCheckBoxMenuItemLibrary.isSelected());
05331: this .saveiReportConfiguration();
05332:
05333: }//GEN-LAST:event_jCheckBoxMenuItemLibraryActionPerformed
05334:
05335: private void jCheckBoxMenuItemDocumentStructureActionPerformed1(
05336: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemDocumentStructureActionPerformed1
05337: if (jCheckBoxMenuItemDocumentStructure.isSelected()) {
05338: if (getActiveReportFrame() == null
05339: || getActiveReportFrame()
05340: .getSelectedCrosstabEditorPanel() == null) {
05341: Misc.dockAt(viewDocumentStructure,
05342: DockingConstants.WEST_REGION, 1);
05343: } else {
05344: jCheckBoxMenuItemDocumentStructure.setSelected(true);
05345: }
05346: } else {
05347: DockingManager.close(viewDocumentStructure);
05348: }
05349: getProperties().put("panelDocumentStructure",
05350: "" + jCheckBoxMenuItemDocumentStructure.isSelected());
05351: this .saveiReportConfiguration();
05352: }//GEN-LAST:event_jCheckBoxMenuItemDocumentStructureActionPerformed1
05353:
05354: private void jMenuViewStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jMenuViewStateChanged
05355:
05356: }//GEN-LAST:event_jMenuViewStateChanged
05357:
05358: private void jMenuViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuViewActionPerformed
05359:
05360: }//GEN-LAST:event_jMenuViewActionPerformed
05361:
05362: private void jCheckBoxMenuItemElementPropertiesActionPerformed1(
05363: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemElementPropertiesActionPerformed1
05364: if (jCheckBoxMenuItemElementProperties.isSelected()) {
05365: Misc.dockAt(viewPropertySheet,
05366: DockingConstants.EAST_REGION, 0);
05367: // this.getDockingContainerRight().insertPanel(0, "Element properties", this.reportElementSheetPanel, true);
05368: } else {
05369: DockingManager.close(viewPropertySheet);
05370: }
05371: getProperties().put("panelElementProperties",
05372: "" + jCheckBoxMenuItemElementProperties.isSelected());
05373: this .saveiReportConfiguration();
05374: }//GEN-LAST:event_jCheckBoxMenuItemElementPropertiesActionPerformed1
05375:
05376: private void jRadioButtonMenuItemPreviewXLS2ActionPerformed(
05377: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewXLS2ActionPerformed
05378: this .setReportViewer(IREPORT_XLS2_VIEWER);
05379: }//GEN-LAST:event_jRadioButtonMenuItemPreviewXLS2ActionPerformed
05380:
05381: private void jButtonLens1jButtonRun2ActionPerformed1(
05382: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLens1jButtonRun2ActionPerformed1
05383: JReportFrame activeFrame = this .getActiveReportFrame();
05384: if (activeFrame != null) {
05385:
05386: double value = jNumberComboBoxZoom.getValue();
05387:
05388: if (value > 800)
05389: value = 800;
05390: else if (value > 700)
05391: value = 700;
05392: else if (value > 600)
05393: value = 600;
05394: else if (value > 500)
05395: value = 500;
05396: else if (value > 400)
05397: value = 400;
05398: else if (value > 350)
05399: value = 350;
05400: else if (value > 300)
05401: value = 300;
05402: else if (value > 250)
05403: value = 250;
05404: else if (value > 200)
05405: value = 200;
05406: else if (value > 150)
05407: value = 150;
05408: else if (value > 100)
05409: value = 100;
05410: else if (value > 50)
05411: value = 50;
05412:
05413: jNumberComboBoxZoom.setValue(value);
05414: }
05415: }//GEN-LAST:event_jButtonLens1jButtonRun2ActionPerformed1
05416:
05417: private void jButtonRun2ActionPerformed1(
05418: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRun2ActionPerformed1
05419:
05420: JReportFrame activeFrame = this .getActiveReportFrame();
05421: if (activeFrame != null) {
05422:
05423: double value = jNumberComboBoxZoom.getValue();
05424:
05425: if (value < 50)
05426: value = 50;
05427: else if (value < 100)
05428: value = 100;
05429: else if (value < 150)
05430: value = 150;
05431: else if (value < 200)
05432: value = 200;
05433: else if (value < 250)
05434: value = 250;
05435: else if (value < 300)
05436: value = 300;
05437: else if (value < 350)
05438: value = 350;
05439: else if (value < 400)
05440: value = 400;
05441: else if (value < 500)
05442: value = 500;
05443: else if (value < 600)
05444: value = 600;
05445: else if (value < 700)
05446: value = 700;
05447: else
05448: value = 800;
05449:
05450: jNumberComboBoxZoom.setValue(value);
05451: }
05452:
05453: }//GEN-LAST:event_jButtonRun2ActionPerformed1
05454:
05455: private void jToggleButtonCrosstabToolItemStateChanged(
05456: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonCrosstabToolItemStateChanged
05457: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
05458: if (jMDIDesktopPane.getSelectedFrame() != null
05459: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
05460: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
05461: .getSelectedFrame();
05462: jrf
05463: .setNewObjectType(ReportElementType.CROSSTAB_ELEMENT);
05464: jrf.setLensMode(false);
05465: }
05466: setActiveTool(jToggleButtonCrosstabTool);
05467: }
05468: }//GEN-LAST:event_jToggleButtonCrosstabToolItemStateChanged
05469:
05470: private void jToggleButtonCrosstabToolActionPerformed(
05471: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonCrosstabToolActionPerformed
05472: jToggleButtonCrosstabTool.setSelected(true);
05473: }//GEN-LAST:event_jToggleButtonCrosstabToolActionPerformed
05474:
05475: private void jMenuItemStylesActionPerformed(
05476: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemStylesActionPerformed
05477: JReportFrame activeFrame = this .getActiveReportFrame();
05478: if (activeFrame != null) {
05479:
05480: StylesDialog sdd = new StylesDialog(this , true);
05481: sdd.setVisible(true);
05482:
05483: }
05484: }//GEN-LAST:event_jMenuItemStylesActionPerformed
05485:
05486: private void jMenuItemSubDatasetActionPerformed(
05487: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSubDatasetActionPerformed
05488:
05489: JReportFrame activeFrame = this .getActiveReportFrame();
05490: if (activeFrame != null) {
05491:
05492: SubDatasetsDialog sdd = new SubDatasetsDialog(this , true);
05493: sdd.setVisible(true);
05494: }
05495: }//GEN-LAST:event_jMenuItemSubDatasetActionPerformed
05496:
05497: private void jToggleButtonFrameToolItemStateChanged(
05498: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonFrameToolItemStateChanged
05499: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
05500: if (jMDIDesktopPane.getSelectedFrame() != null
05501: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
05502: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
05503: .getSelectedFrame();
05504: jrf.setNewObjectType(ReportElementType.FRAME_ELEMENT);
05505: jrf.setLensMode(false);
05506: }
05507: setActiveTool(jToggleButtonFrameTool);
05508: }
05509: }//GEN-LAST:event_jToggleButtonFrameToolItemStateChanged
05510:
05511: private void jToggleButtonFrameToolActionPerformed(
05512: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonFrameToolActionPerformed
05513: jToggleButtonFrameTool.setSelected(true);
05514: }//GEN-LAST:event_jToggleButtonFrameToolActionPerformed
05515:
05516: private void jMenuItemMaxRecordsActionPerformed(
05517: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemMaxRecordsActionPerformed
05518:
05519: it.businesslogic.ireport.gui.MaxRecordsDialog fd = new it.businesslogic.ireport.gui.MaxRecordsDialog(
05520: this , true);
05521: try {
05522: fd.setMaxRecords(Integer.parseInt(this .getProperties()
05523: .getProperty("maxRecords", "0")));
05524: } catch (Exception ex) {
05525: }
05526:
05527: fd.setVisible(true);
05528:
05529: if (fd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
05530: int maxRecords = fd.getMaxRecords();
05531:
05532: this .getProperties().setProperty("maxRecords",
05533: "" + maxRecords);
05534: saveiReportConfiguration();
05535: updateJMenuItemReportMaxRecords();
05536: }
05537:
05538: }//GEN-LAST:event_jMenuItemMaxRecordsActionPerformed
05539:
05540: private void jMenuBuildActionPerformed(
05541: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuBuildActionPerformed
05542: // TODO add your handling code here:
05543: }//GEN-LAST:event_jMenuBuildActionPerformed
05544:
05545: private void jRadioButtonMenuItemPreviewRTFActionPerformed(
05546: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewRTFActionPerformed
05547: this .setReportViewer(IREPORT_RTF_VIEWER);
05548: }//GEN-LAST:event_jRadioButtonMenuItemPreviewRTFActionPerformed
05549:
05550: private void jRadioButtonMenuItemPreviewTXTJRActionPerformed(
05551: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewTXTJRActionPerformed
05552: this .setReportViewer(IREPORT_TXT_JR_VIEWER);
05553: }//GEN-LAST:event_jRadioButtonMenuItemPreviewTXTJRActionPerformed
05554:
05555: private void jCheckBoxMenuItemIgnorePaginationActionPerformed(
05556: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemIgnorePaginationActionPerformed
05557:
05558: getProperties().put("IgnorePagination",
05559: "" + jCheckBoxMenuItemIgnorePagination.isSelected());
05560: this .saveiReportConfiguration();
05561:
05562: }//GEN-LAST:event_jCheckBoxMenuItemIgnorePaginationActionPerformed
05563:
05564: private void jCheckBoxMenuItemReportVirtualizerActionPerformed(
05565: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemReportVirtualizerActionPerformed
05566:
05567: getProperties().put("ReportVirtualizer",
05568: "" + jCheckBoxMenuItemReportVirtualizer.isSelected());
05569: this .saveiReportConfiguration();
05570:
05571: }//GEN-LAST:event_jCheckBoxMenuItemReportVirtualizerActionPerformed
05572:
05573: private void jMenuItemPrintActionPerformed(
05574: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPrintActionPerformed
05575:
05576: JReportFrame activeFrame = this .getActiveReportFrame();
05577: if (activeFrame != null) {
05578:
05579: java.awt.Image img = activeFrame.getImage();
05580: HashMap hm = new HashMap();
05581: hm.put("report", activeFrame.getReport());
05582: hm.put("design_img", img);
05583: try {
05584: net.sf.jasperreports.engine.JasperReport jr = net.sf.jasperreports.engine.JasperCompileManager
05585: .compileReport(getClass()
05586: .getClassLoader()
05587: .getResourceAsStream(
05588: "it/businesslogic/ireport/res/ireport_design.jrxml"));
05589: net.sf.jasperreports.engine.JasperPrint print = net.sf.jasperreports.engine.JasperFillManager
05590: .fillReport(
05591: jr,
05592: hm,
05593: new net.sf.jasperreports.engine.JREmptyDataSource());
05594: net.sf.jasperreports.view.JasperViewer jasperViewer = new net.sf.jasperreports.view.JasperViewer(
05595: print, false);
05596: jasperViewer.setTitle("iReport JasperViewer");
05597: jasperViewer.setVisible(true);
05598: } catch (Exception ex) {
05599: ex.printStackTrace();
05600: }
05601: }
05602:
05603: }//GEN-LAST:event_jMenuItemPrintActionPerformed
05604:
05605: private void jMenuItemRightSideActionPerformed(
05606: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRightSideActionPerformed
05607:
05608: /*
05609: if (jSplitPaneHelp.getDividerSize() == 0)
05610: {
05611:
05612: jSplitPaneHelp.setDividerSize(6);
05613: jSplitPaneHelp.setDividerLocation( jSplitPaneHelp.getWidth()-8-rightColumnWidth );
05614: dockingContainerRight.setSize(400,10);
05615: dockingContainerRight.setVisible(true);
05616: }
05617: else
05618: {
05619: rightColumnWidth = dockingContainerRight.getWidth();
05620: jSplitPaneHelp.setDividerSize(0);
05621: dockingContainerRight.setVisible(false);
05622: }
05623: */
05624:
05625: }//GEN-LAST:event_jMenuItemRightSideActionPerformed
05626:
05627: private void jMenuAlignActionPerformed(
05628: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuAlignActionPerformed
05629: // TODO add your handling code here:
05630: }//GEN-LAST:event_jMenuAlignActionPerformed
05631:
05632: private void jMenuItemSaveAllFromListActionPerformed(
05633: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveAllFromListActionPerformed
05634: jMenuItemSaveAllActionPerformed(evt);
05635: }//GEN-LAST:event_jMenuItemSaveAllFromListActionPerformed
05636:
05637: private void jMenuItemSaveAsFromListActionPerformed(
05638: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveAsFromListActionPerformed
05639:
05640: //JReportFrame jrf = getSelectedJRFFromFilesTree();
05641: //if (jrf != null) {
05642: // saveAs( jrf );
05643: //}
05644:
05645: List frames = getSelectedJRFsFromFilesTree();
05646: for (int i = 0; i < frames.size(); ++i) {
05647: JReportFrame jrf = (JReportFrame) frames.get(i);
05648: try {
05649: saveAs(jrf);
05650: } catch (Exception ex) {
05651: }
05652: ;
05653: }
05654:
05655: }//GEN-LAST:event_jMenuItemSaveAsFromListActionPerformed
05656:
05657: protected void jMenuItemSaveFromListActionPerformed(
05658: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveFromListActionPerformed
05659:
05660: //JReportFrame jrf = getSelectedJRFFromFilesTree();
05661: //if (jrf != null) {
05662: // save( jrf );
05663: //}
05664:
05665: List frames = getSelectedJRFsFromFilesTree();
05666: for (int i = 0; i < frames.size(); ++i) {
05667: JReportFrame jrf = (JReportFrame) frames.get(i);
05668: try {
05669: save(jrf);
05670: } catch (Exception ex) {
05671: }
05672: ;
05673: }
05674:
05675: }//GEN-LAST:event_jMenuItemSaveFromListActionPerformed
05676:
05677: private void jMenuItemRevertToSavedActionPerformed(
05678: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRevertToSavedActionPerformed
05679:
05680: JReportFrame activeFrame = this .getActiveReportFrame();
05681: if (activeFrame != null) {
05682: //
05683: try {
05684: if (activeFrame.getReport().getFilename() != null
05685: && new File(activeFrame.getReport()
05686: .getFilename()).exists()) {
05687: String filename = activeFrame.getReport()
05688: .getFilename();
05689: activeFrame.getReport().setReportChanges(0);
05690: jMDIMenuBar.closeFrame(activeFrame, true);
05691: openFile(filename);
05692: }
05693: } catch (Exception ex) {
05694: }
05695: ;
05696: //dtn.getJrf().updateUI();
05697: //jMDIDesktopPane.internalFrameActivated(dtn.getJrf());
05698: //this.logOnConsole("Activated :"+dtn.getJrf().getReport().getFilename()+"\n");
05699: }
05700: }//GEN-LAST:event_jMenuItemRevertToSavedActionPerformed
05701:
05702: private void jMenuItemRevertToSavedFromListActionPerformed(
05703: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRevertToSavedFromListActionPerformed
05704:
05705: List frames = getSelectedJRFsFromFilesTree();
05706: for (int i = 0; i < frames.size(); ++i) {
05707: JReportFrame jrf = (JReportFrame) frames.get(i);
05708: try {
05709: if (jrf != null
05710: && jrf.getReport().getFilename() != null
05711: && new File(jrf.getReport().getFilename())
05712: .exists()) {
05713: String filename = jrf.getReport().getFilename();
05714: jrf.getReport().setReportChanges(0);
05715: jMDIMenuBar.closeFrame(jrf, true);
05716: openFile(filename);
05717: }
05718: } catch (Exception ex) {
05719: }
05720: ;
05721: }
05722:
05723: //JReportFrame jrf = getSelectedJRFFromFilesTree();
05724: //if (jrf != null && jrf.getReport().getFilename() != null && new File(jrf.getReport().getFilename()).exists())
05725: //{
05726: // String filename = jrf.getReport().getFilename();
05727: // jrf.getReport().setReportChanges(0);
05728: // jMDIMenuBar.closeFrame( jrf, true);
05729: // openFile(filename);
05730: //}
05731:
05732: }//GEN-LAST:event_jMenuItemRevertToSavedFromListActionPerformed
05733:
05734: private void jMenuItemCloseAllExceptThisFromListActionPerformed(
05735: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseAllExceptThisFromListActionPerformed
05736:
05737: if (this .getActiveReportFrame() == null)
05738: return;
05739: JInternalFrame activeF = this .getActiveReportFrame();
05740:
05741: JReportFrame jrf = getSelectedJRFFromFilesTree();
05742:
05743: if (jrf != null) {
05744: //
05745: try {
05746: activeF = jrf;
05747: } catch (Exception ex) {
05748: }
05749: ;
05750: //dtn.getJrf().updateUI();
05751: //jMDIDesktopPane.internalFrameActivated(dtn.getJrf());
05752: //this.logOnConsole("Activated :"+dtn.getJrf().getReport().getFilename()+"\n");
05753: }
05754:
05755: JInternalFrame[] frames = this .jMDIDesktopPane.getAllFrames();
05756: for (int i = 0; i < frames.length; ++i) {
05757: if (frames[i] != activeF) {
05758: jMDIMenuBar.closeFrame(frames[i]);
05759: }
05760: }
05761:
05762: }//GEN-LAST:event_jMenuItemCloseAllExceptThisFromListActionPerformed
05763:
05764: private void jMenuItemCloseAllFromListActionPerformed(
05765: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseAllFromListActionPerformed
05766: jMenuItemCloseAllActionPerformed(evt);
05767: }//GEN-LAST:event_jMenuItemCloseAllFromListActionPerformed
05768:
05769: private void jMenuItemCloseFromListActionPerformed(
05770: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseFromListActionPerformed
05771:
05772: List frames = getSelectedJRFsFromFilesTree();
05773: for (int i = 0; i < frames.size(); ++i) {
05774: JReportFrame jrf = (JReportFrame) frames.get(i);
05775: try {
05776: jMDIMenuBar.closeFrame(jrf);
05777: } catch (Exception ex) {
05778: }
05779: ;
05780: }
05781: }//GEN-LAST:event_jMenuItemCloseFromListActionPerformed
05782:
05783: private void jMenuItemCloseAllExceptThisActionPerformed(
05784: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseAllExceptThisActionPerformed
05785:
05786: if (this .getActiveReportFrame() == null)
05787: return;
05788: JInternalFrame activeF = this .getActiveReportFrame();
05789: JInternalFrame[] frames = this .jMDIDesktopPane.getAllFrames();
05790: for (int i = 0; i < frames.length; ++i) {
05791: if (frames[i] != activeF) {
05792: jMDIMenuBar.closeFrame(frames[i]);
05793: }
05794: }
05795: }//GEN-LAST:event_jMenuItemCloseAllExceptThisActionPerformed
05796:
05797: private void jMenuItemCloseAllActionPerformed(
05798: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseAllActionPerformed
05799:
05800: JInternalFrame[] frames = jMDIDesktopPane.getAllFrames();
05801: for (int i = 0; i < frames.length; ++i) {
05802: if (frames[i] instanceof JReportFrame) {
05803: jMDIMenuBar.closeFrame(frames[i]);
05804: }
05805: }
05806:
05807: }//GEN-LAST:event_jMenuItemCloseAllActionPerformed
05808:
05809: private void jMenuItemCloseActionPerformed(
05810: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseActionPerformed
05811:
05812: jMDIMenuBar.closeFrame(this .getActiveReportFrame());
05813:
05814: }//GEN-LAST:event_jMenuItemCloseActionPerformed
05815:
05816: private void jMenuItemExportOptionsActionPerformed(
05817: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExportOptionsActionPerformed
05818: it.businesslogic.ireport.gui.export.ExportPreferencesDialog epf = new it.businesslogic.ireport.gui.export.ExportPreferencesDialog(
05819: this , true);
05820: epf.setVisible(true);
05821:
05822: }//GEN-LAST:event_jMenuItemExportOptionsActionPerformed
05823:
05824: private void jMenuItemClasspathActionPerformed(
05825: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemClasspathActionPerformed
05826:
05827: ClassPathDialog cpd = new ClassPathDialog(this , true);
05828: cpd.setClasspath(getClasspath());
05829: cpd.setVisible(true);
05830: if (cpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
05831: setClasspath(cpd.getClasspath());
05832: }
05833:
05834: }//GEN-LAST:event_jMenuItemClasspathActionPerformed
05835:
05836: private void jMenuItemCompileActionPerformed(
05837: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCompileActionPerformed
05838:
05839: jButtonCompilerActionPerformed(evt);
05840:
05841: }//GEN-LAST:event_jMenuItemCompileActionPerformed
05842:
05843: private void jMenuItemCompileItemStateChanged(
05844: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jMenuItemCompileItemStateChanged
05845: // TODO add your handling code here:
05846: }//GEN-LAST:event_jMenuItemCompileItemStateChanged
05847:
05848: private void jMenuItemRemoveMarginsActionPerformed(
05849: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRemoveMarginsActionPerformed
05850:
05851: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
05852: .getSelectedFrame();
05853:
05854: if (jrf == null)
05855: return;
05856:
05857: UndoOperation uo = new RemoveMarginsOperation(jrf, jrf
05858: .getReport().getTopMargin(), jrf.getReport()
05859: .getBottomMargin(), jrf.getReport().getLeftMargin(),
05860: jrf.getReport().getRightMargin());
05861: uo.redo();
05862:
05863: jrf.addUndoOperation(uo);
05864: }//GEN-LAST:event_jMenuItemRemoveMarginsActionPerformed
05865:
05866: private void jMenuItemReportLocaleActionPerformed(
05867: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportLocaleActionPerformed
05868:
05869: //it.businesslogic.ireport.gui.locale.NewLocaleFileDialog fd = new it.businesslogic.ireport.gui.locale.NewLocaleFileDialog(this,true);
05870: it.businesslogic.ireport.gui.locale.LocaleSelectorDialog fd = new it.businesslogic.ireport.gui.locale.LocaleSelectorDialog(
05871: this , true);
05872:
05873: String s = this .getProperties().getProperty("reportLocale");
05874: if (s != null) {
05875: fd.setSelectedLocaleId(s);
05876: }
05877: fd.setVisible(true);
05878:
05879: if (fd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
05880: //String reportLocale = fd.getText();
05881: String reportLocale = fd.getSelectedLocaleId();
05882: if (reportLocale == null)
05883: reportLocale = "";
05884: this .getProperties().setProperty("reportLocale",
05885: reportLocale);
05886: saveiReportConfiguration();
05887: updateJMenuItemReportLocaleText();
05888: }
05889:
05890: }//GEN-LAST:event_jMenuItemReportLocaleActionPerformed
05891:
05892: public void updateJMenuItemReportLocaleText() {
05893: Locale loc = Misc.getLocaleFromString(this .getProperties()
05894: .getProperty("reportLocale"));
05895: jMenuItemReportLocale
05896: .setText(it.businesslogic.ireport.util.I18n.getString(
05897: "setReportLocale", "Set report locale -")
05898: + " " + loc.getDisplayName());
05899: }
05900:
05901: public void updateJMenuItemReportTimeZone() {
05902: String s = this .getProperties().getProperty("reportTimeZoneId");
05903: String timezoneName = "default";
05904: if (s != null && s.length() > 0) {
05905: try {
05906: TimeZone tz = TimeZone.getTimeZone(s);
05907: timezoneName = new TimeZoneWrapper(tz) + "";
05908: } catch (Exception ex) {
05909:
05910: }
05911: }
05912:
05913: jMenuItemReportTimeZone
05914: .setText(it.businesslogic.ireport.util.I18n.getString(
05915: "setReportTimeZone", "Set report time zone -")
05916: + " " + timezoneName);
05917: }
05918:
05919: public void updateJMenuItemReportMaxRecords() {
05920: int maxRecords = 0;
05921: try {
05922: maxRecords = Integer.parseInt(this .getProperties()
05923: .getProperty("maxRecords", "0"));
05924: } catch (Exception ex) {
05925: }
05926:
05927: if (maxRecords > 0) {
05928: jMenuItemMaxRecords
05929: .setText(it.businesslogic.ireport.util.I18n
05930: .getFormattedString("maxRecords",
05931: "Max records ({0,number})",
05932: new Object[] { new Integer(
05933: maxRecords) }));
05934: } else {
05935: jMenuItemMaxRecords
05936: .setText(it.businesslogic.ireport.util.I18n
05937: .getString("maxRecordsNotSet",
05938: "maxRecordsNotSet"));
05939: }
05940: }
05941:
05942: private void jCheckBoxMenuItemEMMActionPerformed(
05943: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemEMMActionPerformed
05944:
05945: getProperties().put("EMM",
05946: "" + jCheckBoxMenuItemEMM.isSelected());
05947: this .saveiReportConfiguration();
05948:
05949: }//GEN-LAST:event_jCheckBoxMenuItemEMMActionPerformed
05950:
05951: private void jMenuItemHelpActionPerformed(
05952: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHelpActionPerformed
05953:
05954: openUrl("http://jasperforge.org/sf/wiki/do/viewPage/projects.ireport/wiki/HomePage");
05955:
05956: }//GEN-LAST:event_jMenuItemHelpActionPerformed
05957:
05958: public void openUrl(String url) {
05959: Misc.openURL(url);
05960: /*
05961: String operatingSystem = System.getProperty("os.name");
05962:
05963:
05964: try {
05965: if (operatingSystem.toLowerCase().indexOf("windows") > -1)
05966: {
05967: Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
05968: }
05969: else
05970: {
05971: // Try with htmlview...
05972: Runtime.getRuntime().exec("htmlview " + url + " &");
05973: }
05974: } catch (Exception ex)
05975: {
05976: javax.swing.JOptionPane.showMessageDialog( this,"Unable to open " + url, "", javax.swing.JOptionPane.ERROR_MESSAGE);
05977: }
05978: */
05979: }
05980:
05981: private void jListThreadsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jListThreadsMouseClicked
05982: if (evt.getButton() == evt.BUTTON3) {
05983:
05984: this .jPopupMenuThreads.show(jListThreads, evt.getPoint().x,
05985: evt.getPoint().y);
05986: }
05987: }//GEN-LAST:event_jListThreadsMouseClicked
05988:
05989: private void jMenuItemKillActionPerformed(
05990: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemKillActionPerformed
05991:
05992: Object obj = this .jListThreads.getSelectedValue();
05993: if (obj != null) {
05994: IReportCompiler ic = (IReportCompiler) obj;
05995: ic.stopThread();
05996: }
05997:
05998: }//GEN-LAST:event_jMenuItemKillActionPerformed
05999:
06000: private void jMenuLocaleFilesActionPerformed(
06001: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuLocaleFilesActionPerformed
06002: this .getLocaleFilesDialog().setVisible(true);
06003: }//GEN-LAST:event_jMenuLocaleFilesActionPerformed
06004:
06005: private void jMenuItemReportImportsActionPerformed(
06006: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportImportsActionPerformed
06007: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06008: .getSelectedFrame();
06009:
06010: ReportImportsDialog rsd = new ReportImportsDialog(this , true);
06011: rsd.setJReportFrame(jrf);
06012: rsd.setVisible(true);
06013:
06014: }//GEN-LAST:event_jMenuItemReportImportsActionPerformed
06015:
06016: private void jButtonAlignBottomActionPerformed(
06017: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignBottomActionPerformed
06018: setElementsValue("setVerticalAlign", "Bottom");
06019: }//GEN-LAST:event_jButtonAlignBottomActionPerformed
06020:
06021: private void jButtonAlignMiddleActionPerformed(
06022: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignMiddleActionPerformed
06023: setElementsValue("setVerticalAlign", "Middle");
06024: }//GEN-LAST:event_jButtonAlignMiddleActionPerformed
06025:
06026: private void jButtonAlignTopActionPerformed(
06027: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignTopActionPerformed
06028: setElementsValue("setVerticalAlign", "Top");
06029: }//GEN-LAST:event_jButtonAlignTopActionPerformed
06030:
06031: private void jButtonFormatCenterVActionPerformed(
06032: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFormatCenterVActionPerformed
06033: jMenuItemAlignVerticalAxisActionPerformed(evt);
06034: }//GEN-LAST:event_jButtonFormatCenterVActionPerformed
06035:
06036: private void jButtonFormatCenterHActionPerformed(
06037: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFormatCenterHActionPerformed
06038: jMenuItemAlignHorizontalAxisActionPerformed(evt);
06039: }//GEN-LAST:event_jButtonFormatCenterHActionPerformed
06040:
06041: private void jButtonStrikethroughtActionPerformed(
06042: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStrikethroughtActionPerformed
06043: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06044: .getSelectedFrame();
06045: if (jrf == null)
06046: return;
06047: // Set the new value for all selected elements...
06048: boolean bool = false;
06049: Enumeration e = jrf.getSelectedElements().elements();
06050: while (e.hasMoreElements()) {
06051: ReportElement repele = (ReportElement) e.nextElement();
06052: if (repele instanceof TextReportElement) {
06053: TextReportElement element = (TextReportElement) repele;
06054: bool = ((TextReportElement) repele).isStrikeTrought();
06055: break;
06056: }
06057: }
06058:
06059: setElementsValue("setStrikeTrought", new Boolean(!bool),
06060: Boolean.TYPE);
06061: //this.getElementPropertiesDialog().updateSelection();
06062: }//GEN-LAST:event_jButtonStrikethroughtActionPerformed
06063:
06064: private void jButtonUnderlineActionPerformed(
06065: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonUnderlineActionPerformed
06066:
06067: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06068: .getSelectedFrame();
06069: if (jrf == null)
06070: return;
06071: // Set the new value for all selected elements...
06072: boolean bool = false;
06073: Enumeration e = jrf.getSelectedElements().elements();
06074: while (e.hasMoreElements()) {
06075: ReportElement repele = (ReportElement) e.nextElement();
06076: if (repele instanceof TextReportElement) {
06077: TextReportElement element = (TextReportElement) repele;
06078: bool = ((TextReportElement) repele).isUnderline();
06079: break;
06080: }
06081: }
06082:
06083: setElementsValue("setUnderline", new Boolean(!bool),
06084: Boolean.TYPE);
06085: //this.getElementPropertiesDialog().updateSelection();
06086: }//GEN-LAST:event_jButtonUnderlineActionPerformed
06087:
06088: private void jButtonItalicActionPerformed(
06089: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonItalicActionPerformed
06090: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06091: .getSelectedFrame();
06092: if (jrf == null)
06093: return;
06094: // Set the new value for all selected elements...
06095: boolean bool = false;
06096: Enumeration e = jrf.getSelectedElements().elements();
06097: while (e.hasMoreElements()) {
06098: ReportElement repele = (ReportElement) e.nextElement();
06099: if (repele instanceof TextReportElement) {
06100: TextReportElement element = (TextReportElement) repele;
06101: bool = ((TextReportElement) repele).isItalic();
06102: break;
06103: }
06104: }
06105:
06106: setElementsValue("setItalic", new Boolean(!bool), Boolean.TYPE);
06107: //this.getElementPropertiesDialog().updateSelection();
06108: }//GEN-LAST:event_jButtonItalicActionPerformed
06109:
06110: private void jButtonBoldActionPerformed(
06111: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBoldActionPerformed
06112:
06113: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06114: .getSelectedFrame();
06115: if (jrf == null)
06116: return;
06117: // Set the new value for all selected elements...
06118: boolean bool = false;
06119: Enumeration e = jrf.getSelectedElements().elements();
06120: while (e.hasMoreElements()) {
06121: ReportElement repele = (ReportElement) e.nextElement();
06122: if (repele instanceof TextReportElement) {
06123: TextReportElement element = (TextReportElement) repele;
06124: bool = ((TextReportElement) repele).isBold();
06125: break;
06126: }
06127: }
06128:
06129: setElementsValue("setBold", new Boolean(!bool), Boolean.TYPE);
06130: //this.getElementPropertiesDialog().updateSelection();
06131: }//GEN-LAST:event_jButtonBoldActionPerformed
06132:
06133: private void jButtonDecreaseSizeActionPerformed(
06134: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDecreaseSizeActionPerformed
06135: setElementsValue("modifyFontSize", new Integer(-2),
06136: Integer.TYPE);
06137: //this.getElementPropertiesDialog().updateSelection();
06138: }//GEN-LAST:event_jButtonDecreaseSizeActionPerformed
06139:
06140: private void jButtonIncreaseSizeActionPerformed(
06141: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonIncreaseSizeActionPerformed
06142:
06143: setElementsValue("modifyFontSize", new Integer(2), Integer.TYPE);
06144:
06145: }//GEN-LAST:event_jButtonIncreaseSizeActionPerformed
06146:
06147: private void jComboBoxFontItemStateChanged(
06148: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxFontItemStateChanged
06149: if (!this .isDontHandleEvent()
06150: && jComboBoxFont.getSelectedItem() != null) {
06151: setElementsValue("setFontName", ""
06152: + jComboBoxFont.getSelectedItem());
06153: }
06154: }//GEN-LAST:event_jComboBoxFontItemStateChanged
06155:
06156: private void jNumberComboBoxSizeItemStateChanged(
06157: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jNumberComboBoxSizeItemStateChanged
06158: if (!this .isDontHandleEvent()) {
06159: setElementsValue("setFontSize", new Integer(
06160: (int) jNumberComboBoxSize.getValue()), Integer.TYPE);
06161: //this.getElementPropertiesDialog().updateSelection();
06162: }
06163: }//GEN-LAST:event_jNumberComboBoxSizeItemStateChanged
06164:
06165: private void jNumberComboBoxSizeActionPerformed(
06166: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jNumberComboBoxSizeActionPerformed
06167: if (!this .isDontHandleEvent()) {
06168: setElementsValue("setFontSize", new Integer(
06169: (int) jNumberComboBoxSize.getValue()), Integer.TYPE);
06170: }
06171: }//GEN-LAST:event_jNumberComboBoxSizeActionPerformed
06172:
06173: private void jCheckBoxMenuItemElementsFormattingActionPerformed(
06174: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemElementsFormattingActionPerformed
06175: jToolBarFormat.setVisible(jCheckBoxMenuItemElementsFormatting
06176: .isSelected());
06177: getProperties().put("toolbarFormattingVisible",
06178: "" + jCheckBoxMenuItemElementsFormatting.isSelected());
06179: this .saveiReportConfiguration();
06180: }//GEN-LAST:event_jCheckBoxMenuItemElementsFormattingActionPerformed
06181:
06182: private void jCheckBoxMenuItemTextFormattingActionPerformed(
06183: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemTextFormattingActionPerformed
06184: jToolBarText.setVisible(jCheckBoxMenuItemTextFormatting
06185: .isSelected());
06186: getProperties().put("toolbarTextVisible",
06187: "" + jCheckBoxMenuItemTextFormatting.isSelected());
06188: this .saveiReportConfiguration();
06189: }//GEN-LAST:event_jCheckBoxMenuItemTextFormattingActionPerformed
06190:
06191: private void jButtonAlignRightActionPerformed(
06192: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignRightActionPerformed
06193: setElementsValue("setAlign", "Right");
06194: }//GEN-LAST:event_jButtonAlignRightActionPerformed
06195:
06196: private void jButtonAlignCenterActionPerformed(
06197: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignCenterActionPerformed
06198: setElementsValue("setAlign", "Center");
06199: }//GEN-LAST:event_jButtonAlignCenterActionPerformed
06200:
06201: private void jButtonAlignJustifyActionPerformed(
06202: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignJustifyActionPerformed
06203: setElementsValue("setAlign", "Justified");
06204: }//GEN-LAST:event_jButtonAlignJustifyActionPerformed
06205:
06206: private void jButtonAlignLeftActionPerformed(
06207: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAlignLeftActionPerformed
06208: setElementsValue("setAlign", "Left");
06209: }//GEN-LAST:event_jButtonAlignLeftActionPerformed
06210:
06211: public void jMenuItemOrganizeActionPerformed(
06212: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemOrganizeActionPerformed
06213: FormatCommand.getCommand(OperationType.ORGANIZE_AS_A_TABLE)
06214: .execute();
06215: }//GEN-LAST:event_jMenuItemOrganizeActionPerformed
06216:
06217: public void jMenuItemLeftMarginActionPerformed(
06218: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLeftMarginActionPerformed
06219: FormatCommand.getCommand(OperationType.ALIGN_TO_LEFT_MARGIN)
06220: .execute();
06221: }//GEN-LAST:event_jMenuItemLeftMarginActionPerformed
06222:
06223: public void jMenuItemRightMarginActionPerformed(
06224: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRightMarginActionPerformed
06225: FormatCommand.getCommand(OperationType.ALIGN_TO_RIGHT_MARGIN)
06226: .execute();
06227: }//GEN-LAST:event_jMenuItemRightMarginActionPerformed
06228:
06229: private void jNumberComboBoxZoomActionPerformed(
06230: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jNumberComboBoxZoomActionPerformed
06231: //System.out.println( "Zoom: " + jNumberComboBoxZoom.getValue());
06232: }//GEN-LAST:event_jNumberComboBoxZoomActionPerformed
06233:
06234: private void jMenuItemPluginConfigActionPerformed(
06235: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPluginConfigActionPerformed
06236: getPluginConfigurationDialog().setVisible(true);
06237: }//GEN-LAST:event_jMenuItemPluginConfigActionPerformed
06238:
06239: private void jScrollPaneFilesMousePressed(
06240: java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPaneFilesMousePressed
06241:
06242: }//GEN-LAST:event_jScrollPaneFilesMousePressed
06243:
06244: private void jTreeFilesMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTreeFilesMousePressed
06245: if (evt.getButton() == evt.BUTTON3) {
06246:
06247: Misc.ensurePathIsSelected(jTreeFiles.getPathForLocation(evt
06248: .getX(), evt.getY()), jTreeFiles);
06249: List lst = getSelectedJRFsFromFilesTree();
06250: if (lst != null && lst.size() > 0) {
06251: this .jMenuItemCloseAllExceptThisFromList.setEnabled(lst
06252: .size() == 1);
06253: this .jPopupMenuFiles.show(jTreeFiles, evt.getPoint().x,
06254: evt.getPoint().y);
06255: }
06256: }
06257: }//GEN-LAST:event_jTreeFilesMousePressed
06258:
06259: private void jRadioButtonMenuItemPreviewTXTActionPerformed(
06260: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewTXTActionPerformed
06261: this .setReportViewer(IREPORT_TXT_VIEWER);
06262: }//GEN-LAST:event_jRadioButtonMenuItemPreviewTXTActionPerformed
06263:
06264: private void jToggleButtonBarcodeToolItemStateChanged(
06265: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonBarcodeToolItemStateChanged
06266: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
06267: if (jMDIDesktopPane.getSelectedFrame() != null
06268: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06269: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06270: .getSelectedFrame();
06271: jrf.setNewObjectType(ReportElementType.BARCODE_ELEMENT);
06272: jrf.setLensMode(false);
06273: }
06274: setActiveTool(jToggleButtonBarcodeTool);
06275: }
06276: }//GEN-LAST:event_jToggleButtonBarcodeToolItemStateChanged
06277:
06278: private void jToggleButtonBarcodeToolActionPerformed(
06279: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonBarcodeToolActionPerformed
06280: jToggleButtonBarcodeTool.setSelected(true);
06281: }//GEN-LAST:event_jToggleButtonBarcodeToolActionPerformed
06282:
06283: private void jMenuItemChartActionPerformed(
06284: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemChartActionPerformed
06285: jToggleButtonChartToolItemStateChanged(new java.awt.event.ItemEvent(
06286: jToggleButtonChartTool, 0, jToggleButtonChartTool,
06287: java.awt.event.ItemEvent.SELECTED));
06288: }//GEN-LAST:event_jMenuItemChartActionPerformed
06289:
06290: private void jMenuItemImageActionPerformed(
06291: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImageActionPerformed
06292: jToggleButtonImageToolItemStateChanged(new java.awt.event.ItemEvent(
06293: jToggleButtonImageTool, 0, jToggleButtonImageTool,
06294: java.awt.event.ItemEvent.SELECTED));
06295: }//GEN-LAST:event_jMenuItemImageActionPerformed
06296:
06297: private void jToggleButtonChartToolActionPerformed(
06298: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonChartToolActionPerformed
06299: jToggleButtonChartTool.setSelected(true);
06300: }//GEN-LAST:event_jToggleButtonChartToolActionPerformed
06301:
06302: private void jMenuItemScriptletEditorActionPerformed(
06303: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemScriptletEditorActionPerformed
06304: if (jMDIDesktopPane.getSelectedFrame() != null
06305: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06306: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06307: .getSelectedFrame();
06308:
06309: if (jrf == null)
06310: return;
06311:
06312: if (jrf.getReport().getScriptletHandling() != Report.SCRIPTLET_IREPORT_INTERNAL_HANDLING) {
06313: if (JOptionPane
06314: .showConfirmDialog(
06315: this ,
06316: I18n
06317: .getString(
06318: "messages.scriptletEditor",
06319: "To use the scriptlet editor, you must leave iReport to handle the scriptlet class code internally.\n"
06320: + "You can set how handle scriptlet in report properties form.\n\nDo you want activate this option now?"),
06321: I18n
06322: .getString(
06323: "messages.scriptletEditorTitle",
06324: "Scriptlet editor"),
06325: JOptionPane.YES_NO_CANCEL_OPTION,
06326: JOptionPane.INFORMATION_MESSAGE) != JOptionPane.OK_OPTION) {
06327: return;
06328: }
06329:
06330: jrf.getReport().setScriptletHandling(
06331: Report.SCRIPTLET_IREPORT_INTERNAL_HANDLING);
06332: }
06333:
06334: this .getEventsForm().setVisible(true);
06335: this .getEventsForm().setJReportFrame(jrf);
06336: }
06337: }//GEN-LAST:event_jMenuItemScriptletEditorActionPerformed
06338:
06339: private void jMenuItemPropertiesActionPerformed(
06340: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPropertiesActionPerformed
06341:
06342: if (jMDIDesktopPane.getSelectedFrame() != null
06343: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06344: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06345: .getSelectedFrame();
06346: DatasetPropertiesDialog pd = new DatasetPropertiesDialog(
06347: this , true);
06348: pd.setDataset(jrf.getReport());
06349: pd.updateProperties();
06350:
06351: pd.setVisible(true);
06352: }
06353: }//GEN-LAST:event_jMenuItemPropertiesActionPerformed
06354:
06355: private void jRadioButtonMenuItemPreviewCSVActionPerformed(
06356: java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButtonMenuItemPreviewCSVActionPerformed
06357: {//GEN-HEADEREND:event_jRadioButtonMenuItemPreviewCSVActionPerformed
06358: this .setReportViewer(IREPORT_CSV_VIEWER);
06359: }//GEN-LAST:event_jRadioButtonMenuItemPreviewCSVActionPerformed
06360:
06361: private void jRadioButtonMenuItemPreviewXLSActionPerformed(
06362: java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButtonMenuItemPreviewXLSActionPerformed
06363: {//GEN-HEADEREND:event_jRadioButtonMenuItemPreviewXLSActionPerformed
06364: this .setReportViewer(IREPORT_XLS_VIEWER);
06365: }//GEN-LAST:event_jRadioButtonMenuItemPreviewXLSActionPerformed
06366:
06367: private void jRadioButtonMenuItemPreviewJAVAActionPerformed(
06368: java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButtonMenuItemPreviewJAVAActionPerformed
06369: {//GEN-HEADEREND:event_jRadioButtonMenuItemPreviewJAVAActionPerformed
06370: this .setReportViewer(IREPORT_JAVA_VIEWER);
06371: }//GEN-LAST:event_jRadioButtonMenuItemPreviewJAVAActionPerformed
06372:
06373: private void jRadioButtonMenuItemPreviewHTMLActionPerformed(
06374: java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButtonMenuItemPreviewHTMLActionPerformed
06375: {//GEN-HEADEREND:event_jRadioButtonMenuItemPreviewHTMLActionPerformed
06376: this .setReportViewer(IREPORT_HTML_VIEWER);
06377: }//GEN-LAST:event_jRadioButtonMenuItemPreviewHTMLActionPerformed
06378:
06379: private void jMenuItemQuitActionPerformed(
06380: java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItemQuitActionPerformed
06381: {//GEN-HEADEREND:event_jMenuItemQuitActionPerformed
06382: this .closeApplication();
06383: }//GEN-LAST:event_jMenuItemQuitActionPerformed
06384:
06385: public void paint(java.awt.Graphics g) {
06386: try {
06387: super .paint(g);
06388: } catch (Throwable ex) {
06389: ex.printStackTrace();
06390: }
06391: }
06392:
06393: private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
06394: // Checking for documents update outside iReport...
06395:
06396: if (!catchFormActivated)
06397: return;
06398:
06399: SwingUtilities.invokeLater(new Runnable() {
06400: public void run() {
06401: try {
06402: MainFrame.this .run();
06403: } catch (Throwable ex) {
06404: ex.printStackTrace();
06405: }
06406: }
06407: });
06408: // if (checkModifiedFielsThread == null || !checkModifiedFielsThread.isAlive()) {
06409: // checkModifiedFielsThread= new Thread( this );
06410: //
06411: // checkModifiedFielsThread.start();
06412: //run();
06413: // }
06414: }//GEN-LAST:event_formWindowActivated
06415:
06416: public void openFiles(java.util.List fileList) {
06417: java.util.Iterator iterator = fileList.iterator();
06418: while (iterator.hasNext()) {
06419: java.io.File file = (java.io.File) iterator.next();
06420: if (file.getName().toLowerCase().endsWith(".jrxml")
06421: || file.getName().toLowerCase().endsWith(".jasper")) {
06422: openFile(file);
06423: }
06424: }
06425: }
06426:
06427: public JReportFrame openFile(String filename) {
06428:
06429: return openFile(new File(filename));
06430: }
06431:
06432: public JReportFrame openFile(File file) {
06433:
06434: JReportFrame reportFrame;
06435: reportFrame = findReportFrameByFile(file);
06436:
06437: if (reportFrame == null) {
06438: try {
06439: Report report = new Report(file.getPath());
06440: report.setUsingMultiLineExpressions(false); //this.isUsingMultiLineExpressions());
06441: reportFrame = openNewReportWindow(report);
06442: report.addReportDocumentStatusChangedListener(this );
06443: setActiveReportForm(reportFrame);
06444: } catch (Exception e) {
06445: e.printStackTrace();
06446: getLogPane().getMainLogTextArea().logOnConsole(
06447: e.getMessage() + "\n",
06448: JOptionPane.ERROR_MESSAGE);
06449: }
06450:
06451: } else {
06452:
06453: try {
06454: setActiveReportForm(reportFrame);
06455: } catch (Exception ex) {
06456: ex.printStackTrace();
06457: }
06458: }
06459:
06460: return reportFrame;
06461: }
06462:
06463: /**
06464: * openFromStream
06465: * opens a new Report from an InputStream
06466: *
06467: * Author: Felix Firgau
06468: *
06469: * @param inputStream InputStream
06470: * @return JReportFrame
06471: */
06472: public JReportFrame openFromStream(java.io.InputStream inputStream) {
06473: try {
06474: JReportFrame reportFrame;
06475: Report report = new Report();
06476: ReportReader rr = new ReportReader(report);
06477: rr.readFromStream(inputStream);
06478:
06479: report.setUsingMultiLineExpressions(false); //this.isUsingMultiLineExpressions());
06480: reportFrame = openNewReportWindow(report);
06481: report.addReportDocumentStatusChangedListener(this );
06482: setActiveReportForm(reportFrame);
06483:
06484: return reportFrame;
06485: } catch (IOException ex) {
06486: ex.printStackTrace();
06487: }
06488: return null;
06489: }
06490:
06491: /**
06492: * Test if the passed string is empty.
06493: * @param str
06494: * @return Returns true if empty.
06495: */
06496: private boolean isEmptyString(String str) {
06497: return (str == null || str.trim().length() == 0);
06498: }
06499:
06500: /**
06501: * Search for a opened file in the iReport Designer.
06502: *
06503: * @param file File to search.
06504: * @return The JReportFrame.
06505: */
06506: private JReportFrame findReportFrameByFile(File fileToSearch) {
06507:
06508: if (fileToSearch != null) {
06509:
06510: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
06511: .getAllFrames();
06512: JReportFrame jrf;
06513: String frameFilename;
06514:
06515: for (int i = 0; i < frames.length; ++i) {
06516: if (frames[i] instanceof JReportFrame) {
06517: jrf = (JReportFrame) frames[i];
06518:
06519: frameFilename = jrf.getReport().getFilename();
06520: if (!isEmptyString(frameFilename)
06521: && fileToSearch.equals(new File(
06522: frameFilename))) {
06523: return jrf;
06524: }
06525: }
06526: }
06527: }
06528:
06529: return null;
06530: }
06531:
06532: /**
06533: * Search for a opened file in the iReport Designer.
06534: *
06535: * @param filename Filename to find.
06536: * @return The JReportFrame.
06537: */
06538: private JReportFrame findReportFrameByFilename(String filename) {
06539:
06540: if (!isEmptyString(filename)) {
06541: return findReportFrameByFile(new File(filename));
06542: }
06543:
06544: return null;
06545: }
06546:
06547: public void checkForModifiedFiles() {
06548:
06549: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
06550: .getAllFrames();
06551: String filename;
06552: JReportFrame jrf;
06553: long time;
06554: Report report;
06555: int res;
06556:
06557: try {
06558: for (int i = 0; i < frames.length; ++i) {
06559:
06560: if (frames[i] instanceof JReportFrame) {
06561:
06562: jrf = (JReportFrame) frames[i];
06563: filename = jrf.getReport().getFilename();
06564:
06565: if (!isEmptyString(filename)) {
06566:
06567: time = Misc.getLastWriteTime(filename);
06568:
06569: if (jrf.getReport().getLoadTime() < time) {
06570:
06571: //System.out.println("Trovato: "+filename);
06572: res = javax.swing.JOptionPane.CANCEL_OPTION;
06573:
06574: if (getProperties().getProperty(
06575: "AutoReload", "false").equals(
06576: "true")) {
06577: res = javax.swing.JOptionPane.OK_OPTION;
06578: } else {
06579: res = javax.swing.JOptionPane
06580: .showConfirmDialog(
06581: this ,
06582: I18n
06583: .getFormattedString(
06584: "messages.fileModifiedOutsideIReport",
06585: "{0} \n\nThis file has been modified outside iReport.Do you want reload it?",
06586: new Object[] { filename }),
06587: "iReport",
06588: javax.swing.JOptionPane.INFORMATION_MESSAGE);
06589: }
06590:
06591: if (res == javax.swing.JOptionPane.OK_OPTION) {
06592:
06593: //setCurrentZoomFactor( jrf.getZoomFactor() );
06594: int positionInList = 0;
06595: DefaultMutableTreeNode root = (DefaultMutableTreeNode) this .jTreeFiles
06596: .getModel().getRoot();
06597: for (positionInList = 0; positionInList < root
06598: .getChildCount(); ++positionInList) {
06599: DefaultMutableTreeNode documentEntryNode = (DefaultMutableTreeNode) root
06600: .getChildAt(positionInList);
06601: DocumentTreeEntry dte = (DocumentTreeEntry) documentEntryNode
06602: .getUserObject();
06603: if (dte.getJrf() == jrf) {
06604: break;
06605: }
06606: }
06607:
06608: jrf
06609: .setDefaultCloseOperation(jrf.DISPOSE_ON_CLOSE);
06610: jrf.doDefaultCloseAction();
06611: openFile(filename);
06612:
06613: if (positionInList < root
06614: .getChildCount() - 1) {
06615: // Move the last entry to the correct position...
06616: DefaultMutableTreeNode documentEntryNode = (DefaultMutableTreeNode) root
06617: .getChildAt(root
06618: .getChildCount() - 1);
06619: root.remove(documentEntryNode);
06620: root.insert(documentEntryNode,
06621: positionInList);
06622: jTreeFiles.updateUI();
06623: }
06624: //setCurrentZoomFactor( 1.0 ); //reset
06625:
06626: } else {
06627: jrf.getReport().setLoadTime(time);
06628: }
06629: } else if (time < 0) //File removed!
06630: {
06631: //jrf.getReport().setLoadTime( new java.util.Date().getTime() );
06632: jrf.getReport().incrementReportChanges();
06633: }
06634: }
06635: }
06636: }
06637: } catch (Throwable ex) {
06638: ex.printStackTrace();
06639: }
06640:
06641: }
06642:
06643: /**
06644: *Used to determine if a save all is required.
06645: */
06646: public boolean isSaveAllRequired() {
06647: boolean ret = false;
06648: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
06649: .getAllFrames();
06650: for (int i = 0; i < frames.length; ++i) {
06651: if (frames[i] instanceof JReportFrame) {
06652: JReportFrame jrf = (JReportFrame) frames[i];
06653: Report checkMe = jrf.getReport();
06654: if (checkMe == null) {
06655: ret = (ret || false);
06656: } else {
06657: ret = (ret || checkMe.isModified());
06658: }
06659: }//end if instance of JReportFrame
06660: }//end for frames
06661: return ret;
06662: }//end isSaveAllRequired
06663:
06664: private void jMenuItemXMLSourceActionPerformed(
06665: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemXMLSourceActionPerformed
06666: if (jMDIDesktopPane.getSelectedFrame() != null
06667: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06668: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06669: .getSelectedFrame();
06670: if (jrf.getReport().getFilename() == null
06671: || jrf.getReport().getFilename().equals("")) {
06672: int res = javax.swing.JOptionPane
06673: .showConfirmDialog(
06674: this ,
06675: I18n
06676: .getString(
06677: "messages.mustSaveFile",
06678: "You must save your file before editing it with an external editor!\nSave it now ?"),
06679: "",
06680: javax.swing.JOptionPane.INFORMATION_MESSAGE);
06681: if (res == javax.swing.JOptionPane.OK_OPTION) {
06682: jMenuItemSaveActionPerformed(evt);
06683: } else
06684: return;
06685: } else {
06686: int res = javax.swing.JOptionPane.OK_OPTION;
06687: if (jrf.getReport().isModified()) {
06688: res = javax.swing.JOptionPane
06689: .showConfirmDialog(
06690: this ,
06691: I18n
06692: .getString(
06693: "messages.fileModifiedLaunchingEditor",
06694: "The document has been modified!\nWould you like to save it before launching the external editor?"),
06695: "",
06696: javax.swing.JOptionPane.INFORMATION_MESSAGE);
06697: }
06698: if (res == javax.swing.JOptionPane.OK_OPTION) {
06699: jMenuItemSaveActionPerformed(evt);
06700: }
06701: }
06702: if (jrf.getReport().getFilename() == null
06703: || jrf.getReport().getFilename().equals(""))
06704: return;
06705:
06706: Runtime rt = Runtime.getRuntime();
06707: String editor = "notepad.exe";
06708: try {
06709: if (this .getProperties().getProperty("ExternalEditor") != null)
06710: editor = (String) this .getProperties().getProperty(
06711: "ExternalEditor");
06712: if (editor == null || editor.equals("")) {
06713:
06714: getLogPane()
06715: .getMainLogTextArea()
06716: .logOnConsole(
06717: I18n
06718: .getString(
06719: "messages.useNotepad",
06720: "Using notepad.exe as default editor!\n"),
06721: JOptionPane.WARNING_MESSAGE);
06722:
06723: editor = "notepad.exe";
06724: }
06725:
06726: // WRONG ON UNIX: rt.exec(editor+ " \"" +jrf.getReport().getFilename()+"\"");
06727: // String tokenizer wasn't parsing the command and arguments
06728: // properly, so pass them in as separate elements.
06729: rt.exec(new String[] { editor,
06730: jrf.getReport().getFilename() });
06731: } catch (Exception ex) {
06732:
06733: javax.swing.JOptionPane
06734: .showMessageDialog(
06735: this ,
06736: I18n
06737: .getFormattedString(
06738: "messages.errorExecutingEditor",
06739: "An exception is occured executing:\n{0} \"{1}\"",
06740: new Object[] {
06741: editor,
06742: jrf
06743: .getReport()
06744: .getFilename() }),
06745: "",
06746: javax.swing.JOptionPane.ERROR_MESSAGE);
06747: }
06748: }
06749: }//GEN-LAST:event_jMenuItemXMLSourceActionPerformed
06750:
06751: public void jMenuItemVSRemoveActionPerformed(
06752: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVSRemoveActionPerformed
06753: //formatMenuPerformed( OperationType.REMOVE_SPACE_V);
06754: FormatCommand.getCommand(OperationType.REMOVE_SPACE_V)
06755: .execute();
06756: }//GEN-LAST:event_jMenuItemVSRemoveActionPerformed
06757:
06758: public void jMenuItemVSDecreaseActionPerformed(
06759: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVSDecreaseActionPerformed
06760: FormatCommand.getCommand(OperationType.DECREASE_SPACE_V)
06761: .execute();
06762: }//GEN-LAST:event_jMenuItemVSDecreaseActionPerformed
06763:
06764: public void jMenuItemVSMakeEqualActionPerformed(
06765: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVSMakeEqualActionPerformed
06766: FormatCommand.getCommand(OperationType.EQUALS_SPACE_V)
06767: .execute();
06768: }//GEN-LAST:event_jMenuItemVSMakeEqualActionPerformed
06769:
06770: public void jMenuItemHSRemoveActionPerformed(
06771: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHSRemoveActionPerformed
06772: FormatCommand.getCommand(OperationType.REMOVE_SPACE_H)
06773: .execute();
06774: }//GEN-LAST:event_jMenuItemHSRemoveActionPerformed
06775:
06776: public void jMenuItemHSIncreaseActionPerformed(
06777: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHSIncreaseActionPerformed
06778: FormatCommand.getCommand(OperationType.INCREASE_SPACE_H)
06779: .execute();
06780: }//GEN-LAST:event_jMenuItemHSIncreaseActionPerformed
06781:
06782: public void jMenuItemHSMakeEqualActionPerformed(
06783: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHSMakeEqualActionPerformed
06784: FormatCommand.getCommand(OperationType.EQUALS_SPACE_H)
06785: .execute();
06786: }//GEN-LAST:event_jMenuItemHSMakeEqualActionPerformed
06787:
06788: public void jMenuItemJoinRightActionPerformed(
06789: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemJoinRightActionPerformed
06790: FormatCommand.getCommand(OperationType.JOIN_RIGHT).execute();
06791: }//GEN-LAST:event_jMenuItemJoinRightActionPerformed
06792:
06793: public void jMenuItemJoinLeftActionPerformed(
06794: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemJoinLeftActionPerformed
06795: FormatCommand.getCommand(OperationType.JOIN_LEFT).execute();
06796: }//GEN-LAST:event_jMenuItemJoinLeftActionPerformed
06797:
06798: public void jMenuItemCenterBackgroundActionPerformed(
06799: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCenterBackgroundActionPerformed
06800: FormatCommand.getCommand(OperationType.CENTER_IN_BACKGROUND)
06801: .execute();
06802: }//GEN-LAST:event_jMenuItemCenterBackgroundActionPerformed
06803:
06804: public void jMenuItemCenterInBandActionPerformed(
06805: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCenterInBandActionPerformed
06806: FormatCommand.getCommand(OperationType.CENTER_IN_BAND)
06807: .execute();
06808: }//GEN-LAST:event_jMenuItemCenterInBandActionPerformed
06809:
06810: public void jMenuItemCenterVActionPerformed(
06811: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCenterVActionPerformed
06812: FormatCommand.getCommand(OperationType.CENTER_IN_BAND_V)
06813: .execute();
06814: }//GEN-LAST:event_jMenuItemCenterVActionPerformed
06815:
06816: public void jMenuItemCenterHActionPerformed(
06817: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCenterHActionPerformed
06818: FormatCommand.getCommand(OperationType.CENTER_IN_BAND_H)
06819: .execute();
06820: }//GEN-LAST:event_jMenuItemCenterHActionPerformed
06821:
06822: public void jMenuItemSameSizeActionPerformed(
06823: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameSizeActionPerformed
06824: FormatCommand.getCommand(OperationType.SAME_SIZE).execute();
06825: }//GEN-LAST:event_jMenuItemSameSizeActionPerformed
06826:
06827: public void jMenuItemSameHeightMaxActionPerformed(
06828: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameHeightMaxActionPerformed
06829: FormatCommand.getCommand(OperationType.SAME_HEIGHT_MAX)
06830: .execute();
06831: }//GEN-LAST:event_jMenuItemSameHeightMaxActionPerformed
06832:
06833: public void jMenuItemSameHeightMinActionPerformed(
06834: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameHeightMinActionPerformed
06835: FormatCommand.getCommand(OperationType.SAME_HEIGHT_MIN)
06836: .execute();
06837: }//GEN-LAST:event_jMenuItemSameHeightMinActionPerformed
06838:
06839: public void jMenuItemSameHeightActionPerformed(
06840: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameHeightActionPerformed
06841: FormatCommand.getCommand(OperationType.SAME_HEIGHT).execute();
06842: }//GEN-LAST:event_jMenuItemSameHeightActionPerformed
06843:
06844: public void jMenuItemSameWidthMinActionPerformed(
06845: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameWidthMinActionPerformed
06846: FormatCommand.getCommand(OperationType.SAME_WIDTH_MIN)
06847: .execute();
06848: }//GEN-LAST:event_jMenuItemSameWidthMinActionPerformed
06849:
06850: public void jMenuItemSameWidthMaxActionPerformed(
06851: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameWidthMaxActionPerformed
06852: FormatCommand.getCommand(OperationType.SAME_WIDTH_MAX)
06853: .execute();
06854: }//GEN-LAST:event_jMenuItemSameWidthMaxActionPerformed
06855:
06856: public void jMenuItemSameWidthActionPerformed(
06857: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSameWidthActionPerformed
06858: FormatCommand.getCommand(OperationType.SAME_WIDTH).execute();
06859: }//GEN-LAST:event_jMenuItemSameWidthActionPerformed
06860:
06861: public void jMenuItemAlignToBandBottomActionPerformed(
06862: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignToBandBottomActionPerformed
06863: FormatCommand.getCommand(OperationType.ALIGN_BOTTOM_TO_BAND)
06864: .execute();
06865: }//GEN-LAST:event_jMenuItemAlignToBandBottomActionPerformed
06866:
06867: public void jMenuItemAlignToBandTopActionPerformed(
06868: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignToBandTopActionPerformed
06869: FormatCommand.getCommand(OperationType.ALIGN_TOP_TO_BAND)
06870: .execute();
06871: }//GEN-LAST:event_jMenuItemAlignToBandTopActionPerformed
06872:
06873: public void jMenuItemAlignHorizontalAxisActionPerformed(
06874: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignHorizontalAxisActionPerformed
06875: FormatCommand.getCommand(OperationType.ALIGN_HORIZONTAL_AXIS)
06876: .execute();
06877: }//GEN-LAST:event_jMenuItemAlignHorizontalAxisActionPerformed
06878:
06879: public void jMenuItemAlignVerticalAxisActionPerformed(
06880: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignVerticalAxisActionPerformed
06881: FormatCommand.getCommand(OperationType.ALIGN_VERTICAL_AXIS)
06882: .execute();
06883: }//GEN-LAST:event_jMenuItemAlignVerticalAxisActionPerformed
06884:
06885: public void jMenuItemAlignBottomActionPerformed(
06886: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignBottomActionPerformed
06887: FormatCommand.getCommand(OperationType.ALIGN_BOTTOM).execute();
06888: }//GEN-LAST:event_jMenuItemAlignBottomActionPerformed
06889:
06890: public void jMenuItemAlignTopActionPerformed(
06891: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignTopActionPerformed
06892: FormatCommand.getCommand(OperationType.ALIGN_TOP).execute();
06893: }//GEN-LAST:event_jMenuItemAlignTopActionPerformed
06894:
06895: public void jMenuItemAlignRightActionPerformed(
06896: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignRightActionPerformed
06897: FormatCommand.getCommand(OperationType.ALIGN_RIGHT).execute();
06898:
06899: }//GEN-LAST:event_jMenuItemAlignRightActionPerformed
06900:
06901: /*
06902: public void formatMenuPerformed(int operationType) {
06903: if (jMDIDesktopPane.getSelectedFrame() != null &&
06904: jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06905: JReportFrame jrf = (JReportFrame)jMDIDesktopPane.getSelectedFrame();
06906: jrf.makeOperation( operationType );
06907: if (jrf.getSelectedElements().size()>0)
06908: updateDocumentStructureTree(jrf);
06909: }
06910: }
06911: */
06912:
06913: public void jMenuItemAlignLeftActionPerformed(
06914: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAlignLeftActionPerformed
06915: // Align all element to left....
06916: FormatCommand.getCommand(OperationType.ALIGN_LEFT).execute();
06917: }//GEN-LAST:event_jMenuItemAlignLeftActionPerformed
06918:
06919: private void jRadioButtonMenuItemPreviewInternalViewerActionPerformed(
06920: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewInternalViewerActionPerformed
06921: this .setReportViewer(IREPORT_JASPER_VIEWER);
06922: }//GEN-LAST:event_jRadioButtonMenuItemPreviewInternalViewerActionPerformed
06923:
06924: public void jMenuItemSendToBackActionPerformed(
06925: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSendToBackActionPerformed
06926: if (jMDIDesktopPane.getSelectedFrame() != null
06927: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06928: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06929: .getSelectedFrame();
06930: jrf.sendToBack();
06931: if (jrf.getSelectedElements().size() > 0)
06932: getDocumentStructurePanel()
06933: .updateDocumentStructureTree(jrf);
06934: }
06935: }//GEN-LAST:event_jMenuItemSendToBackActionPerformed
06936:
06937: public void jMenuItemBringToFrontActionPerformed(
06938: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemBringToFrontActionPerformed
06939:
06940: if (jMDIDesktopPane.getSelectedFrame() != null
06941: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06942: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06943: .getSelectedFrame();
06944: jrf.bringToFront();
06945: if (jrf.getSelectedElements().size() > 0)
06946: getDocumentStructurePanel()
06947: .updateDocumentStructureTree(jrf);
06948: }
06949: }//GEN-LAST:event_jMenuItemBringToFrontActionPerformed
06950:
06951: private void jMenuItemWizardActionPerformed(
06952: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemWizardActionPerformed
06953:
06954: newWizard();
06955: }//GEN-LAST:event_jMenuItemWizardActionPerformed
06956:
06957: public Report newWizard() {
06958: /*
06959: if (this.getProperties().get("DefaultConnection") == null ||
06960: !( this.getProperties().get("DefaultConnection") instanceof it.businesslogic.ireport.connection.JDBCConnection) ) {
06961: javax.swing.JOptionPane.showMessageDialog(this, "Before start the Wizard, you must configure a JDBC connection\nand set it the active connection.\n\nIf you have already created and tested a JDBC connection go to the menu\nbuild->set active connection and select your entry.\nIf you have not yet setup a JDBC connection go to\nDatasources->Connection/Datasources to create one.","",javax.swing.JOptionPane.ERROR_MESSAGE);
06962: return;
06963: }
06964: */
06965:
06966: WizardDialog wd = new WizardDialog(this , true);
06967: wd.setVisible(true);
06968: if (wd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
06969: Report report = wd.getReport();
06970: if (report != null) {
06971: // Name the report...
06972:
06973: openNewReportWindow(report);
06974: return report;
06975: }
06976: }
06977: return null;
06978: }
06979:
06980: private void jMenuItemReportPropertiesActionPerformed(
06981: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportPropertiesActionPerformed
06982: if (jMDIDesktopPane.getSelectedFrame() != null
06983: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
06984: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
06985: .getSelectedFrame();
06986: ReportPropertiesFrame rpf = new ReportPropertiesFrame(this ,
06987: true);
06988: rpf.setModal(true);
06989:
06990: rpf.setBottomMargin(jrf.getReport().getBottomMargin());
06991:
06992: //rpf.setGlobalUnit( jrf.getReport().getGlobalUnit());
06993:
06994: rpf.setLeftMargin(jrf.getReport().getLeftMargin());
06995: rpf.setOrientation(jrf.getReport().getOrientation());
06996: rpf.setPrintOrder(jrf.getReport().getPrintOrder());
06997: rpf.setReportFormat(jrf.getReport().getReportFormat());
06998: rpf.setReportHeight(jrf.getReport().getHeight());
06999: rpf.setReportName(jrf.getReport().getName());
07000: rpf.setReportWidth(jrf.getReport().getWidth());
07001: rpf.setRightMargin(jrf.getReport().getRightMargin());
07002: rpf.setScriptletClass(jrf.getReport().getScriptletClass());
07003: rpf.setScriptletHandling(jrf.getReport()
07004: .getScriptletHandling());
07005: rpf.setSummaryOnNewPage(jrf.getReport()
07006: .isIsSummaryNewPage());
07007: rpf.setTitleOnNewPage(jrf.getReport().isIsTitleNewPage());
07008: rpf.setTopMargin(jrf.getReport().getTopMargin());
07009: rpf.setWhenNoDataType(jrf.getReport().getWhenNoDataType());
07010: rpf.setXmlEncoding(jrf.getReport().getEncoding());
07011: rpf.setFloatColumnFooter(jrf.getReport()
07012: .isFloatColumnFooter());
07013: rpf.setResourceBundleBaseName(jrf.getReport()
07014: .getResourceBundleBaseName());
07015: rpf.setLanguage(jrf.getReport().getLanguage());
07016: rpf.setWhenResourceMissingType(jrf.getReport()
07017: .getWhenResourceMissingType());
07018: rpf.setIgnorePagination(jrf.getReport()
07019: .isIgnorePagination());
07020: rpf.setFormatFactoryClass(jrf.getReport()
07021: .getFormatFactoryClass());
07022:
07023: rpf.setColumns(jrf.getReport().getColumnCount());
07024: rpf.setColumnsSpacing(jrf.getReport().getColumnSpacing());
07025: rpf.setColumnsWidth(jrf.getReport().getColumnWidth());
07026:
07027: //System.out.println("Il nome :"+rpf.getReportName()+" (old)");
07028: rpf.setVisible(true);
07029: if (rpf.getDialogResult() == JOptionPane.OK_OPTION) {
07030: // Change report...
07031: jrf.getReport().incrementReportChanges();
07032: //javax.swing.JOptionPane.showMessageDialog(null,""+rpf.getReportName());
07033: // First all fields that don't modify layout...
07034: jrf.getReport().setWidth(rpf.getReportWidth());
07035: jrf.getReport().setHeight(rpf.getReportHeight());
07036: jrf.getReport().setOrientation(rpf.getOrientation());
07037: jrf.getReport().setName(rpf.getReportName());
07038: int oldTop = jrf.getReport().getTopMargin();
07039: jrf.getReport().setTopMargin(rpf.getTopMargin());
07040: int differenceY = jrf.getReport().getTopMargin()
07041: - oldTop;
07042:
07043: int oldLeft = jrf.getReport().getLeftMargin();
07044: jrf.getReport().setLeftMargin(rpf.getLeftMargin());
07045: int differenceX = jrf.getReport().getLeftMargin()
07046: - oldLeft;
07047: if (differenceX != 0 || differenceY != 0) {
07048: Enumeration e = jrf.getReport().getElements()
07049: .elements();
07050: while (e.hasMoreElements()) {
07051: ReportElement re = (ReportElement) e
07052: .nextElement();
07053: re.trasform(new java.awt.Point(differenceX,
07054: differenceY),
07055: TransformationType.TRANSFORMATION_MOVE);
07056: }
07057: }
07058:
07059: jrf.getReport().setLanguage(rpf.getLanguage());
07060: jrf.getReport().setRightMargin(rpf.getRightMargin());
07061: jrf.getReport().setBottomMargin(rpf.getBottomMargin());
07062: jrf.getReport().setColumnCount(rpf.getColumns());
07063: jrf.getReport().setColumnWidth(rpf.getColumnsWidth());
07064: jrf.getReport().setColumnSpacing(
07065: rpf.getColumnsSpacing());
07066: jrf.getReport().setIsSummaryNewPage(
07067: rpf.isSummaryOnNewPage());
07068: jrf.getReport().setIsTitleNewPage(
07069: rpf.isTitleOnNewPage());
07070: jrf.getReport().setWhenNoDataType(
07071: rpf.getWhenNoDataType());
07072: jrf.getReport().setScriptletClass(
07073: rpf.getScriptletClass());
07074: jrf.getReport().setEncoding(rpf.getXmlEncoding());
07075: jrf.getReport().setPrintOrder(rpf.getPrintOrder());
07076: jrf.getReport().setReportFormat(rpf.getReportFormat());
07077: jrf.getReport().setFloatColumnFooter(
07078: rpf.isFloatColumnFooter());
07079: jrf.getReport().setScriptletHandling(
07080: rpf.getScriptletHandling());
07081: jrf.getReport().setResourceBundleBaseName(
07082: rpf.getResourceBundleBaseName());
07083: jrf.getReport().setWhenResourceMissingType(
07084: rpf.getWhenResourceMissingType());
07085: jrf.getReport().setIgnorePagination(
07086: rpf.isIgnorePagination());
07087: jrf.getReport().setFormatFactoryClass(
07088: rpf.getFormatFactoryClass());
07089:
07090: this
07091: .setTitle(getRebrandedTitle()
07092: + " ["
07093: + jrf.getReport().getName()
07094: + " "
07095: + jrf.getReport().getWidth()
07096: + "x"
07097: + jrf.getReport().getHeight()
07098: + " "
07099: + jrf.getReport().getFilename()
07100: + " "
07101: + (jrf.getReport().isReadOnly() ? "(READ ONLY) "
07102: : "") + "]");
07103: jrf.updateTitle();
07104: // Aggiorniamo il menu attivo...
07105: java.awt.Component[] menus = this .jMenuWindow
07106: .getMenuComponents();
07107: int frame = 0;
07108: for (int k = 0; k < menus.length; ++k) {
07109: //javax.swing.JOptionPane.showMessageDialog(this,"Menu: " + menus[k] );
07110:
07111: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
07112: frame++;
07113:
07114: JRadioButtonMenuItemMDIFrame mri = (JRadioButtonMenuItemMDIFrame) menus[k];
07115: //((JRadioButtonMenuItemMDIFrame)menus[k]).getFrame() == jrf)
07116: if (mri.isSelected()) {
07117: //javax.swing.JOptionPane.showMessageDialog( this, "Selected" + frame +" "+text);
07118: mri.setText(frame + ". " + jrf.getTitle());
07119: break;
07120: }
07121: }
07122: }
07123:
07124: jrf.setIsDocDirty(true);
07125: jrf.updateScrollBars();
07126: jrf.getJPanelReport().repaint();
07127: if (getReportSheetPanel().getCurrentMode() == DocumentSheetPanel.SHOW_DOCUMENT_SHEET) {
07128: getReportSheetPanel().getReportSheetPanel()
07129: .updateSelection(jrf);
07130: }
07131: }
07132: }
07133: }//GEN-LAST:event_jMenuItemReportPropertiesActionPerformed
07134:
07135: private void jMenuItemGroupsActionPerformed(
07136: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGroupsActionPerformed
07137: jButtonGroupsActionPerformed(evt);
07138: }//GEN-LAST:event_jMenuItemGroupsActionPerformed
07139:
07140: public void jMenuItemBandsActionPerformed(
07141: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemBandsActionPerformed
07142: jButtonBandsActionPerformed(evt);
07143: }//GEN-LAST:event_jMenuItemBandsActionPerformed
07144:
07145: private void jMenuItemElementPropertiesActionPerformed(
07146: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemElementPropertiesActionPerformed
07147: this .getElementPropertiesDialog().setVisible(true);
07148: //this.getElementPropertiesDialog().updateSelection();
07149: }//GEN-LAST:event_jMenuItemElementPropertiesActionPerformed
07150:
07151: private void jMenuItemParametersActionPerformed(
07152: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemParametersActionPerformed
07153: jButtonParametersActionPerformed(evt);
07154: this .getValuesDialog().gotoTab("Parameters");
07155: }//GEN-LAST:event_jMenuItemParametersActionPerformed
07156:
07157: private void jMenuItemVariablesActionPerformed(
07158: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVariablesActionPerformed
07159: jButtonParametersActionPerformed(evt);
07160: this .getValuesDialog().gotoTab("Variables");
07161: }//GEN-LAST:event_jMenuItemVariablesActionPerformed
07162:
07163: private void jMenuItemFieldsActionPerformed(
07164: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFieldsActionPerformed
07165: jButtonParametersActionPerformed(evt);
07166: this .getValuesDialog().gotoTab("Fields");
07167: }//GEN-LAST:event_jMenuItemFieldsActionPerformed
07168:
07169: private void jMenuItemReportQueryActionPerformed(
07170: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportQueryActionPerformed
07171: jButtonDatabaseActionPerformed(evt);
07172: }//GEN-LAST:event_jMenuItemReportQueryActionPerformed
07173:
07174: private void jMenuItemExecuteDBActionPerformed(
07175: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExecuteDBActionPerformed
07176: jButtonRun2ActionPerformed(evt);
07177: }//GEN-LAST:event_jMenuItemExecuteDBActionPerformed
07178:
07179: private void jMenuItemExecuteActionPerformed(
07180: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExecuteActionPerformed
07181: jButtonRun1ActionPerformed(evt);
07182: }//GEN-LAST:event_jMenuItemExecuteActionPerformed
07183:
07184: private void jButtonPasteActionPerformed(
07185: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPasteActionPerformed
07186: jMenuItemPasteActionPerformed(evt);
07187: }//GEN-LAST:event_jButtonPasteActionPerformed
07188:
07189: private void jButtonCopyActionPerformed(
07190: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCopyActionPerformed
07191: jMenuItemCopyActionPerformed(evt);
07192: }//GEN-LAST:event_jButtonCopyActionPerformed
07193:
07194: private void jButtonCutActionPerformed(
07195: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCutActionPerformed
07196: jMenuItemCutActionPerformed(evt);
07197: }//GEN-LAST:event_jButtonCutActionPerformed
07198:
07199: private void jMenuItemPasteActionPerformed(
07200: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPasteActionPerformed
07201: if (jMDIDesktopPane.getSelectedFrame() != null
07202: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07203: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07204: .getSelectedFrame();
07205: jrf.paste();
07206: }
07207: }//GEN-LAST:event_jMenuItemPasteActionPerformed
07208:
07209: private void jMenuItemCopyActionPerformed(
07210: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCopyActionPerformed
07211: if (jMDIDesktopPane.getSelectedFrame() != null
07212: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07213: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07214: .getSelectedFrame();
07215: jrf.copy();
07216: if (getClipBoard().size() > 0) {
07217: this .jMenuItemPaste.setEnabled(true);
07218: this .jButtonPaste.setEnabled(true);
07219: } else {
07220: this .jMenuItemPaste.setEnabled(false);
07221: this .jButtonPaste.setEnabled(false);
07222: }
07223: }
07224: }//GEN-LAST:event_jMenuItemCopyActionPerformed
07225:
07226: private void jMenuItemCutActionPerformed(
07227: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCutActionPerformed
07228: if (jMDIDesktopPane.getSelectedFrame() != null
07229: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07230: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07231: .getSelectedFrame();
07232: jrf.cut();
07233: }
07234: }//GEN-LAST:event_jMenuItemCutActionPerformed
07235:
07236: private void jButtonRun2ActionPerformed(
07237: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRun2ActionPerformed
07238: compileAndRun2();
07239: }//GEN-LAST:event_jButtonRun2ActionPerformed
07240:
07241: public IReportCompiler compileAndRun2() {
07242: // 1. Get active report...
07243: if (jMDIDesktopPane.getSelectedFrame() != null
07244: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07245: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07246: .getSelectedFrame();
07247: if (jrf.getReport().getFilename() == null
07248: || jrf.getReport().getFilename().trim().equals("")
07249: || Misc.nvl(
07250: this .getProperties().getProperty(
07251: "SaveBeforeCompiling"), "true")
07252: .equals("true")) // && jrf.getReport().isModified() Force a save
07253: {
07254: jMenuItemSaveActionPerformed(new java.awt.event.ActionEvent(
07255: jMenuItemSave, 0, "Save"));
07256: if (jrf.getReport().isModified()) {
07257: getLogPane().getMainLogTextArea().logOnConsole(
07258: I18n.getString(
07259: "messages.actionAbortedByUser",
07260: "Action aborted by user"),
07261: JOptionPane.WARNING_MESSAGE);
07262: }
07263: }
07264: //1. Save the report if needed....
07265:
07266: if (jrf.getReport().getFilename() == null
07267: || jrf.getReport().getFilename().trim().equals("")) {
07268: getLogPane().getMainLogTextArea().logOnConsole(
07269: I18n.getString("messages.actionAbortedByUser",
07270: "Action aborted by user"),
07271: JOptionPane.WARNING_MESSAGE);
07272: return null;
07273: }
07274:
07275: //clearConsole();
07276: //1. Compile....
07277: IReportCompiler ic = new IReportCompiler();
07278:
07279: ic.setThreadList(jListThreads);
07280: ic.setCommand(IReportCompiler.CMD_COMPILE
07281: | IReportCompiler.CMD_EXPORT);
07282:
07283: if (jrf.getReport().getScriptletHandling() == jrf
07284: .getReport().SCRIPTLET_IREPORT_INTERNAL_HANDLING) {
07285: ic.setCommand(ic.getCommand()
07286: | IReportCompiler.CMD_COMPILE_SCRIPTLET);
07287: }
07288:
07289: HashMap hm = new HashMap();
07290: hm.put(ic.USE_EMPTY_DATASOURCE, "false");
07291:
07292: if (this .getProperties().get("DefaultConnection") == null) {
07293: javax.swing.JOptionPane
07294: .showMessageDialog(
07295: this ,
07296: I18n
07297: .getString(
07298: "messages.connectionNotConfigured",
07299: "You must configure a JDBC connection\nand set it the active connection.\n\nIf you have already created and tested a JDBC connection go to the menu\nbuild->set active connection and select your entry.\nIf you have not yet setup a JDBC connection go to\nDatasources->Connection/Datasources to create one."),
07300: "",
07301: javax.swing.JOptionPane.ERROR_MESSAGE);
07302: return null;
07303: }
07304:
07305: IReportConnection connection = (IReportConnection) this
07306: .getProperties().get("DefaultConnection");
07307:
07308: //if (connection instanceof it.businesslogic.ireport.connection.JDBCConnection)
07309: //{
07310: // javax.swing.JOptionPane.showMessageDialog(null, ((it.businesslogic.ireport.connection.JDBCConnection)connection).getJDBCDriver());
07311: //}
07312:
07313: hm.put(ic.USE_CONNECTION, "true");
07314: hm.put(ic.CONNECTION, connection);
07315: hm
07316: .put(ic.OUTPUT_DIRECTORY,
07317: getTranslatedCompileDirectory());
07318:
07319: if (jrf.getReport().getLanguage().equals("groovy")) {
07320: hm
07321: .put(ic.COMPILER,
07322: "net.sf.jasperreports.compilers.JRGroovyCompiler");
07323: }
07324:
07325: ic.setProperties(hm);
07326:
07327: if (jRadioButtonMenuItemPreviewCSV.isSelected())
07328: hm.put(ic.OUTPUT_FORMAT, "csv");
07329: else if (jRadioButtonMenuItemPreviewHTML.isSelected())
07330: hm.put(ic.OUTPUT_FORMAT, "html");
07331: else if (jRadioButtonMenuItemPreviewXLS.isSelected())
07332: hm.put(ic.OUTPUT_FORMAT, "xls");
07333: else if (jRadioButtonMenuItemPreviewXLS2.isSelected())
07334: hm.put(ic.OUTPUT_FORMAT, "xls2");
07335: else if (jRadioButtonMenuItemPreviewJAVA.isSelected())
07336: hm.put(ic.OUTPUT_FORMAT, "java2D");
07337: else if (jRadioButtonMenuItemPreviewInternalViewer
07338: .isSelected())
07339: hm.put(ic.OUTPUT_FORMAT, "jrviewer");
07340: else if (jRadioButtonMenuItemPreviewTXT.isSelected())
07341: hm.put(ic.OUTPUT_FORMAT, "txt");
07342: else if (jRadioButtonMenuItemPreviewTXTJR.isSelected())
07343: hm.put(ic.OUTPUT_FORMAT, "txtjr");
07344: else if (jRadioButtonMenuItemPreviewRTF.isSelected())
07345: hm.put(ic.OUTPUT_FORMAT, "rtf");
07346: else if (jRadioButtonMenuItemPreviewODF.isSelected())
07347: hm.put(ic.OUTPUT_FORMAT, "odf");
07348: else if (jRadioButtonMenuItemPreviewFLASH.isSelected())
07349: hm.put(ic.OUTPUT_FORMAT, "swf");
07350: else
07351: hm.put(ic.OUTPUT_FORMAT, "pdf");
07352:
07353: ic.setProperties(hm);
07354: ic.setJrf(jrf);
07355: ic.setMainFrame(this );
07356:
07357: ic.start();
07358: return ic;
07359: }
07360: return null;
07361: }
07362:
07363: private void jMenuItemDeleteActionPerformed(
07364: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDeleteActionPerformed
07365:
07366: if (jMDIDesktopPane.getSelectedFrame() != null
07367: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07368: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07369: .getSelectedFrame();
07370:
07371: jrf.delete();
07372: }
07373:
07374: }//GEN-LAST:event_jMenuItemDeleteActionPerformed
07375:
07376: private void jMenuItemRedoActionPerformed(
07377: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRedoActionPerformed
07378: if (jMDIDesktopPane.getSelectedFrame() != null
07379: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07380: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07381: .getSelectedFrame();
07382:
07383: jrf.redo();
07384: this .updateUndoMenu(jrf);
07385:
07386: if (jrf.getSelectedElements().size() > 0)
07387: getDocumentStructurePanel()
07388: .updateDocumentStructureTree(jrf);
07389: }
07390:
07391: }//GEN-LAST:event_jMenuItemRedoActionPerformed
07392:
07393: private void jMenuItemUndoActionPerformed(
07394: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemUndoActionPerformed
07395: if (jMDIDesktopPane.getSelectedFrame() != null
07396: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07397: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07398: .getSelectedFrame();
07399:
07400: jrf.undo();
07401: this .updateUndoMenu(jrf);
07402:
07403: if (jrf.getSelectedElements().size() > 0)
07404: getDocumentStructurePanel()
07405: .updateDocumentStructureTree(jrf);
07406: }
07407: }//GEN-LAST:event_jMenuItemUndoActionPerformed
07408:
07409: private void jTreeFilesValueChanged(
07410: javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jTreeFilesValueChanged
07411: // Select all selected elements...
07412:
07413: }//GEN-LAST:event_jTreeFilesValueChanged
07414:
07415: private void jMenuItemAboutActionPerformed(
07416: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAboutActionPerformed
07417:
07418: IReportAbout ra = new IReportAbout(this , true);
07419: ra.setVisible(true);
07420: }//GEN-LAST:event_jMenuItemAboutActionPerformed
07421:
07422: private void jButtonRun1ActionPerformed(
07423: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRun1ActionPerformed
07424: compileAndRun1(evt != null
07425: && (evt.getModifiers() & evt.SHIFT_MASK) != 0);
07426: }//GEN-LAST:event_jButtonRun1ActionPerformed
07427:
07428: public IReportCompiler compileAndRun1() {
07429: return compileAndRun1(false);
07430: }
07431:
07432: public IReportCompiler compileAndRun1(boolean emptyRecord) {
07433: // 1. Get active report...
07434: if (jMDIDesktopPane.getSelectedFrame() != null
07435: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07436: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07437: .getSelectedFrame();
07438: if (jrf.getReport().getFilename() == null
07439: || jrf.getReport().getFilename().trim().equals("")
07440: || (Misc.nvl(this .getProperties().getProperty(
07441: "SaveBeforeCompiling"), "true")
07442: .equals("true")))// && jrf.getReport().isModified())) Force a save
07443: {
07444: jMenuItemSaveActionPerformed(new java.awt.event.ActionEvent(
07445: jMenuItemSave, 0, "Save"));
07446: if (jrf.getReport().isModified()) {
07447: getLogPane().getMainLogTextArea().logOnConsole(
07448: I18n.getString(
07449: "messages.actionAbortedByUser",
07450: "Action aborted by user"),
07451: JOptionPane.WARNING_MESSAGE);
07452: }
07453: }
07454: //1. Save the report if needed....
07455:
07456: if (jrf.getReport().getFilename() == null
07457: || jrf.getReport().getFilename().trim().equals("")) {
07458: getLogPane().getMainLogTextArea().logOnConsole(
07459: I18n.getString("messages.actionAbortedByUser",
07460: "Action aborted by user."),
07461: JOptionPane.WARNING_MESSAGE);
07462: return null;
07463: }
07464:
07465: //clearConsole();
07466: //1. Compile....
07467: IReportCompiler ic = new IReportCompiler();
07468:
07469: ic.setThreadList(jListThreads);
07470: ic.setCommand(IReportCompiler.CMD_COMPILE
07471: | IReportCompiler.CMD_EXPORT);
07472:
07473: if (jrf.getReport().getScriptletHandling() == jrf
07474: .getReport().SCRIPTLET_IREPORT_INTERNAL_HANDLING) {
07475: ic.setCommand(ic.getCommand()
07476: | IReportCompiler.CMD_COMPILE_SCRIPTLET);
07477: }
07478:
07479: HashMap hm = new HashMap();
07480: hm.put(ic.USE_EMPTY_DATASOURCE, "true");
07481: Integer records = new Integer(1);
07482:
07483: if (emptyRecord) {
07484: String s = null;
07485:
07486: while (true) {
07487: s = JOptionPane.showInputDialog(this , I18n
07488: .getString("messages.setRecordNumber",
07489: "Set the number of empty records"),
07490: "1");
07491:
07492: if (s == null)
07493: break;
07494: try {
07495: int recs = Integer.parseInt(s);
07496: records = new Integer(recs);
07497: break;
07498: } catch (Exception ex) {
07499:
07500: }
07501: }
07502: }
07503:
07504: hm.put(ic.EMPTY_DATASOURCE_RECORDS, records);
07505: hm
07506: .put(ic.OUTPUT_DIRECTORY,
07507: getTranslatedCompileDirectory());
07508:
07509: if (jrf.getReport().getLanguage().equals("groovy")) {
07510: hm
07511: .put(ic.COMPILER,
07512: "net.sf.jasperreports.compilers.JRGroovyCompiler");
07513: }
07514:
07515: ic.setProperties(hm);
07516:
07517: if (jRadioButtonMenuItemPreviewCSV.isSelected())
07518: hm.put(ic.OUTPUT_FORMAT, "csv");
07519: else if (jRadioButtonMenuItemPreviewHTML.isSelected())
07520: hm.put(ic.OUTPUT_FORMAT, "html");
07521: else if (jRadioButtonMenuItemPreviewXLS.isSelected())
07522: hm.put(ic.OUTPUT_FORMAT, "xls");
07523: else if (jRadioButtonMenuItemPreviewXLS2.isSelected())
07524: hm.put(ic.OUTPUT_FORMAT, "xls2");
07525: else if (jRadioButtonMenuItemPreviewJAVA.isSelected())
07526: hm.put(ic.OUTPUT_FORMAT, "java2D");
07527: else if (jRadioButtonMenuItemPreviewInternalViewer
07528: .isSelected())
07529: hm.put(ic.OUTPUT_FORMAT, "jrviewer");
07530: else if (jRadioButtonMenuItemPreviewTXT.isSelected())
07531: hm.put(ic.OUTPUT_FORMAT, "txt");
07532: else if (jRadioButtonMenuItemPreviewTXTJR.isSelected())
07533: hm.put(ic.OUTPUT_FORMAT, "txtjr");
07534: else if (jRadioButtonMenuItemPreviewRTF.isSelected())
07535: hm.put(ic.OUTPUT_FORMAT, "rtf");
07536: else if (jRadioButtonMenuItemPreviewODF.isSelected())
07537: hm.put(ic.OUTPUT_FORMAT, "odf");
07538: else if (jRadioButtonMenuItemPreviewFLASH.isSelected())
07539: hm.put(ic.OUTPUT_FORMAT, "swf");
07540: else
07541: hm.put(ic.OUTPUT_FORMAT, "pdf");
07542:
07543: ic.setProperties(hm);
07544: ic.setJrf(jrf);
07545: ic.setMainFrame(this );
07546:
07547: ic.start();
07548: return ic;
07549: }
07550: return null;
07551: }
07552:
07553: private void jMenuItemPrevWinActionPerformed(
07554: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPrevWinActionPerformed
07555: // Remove all menus...
07556: java.awt.Component[] menus = this .jMenuWindow
07557: .getMenuComponents();
07558: int firstFrame = -1;
07559: for (int k = 0; k < menus.length; ++k) {
07560: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
07561: if (firstFrame == -1)
07562: firstFrame = k;
07563: if (((JRadioButtonMenuItemMDIFrame) menus[k])
07564: .getFrame() == jMDIDesktopPane
07565: .getSelectedFrame()) {
07566: // The next if exists, is the right menu..
07567: k--;
07568: if (k >= firstFrame
07569: && menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
07570: try {
07571: ((JRadioButtonMenuItemMDIFrame) menus[k])
07572: .getFrame().setSelected(true);
07573: } catch (Exception ex) {
07574: }
07575: } else if (menus[menus.length - 1] instanceof JRadioButtonMenuItemMDIFrame) {
07576: try {
07577: ((JRadioButtonMenuItemMDIFrame) menus[menus.length - 1])
07578: .getFrame().setSelected(true);
07579: } catch (Exception ex) {
07580: }
07581: }
07582: return;
07583: }
07584: }
07585: }
07586: }//GEN-LAST:event_jMenuItemPrevWinActionPerformed
07587:
07588: private void jMenuItemNextWinActionPerformed(
07589: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemNextWinActionPerformed
07590:
07591: // Remove all menus...
07592: java.awt.Component[] menus = this .jMenuWindow
07593: .getMenuComponents();
07594: int firstFrame = -1;
07595: for (int k = 0; k < menus.length; ++k) {
07596: if (menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
07597: if (firstFrame == -1)
07598: firstFrame = k;
07599: if (((JRadioButtonMenuItemMDIFrame) menus[k])
07600: .getFrame() == jMDIDesktopPane
07601: .getSelectedFrame()) {
07602: // The next if exists, is the right menu..
07603: k++;
07604: if (k < menus.length
07605: && menus[k] instanceof JRadioButtonMenuItemMDIFrame) {
07606: try {
07607: ((JRadioButtonMenuItemMDIFrame) menus[k])
07608: .getFrame().setSelected(true);
07609: } catch (Exception ex) {
07610: }
07611: } else if (firstFrame != -1) {
07612: try {
07613: ((JRadioButtonMenuItemMDIFrame) menus[firstFrame])
07614: .getFrame().setSelected(true);
07615: } catch (Exception ex) {
07616: }
07617: }
07618: return;
07619: }
07620: }
07621: }
07622:
07623: /*
07624: JInternalFrame[] frames = jMDIDesktopPane.getAllFrames();
07625: if (frames.length < 2) return;
07626: for (int i=0; i<frames.length; ++i)
07627: {
07628: if (frames[i] == jMDIDesktopPane.getSelectedFrame())
07629: {
07630: i++;
07631: if (i == frames.length) i=0;
07632: try {
07633: frames[i].setSelected(true);
07634: } catch (Exception ex){}
07635: return;
07636: }
07637: }
07638: */
07639:
07640: }//GEN-LAST:event_jMenuItemNextWinActionPerformed
07641:
07642: private void jMenuItemtileAnodineActionPerformed(
07643: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemtileAnodineActionPerformed
07644: jMDIDesktopPane.tileAnodine();
07645: }//GEN-LAST:event_jMenuItemtileAnodineActionPerformed
07646:
07647: private void jMenuItemTileVerticalActionPerformed(
07648: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTileVerticalActionPerformed
07649: jMDIDesktopPane.tileVertically();
07650: }//GEN-LAST:event_jMenuItemTileVerticalActionPerformed
07651:
07652: private void jMenuItemTileHorizontalActionPerformed(
07653: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTileHorizontalActionPerformed
07654: jMDIDesktopPane.tileHorizontally();
07655: }//GEN-LAST:event_jMenuItemTileHorizontalActionPerformed
07656:
07657: private void jMenuItemCascadeActionPerformed(
07658: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCascadeActionPerformed
07659: // Dispose all frames in cascade....
07660: // The active frame must be the last....
07661: jMDIDesktopPane.cascade();
07662: }//GEN-LAST:event_jMenuItemCascadeActionPerformed
07663:
07664: private void jRadioButtonMenuItemPreviewPDFActionPerformed(
07665: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewPDFActionPerformed
07666: this .setReportViewer(IREPORT_PDF_VIEWER);
07667: }//GEN-LAST:event_jRadioButtonMenuItemPreviewPDFActionPerformed
07668:
07669: private void jTreeFilesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTreeFilesMouseClicked
07670: if (evt.getClickCount() == 2
07671: && evt.getButton() == java.awt.event.MouseEvent.BUTTON1) {
07672: TreePath path = jTreeFiles.getSelectionPath();
07673: if (path == null)
07674: return;
07675: javax.swing.tree.TreeNode node = (javax.swing.tree.TreeNode) path
07676: .getLastPathComponent();
07677: if (node instanceof DefaultMutableTreeNode) {
07678: DefaultMutableTreeNode nodem = (DefaultMutableTreeNode) node;
07679: Object obj = nodem.getUserObject();
07680: if (obj != null && obj instanceof DocumentTreeEntry) {
07681: DocumentTreeEntry dtn = (DocumentTreeEntry) obj;
07682: if (dtn.getJrf() != null) {
07683: //
07684: try {
07685: dtn.getJrf().setSelected(true);
07686: } catch (Exception ex) {
07687: }
07688: ;
07689: //dtn.getJrf().updateUI();
07690: //jMDIDesktopPane.internalFrameActivated(dtn.getJrf());
07691: //this.logOnConsole("Activated :"+dtn.getJrf().getReport().getFilename()+"\n");
07692: }
07693: }
07694: }
07695: }
07696: //else System.out.println("Mouse clicked...");
07697:
07698: }//GEN-LAST:event_jTreeFilesMouseClicked
07699:
07700: private void jMenuItemFontsActionPerformed(
07701: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFontsActionPerformed
07702:
07703: JOptionPane
07704: .showMessageDialog(
07705: this ,
07706: it.businesslogic.ireport.util.I18n
07707: .getString("reportFontsDeprecated",
07708: "Report fonts are deprecated.\nWe strongly suggest to use styles instead."),
07709: I18n.getString(
07710: "messages.reportFontsDeprecated.title",
07711: "Report fonts"),
07712: //"Report fonts",
07713: JOptionPane.WARNING_MESSAGE);
07714:
07715: this .fontsDialog.setVisible(true);
07716: }//GEN-LAST:event_jMenuItemFontsActionPerformed
07717:
07718: private void jMenuItemActiveConnectionActionPerformed(
07719: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemActiveConnectionActionPerformed
07720: ActiveConnectionDialog acd = new ActiveConnectionDialog(this ,
07721: true);
07722: acd.setVisible(true);
07723: if (acd.getDialogResult() == JOptionPane.OK_OPTION) {
07724: this .getProperties().put("DefaultConnection",
07725: acd.getIReportConnection());
07726:
07727: this .saveiReportConfiguration();
07728: jToolbarConnectionPanel.updateConnections();
07729:
07730: }
07731: }//GEN-LAST:event_jMenuItemActiveConnectionActionPerformed
07732:
07733: public void setActiveConnection(IReportConnection conn) {
07734: if (conn != null) {
07735: this .getProperties().put("DefaultConnection", conn);
07736: this .saveiReportConfiguration();
07737: jToolbarConnectionPanel.updateConnections();
07738: }
07739: }
07740:
07741: private void jToggleButtonChartToolItemStateChanged(
07742: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonChartToolItemStateChanged
07743: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
07744: if (jMDIDesktopPane.getSelectedFrame() != null
07745: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07746: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07747: .getSelectedFrame();
07748: jrf.setNewObjectType(ReportElementType.CHART_ELEMENT);
07749: jrf.setLensMode(false);
07750: }
07751: setActiveTool(jToggleButtonChartTool);
07752: }
07753: }//GEN-LAST:event_jToggleButtonChartToolItemStateChanged
07754:
07755: private void jMenuItemConnectionsActionPerformed(
07756: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemConnectionsActionPerformed
07757:
07758: try {
07759: ConnectionsDialog cd = new ConnectionsDialog(this , true);
07760: cd.setVisible(true);
07761: jToolbarConnectionPanel.updateConnections();
07762: } catch (Exception ex) {
07763: ex.printStackTrace();
07764: }
07765:
07766: }//GEN-LAST:event_jMenuItemConnectionsActionPerformed
07767:
07768: private void jMenuItemReportQuery2ActionPerformed(
07769: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReportQuery2ActionPerformed
07770: this .jButtonDatabaseActionPerformed(evt);
07771: }//GEN-LAST:event_jMenuItemReportQuery2ActionPerformed
07772:
07773: private void jMenuItemCompatibilityActionPerformed(
07774: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCompatibilityActionPerformed
07775: CompatibilityDialog cd = new CompatibilityDialog(this , true);
07776: cd.setVisible(true);
07777: }//GEN-LAST:event_jMenuItemCompatibilityActionPerformed
07778:
07779: private void jMenuItemOptionsActionPerformed(
07780: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemOptionsActionPerformed
07781: OptionsDialog od = new OptionsDialog(this , true);
07782: od.loadConfiguration();
07783: od.setVisible(true);
07784: }//GEN-LAST:event_jMenuItemOptionsActionPerformed
07785:
07786: private void jCheckBoxMenuItemOutputActionPerformed(
07787: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemOutputActionPerformed
07788:
07789: if (jCheckBoxMenuItemOutput.isSelected()) {
07790: Misc.dockAt(logPaneView, DockingConstants.SOUTH_REGION, 0);
07791: } else {
07792: DockingManager.close(logPaneView);
07793: }
07794:
07795: }//GEN-LAST:event_jCheckBoxMenuItemOutputActionPerformed
07796:
07797: private void jCheckBoxMenuItemExplorerActionPerformed(
07798: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemExplorerActionPerformed
07799:
07800: if (jCheckBoxMenuItemExplorer.isSelected()) {
07801: Misc.dockAt(viewFiles, DockingConstants.WEST_REGION, 0);
07802: } else {
07803: DockingManager.close(viewFiles);
07804: }
07805: getProperties().put("panelFiles",
07806: "" + jCheckBoxMenuItemExplorer.isSelected());
07807: this .saveiReportConfiguration();
07808:
07809: }//GEN-LAST:event_jCheckBoxMenuItemExplorerActionPerformed
07810:
07811: public void jMenuItemHSDecreaseActionPerformed(
07812: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHSDecreaseActionPerformed
07813: FormatCommand.getCommand(OperationType.DECREASE_SPACE_H)
07814: .execute();
07815: }//GEN-LAST:event_jMenuItemHSDecreaseActionPerformed
07816:
07817: public void jMenuItemVSIncreaseActionPerformed(
07818: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVSIncreaseActionPerformed
07819: FormatCommand.getCommand(OperationType.INCREASE_SPACE_V)
07820: .execute();
07821: }//GEN-LAST:event_jMenuItemVSIncreaseActionPerformed
07822:
07823: private void jButtonDatabaseActionPerformed(
07824: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDatabaseActionPerformed
07825: this .getReportQueryDialog().setSubDataset(
07826: this .getActiveReportFrame().getReport());
07827: this .getReportQueryDialog().setVisible(true);
07828: }//GEN-LAST:event_jButtonDatabaseActionPerformed
07829:
07830: private void jMenuItemSaveAllActionPerformed(
07831: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveAllActionPerformed
07832: saveAll();
07833: }
07834:
07835: /**
07836: * save all open reports
07837: */
07838: public void saveAll() {
07839: saveAll(jMDIDesktopPane.getAllFrames());
07840: }
07841:
07842: /**
07843: * save all reportframes
07844: *
07845: * @param frames JInternalFrame[]
07846: */
07847: public void saveAll(javax.swing.JInternalFrame[] frames) {
07848: for (int i = 0; i < frames.length; ++i) {
07849: if (frames[i] instanceof JReportFrame) {
07850: JReportFrame jrf = (JReportFrame) frames[i];
07851: if (jrf.getReport().getFilename() == null
07852: || jrf.getReport().getFilename().trim().equals(
07853: "")) {
07854: // Choose a file name....
07855: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
07856: getCurrentDirectory());
07857:
07858: jfc
07859: .setDialogTitle("Save report as XML jasperreports file....");
07860: jfc
07861: .setFileFilter(new javax.swing.filechooser.FileFilter() {
07862: public boolean accept(java.io.File file) {
07863: String filename = file.getName();
07864: return (filename.toLowerCase()
07865: .endsWith(".xml")
07866: || file.isDirectory() || filename
07867: .toLowerCase().endsWith(
07868: ".jrxml"));
07869: }
07870:
07871: public String getDescription() {
07872: return "JasperReports XML *.xml, *.jrxml";
07873: }
07874: });
07875:
07876: jfc.setMultiSelectionEnabled(false);
07877:
07878: jfc
07879: .setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);
07880: if (jfc.showSaveDialog(this ) != javax.swing.JOptionPane.OK_OPTION) {
07881: //if we saved or didn't save the current file
07882: javax.swing.JInternalFrame current = jMDIDesktopPane
07883: .getSelectedFrame();
07884: if (current instanceof JReportFrame) {
07885: JReportFrame crf = (JReportFrame) current;
07886: if (crf.getReport().isModified()) {
07887: this .enableSaveSpecific();
07888: } else {
07889: this .disableSaveSpecific();
07890: }
07891: }
07892: return;
07893: }
07894: setCurrentDirectory(jfc.getSelectedFile(), true);
07895: jrf.getReport().setFilename(
07896: jfc.getSelectedFile().getPath());
07897: }
07898:
07899: //saveBackup( jrf.getReport().getFilename());
07900: jrf.getReport().saveXMLFile();
07901: //jrf.getReport().in(false);
07902: //this.addToRecentFileList(rp.filename);
07903: //saveProperties();
07904: //this.updateRecentFileList();
07905: }//end if instance of
07906: }//end for loop frames
07907: this .disableSaveAllSpecific();
07908: this .disableSaveSpecific();
07909: }//GEN-LAST:event_jMenuItemSaveAllActionPerformed
07910:
07911: private void jMenuItemSaveAsActionPerformed(
07912: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveAsActionPerformed
07913: if (jMDIDesktopPane.getSelectedFrame() != null
07914: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
07915: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
07916: .getSelectedFrame();
07917:
07918: saveAs(jrf);
07919: }
07920: }//GEN-LAST:event_jMenuItemSaveAsActionPerformed
07921:
07922: public void saveAs(JReportFrame jrf) {
07923: String reportName = jrf.getReport().getName();
07924:
07925: // Choose a new file name....
07926: // -----------------------------------------------------------------
07927:
07928: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
07929: getCurrentDirectory());
07930: jfc
07931: .setDialogTitle("Save report as XML jasperreports file as....");
07932:
07933: // Handling the new File, that gets saved for the first time
07934: // Propose a new file name based on the report name
07935: if (jrf.getReport().getFilename() != null)
07936: jfc.setSelectedFile(new java.io.File(jrf.getReport()
07937: .getFilename()));
07938:
07939: if (jrf.getReport().getFilename() == null
07940: || jrf.getReport().getFilename().trim().equals("")) {
07941: if (!((reportName == null) || (reportName.trim().equals("")))) {
07942: File file = new java.io.File(reportName + ".jrxml");
07943: jfc.setSelectedFile(file);
07944: }
07945: }
07946:
07947: jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
07948: public boolean accept(java.io.File file) {
07949: String filename = file.getName();
07950: return (filename.toLowerCase().endsWith(".xml")
07951: || file.isDirectory() || filename.toLowerCase()
07952: .endsWith(".jrxml"));
07953: }
07954:
07955: public String getDescription() {
07956: return "JasperReports XML *.xml, *.jrxml";
07957: }
07958: });
07959: jfc.setMultiSelectionEnabled(false);
07960: jfc.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);
07961:
07962: // Show the dialog:
07963: if (jfc.showSaveDialog(this ) != javax.swing.JOptionPane.OK_OPTION) {
07964: return;
07965: }
07966:
07967: setCurrentDirectory(jfc.getSelectedFile(), true);
07968:
07969: //file exists?
07970: if (jfc.getSelectedFile().exists()) {
07971: //is the same file to save?
07972: if (new File(jrf.getReport().getFilename()).equals(jfc
07973: .getSelectedFile())) {
07974: // Synchronize Report Name ?
07975: boolean sync = false;
07976: String filename = jfc.getSelectedFile().getName();
07977: if (filename.lastIndexOf(".") > 0) {
07978: filename = filename.substring(0, filename
07979: .lastIndexOf("."));
07980: }
07981:
07982: if (!reportName.toLowerCase().equals(
07983: filename.toLowerCase())) {
07984: if (isSynchronizeReportName()) {
07985: sync = true;
07986: } else {
07987: if (isShowOptionDialogSynchronize(jrf
07988: .getReport().getName(), filename)) {
07989: sync = true;
07990: }
07991: }
07992: }
07993: if (sync) {
07994: jrf.getReport().setName(filename);
07995: }
07996: //save only
07997: jrf.getReport().saveXMLFile();
07998: //jrf.getReport().setModified(false);
07999: return;
08000: } else {
08001: //is different file to save?
08002: //confirm overwrite
08003: int ret = I18nOptionPane.showOptionDialog(this ,
08004: "overwriteFile", "saveAs",
08005: JOptionPane.YES_NO_OPTION,
08006: JOptionPane.WARNING_MESSAGE, null,
08007: new String[] { "yes", "no" }, "no");
08008:
08009: //if yes
08010: if (ret == 0) {
08011: //is that file opened?
08012: JReportFrame reportFrame = findReportFrameByFile(jfc
08013: .getSelectedFile());
08014: if (reportFrame != null) {
08015: //close file
08016: reportFrame
08017: .setDefaultCloseOperation(jrf.DISPOSE_ON_CLOSE);
08018: reportFrame.doDefaultCloseAction();
08019: }
08020: } else {
08021: //canceled
08022: return;
08023: }
08024:
08025: }
08026: } else {
08027: // File does not exist yet.
08028:
08029: }
08030:
08031: String f = jfc.getSelectedFile().getPath();
08032: if (!f.toLowerCase().endsWith(".jrxml")
08033: && !f.toLowerCase().endsWith(".xml")) {
08034: f += ".jrxml";
08035: }
08036:
08037: //saveBackup( jrf.getReport().getFilename());
08038: jrf.getReport().checkReadOnlyFlag(f);
08039: if (jrf.getReport().isReadOnly()) {
08040: javax.swing.JOptionPane
08041: .showMessageDialog(
08042: this ,
08043: it.businesslogic.ireport.util.I18n
08044: .getString("selectedFileReadOnly",
08045: "Selected File is read only and cannot be used."),
08046: it.businesslogic.ireport.util.I18n
08047: .getString("save", "Save"),
08048: javax.swing.JOptionPane.INFORMATION_MESSAGE);
08049: return;
08050: }
08051:
08052: // Begin Modification, Robert Lamping, May 3, 2005
08053:
08054: String filename = jfc.getSelectedFile().getName();
08055: if (filename.lastIndexOf(".") > 0) {
08056: filename = filename.substring(0, filename.lastIndexOf("."));
08057: }
08058:
08059: if (reportName.trim().equals("")) {
08060: // if report name is empty, then use the filename without the last extension as
08061: // the new report name.
08062: jrf.getReport().setName(filename);
08063: } else {
08064: // If different file name was entered than the report name
08065: // and the report name is not null or empty. then:
08066: // Ask whether it should be brought in sync.
08067:
08068: // filename always includes a "."
08069: // so take everything until the last occurance of "."
08070: // and compare this to the reportname
08071: // if not equal, than ask to synchronize.
08072:
08073: if (!reportName.toLowerCase()
08074: .equals(filename.toLowerCase())) {
08075: // Ask to synchronize
08076: // TODO: I18N hardcoded text
08077: if (isSynchronizeReportName()) {
08078: jrf.getReport().setName(filename);
08079:
08080: getLogPane()
08081: .getMainLogTextArea()
08082: .logOnConsole(
08083: I18n
08084: .getString(
08085: "messages.nameSync",
08086: "Report name synchronized with file name\n"),
08087: JOptionPane.INFORMATION_MESSAGE);
08088:
08089: } else {
08090: if (isShowOptionDialogSynchronize(reportName,
08091: filename)) {
08092: jrf.getReport().setName(filename);
08093: }
08094: }
08095: }
08096:
08097: }
08098: // End Modification, Robert Lamping, May 3, 2005
08099:
08100: jrf.getReport().setFilename(f);
08101: jrf.getReport().saveXMLFile();
08102:
08103: //jrf.getReport().setModified(false);
08104: jrf.updateTitle();
08105: updateMenuWindowList();
08106:
08107: javax.swing.tree.DefaultTreeModel dtm = (javax.swing.tree.DefaultTreeModel) jTreeFiles
08108: .getModel();
08109: dtm.reload();
08110:
08111: setActiveReportForm(jrf);
08112: this .disableSaveSpecific();
08113: if (this .isSaveAllRequired()) {
08114: this .enableSaveAllSpecific();
08115: } else {
08116: this .disableSaveAllSpecific();
08117: }
08118: recentFilesList.insertElementAt(jrf.getReport().getFilename(),
08119: 0);
08120: this .updateRecentFileMenu(jMenuRecentFiles, recentFilesList);
08121: //saveFileList(recentFilesList, "recentFiles.xml");
08122: saveFileList(recentFilesList, IREPORT_RECENT_FILES_FILE);
08123: // this.addToRecentFileList(rp.filename);
08124: //saveProperties();
08125: //this.updateRecentFileList();
08126:
08127: }
08128:
08129: private void jButtonOpenActionPerformed(
08130: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpenActionPerformed
08131: this .jMenuItemOpenActionPerformed(evt);
08132: }//GEN-LAST:event_jButtonOpenActionPerformed
08133:
08134: private void jButtonCompilerActionPerformed(
08135: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCompilerActionPerformed
08136: compile();
08137: }
08138:
08139: public IReportCompiler compile() {
08140: return compile(jListThreads);
08141: }
08142:
08143: public IReportCompiler compile(javax.swing.JList jListThreads) {
08144: // 1. Get active report...
08145: if (jMDIDesktopPane.getSelectedFrame() != null
08146: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08147: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08148: .getSelectedFrame();
08149: if (jrf.getReport().getFilename() == null
08150: || jrf.getReport().getFilename().trim().equals("")
08151: || (Misc.nvl(this .getProperties().getProperty(
08152: "SaveBeforeCompiling"), "true")
08153: .equals("true"))) // && jrf.getReport().isModified()))Force a save
08154: {
08155: jMenuItemSaveActionPerformed(new java.awt.event.ActionEvent(
08156: jMenuItemSave, 0, "Save"));
08157: if (jrf.getReport().isModified()) {
08158: getLogPane().getMainLogTextArea().logOnConsole(
08159: I18n.getString(
08160: "messages.actionAbortedByUser",
08161: "Action aborted by user"),
08162: JOptionPane.WARNING_MESSAGE);
08163: }
08164: }
08165:
08166: //1. Save the report if needed....
08167:
08168: if (jrf.getReport().getFilename() == null
08169: || jrf.getReport().getFilename().trim().equals("")) {
08170: getLogPane().getMainLogTextArea().logOnConsole(
08171: I18n.getString("messages.actionAbortedByUser",
08172: "Action aborted by user"),
08173: JOptionPane.WARNING_MESSAGE);
08174: return null;
08175: }
08176:
08177: //clearConsole();
08178: //1. Compile....
08179: IReportCompiler ic = new IReportCompiler();
08180: ic.setThreadList(jListThreads);
08181:
08182: HashMap hm = new HashMap();
08183: hm
08184: .put(ic.OUTPUT_DIRECTORY,
08185: getTranslatedCompileDirectory());
08186:
08187: if (jrf.getReport().getLanguage().equals("groovy")) {
08188: hm
08189: .put(ic.COMPILER,
08190: "net.sf.jasperreports.compilers.JRGroovyCompiler");
08191: }
08192:
08193: ic.setProperties(hm);
08194: ic.setCommand(IReportCompiler.CMD_COMPILE);
08195:
08196: if (jrf.getReport().getScriptletHandling() == jrf
08197: .getReport().SCRIPTLET_IREPORT_INTERNAL_HANDLING) {
08198: ic.setCommand(ic.getCommand()
08199: | IReportCompiler.CMD_COMPILE_SCRIPTLET);
08200: }
08201: ic.setJrf(jrf);
08202: ic.setMainFrame(this );
08203: ic.start();
08204: return ic;
08205: }
08206: return null;
08207:
08208: }//GEN-LAST:event_jButtonCompilerActionPerformed
08209:
08210: private void jButtonSaveActionPerformed(
08211: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed
08212: jMenuItemSaveActionPerformed(evt);
08213: }//GEN-LAST:event_jButtonSaveActionPerformed
08214:
08215: public void jMenuItemSaveActionPerformed(
08216: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSaveActionPerformed
08217: if (jMDIDesktopPane.getSelectedFrame() != null
08218: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08219: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08220: .getSelectedFrame();
08221:
08222: save(jrf);
08223: }
08224: }//GEN-LAST:event_jMenuItemSaveActionPerformed
08225:
08226: public void save(JReportFrame jrf) {
08227: String reportName = jrf.getReport().getName();
08228:
08229: if (CompatibilitySupport.LAST_AVAILABLE_VERSION > CompatibilitySupport.version
08230: && !getProperties().getProperty(
08231: "showCompatibilityMessage", "true").equals(
08232: "false")) {
08233:
08234: JOptionPane optionPane = new JOptionPane();
08235: JCheckBox checkbox = new JCheckBox(
08236: "Don't show this message again.");
08237: checkbox.setEnabled(false);
08238: Object msg[] = {
08239: "Warning: you have chosen to keep this report compatible with the "
08240: + CompatibilitySupport.getVersionName()
08241: + " version of JasperReports.\nThis may result in the loss of formatting information or parts of your report, if they are not supported by version you specified ("
08242: + CompatibilitySupport.getVersionName()
08243: + ").\n\nDo you want to continue?",
08244: checkbox };
08245: optionPane.setMessage(msg);
08246: optionPane.setMessageType(JOptionPane.WARNING_MESSAGE);
08247: optionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION);
08248:
08249: JDialog dialog = optionPane.createDialog(this ,
08250: "Compatibility warning");
08251: checkbox.setEnabled(true);
08252: dialog.setVisible(true);
08253:
08254: Object value = optionPane.getValue();
08255: if (value == null
08256: || value == optionPane.UNINITIALIZED_VALUE) {
08257: return; //User aborted?
08258: } else {
08259: int res = ((Integer) value).intValue();
08260:
08261: if (res != JOptionPane.OK_OPTION)
08262: return;
08263:
08264: // Save the user choice...
08265: if (checkbox.isSelected()) {
08266: getProperties().setProperty(
08267: "showCompatibilityMessage", "false");
08268: }
08269: }
08270:
08271: }
08272:
08273: if (jrf.getReport().getFilename() == null
08274: || jrf.getReport().getFilename().trim().equals("")) {
08275: // Choose a file name....
08276: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
08277: getCurrentDirectory());
08278: jfc
08279: .setDialogTitle("Save report as XML jasperreports file....");
08280:
08281: // Begin Modification, Robert Lamping, May 3, 2005
08282: // filename is empty, so default it to the report name
08283: // whether or not the (future) option to keep report name and file name equal
08284:
08285: File file = new java.io.File(reportName + ".jrxml");
08286: jfc.setSelectedFile(file);
08287: // End Modification, Robert Lamping, May 3, 2005
08288:
08289: jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
08290: public boolean accept(java.io.File file) {
08291: String filename = file.getName();
08292: return (filename.toLowerCase().endsWith(".xml")
08293: || file.isDirectory() || filename
08294: .toLowerCase().endsWith(".jrxml"));
08295: }
08296:
08297: public String getDescription() {
08298: return "JasperReports XML *.xml, *.jrxml";
08299: }
08300: });
08301:
08302: jfc.setMultiSelectionEnabled(false);
08303:
08304: jfc.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);
08305: if (jfc.showSaveDialog(this ) != javax.swing.JOptionPane.OK_OPTION)
08306: return;
08307: setCurrentDirectory(jfc.getSelectedFile(), true);
08308: String f = jfc.getSelectedFile().getPath();
08309: if (!f.toLowerCase().endsWith(".jrxml")
08310: && !f.toLowerCase().endsWith(".xml")) {
08311: f += ".jrxml";
08312: }
08313: jrf.getReport().checkReadOnlyFlag(f);
08314: if (jrf.getReport().isReadOnly()) {
08315: javax.swing.JOptionPane
08316: .showMessageDialog(
08317: this ,
08318: it.businesslogic.ireport.util.I18n
08319: .getString(
08320: "selectedFileReadOnly",
08321: "Selected File is read only and cannot be used."),
08322: it.businesslogic.ireport.util.I18n
08323: .getString("save", "Save"),
08324: javax.swing.JOptionPane.INFORMATION_MESSAGE);
08325: return;
08326: }
08327:
08328: // Begin Modification, Robert Lamping, May 3, 2005
08329: // If a file with the same name exists as f
08330: // then the ask whether the file must be overwritten.
08331:
08332: //file exists?
08333: if (jfc.getSelectedFile().exists()) {
08334:
08335: //confirm overwrite
08336: // TODO: Show Filename in OptionDialog
08337: int ret = I18nOptionPane.showOptionDialog(this ,
08338: "overwriteFile", "save",
08339: JOptionPane.YES_NO_OPTION,
08340: JOptionPane.WARNING_MESSAGE, null,
08341: new String[] { "yes", "no" }, "no", jfc
08342: .getSelectedFile().getPath());
08343:
08344: //if yes
08345: if (ret == 0) {
08346:
08347: //is that file opened?
08348: JReportFrame reportFrame = findReportFrameByFile(jfc
08349: .getSelectedFile());
08350: if (reportFrame != null) {
08351: //close file
08352: reportFrame
08353: .setDefaultCloseOperation(jrf.DISPOSE_ON_CLOSE);
08354: reportFrame.doDefaultCloseAction();
08355: }
08356: } else {
08357:
08358: //canceled
08359: return;
08360: }
08361: }
08362:
08363: String filename = jfc.getSelectedFile().getName();
08364: if (filename.lastIndexOf(".") > 0) {
08365: filename = filename.substring(0, filename
08366: .lastIndexOf("."));
08367: }
08368:
08369: if (reportName.trim().equals("")) {
08370: // if report name is empty, then use the filename without the last extension as
08371: // the new report name.
08372: jrf.getReport().setName(filename);
08373: } else {
08374: // If different file name was entered than the report name
08375: // and the report name is not null or empty. then:
08376: // Ask whether it should be brought in sync.
08377:
08378: // filename always includes a "."
08379: // so take everything until the last occurance of "."
08380: // and compare this to the reportname
08381: // if not equal, than ask to synchronize.
08382:
08383: if (!reportName.toLowerCase().equals(
08384: filename.toLowerCase())) {
08385: // Ask to synchronize
08386: // TODO: I18N hardcoded text
08387: if (isSynchronizeReportName()) {
08388: jrf.getReport().setName(filename);
08389: getLogPane()
08390: .getMainLogTextArea()
08391: .logOnConsole(
08392: I18n
08393: .getString(
08394: "messages.nameSync",
08395: "Report name synchronized with file name\n"),
08396: JOptionPane.INFORMATION_MESSAGE);
08397: } else {
08398: // ask user whether to synchronize or not
08399: if (isShowOptionDialogSynchronize(reportName,
08400: filename)) {
08401: jrf.getReport().setName(filename);
08402: }
08403: }
08404: }
08405:
08406: }
08407: // End Modification, Robert Lamping, May 3, 2005
08408:
08409: jrf.getReport().setFilename(f);
08410: recentFilesList.insertElementAt(jrf.getReport()
08411: .getFilename(), 0);
08412: this
08413: .updateRecentFileMenu(jMenuRecentFiles,
08414: recentFilesList);
08415: //saveFileList(recentFilesList, "recentFiles.xml");
08416: saveFileList(recentFilesList, IREPORT_RECENT_FILES_FILE);
08417: } else {
08418:
08419: // Begin Modification, Robert Lamping, May 3, 2005
08420: File file = new java.io.File(jrf.getReport().getFilename());
08421: // strip the path:
08422: String filename = file.getName();
08423: if (filename.lastIndexOf(".") > 0) {
08424: filename = filename.substring(0, filename
08425: .lastIndexOf("."));
08426: }
08427:
08428: if (reportName.trim().equals("")) {
08429: // if report name is empty, then use the filename without the last extension as
08430: // the new report name.
08431: jrf.getReport().setName(filename);
08432: } else {
08433: // If different file name was entered than the report name
08434: // and the report name is not null or empty. then:
08435: // Ask whether it should be brought in sync.
08436:
08437: // filename always includes a "."
08438: // so take everything until the last occurance of "."
08439: // and compare this to the reportname
08440: // if not equal, than ask to synchronize.
08441: if (!reportName.toLowerCase().equals(
08442: filename.toLowerCase())) {
08443: if (isSynchronizeReportName()) {
08444: jrf.getReport().setName(filename);
08445: getLogPane()
08446: .getMainLogTextArea()
08447: .logOnConsole(
08448: I18n
08449: .getString(
08450: "messages.nameSync",
08451: "Report name synchronized with file name\n"),
08452: JOptionPane.INFORMATION_MESSAGE);
08453: } else {
08454: // ask user whether to synchronize or not
08455: if (isShowOptionDialogSynchronize(reportName,
08456: filename)) {
08457: jrf.getReport().setName(filename);
08458: }
08459: }
08460: }
08461:
08462: }
08463: // End Modification, Robert Lamping, May 3, 2005
08464:
08465: }
08466:
08467: if (!jrf.getReport().isReadOnly()
08468: && !getProperties().getProperty("BackupPolicy", "3")
08469: .equals("1")) {
08470: saveBackup(jrf.getReport().getFilename());
08471: }
08472: jrf.getReport().saveXMLFile();
08473: //jrf.getReport().setReportChanges(0);
08474: //jrf.getReport().setModified(false);
08475: this .disableSaveSpecific();
08476: if (this .isSaveAllRequired()) {
08477: this .enableSaveAllSpecific();
08478: } else {
08479: this .disableSaveAllSpecific();
08480: }
08481: //this.addToRecentFileList(rp.filename);
08482: //saveProperties();
08483: //this.updateRecentFileList();
08484: this .jTreeFiles.updateUI();
08485:
08486: }
08487:
08488: /**
08489: * saveToStream
08490: * saves a Report to an OutputStream
08491: *
08492: * Author: Felix Firgau
08493: *
08494: * @param outputStream OutputStream
08495: */
08496: public void saveToStream(java.io.OutputStream outputStream) {
08497: JReportFrame rf = getActiveReportFrame();
08498: if (rf == null)
08499: return;
08500: Report activeReport = rf.getReport();
08501: ReportWriter rw = new ReportWriter(activeReport);
08502: rw.writeToOutputStream(outputStream);
08503: }
08504:
08505: private void jCheckBoxMenuItemSnapToGridActionPerformed(
08506: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemSnapToGridActionPerformed
08507: // Set SnapToGrid to all reports form..
08508: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
08509: .getAllFrames();
08510: for (int i = 0; i < frames.length; ++i) {
08511: if (frames[i] instanceof JReportFrame) {
08512: JReportFrame jrf = (JReportFrame) frames[i];
08513: jrf.setSnapToGrid(jCheckBoxMenuItemSnapToGrid
08514: .isSelected());
08515: this .getProperties().setProperty("snapToGrid",
08516: jCheckBoxMenuItemSnapToGrid.isSelected() + "");
08517: this .saveiReportConfiguration();
08518: }
08519: }
08520: }//GEN-LAST:event_jCheckBoxMenuItemSnapToGridActionPerformed
08521:
08522: private void jCheckBoxMenuItemGridActionPerformed(
08523: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemGridActionPerformed
08524:
08525: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
08526: .getAllFrames();
08527: for (int i = 0; i < frames.length; ++i) {
08528: if (frames[i] instanceof JReportFrame) {
08529: JReportFrame jrf = (JReportFrame) frames[i];
08530: jrf.setShowGrid(jCheckBoxMenuItemGrid.isSelected());
08531: this .getProperties().setProperty("showGrid",
08532: jCheckBoxMenuItemGrid.isSelected() + "");
08533: this .saveiReportConfiguration();
08534: }
08535: }
08536: }//GEN-LAST:event_jCheckBoxMenuItemGridActionPerformed
08537:
08538: private void jButtonBandsActionPerformed(
08539: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBandsActionPerformed
08540: getBandsDialog().setVisible(true);
08541: }//GEN-LAST:event_jButtonBandsActionPerformed
08542:
08543: private void jButtonGroupsActionPerformed(
08544: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGroupsActionPerformed
08545: getGroupsDialog().setVisible(true);
08546: }//GEN-LAST:event_jButtonGroupsActionPerformed
08547:
08548: private void jButtonParametersActionPerformed(
08549: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonParametersActionPerformed
08550: // Show values frame...
08551: getValuesDialog().setVisible(true);
08552:
08553: }//GEN-LAST:event_jButtonParametersActionPerformed
08554:
08555: private void jMenuItemOpenActionPerformed(
08556: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemOpenActionPerformed
08557: open();
08558: }
08559:
08560: /**
08561: * opens one or more existing report. Shows file chooser dialog.
08562: * returns the newly opened ReportFrames (maybe more than one) or null if file chooser is canceled.
08563: *
08564: * @return JReportFrame[]
08565: */
08566: public JReportFrame[] open() {
08567: // Select an XMl file...
08568: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
08569: getCurrentDirectory());
08570:
08571: jfc.setDialogTitle("Load XML jasperreports file....");
08572:
08573: jfc
08574: .addChoosableFileFilter(new javax.swing.filechooser.FileFilter() {
08575: public boolean accept(java.io.File file) {
08576: String filename = file.getName();
08577: return (filename.toLowerCase().endsWith(
08578: ".jasper") || file.isDirectory());
08579: }
08580:
08581: public String getDescription() {
08582: return "JasperReports compiled *.jasper";
08583: }
08584: });
08585:
08586: jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
08587: public boolean accept(java.io.File file) {
08588: String filename = file.getName();
08589: return (filename.toLowerCase().endsWith(".xml")
08590: || file.isDirectory() || filename.toLowerCase()
08591: .endsWith(".jrxml"));
08592: }
08593:
08594: public String getDescription() {
08595: return "JasperReports XML *.xml, *.jrxml";
08596: }
08597: });
08598:
08599: jfc.setMultiSelectionEnabled(true);
08600: jfc.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
08601: if (jfc.showOpenDialog(this ) == javax.swing.JOptionPane.OK_OPTION) {
08602: java.io.File[] files = jfc.getSelectedFiles();
08603:
08604: JReportFrame[] result = new JReportFrame[files.length];
08605:
08606: for (int i = 0; i < files.length; ++i) {
08607: result[i] = openFile(files[i]);
08608: }
08609: setCurrentDirectory(jfc.getSelectedFile(), true);
08610: return result;
08611: }
08612: return null;
08613:
08614: }//GEN-LAST:event_jMenuItemOpenActionPerformed
08615:
08616: private void jToggleButtonSubreportToolItemStateChanged(
08617: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonSubreportToolItemStateChanged
08618: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08619: if (jMDIDesktopPane.getSelectedFrame() != null
08620: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08621: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08622: .getSelectedFrame();
08623: jrf
08624: .setNewObjectType(ReportElementType.SUBREPORT_ELEMENT);
08625: jrf.setLensMode(false);
08626: }
08627: setActiveTool(jToggleButtonSubreportTool);
08628: }
08629: }//GEN-LAST:event_jToggleButtonSubreportToolItemStateChanged
08630:
08631: private void jToggleButtonSubreportToolActionPerformed(
08632: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonSubreportToolActionPerformed
08633: jToggleButtonSubreportTool.setSelected(true);
08634: }//GEN-LAST:event_jToggleButtonSubreportToolActionPerformed
08635:
08636: private void jToggleButtonTextFieldToolItemStateChanged(
08637: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonTextFieldToolItemStateChanged
08638: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08639: if (jMDIDesktopPane.getSelectedFrame() != null
08640: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08641: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08642: .getSelectedFrame();
08643: jrf
08644: .setNewObjectType(ReportElementType.TEXTFIELD_ELEMENT);
08645: jrf.setLensMode(false);
08646: }
08647: setActiveTool(jToggleButtonTextFieldTool);
08648: }
08649: }//GEN-LAST:event_jToggleButtonTextFieldToolItemStateChanged
08650:
08651: private void jToggleButtonTextFieldToolActionPerformed(
08652: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonTextFieldToolActionPerformed
08653: jToggleButtonTextFieldTool.setSelected(true);
08654: }//GEN-LAST:event_jToggleButtonTextFieldToolActionPerformed
08655:
08656: private void jToggleButtonStaticTextToolItemStateChanged(
08657: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonStaticTextToolItemStateChanged
08658: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08659: if (jMDIDesktopPane.getSelectedFrame() != null
08660: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08661: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08662: .getSelectedFrame();
08663: jrf
08664: .setNewObjectType(ReportElementType.STATICTEXT_ELEMENT);
08665: jrf.setLensMode(false);
08666: }
08667: setActiveTool(jToggleButtonStaticTextTool);
08668: }
08669: }//GEN-LAST:event_jToggleButtonStaticTextToolItemStateChanged
08670:
08671: private void jToggleButtonStaticTextToolActionPerformed(
08672: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonStaticTextToolActionPerformed
08673: jToggleButtonStaticTextTool.setSelected(true);
08674: }//GEN-LAST:event_jToggleButtonStaticTextToolActionPerformed
08675:
08676: private void jToggleButtonImageToolItemStateChanged(
08677: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonImageToolItemStateChanged
08678: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08679: if (jMDIDesktopPane.getSelectedFrame() != null
08680: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08681: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08682: .getSelectedFrame();
08683: jrf.setNewObjectType(ReportElementType.IMAGE_ELEMENT);
08684: jrf.setLensMode(false);
08685: }
08686: setActiveTool(jToggleButtonImageTool);
08687: }
08688: }//GEN-LAST:event_jToggleButtonImageToolItemStateChanged
08689:
08690: private void jToggleButtonImageToolActionPerformed(
08691: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonImageToolActionPerformed
08692: jToggleButtonImageTool.setSelected(true);
08693: }//GEN-LAST:event_jToggleButtonImageToolActionPerformed
08694:
08695: private void jToggleButtonEllipseToolItemStateChanged(
08696: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonEllipseToolItemStateChanged
08697: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08698: if (jMDIDesktopPane.getSelectedFrame() != null
08699: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08700: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08701: .getSelectedFrame();
08702: jrf.setNewObjectType(ReportElementType.ELLIPSE_ELEMENT);
08703: jrf.setLensMode(false);
08704: }
08705: setActiveTool(jToggleButtonEllipseTool);
08706: }
08707: }//GEN-LAST:event_jToggleButtonEllipseToolItemStateChanged
08708:
08709: private void jToggleButtonEllipseToolActionPerformed(
08710: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonEllipseToolActionPerformed
08711: jToggleButtonEllipseTool.setSelected(true);
08712: }//GEN-LAST:event_jToggleButtonEllipseToolActionPerformed
08713:
08714: private void jToggleButtonRectToolItemStateChanged(
08715: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonRectToolItemStateChanged
08716: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08717: if (jMDIDesktopPane.getSelectedFrame() != null
08718: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08719: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08720: .getSelectedFrame();
08721: jrf
08722: .setNewObjectType(ReportElementType.RECTANGLE_ELEMENT);
08723: jrf.setLensMode(false);
08724: }
08725: setActiveTool(jToggleButtonRectTool);
08726: }
08727: }//GEN-LAST:event_jToggleButtonRectToolItemStateChanged
08728:
08729: private void jToggleButtonRectToolActionPerformed(
08730: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonRectToolActionPerformed
08731: jToggleButtonRectTool.setSelected(true);
08732: }//GEN-LAST:event_jToggleButtonRectToolActionPerformed
08733:
08734: private void jToggleButtonLineToolActionPerformed(
08735: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonLineToolActionPerformed
08736: jToggleButtonLineTool.setSelected(true);
08737: }//GEN-LAST:event_jToggleButtonLineToolActionPerformed
08738:
08739: private void jToggleButtonLineToolItemStateChanged(
08740: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonLineToolItemStateChanged
08741: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08742: if (jMDIDesktopPane.getSelectedFrame() != null
08743: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08744: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08745: .getSelectedFrame();
08746: jrf.setNewObjectType(ReportElementType.LINE_ELEMENT);
08747: jrf.setLensMode(false);
08748: }
08749: setActiveTool(jToggleButtonLineTool);
08750: }
08751: }//GEN-LAST:event_jToggleButtonLineToolItemStateChanged
08752:
08753: private void jToggleButtonPointerActionPerformed(
08754: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButtonPointerActionPerformed
08755: jToggleButtonPointer.setSelected(true);
08756: }//GEN-LAST:event_jToggleButtonPointerActionPerformed
08757:
08758: private void jToggleButtonPointerItemStateChanged(
08759: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonPointerItemStateChanged
08760: if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
08761:
08762: if (jMDIDesktopPane.getSelectedFrame() != null
08763: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
08764: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
08765: .getSelectedFrame();
08766: jrf.setNewObjectType(ReportElementType.NONE);
08767: jrf.setLensMode(false);
08768: }
08769: if (jToggleButtonPointer.isEnabled()) {
08770: setActiveTool(jToggleButtonPointer);
08771: }
08772: }
08773: }//GEN-LAST:event_jToggleButtonPointerItemStateChanged
08774:
08775: private void jButtonNewActionPerformed(
08776: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNewActionPerformed
08777: evt.setSource(jButtonNew);
08778: this .jMenuItemNewDocumentActionPerformed(evt);
08779: }//GEN-LAST:event_jButtonNewActionPerformed
08780:
08781: public void setCutCopyEnabled(boolean enabled) {
08782: this .jButtonCut.setEnabled(enabled);
08783: this .jMenuItemCut.setEnabled(enabled);
08784:
08785: this .jButtonCopy.setEnabled(enabled);
08786: this .jMenuItemCopy.setEnabled(enabled);
08787:
08788: this .jMenuItemDelete.setEnabled(enabled);
08789:
08790: getDocumentStructurePanel().setCutCopyEnabled(enabled);
08791: }
08792:
08793: public void setPasteEnebled(boolean enabled) {
08794: this .jButtonPaste.setEnabled(enabled);
08795: this .jMenuItemPaste.setEnabled(enabled);
08796:
08797: getDocumentStructurePanel().setPasteEnebled(enabled);
08798: }
08799:
08800: public void setUndoEnebled(boolean enabled) {
08801: this .jMenuItemUndo.setEnabled(enabled);
08802: }
08803:
08804: public void setRedoEnebled(boolean enabled) {
08805: this .jMenuItemRedo.setEnabled(enabled);
08806: }
08807:
08808: public void setSaveEnebled(boolean enabled) {
08809: this .jButtonSave.setEnabled(enabled);
08810: this .jMenuItemSave.setEnabled(enabled);
08811: }
08812:
08813: private void jMenuItemSubreportActionPerformed(
08814: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSubreportActionPerformed
08815: jToggleButtonSubreportToolItemStateChanged(new java.awt.event.ItemEvent(
08816: jToggleButtonSubreportTool, 0,
08817: jToggleButtonSubreportTool,
08818: java.awt.event.ItemEvent.SELECTED));
08819: }//GEN-LAST:event_jMenuItemSubreportActionPerformed
08820:
08821: private void jMenuItemTextFieldActionPerformed(
08822: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTextFieldActionPerformed
08823: jToggleButtonTextFieldToolItemStateChanged(new java.awt.event.ItemEvent(
08824: jToggleButtonTextFieldTool, 0,
08825: jToggleButtonTextFieldTool,
08826: java.awt.event.ItemEvent.SELECTED));
08827: }//GEN-LAST:event_jMenuItemTextFieldActionPerformed
08828:
08829: private void jMenuItemStaticTextActionPerformed(
08830: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemStaticTextActionPerformed
08831: jToggleButtonStaticTextToolItemStateChanged(new java.awt.event.ItemEvent(
08832: jToggleButtonStaticTextTool, 0,
08833: jToggleButtonStaticTextTool,
08834: java.awt.event.ItemEvent.SELECTED));
08835: }//GEN-LAST:event_jMenuItemStaticTextActionPerformed
08836:
08837: private void jMenuItemEllipseActionPerformed(
08838: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemEllipseActionPerformed
08839: jToggleButtonEllipseToolItemStateChanged(new java.awt.event.ItemEvent(
08840: jToggleButtonEllipseTool, 0, jToggleButtonEllipseTool,
08841: java.awt.event.ItemEvent.SELECTED));
08842: }//GEN-LAST:event_jMenuItemEllipseActionPerformed
08843:
08844: private void jMenuItemRoundRectangleActionPerformed(
08845: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRoundRectangleActionPerformed
08846: //jToggleButtonRectRoundToolItemStateChanged(new java.awt.event.ItemEvent(jToggleButtonRectRoundTool,0,jToggleButtonRectRoundTool, java.awt.event.ItemEvent.SELECTED));
08847: }//GEN-LAST:event_jMenuItemRoundRectangleActionPerformed
08848:
08849: private void jMenuItemRectangleActionPerformed(
08850: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRectangleActionPerformed
08851: jToggleButtonRectToolItemStateChanged(new java.awt.event.ItemEvent(
08852: jToggleButtonRectTool, 0, jToggleButtonRectTool,
08853: java.awt.event.ItemEvent.SELECTED));
08854: }//GEN-LAST:event_jMenuItemRectangleActionPerformed
08855:
08856: private void jMenuItemLineActionPerformed(
08857: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLineActionPerformed
08858: jToggleButtonLineToolItemStateChanged(new java.awt.event.ItemEvent(
08859: jToggleButtonLineTool, 0, jToggleButtonLineTool,
08860: java.awt.event.ItemEvent.SELECTED));
08861: }//GEN-LAST:event_jMenuItemLineActionPerformed
08862:
08863: private void jMenuEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuEditActionPerformed
08864: // Add your handling code here:
08865: }//GEN-LAST:event_jMenuEditActionPerformed
08866:
08867: private void jNumberComboBoxZoomValueChanged(ValueChangedEvent evt) {
08868: applyComboBoxZoomFactor();
08869: }
08870:
08871: private void applyComboBoxZoomFactor() {
08872:
08873: JInternalFrame jif = jMDIDesktopPane.getSelectedFrame();
08874: if (jif instanceof JReportFrame) {
08875: double new_factor = 0;
08876: String s = this .jNumberComboBoxZoom.getSelectedItem() + "";
08877:
08878: /* Code Begin Robert Lamping, 17 july 2004
08879: * Add + modification
08880: * Fit to Page renamed to Width
08881: * Added: Whole Page, Height
08882: */
08883: if (s.equalsIgnoreCase("Width")) {
08884: new_factor = (double) (((JReportFrame) jif)
08885: .getJPanelReport().getWidth() - 20)
08886: / (double) (((JReportFrame) jif).getReport()
08887: .getWidth());
08888: ((JReportFrame) jif).setZoomFactor(new_factor);
08889: new_factor = (int) (100.0 * new_factor);
08890: jNumberComboBoxZoom.setValue(new_factor);
08891: ((JReportFrame) jif).centerSelectedElements();
08892:
08893: } else if (s.equalsIgnoreCase("Whole page")) {
08894: int height = ((JReportFrame) jif).getReport()
08895: .getDesignHeight();
08896: new_factor = Math.min((double) (((JReportFrame) jif)
08897: .getJPanelReport().getWidth() - 20)
08898: / (double) (((JReportFrame) jif).getReport()
08899: .getWidth()),
08900: (double) (((JReportFrame) jif)
08901: .getJPanelReport().getHeight() - 20)
08902: / (double) height);
08903: ((JReportFrame) jif).setZoomFactor(new_factor);
08904: new_factor = (int) (100.0 * new_factor);
08905: jNumberComboBoxZoom.setValue(new_factor);
08906:
08907: } else if (s.equalsIgnoreCase("Height")) {
08908: int height = ((JReportFrame) jif).getReport()
08909: .getDesignHeight();
08910: new_factor = (double) (((JReportFrame) jif)
08911: .getJPanelReport().getHeight() - 20)
08912: / (double) height;
08913: ((JReportFrame) jif).setZoomFactor(new_factor);
08914: new_factor = (int) (100.0 * new_factor);
08915: jNumberComboBoxZoom.setValue(new_factor);
08916: ((JReportFrame) jif).centerSelectedElements();
08917:
08918: /* Code End Robert Lamping, 17 july 2004 */
08919: } else {
08920:
08921: /* Code Begin Robert Lamping, 18 july 2004 */
08922: Point defaultCenter = ((JReportFrame) jif)
08923: .getCurrentCenter();
08924:
08925: ((JReportFrame) jif)
08926: .setZoomFactor((double) (this .jNumberComboBoxZoom
08927: .getValue() / 100.0));
08928:
08929: // Move selected items in the middle if possible.
08930: ((JReportFrame) jif)
08931: .centerSelectedElements(defaultCenter);
08932: /* Code End Robert Lamping, 18 july 2004 */
08933:
08934: }
08935: this .setCurrentZoomFactor(currentZoomFactor);
08936:
08937: }
08938:
08939: }
08940:
08941: /**
08942: * This method adjust JImageButtons position in according with buttons array.
08943: * A null entry is interpreted as a 8 pixel space.
08944:
08945: public boolean addToolbarComponent(javax.swing.JComponent ctl)
08946: {
08947: if (getToolBarControls() == null ) return false;
08948: if (getToolBarControls().contains( ctl)) return false;
08949: getToolBarControls().add(ctl);
08950: updateToolBarUI();
08951: return true;
08952: }
08953:
08954: private void updateToolBarUI()
08955: {
08956: // Add your handling code here:
08957: if (getToolBarControls() == null ) return;
08958: int actualWidth=0;
08959: int actualHeight=0;
08960: int availWidth = this.jPanelToolBar.getWidth();
08961:
08962: java.util.Enumeration e = getToolBarControls().elements();
08963: while (e.hasMoreElements()) {
08964: Object obj = e.nextElement();
08965: if (obj == null || ! (obj instanceof javax.swing.JComponent)) {
08966: if (actualWidth > 0) {
08967: actualWidth += 8;
08968: }
08969: }
08970: else {
08971: javax.swing.JComponent ctl = (javax.swing.JComponent)obj;
08972: if ((actualWidth + ctl.getWidth()) > availWidth && (ctl.getWidth()+0 <= availWidth)) {
08973: // Go to the next row...
08974: actualHeight += 32;
08975: actualWidth = 0;
08976: }
08977: ctl.setLocation(actualWidth,actualHeight);
08978: actualWidth += ctl.getWidth();
08979: }
08980: }
08981: jPanelToolBar.setSize( this.jPanelToolBar.getWidth(), (actualHeight+34));
08982: jPanelToolBar.setPreferredSize(new java.awt.Dimension( this.jPanelToolBar.getWidth(), (actualHeight)+34));
08983: jPanelToolBar.updateUI();
08984: }
08985: */
08986: private void jMenuItemNewDocumentActionPerformed(
08987: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemNewDocumentActionPerformed
08988:
08989: if ((evt.getSource() == jButtonNew || getProperties()
08990: .getProperty("DontUseTemplateFromMenu", "true").equals(
08991: "false"))
08992: && getProperties().getProperty("DefaultTemplate") != null) {
08993: File f = new File(getProperties().getProperty(
08994: "DefaultTemplate"));
08995: if (f.exists()) {
08996: newReport(f);
08997: return;
08998: }
08999:
09000: }
09001: newReport();
09002: }//GEN-LAST:event_jMenuItemNewDocumentActionPerformed
09003:
09004: /**
09005: * newReport
09006: * generates a new report from a template file
09007: * returns the new report or null if an error occurs
09008: *
09009: * @param template File
09010: * @return Report
09011: */
09012: public Report newReport(File template) {
09013: try {
09014: Report report = new Report(template.getPath());
09015: report.setFilename(null);
09016: report.setName(getFirstNameFree());
09017: report.incrementReportChanges();
09018: openNewReportWindow(report);
09019: return report;
09020: } catch (Exception ex) {
09021: ex.printStackTrace();
09022: return null;
09023: }
09024: }
09025:
09026: /**
09027: * newReport
09028: * generates a new report and shows property dialog
09029: * returns the new report or null if property dialog is canceled
09030: *
09031: * @return Report
09032: */
09033: public Report newReport() {
09034: // Get info about the new report....
09035: // 1. Display the ReportProperties frame in dialog mode.
09036: // Will be proposed default values...
09037: ReportPropertiesFrame rpf = new ReportPropertiesFrame(this ,
09038: true);
09039: rpf.setModal(true);
09040: // find the first name free...
09041: String name = getFirstNameFree();
09042: rpf.setReportName(name);
09043: rpf.setVisible(true);
09044: if (rpf.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
09045: // The user has clicked on OK...
09046: // Storing in a new report the report characteristics.
09047: Report newReport = new Report();
09048: newReport.setUsingMultiLineExpressions(false); //this.isUsingMultiLineExpressions());
09049: newReport.setWidth(rpf.getReportWidth());
09050: newReport.setHeight(rpf.getReportHeight());
09051: newReport.setOrientation(rpf.getOrientation());
09052: newReport.setName(rpf.getReportName());
09053: newReport.setTopMargin(rpf.getTopMargin());
09054: newReport.setLeftMargin(rpf.getLeftMargin());
09055: newReport.setRightMargin(rpf.getRightMargin());
09056: newReport.setBottomMargin(rpf.getBottomMargin());
09057: newReport.setColumnCount(rpf.getColumns());
09058: newReport.setColumnWidth(rpf.getColumnsWidth());
09059: newReport.setColumnSpacing(rpf.getColumnsSpacing());
09060: newReport.setIsSummaryNewPage(rpf.isSummaryOnNewPage());
09061: newReport.setIsTitleNewPage(rpf.isTitleOnNewPage());
09062: newReport.setWhenNoDataType(rpf.getWhenNoDataType());
09063: newReport.setScriptletClass(rpf.getScriptletClass());
09064: newReport.setEncoding(rpf.getXmlEncoding());
09065: newReport.setPrintOrder(rpf.getPrintOrder());
09066: newReport.setReportFormat(rpf.getReportFormat());
09067: newReport.setFloatColumnFooter(rpf.isFloatColumnFooter());
09068: newReport.setResourceBundleBaseName(rpf
09069: .getResourceBundleBaseName());
09070: newReport.setWhenResourceMissingType(rpf
09071: .getWhenResourceMissingType());
09072: newReport.setIgnorePagination(rpf.isIgnorePagination());
09073: newReport
09074: .setFormatFactoryClass(rpf.getFormatFactoryClass());
09075:
09076: /* todo newReport.setPageName(rpf.getPageName()); */
09077: newReport.setLanguage(rpf.getLanguage());
09078:
09079: openNewReportWindow(newReport);
09080: return newReport;
09081: }
09082: return null;
09083: }
09084:
09085: /**
09086: * setup and configure a new JReportFrame for subclassing JReportFrame
09087: * Implemented by Felix Firgau on February 21st 2007
09088: * @param jrf JReportFrame
09089: */
09090: public void setupNewReportWindow(JReportFrame jrf) {
09091: jrf.addReportListener(this );
09092: //this.addReportListener( this.);
09093: Report newReport = jrf.getReport();
09094: newReport.addSubDatasetObjectChangedListener(this
09095: .getLibraryPanel());
09096: newReport.addSubDatasetObjectChangedListener(this
09097: .getValuesDialog());
09098: newReport.addReportSubDatasetChangedListener(this
09099: .getLibraryPanel());
09100:
09101: newReport.addSubDatasetObjectChangedListener(this
09102: .getDocumentStructurePanel());
09103: newReport.addReportSubDatasetChangedListener(this
09104: .getDocumentStructurePanel());
09105: newReport.addSubDatasetObjectChangedListener(this
09106: .getReportSheetPanel());
09107: newReport.addReportSubDatasetChangedListener(this
09108: .getReportSheetPanel());
09109:
09110: newReport.addStyleChangedListener(this );
09111:
09112: // this is for JMDIFrame design...
09113: // jMDIMenuBar could be retrived from the jrf parent, contained in the JFrame
09114: // that store the JDesktopPane parent...
09115: jrf.setMenu(this .jMDIMenuBar);
09116: // Set default, but we starting the frame maximized by default...
09117: jrf.setBounds(10, 10, 700, 500);
09118: // We must set the frame visible before adding it to the jMDIDesktopPane...
09119:
09120: jrf.setShowGrid(this .getProperties().getProperty("showGrid",
09121: "false").equals("true"));
09122: jrf.setSnapToGrid(this .getProperties().getProperty(
09123: "snapToGrid", "false").equals("true"));
09124:
09125: jrf.setVisible(true);
09126:
09127: if (!isEmptyString(jrf.getReport().getFilename())) {
09128: recentFilesList.remove(jrf.getReport().getFilename());
09129: recentFilesList.insertElementAt(jrf.getReport()
09130: .getFilename(), 0);
09131: this
09132: .updateRecentFileMenu(jMenuRecentFiles,
09133: recentFilesList);
09134: //saveFileList(recentFilesList, "recentFiles.xml");
09135: saveFileList(recentFilesList, IREPORT_RECENT_FILES_FILE);
09136: }
09137:
09138: jMDIDesktopPane
09139: .add(jrf, javax.swing.JLayeredPane.DEFAULT_LAYER);
09140:
09141: jMDIDesktopPane.getDesktopManager().activateFrame(jrf);
09142:
09143: // Count all frames...
09144:
09145: int f_num = jMDIDesktopPane.getAllFrames().length;
09146: JRadioButtonMenuItemMDIFrame menuItem = new JRadioButtonMenuItemMDIFrame(
09147: (JMDIFrame) jrf, f_num + ". " + jrf.getTitle());
09148: menuItem.setSelected(true);
09149: menuItem.setMnemonic((int) ((f_num + "").charAt(0)));
09150: menuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
09151: (int) ((f_num + "").charAt(0)),
09152: java.awt.Event.META_MASK));
09153:
09154: this .jMenuWindow.insert(menuItem, this .jMenuWindow
09155: .getMenuComponentCount());
09156: menuItem.addActionListener(new java.awt.event.ActionListener() {
09157: public void actionPerformed(java.awt.event.ActionEvent evt) {
09158: jMenuWindowListActionPerformed(evt);
09159: }
09160: });
09161: buttonGroupFramesList.add(menuItem);
09162: //updateMenuWindowList();
09163:
09164: // After activation, we try to maximize the window....
09165: try {
09166: jrf.setSelected(true);
09167: jrf.setZoomFactor(this .getCurrentZoomFactor());
09168: //if (jMDIMenuBar.getMaximizedFrame() != null)
09169: jrf.setMaximum(true);
09170: String report_name = jrf.getReport().getName();
09171: DocumentTreeEntry dte = new DocumentTreeEntry(jrf, jrf
09172: .getReport().getName());
09173: javax.swing.tree.DefaultTreeModel dtm = (javax.swing.tree.DefaultTreeModel) jTreeFiles
09174: .getModel();
09175: ((javax.swing.tree.DefaultMutableTreeNode) dtm.getRoot())
09176: .add(new javax.swing.tree.DefaultMutableTreeNode(
09177: dte));
09178: setFileListActivatedFrame(jrf);
09179: this .jTreeFiles.updateUI();
09180:
09181: } catch (java.beans.PropertyVetoException ex) {
09182: /* Nothing to do */
09183: } catch (Exception ex2) {
09184: /* Do nothing */
09185: }
09186:
09187: //set zoomfactor in toolbar
09188: this .jNumberComboBoxZoom.setValue((int) (this
09189: .getCurrentZoomFactor() * 100));
09190:
09191: // This call fix a bug in the code to show control box buttons on menu panel...
09192: jMDIMenuBar.restoreButtonsPosition();
09193: if (!isEmptyString(newReport.getFilename())) {
09194: if (newReport.isModified()) {
09195: this .enableSaveSpecific();
09196: this .enableSaveAllSpecific();
09197: } else {
09198: this .disableSaveSpecific();
09199: if (this .isSaveAllRequired()) {
09200: this .enableSaveAllSpecific();
09201: } else {
09202: this .disableSaveAllSpecific();
09203: }
09204: }
09205: } else {
09206: this .enableSaveSpecific();
09207: this .enableSaveAllSpecific();
09208: }
09209: }
09210:
09211: public JReportFrame openNewReportWindow(Report newReport) {
09212: // Create a new document frame....
09213: // ...that rappresent the report document created...
09214: JReportFrame jrf = new JReportFrame(newReport);
09215: setupNewReportWindow(jrf); //FF see above
09216: return jrf;
09217: }
09218:
09219: private void jMenuFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuFileActionPerformed
09220: // Add your handling code here:
09221: jMDIMenuBar.restoreButtonsPosition();
09222: }//GEN-LAST:event_jMenuFileActionPerformed
09223:
09224: private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
09225:
09226: // This try is of java <1.4 comatibility
09227:
09228: try {
09229: SwingUtilities.invokeLater(new Runnable() {
09230: public void run() {
09231: try {
09232:
09233: setExtendedState(MAXIMIZED_BOTH);
09234:
09235: } catch (java.lang.NoSuchMethodError ex) {
09236: java.awt.Dimension dim = java.awt.Toolkit
09237: .getDefaultToolkit().getScreenSize();
09238: java.awt.Point p = new java.awt.Point();
09239: p.x = Math.max(0, (dim.width - getWidth()) / 2);
09240: p.y = Math.max(0,
09241: (dim.height - getHeight()) / 2);
09242: setLocation(p);
09243: }
09244:
09245: try {
09246:
09247: if (getProperties().getProperty(
09248: "RestoreLayout", "true").equals("true")) {
09249: DockingManager.restoreLayout();
09250: if (DockingManager
09251: .isDocked((Dockable) crosstabMeasuresPanelView)) {
09252: DockingManager
09253: .undock((Dockable) crosstabMeasuresPanelView);
09254: }
09255: if (DockingManager
09256: .isDocked((Dockable) crosstabStructureView)) {
09257: DockingManager
09258: .undock((Dockable) crosstabStructureView);
09259: }
09260:
09261: jCheckBoxMenuItemDocumentStructure
09262: .setState(viewDocumentStructure
09263: .isShowing());
09264: jCheckBoxMenuItemElementProperties
09265: .setState(viewPropertySheet
09266: .isShowing());
09267: jCheckBoxMenuItemExplorer
09268: .setState(viewFiles.isShowing());
09269:
09270: jCheckBoxMenuItemLibrary
09271: .setState(viewLibrary.isShowing());
09272: jCheckBoxMenuItemStylesLibrary
09273: .setState(stylesPanleView
09274: .isShowing());
09275: jCheckBoxMenuItemThreadList
09276: .setState(viewThreads.isShowing());
09277: jCheckBoxMenuItemOutput
09278: .setState(logPaneView.isShowing());
09279:
09280: if (!viewLibrary.isShowing()) {
09281: java.awt.Component comp = viewLibrary
09282: .getComponent();
09283: java.awt.Container parent = comp
09284: .getParent();
09285: if (parent != null
09286: && parent instanceof javax.swing.JTabbedPane) {
09287: ((javax.swing.JTabbedPane) parent)
09288: .setSelectedIndex(0);
09289: }
09290: }
09291:
09292: }
09293: } catch (Exception ex) {
09294: ex.printStackTrace();
09295: }
09296: }
09297: });
09298: } catch (Exception ex) {
09299: }
09300:
09301: //this.setSize(dim);
09302: //this.getContentPane().repaint();
09303: //this.update(this.getGraphics());
09304: //this.setState(java.awt.Frame.MAXIMIZED_HORIZ);
09305: }//GEN-LAST:event_formWindowOpened
09306:
09307: /** Exit the Application */
09308: protected void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
09309:
09310: if (isNoExit()) {
09311: this .setVisible(false);
09312: return;
09313: }
09314: closeApplication();
09315: }//GEN-LAST:event_exitForm
09316:
09317: private void jRadioButtonMenuItemPreviewFLASHActionPerformed(
09318: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemPreviewFLASHActionPerformed
09319: this .setReportViewer(IREPORT_FLASH_VIEWER);
09320: }//GEN-LAST:event_jRadioButtonMenuItemPreviewFLASHActionPerformed
09321:
09322: private void closeApplication() {
09323: try {
09324: this .saveiReportConfiguration();
09325: } catch (Throwable e) {
09326: e.printStackTrace(System.err);
09327: }
09328:
09329: //try {
09330: // DockingManager.storeLayoutModel();
09331: //} catch(Exception ex) {
09332: // ex.printStackTrace();
09333: //}
09334:
09335: if (this .isSaveAllRequired()
09336: && !getProperties().getProperty("AskToSave", "true")
09337: .equals("false")) {
09338: String message = I18n
09339: .getString("messages.unsavedFiles",
09340: "There are unsaved files. Would you like to save them before exiting?");
09341: String caption = I18n.getString(
09342: "messages.unsavedFilesCaption", "Unsaved files");
09343: int ret = javax.swing.JOptionPane.showConfirmDialog(this ,
09344: message, caption,
09345: javax.swing.JOptionPane.YES_NO_CANCEL_OPTION);
09346: switch (ret) {
09347: case javax.swing.JOptionPane.YES_OPTION:
09348: java.awt.event.ActionEvent ae = new java.awt.event.ActionEvent(
09349: jMenuItemSaveAll, 0, this .jMenuItemSaveAll
09350: .getActionCommand());
09351: jMenuItemSaveAllActionPerformed(ae);
09352: break;
09353: case javax.swing.JOptionPane.NO_OPTION:
09354: break;
09355: //case javax.swing.JOptionPane.CANCEL_OPTION:
09356: default:
09357: return;
09358: }
09359: }
09360: this .dispose();
09361: if (!isEmbedded()) {
09362: System.exit(0);
09363: }
09364: }
09365:
09366: /**
09367: * @param args the command line arguments
09368: */
09369: public static void main(String args[]) {
09370:
09371: // command line arguments
09372: //StringParam patternArg =
09373: // new StringParam("config-file", "",
09374: // StringParam.PUBLIC);
09375:
09376: System.setProperty("sun.swing.enableImprovedDragGesture", "");
09377:
09378: FileParam configFileOpt = new FileParam("config-file", I18n
09379: .getString("cmdline.configFile",
09380: "the configuration file to use"),
09381: FileParam.IS_FILE & FileParam.IS_READABLE
09382: & FileParam.IS_WRITEABLE, FileParam.OPTIONAL);
09383:
09384: FileParam ireportHomeDirOpt = new FileParam("ireport-home",
09385: I18n.getString("cmdline.ireportHome",
09386: "iReport home directory"), FileParam.IS_DIR
09387: & FileParam.IS_READABLE
09388: & FileParam.IS_WRITEABLE, FileParam.OPTIONAL);
09389:
09390: FileParam userHomeDirOpt = new FileParam("user-home", I18n
09391: .getString("cmdline.userHome", "User home directory"),
09392: FileParam.IS_DIR & FileParam.IS_READABLE
09393: & FileParam.IS_WRITEABLE, FileParam.OPTIONAL);
09394:
09395: FileParam tempDirOpt = new FileParam("temp-dir", I18n
09396: .getString("cmdline.tmpDir",
09397: "Dir where store temporary java sources"),
09398: FileParam.IS_DIR & FileParam.IS_READABLE
09399: & FileParam.IS_WRITEABLE, FileParam.OPTIONAL);
09400:
09401: BooleanParam configSplashOpt = new BooleanParam("no-splash",
09402: I18n.getString("cmdline.noSplash",
09403: "not show the spash window"));
09404:
09405: BooleanParam configEmbeddedOpt = new BooleanParam("embedded",
09406: I18n.getString("cmdline.embedded",
09407: "avoid exit when the main window is closed"));
09408:
09409: BooleanParam configUseWebStartOpt = new BooleanParam(
09410: "webstart",
09411: I18n
09412: .getString(
09413: "cmdline.webstart",
09414: "enable a special class path management when Java Web Start is used to run iReport"));
09415:
09416: StringParam configBeanClassOpt = new StringParam(
09417: "beanClass",
09418: I18n
09419: .getString("cmdline.beanClass",
09420: "show this class when open extended bean data source query editor"));
09421:
09422: FileParam filesArg = new FileParam("files", I18n.getString(
09423: "cmdline.files",
09424: "xml file(s) to edit, supports use of wildcards "),
09425: FileParam.IS_FILE & FileParam.IS_READABLE,
09426: FileParam.OPTIONAL, FileParam.MULTI_VALUED);
09427:
09428: // command line options
09429: //BooleanParam ignorecaseOpt =
09430: // new BooleanParam("ignoreCase", "ignore case while matching");
09431: //BooleanParam listfilesOpt =
09432: // new BooleanParam("listFiles", "list filenames containing pattern");
09433:
09434: // a help text because we will use a HelpCmdLineHandler so our
09435: // command will display verbose help with the -help option
09436: String helpText = I18n.getString("cmdline.helpText",
09437: "iReport line command options");
09438: CmdLineHandler cl = new VersionCmdLineHandler(MainFrame
09439: .getRebrandedTitle(), new HelpCmdLineHandler(helpText,
09440: "iReport", "Designer for JasperReports",
09441: new Parameter[] { configFileOpt, ireportHomeDirOpt,
09442: userHomeDirOpt, tempDirOpt, configSplashOpt,
09443: configEmbeddedOpt, configUseWebStartOpt,
09444: configBeanClassOpt },
09445: new Parameter[] { filesArg }));
09446:
09447: cl.setParser(new PosixCmdLineParser());
09448:
09449: cl.setDieOnParseError(false);
09450:
09451: if (!cl.parse(args)) {
09452: // This prevent a call to exit from the parser.
09453: System.out.println(cl.getUsage(true));
09454: System.out.println(cl.getParseError());
09455: return;
09456: }
09457:
09458: Map map = new HashMap();
09459: if (configFileOpt.isSet()) {
09460: map.put("config-file", configFileOpt.getFile().getPath());
09461: }
09462:
09463: if (!configSplashOpt.isTrue()) {
09464: SplashDialog sp = new SplashDialog(null, false);
09465: sp.setVisible(true);
09466: map.put("splash", sp);
09467: }
09468:
09469: if (ireportHomeDirOpt.isSet()) {
09470: map.put("ireport-home", ireportHomeDirOpt.getFile()
09471: .getPath());
09472: }
09473:
09474: if (userHomeDirOpt.isSet()) {
09475: map.put("user-home", userHomeDirOpt.getFile().getPath());
09476: }
09477:
09478: if (tempDirOpt.isSet()) {
09479: map.put("temp-dir", tempDirOpt.getFile().getPath());
09480: }
09481:
09482: if (filesArg.isSet()) {
09483: map.put("files", filesArg.getFiles());
09484: }
09485:
09486: if (configBeanClassOpt.isSet()) {
09487: map.put("beanClass", configBeanClassOpt.getValue());
09488: }
09489:
09490: if (configEmbeddedOpt.isTrue()) {
09491: map.put("embedded", "true");
09492: }
09493:
09494: if (configUseWebStartOpt.isTrue()) {
09495: map.put("webstart", "true");
09496: }
09497:
09498: // Clear previus loaded boundle
09499: I18n.setCurrentLocale(java.util.Locale.getDefault());
09500:
09501: MainFrame.reportClassLoader.rescanLibDirectory();
09502: Thread.currentThread().setContextClassLoader(
09503: MainFrame.reportClassLoader);
09504: final MainFrame _mainFrame = new MainFrame(map);
09505: SwingUtilities.invokeLater(new Runnable() {
09506: public void run() {
09507: _mainFrame.setVisible(true);
09508: }
09509: });
09510: }
09511:
09512: private static byte[] getBytesFromInputStream(
09513: java.io.InputStream in, int length)
09514: throws java.io.IOException {
09515: java.io.DataInputStream din = new java.io.DataInputStream(in);
09516: byte[] bytecodes = new byte[length];
09517: try {
09518: din.readFully(bytecodes);
09519: } finally {
09520: if (din != null)
09521: din.close();
09522: }
09523: return bytecodes;
09524: }
09525:
09526: /** Gets the image to be displayed in the minimized icon
09527: * for this frame.
09528: * @return the icon image for this frame, or <code>null</code>
09529: * if this frame doesn't have an icon image.
09530: * @see #setIconImage(Icon)
09531: *
09532: */
09533: public java.awt.Image getIconImage() {
09534: try {
09535: ClassLoader cl = this .getClass().getClassLoader();
09536: //java.io.InputStream in = new java.io.FileInputStream( cl.getResource("it/businesslogic/ireport/icons/iconsmall.jpg").getPath() );
09537: java.io.InputStream in = cl
09538: .getResourceAsStream("it/businesslogic/ireport/icons/ireport_icon.png");
09539: byte[] data = getBytesFromInputStream(in, in.available());
09540: return java.awt.Toolkit.getDefaultToolkit().createImage(
09541: data);
09542: } catch (Exception ex) {
09543: ex.getMessage();
09544: ex.printStackTrace();
09545: }
09546: return null;
09547: }
09548:
09549: /** Getter for property elementPropertiesFrame.
09550: * @return Value of property elementPropertiesFrame.
09551: *
09552: */
09553: public ElementPropertiesDialog getElementPropertiesDialog() {
09554: return elementPropertiesDialog;
09555: }
09556:
09557: /** Setter for property elementPropertiesFrame.
09558: * @param elementPropertiesFrame New value of property elementPropertiesFrame.
09559: *
09560: */
09561: public void setElementPropertiesDialog(
09562: ElementPropertiesDialog elementPropertiesDialog) {
09563: this .elementPropertiesDialog = elementPropertiesDialog;
09564: }
09565:
09566: /** Getter for property valuesDialog.
09567: * @return Value of property valuesDialog.
09568: *
09569: */
09570: public it.businesslogic.ireport.gui.ValuesDialog getValuesDialog() {
09571: return valuesDialog;
09572: }
09573:
09574: /** Setter for property valuesDialog.
09575: * @param valuesDialog New value of property valuesDialog.
09576: *
09577: */
09578: public void setValuesDialog(
09579: it.businesslogic.ireport.gui.ValuesDialog valuesDialog) {
09580: this .valuesDialog = valuesDialog;
09581: }
09582:
09583: /** Getter for property groupsDialog.
09584: * @return Value of property groupsDialog.
09585: *
09586: */
09587: public it.businesslogic.ireport.gui.GroupsDialog getGroupsDialog() {
09588: return groupsDialog;
09589: }
09590:
09591: /** Setter for property groupsDialog.
09592: * @param groupsDialog New value of property groupsDialog.
09593: *
09594: */
09595: public void setGroupsDialog(
09596: it.businesslogic.ireport.gui.GroupsDialog groupsDialog) {
09597: this .groupsDialog = groupsDialog;
09598: }
09599:
09600: /** Getter for property bandsDialog.
09601: * @return Value of property bandsDialog.
09602: *
09603: */
09604: public BandsDialog getBandsDialog() {
09605: return bandsDialog;
09606: }
09607:
09608: /** Setter for property bandsDialog.
09609: * @param bandsDialog New value of property bandsDialog.
09610: *
09611: */
09612: public void setBandsDialog(BandsDialog bandsDialog) {
09613: this .bandsDialog = bandsDialog;
09614: }
09615:
09616: /** Getter for property reportQueryDialog.
09617: * @return Value of property reportQueryDialog.
09618: *
09619: */
09620: public it.businesslogic.ireport.gui.ReportQueryDialog getReportQueryDialog() {
09621: return reportQueryDialog;
09622: }
09623:
09624: /** Setter for property reportQueryDialog.
09625: * @param reportQueryDialog New value of property reportQueryDialog.
09626: *
09627: */
09628: public void setReportQueryDialog(
09629: it.businesslogic.ireport.gui.ReportQueryDialog reportQueryDialog) {
09630: this .reportQueryDialog = reportQueryDialog;
09631: }
09632:
09633: // Variables declaration - do not modify//GEN-BEGIN:variables
09634: private javax.swing.JButton Filler;
09635: private javax.swing.JButton Filler1;
09636: private javax.swing.ButtonGroup buttonGroupExportType;
09637: private javax.swing.ButtonGroup buttonGroupFramesList;
09638: private javax.swing.JButton jButtonAlignBottom;
09639: private javax.swing.JButton jButtonAlignCenter;
09640: private javax.swing.JButton jButtonAlignJustify;
09641: private javax.swing.JButton jButtonAlignLeft;
09642: private javax.swing.JButton jButtonAlignMiddle;
09643: private javax.swing.JButton jButtonAlignRight;
09644: private javax.swing.JButton jButtonAlignTop;
09645: private javax.swing.JButton jButtonBands;
09646: private javax.swing.JButton jButtonBold;
09647: private javax.swing.JButton jButtonCompiler;
09648: private javax.swing.JButton jButtonCopy;
09649: private javax.swing.JButton jButtonCut;
09650: private javax.swing.JButton jButtonDatabase;
09651: private javax.swing.JButton jButtonDecreaseSize;
09652: private javax.swing.JButton jButtonGroups;
09653: private javax.swing.JButton jButtonIncreaseSize;
09654: private javax.swing.JButton jButtonItalic;
09655: private javax.swing.JButton jButtonLens1;
09656: private javax.swing.JButton jButtonLens2;
09657: private javax.swing.JButton jButtonNew;
09658: private javax.swing.JButton jButtonOpen;
09659: private javax.swing.JButton jButtonParameters;
09660: private javax.swing.JButton jButtonPaste;
09661: private javax.swing.JButton jButtonRun1;
09662: private javax.swing.JButton jButtonRun2;
09663: private javax.swing.JButton jButtonSave;
09664: private javax.swing.JButton jButtonSaveAll;
09665: private javax.swing.JButton jButtonStrikethrought;
09666: private javax.swing.JButton jButtonUnderline;
09667: private javax.swing.JButton jButtonWizard;
09668: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemDocumentStructure;
09669: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemEMM;
09670: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemElementProperties;
09671: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemElementsFormatting;
09672: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemExplorer;
09673: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemGrid;
09674: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemIgnorePagination;
09675: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemLibrary;
09676: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemOutput;
09677: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemReportVirtualizer;
09678: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemSnapToGrid;
09679: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemStylesLibrary;
09680: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemTextFormatting;
09681: private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemThreadList;
09682: private javax.swing.JComboBox jComboBoxFont;
09683: private javax.swing.JList jListThreads;
09684: private it.businesslogic.ireport.gui.JMDIDesktopPane jMDIDesktopPane;
09685: private it.businesslogic.ireport.gui.JMDIMenuBar jMDIMenuBar;
09686: private javax.swing.JMenu jMenuAdd;
09687: private javax.swing.JMenu jMenuAlign;
09688: private javax.swing.JMenu jMenuBuild;
09689: private javax.swing.JMenu jMenuDatabase;
09690: private javax.swing.JMenu jMenuEdit;
09691: private javax.swing.JMenu jMenuFile;
09692: private javax.swing.JMenu jMenuFormat;
09693: private javax.swing.JMenu jMenuHSpacing;
09694: private javax.swing.JMenu jMenuHelp;
09695: private javax.swing.JMenu jMenuInternationalization;
09696: private javax.swing.JMenuItem jMenuItemAbout;
09697: private javax.swing.JMenuItem jMenuItemActiveConnection;
09698: private javax.swing.JMenuItem jMenuItemActiveConnection1;
09699: private javax.swing.JMenuItem jMenuItemAddGroup;
09700: private javax.swing.JMenuItem jMenuItemAlignBottom;
09701: private javax.swing.JMenuItem jMenuItemAlignHorizontalAxis;
09702: private javax.swing.JMenuItem jMenuItemAlignLeft;
09703: private javax.swing.JMenuItem jMenuItemAlignRight;
09704: private javax.swing.JMenuItem jMenuItemAlignToBandBottom;
09705: private javax.swing.JMenuItem jMenuItemAlignToBandTop;
09706: private javax.swing.JMenuItem jMenuItemAlignTop;
09707: private javax.swing.JMenuItem jMenuItemAlignVerticalAxis;
09708: private javax.swing.JMenuItem jMenuItemBands;
09709: private javax.swing.JMenuItem jMenuItemBringToFront;
09710: private javax.swing.JMenuItem jMenuItemCascade;
09711: private javax.swing.JMenuItem jMenuItemCenterBackground;
09712: private javax.swing.JMenuItem jMenuItemCenterH;
09713: private javax.swing.JMenuItem jMenuItemCenterInBand;
09714: private javax.swing.JMenuItem jMenuItemCenterV;
09715: private javax.swing.JMenuItem jMenuItemChart;
09716: private javax.swing.JMenuItem jMenuItemClasspath;
09717: private javax.swing.JMenuItem jMenuItemClose;
09718: private javax.swing.JMenuItem jMenuItemCloseAll;
09719: private javax.swing.JMenuItem jMenuItemCloseAllExceptThis;
09720: private javax.swing.JMenuItem jMenuItemCloseAllExceptThisFromList;
09721: private javax.swing.JMenuItem jMenuItemCloseAllFromList;
09722: private javax.swing.JMenuItem jMenuItemCloseFromList;
09723: private javax.swing.JMenuItem jMenuItemCompatibility;
09724: private javax.swing.JMenuItem jMenuItemCompile;
09725: private javax.swing.JMenuItem jMenuItemConnections;
09726: private javax.swing.JMenuItem jMenuItemCopy;
09727: private javax.swing.JMenuItem jMenuItemCreateFromTemplate;
09728: private javax.swing.JMenuItem jMenuItemCut;
09729: private javax.swing.JMenuItem jMenuItemDelete;
09730: private javax.swing.JMenuItem jMenuItemElementProperties;
09731: private javax.swing.JMenuItem jMenuItemEllipse;
09732: private javax.swing.JMenuItem jMenuItemExecute;
09733: private javax.swing.JMenuItem jMenuItemExecuteDB;
09734: private javax.swing.JMenuItem jMenuItemExportOptions;
09735: private javax.swing.JMenuItem jMenuItemExpressions;
09736: private javax.swing.JMenuItem jMenuItemFields;
09737: private javax.swing.JMenuItem jMenuItemFonts;
09738: private javax.swing.JMenuItem jMenuItemFontspath;
09739: private javax.swing.JMenuItem jMenuItemForum;
09740: private javax.swing.JMenuItem jMenuItemGroups;
09741: private javax.swing.JMenuItem jMenuItemHSDecrease;
09742: private javax.swing.JMenuItem jMenuItemHSIncrease;
09743: private javax.swing.JMenuItem jMenuItemHSMakeEqual;
09744: private javax.swing.JMenuItem jMenuItemHSRemove;
09745: private javax.swing.JMenuItem jMenuItemHelp;
09746: private javax.swing.JMenuItem jMenuItemHomePage;
09747: private javax.swing.JMenuItem jMenuItemImage;
09748: private javax.swing.JMenuItem jMenuItemInsertPageBreak;
09749: private javax.swing.JMenuItem jMenuItemJoinLeft;
09750: private javax.swing.JMenuItem jMenuItemJoinRight;
09751: private javax.swing.JMenuItem jMenuItemKill;
09752: private javax.swing.JMenuItem jMenuItemLeftMargin;
09753: private javax.swing.JMenuItem jMenuItemLine;
09754: private javax.swing.JMenuItem jMenuItemMaxRecords;
09755: private javax.swing.JMenuItem jMenuItemNewDocument;
09756: private javax.swing.JMenuItem jMenuItemNextWin;
09757: private javax.swing.JMenuItem jMenuItemOpen;
09758: private javax.swing.JMenuItem jMenuItemOptions;
09759: private javax.swing.JMenuItem jMenuItemOrganize;
09760: private javax.swing.JMenuItem jMenuItemParameters;
09761: private javax.swing.JMenuItem jMenuItemPaste;
09762: private javax.swing.JMenuItem jMenuItemPluginConfig;
09763: private javax.swing.JMenuItem jMenuItemPrevWin;
09764: private javax.swing.JMenuItem jMenuItemPrint;
09765: private javax.swing.JMenuItem jMenuItemProperties;
09766: private javax.swing.JMenuItem jMenuItemQueryExecuters;
09767: private javax.swing.JMenuItem jMenuItemQuit;
09768: private javax.swing.JMenuItem jMenuItemRectangle;
09769: private javax.swing.JMenuItem jMenuItemRedo;
09770: private javax.swing.JMenuItem jMenuItemReloadFonts;
09771: private javax.swing.JMenuItem jMenuItemRemoveMargins;
09772: private javax.swing.JMenuItem jMenuItemReportImports;
09773: private javax.swing.JMenuItem jMenuItemReportLocale;
09774: private javax.swing.JMenuItem jMenuItemReportProperties;
09775: private javax.swing.JMenuItem jMenuItemReportQuery;
09776: private javax.swing.JMenuItem jMenuItemReportQuery2;
09777: private javax.swing.JMenuItem jMenuItemReportTimeZone;
09778: private javax.swing.JMenuItem jMenuItemRevertToSaved;
09779: private javax.swing.JMenuItem jMenuItemRevertToSavedFromList;
09780: private javax.swing.JMenuItem jMenuItemRightMargin;
09781: private javax.swing.JMenuItem jMenuItemRightSide;
09782: private javax.swing.JMenuItem jMenuItemRoundRectangle;
09783: private javax.swing.JMenuItem jMenuItemSameHeight;
09784: private javax.swing.JMenuItem jMenuItemSameHeightMax;
09785: private javax.swing.JMenuItem jMenuItemSameHeightMin;
09786: private javax.swing.JMenuItem jMenuItemSameSize;
09787: private javax.swing.JMenuItem jMenuItemSameWidth;
09788: private javax.swing.JMenuItem jMenuItemSameWidthMax;
09789: private javax.swing.JMenuItem jMenuItemSameWidthMin;
09790: private javax.swing.JMenuItem jMenuItemSave;
09791: private javax.swing.JMenuItem jMenuItemSaveAll;
09792: private javax.swing.JMenuItem jMenuItemSaveAllFromList;
09793: private javax.swing.JMenuItem jMenuItemSaveAs;
09794: private javax.swing.JMenuItem jMenuItemSaveAsFromList;
09795: private javax.swing.JMenuItem jMenuItemSaveFromList;
09796: private javax.swing.JMenuItem jMenuItemScriptletEditor;
09797: private javax.swing.JMenuItem jMenuItemSendToBack;
09798: private javax.swing.JMenuItem jMenuItemStaticText;
09799: private javax.swing.JMenuItem jMenuItemStyles;
09800: private javax.swing.JMenuItem jMenuItemSubDataset;
09801: private javax.swing.JMenuItem jMenuItemSubDataset1;
09802: private javax.swing.JMenuItem jMenuItemSubreport;
09803: private javax.swing.JMenuItem jMenuItemTextField;
09804: private javax.swing.JMenuItem jMenuItemTileHorizontal;
09805: private javax.swing.JMenuItem jMenuItemTileVertical;
09806: private javax.swing.JMenuItem jMenuItemUndo;
09807: private javax.swing.JMenuItem jMenuItemVSDecrease;
09808: private javax.swing.JMenuItem jMenuItemVSIncrease;
09809: private javax.swing.JMenuItem jMenuItemVSMakeEqual;
09810: private javax.swing.JMenuItem jMenuItemVSRemove;
09811: private javax.swing.JMenuItem jMenuItemVariables;
09812: private javax.swing.JMenuItem jMenuItemWizard;
09813: private javax.swing.JMenuItem jMenuItemXMLSource;
09814: private javax.swing.JMenuItem jMenuItemtileAnodine;
09815: private javax.swing.JMenuItem jMenuLocaleFiles;
09816: private javax.swing.JMenu jMenuPanels;
09817: private javax.swing.JMenu jMenuPlugins;
09818: private javax.swing.JMenu jMenuPosition;
09819: private javax.swing.JMenu jMenuRecentFiles;
09820: private javax.swing.JMenu jMenuSize;
09821: private javax.swing.JMenu jMenuToolBars;
09822: private javax.swing.JMenu jMenuTools;
09823: private javax.swing.JMenu jMenuVSpacing;
09824: private javax.swing.JMenu jMenuView;
09825: private javax.swing.JMenu jMenuWindow;
09826: private it.businesslogic.ireport.gui.JNumberComboBox jNumberComboBoxSize;
09827: private it.businesslogic.ireport.gui.JNumberComboBox jNumberComboBoxZoom;
09828: private javax.swing.JPanel jPanel1;
09829: private javax.swing.JPanel jPanel2;
09830: private javax.swing.JPanel jPanelFiles;
09831: private javax.swing.JPanel jPanelMaster;
09832: private javax.swing.JPanel jPanelZoom;
09833: private javax.swing.JPopupMenu jPopupMenuFiles;
09834: private javax.swing.JPopupMenu jPopupMenuThreads;
09835: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewCSV;
09836: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewFLASH;
09837: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewHTML;
09838: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewInternalViewer;
09839: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewJAVA;
09840: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewODF;
09841: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewPDF;
09842: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewRTF;
09843: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewTXT;
09844: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewTXTJR;
09845: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewXLS;
09846: private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemPreviewXLS2;
09847: private javax.swing.JScrollPane jScrollPaneFiles;
09848: private javax.swing.JScrollPane jScrollProcesses;
09849: private javax.swing.JSeparator jSeparator1;
09850: private javax.swing.JSeparator jSeparator10;
09851: private javax.swing.JSeparator jSeparator11;
09852: private javax.swing.JSeparator jSeparator12;
09853: private javax.swing.JSeparator jSeparator13;
09854: private javax.swing.JSeparator jSeparator14;
09855: private javax.swing.JSeparator jSeparator15;
09856: private javax.swing.JSeparator jSeparator16;
09857: private javax.swing.JSeparator jSeparator17;
09858: private javax.swing.JSeparator jSeparator18;
09859: private javax.swing.JSeparator jSeparator19;
09860: private javax.swing.JSeparator jSeparator2;
09861: private javax.swing.JSeparator jSeparator20;
09862: private javax.swing.JSeparator jSeparator21;
09863: private javax.swing.JSeparator jSeparator22;
09864: private javax.swing.JSeparator jSeparator23;
09865: private javax.swing.JSeparator jSeparator24;
09866: private javax.swing.JSeparator jSeparator25;
09867: private javax.swing.JSeparator jSeparator26;
09868: private javax.swing.JSeparator jSeparator27;
09869: private javax.swing.JSeparator jSeparator28;
09870: private javax.swing.JSeparator jSeparator29;
09871: private javax.swing.JSeparator jSeparator3;
09872: private javax.swing.JSeparator jSeparator30;
09873: private javax.swing.JSeparator jSeparator31;
09874: private javax.swing.JSeparator jSeparator32;
09875: private javax.swing.JSeparator jSeparator33;
09876: private javax.swing.JSeparator jSeparator4;
09877: private javax.swing.JSeparator jSeparator5;
09878: private javax.swing.JSeparator jSeparator6;
09879: private javax.swing.JSeparator jSeparator7;
09880: private javax.swing.JSeparator jSeparator8;
09881: private javax.swing.JSeparator jSeparator9;
09882: private javax.swing.JToggleButton jToggleButtonBarcodeTool;
09883: private javax.swing.JToggleButton jToggleButtonChartTool;
09884: private javax.swing.JToggleButton jToggleButtonCrosstabTool;
09885: private javax.swing.JToggleButton jToggleButtonEllipseTool;
09886: private javax.swing.JToggleButton jToggleButtonFrameTool;
09887: private javax.swing.JToggleButton jToggleButtonImageTool;
09888: private javax.swing.JToggleButton jToggleButtonLineTool;
09889: private javax.swing.JToggleButton jToggleButtonPointer;
09890: private javax.swing.JToggleButton jToggleButtonRectTool;
09891: private javax.swing.JToggleButton jToggleButtonStaticTextTool;
09892: private javax.swing.JToggleButton jToggleButtonSubreportTool;
09893: private javax.swing.JToggleButton jToggleButtonTextFieldTool;
09894: private javax.swing.JToolBar jToolBar1;
09895: private javax.swing.JToolBar jToolBarConnections;
09896: private javax.swing.JToolBar jToolBarFormat;
09897: private javax.swing.JToolBar jToolBarText;
09898: private javax.swing.JTree jTreeFiles;
09899:
09900: // End of variables declaration//GEN-END:variables
09901:
09902: /**
09903: * Load expressions from IREPORT_EXPRESSIONS_FILE and set the static vector in
09904: * the ExpressionEditor.
09905: */
09906: public void loadExpressionsList() {
09907:
09908: Vector v = Misc.loadExpressionsList(IREPORT_EXPRESSIONS_FILE);
09909: ExpressionEditor.defaultExpressions = v;
09910: }
09911:
09912: /**
09913: * Load expressions from IREPORT_EXPRESSIONS_FILE and set the static vector in
09914: * the ExpressionEditor.
09915: */
09916: public void saveExpressionsList(Vector v) {
09917:
09918: Misc.saveExpressionsList(v, IREPORT_EXPRESSIONS_FILE);
09919: ExpressionEditor.defaultExpressions = v;
09920: }
09921:
09922: /* This method load:
09923: * recent file list
09924: * recent project list
09925: * favorites files list
09926: */
09927: public void loadFileLists() {
09928:
09929: loadFileList(this .getRecentFilesList(),
09930: IREPORT_RECENT_FILES_FILE);
09931: //loadFileList(this.getRecentProjectsList(), IREPORT_RECENT_PROJECTS_FILE);
09932: // First we must implement it....
09933: //loadFileList(this.getFavoriteFilesList() , IREPORT_FAVORITE_FILES_FILE);
09934: }
09935:
09936: private void loadFileList(Vector v, String xmlFile) {
09937: File file = null;
09938: try {
09939: file = new File(xmlFile);
09940: } catch (Exception ex) {
09941: }
09942: if (file == null || !file.exists() || file.isDirectory()) {
09943: try {
09944: outputBuffer.setLength(0);
09945: getLogPane()
09946: .getMainLogTextArea()
09947: .logOnConsole(
09948: I18n
09949: .getFormattedString(
09950: "messages.errorLoadingConfig",
09951: "Error loading Configuration file: {0}\n",
09952: new Object[] { xmlFile }),
09953: JOptionPane.ERROR_MESSAGE);
09954:
09955: } catch (Exception exsx) {
09956: }
09957: return;
09958: }
09959: // Create a Xerces DOM Parser
09960: DOMParser parser = new DOMParser();
09961: // Parse the Document
09962: // and traverse the DOM
09963: try {
09964:
09965: parser.setEntityResolver(new org.xml.sax.EntityResolver() {
09966: /* Code by Teodor Danciu */
09967: public org.xml.sax.InputSource resolveEntity(
09968: String publicId, String systemId)
09969: throws SAXException//, java.io.IOException
09970: {
09971: org.xml.sax.InputSource inputSource = null;
09972:
09973: if (systemId != null) {
09974: String dtd = null;
09975:
09976: if (systemId
09977: .equals("http://ireport.sourceforge.net/dtds/iReportFilesList.dtd")) {
09978: dtd = "it/businesslogic/ireport/dtds/iReportFilesList.dtd";
09979: } else {
09980: return new org.xml.sax.InputSource(systemId);
09981: }
09982:
09983: ClassLoader classLoader = this .getClass()
09984: .getClassLoader();
09985:
09986: java.net.URL url = null;
09987:
09988: if (classLoader != null) {
09989: url = classLoader.getResource(dtd);
09990: }
09991: if (url == null) {
09992: classLoader = this .getClass()
09993: .getClassLoader();
09994: }
09995:
09996: java.io.InputStream is = classLoader
09997: .getResourceAsStream(dtd);
09998: if (is != null) {
09999: java.io.InputStreamReader isr = new java.io.InputStreamReader(
10000: is);
10001: inputSource = new org.xml.sax.InputSource(
10002: isr);
10003: }
10004:
10005: }
10006:
10007: return inputSource;
10008: }
10009: });
10010: /* End Code by Teodor Danciu */
10011: parser.parse(new java.io.File(xmlFile).toURI().toString());
10012: Document document = parser.getDocument();
10013:
10014: // Traverse the tree until we don't find a iReportFilesList element...
10015: Node fileList = goToNodeElement("iReportFilesList",
10016: document.getDocumentElement());
10017: if (fileList == null)
10018: return;
10019: NodeList list = fileList.getChildNodes();
10020: for (int i = 0; i < list.getLength(); ++i) {
10021: Node child = list.item(i);
10022: if (child.getNodeType() == Node.ELEMENT_NODE
10023: && child.getNodeName().equals("iReportFile")) {
10024: String fileName = Report.readPCDATA(child);
10025: if (fileName != null
10026: && fileName.trim().length() > 0) {
10027: v.addElement(fileName);
10028: }
10029: }
10030:
10031: }
10032:
10033: } catch (Exception ex) {
10034: }
10035: }
10036:
10037: static public Node goToNodeElement(String name, Node node) {
10038: if (node.getNodeType() == Node.ELEMENT_NODE
10039: && node.getNodeName().equals("iReportFilesList")) {
10040: return node;
10041: }
10042:
10043: NodeList list = node.getChildNodes();
10044: for (int i = 0; i < list.getLength(); ++i) {
10045: Node child = goToNodeElement(name, list.item(i));
10046: if (child != null)
10047: return child;
10048: }
10049:
10050: return null;
10051: }
10052:
10053: /* iReport configuration loader...
10054: */
10055: public void loadiReportConfiguration() {
10056: loadiReportConfiguration(IREPORT_CONFIG_FILE);
10057: }
10058:
10059: /* iReport configuration loader...
10060: */
10061: public void loadiReportConfiguration(String xmlFile) {
10062: // Adding default properties...
10063: properties.put("RecentFilesLength", "10");
10064: properties.put("ViewRules", "true");
10065: properties.put("GridSize", "10");
10066: properties.put("ViewBorderForTextElements", "true");
10067: properties.put("DefaultTemplate", "");
10068: properties.put("DefaultCompilationDirectory", ".");
10069: properties.put("BackupPolicy", "2");
10070: properties.put("DefaultBackupDirectory", "");
10071: properties.put("ExternalEditor", "");
10072: properties.put("ExternalPDFViewer", "");
10073: properties.put("ExternalHTMLViewer", "");
10074: properties.put("ExternalXLSViewer", "");
10075: properties.put("ExternalCSVViewer", "");
10076: properties.put("ViewBorderForTextElements", "true");
10077: properties.put("DefaultUnit", "cm");
10078: properties.put("SaveBeforeCompiling", "true");
10079: properties.put("LookAndFeel", "System");
10080: properties.put("UseAutoRegiesterFields", "true");
10081: properties.put("Language", java.util.Locale.getDefault()
10082: .getLanguage());
10083: properties.put("Country", "");
10084: properties.put("Compatibility", ""
10085: + CompatibilitySupport.LAST_AVAILABLE_VERSION);
10086: properties.put("toolbarFormattingVisible", "true");
10087: properties.put("toolbarTextVisible", "true");
10088: properties.put("showGrid", "false");
10089: properties.put("snapToGrid", "false");
10090:
10091: File file = null;
10092: try {
10093: file = new File(xmlFile);
10094: } catch (Exception ex) {
10095: }
10096: if (file == null || !file.exists() || file.isDirectory()) {
10097: try {
10098: outputBuffer.setLength(0);
10099:
10100: getLogPane()
10101: .getMainLogTextArea()
10102: .logOnConsole(
10103: I18n
10104: .getFormattedString(
10105: "messages.errorLoadingConfigDefParams",
10106: "Error loading Configuration file: {0}\nUsing default parameters.",
10107: new Object[] { xmlFile }),
10108: JOptionPane.ERROR_MESSAGE);
10109:
10110: } catch (Exception exsx) {
10111: }
10112: return;
10113: }
10114: // Create a Xerces DOM Parser
10115: DOMParser parser = new DOMParser();
10116: // Parse the Document
10117: // and traverse the DOM
10118: try {
10119:
10120: parser.setEntityResolver(new org.xml.sax.EntityResolver() {
10121: /* Code by Teodor Danciu */
10122: public org.xml.sax.InputSource resolveEntity(
10123: String publicId, String systemId)
10124: throws SAXException//, java.io.IOException
10125: {
10126: org.xml.sax.InputSource inputSource = null;
10127:
10128: if (systemId != null) {
10129: String dtd = null;
10130:
10131: if (systemId
10132: .equals("http://ireport.sourceforge.net/dtds/iReportProperties.dtd")) {
10133: dtd = "it/businesslogic/ireport/dtds/iReportProperties.dtd";
10134: } else {
10135: return new org.xml.sax.InputSource(systemId);
10136: }
10137:
10138: ClassLoader classLoader = this .getClass()
10139: .getClassLoader();
10140:
10141: java.net.URL url = null;
10142:
10143: if (classLoader != null) {
10144: url = classLoader.getResource(dtd);
10145: }
10146: if (url == null) {
10147: classLoader = this .getClass()
10148: .getClassLoader();
10149: }
10150:
10151: java.io.InputStream is = classLoader
10152: .getResourceAsStream(dtd);
10153: if (is != null) {
10154: java.io.InputStreamReader isr = new java.io.InputStreamReader(
10155: is);
10156: inputSource = new org.xml.sax.InputSource(
10157: isr);
10158: }
10159:
10160: }
10161:
10162: return inputSource;
10163: }
10164: });
10165: /* End Code by Teodor Danciu */
10166: parser.parse(new java.io.File(xmlFile).toURI().toString());
10167: Document document = parser.getDocument();
10168:
10169: traverse(document.getDocumentElement());
10170:
10171: String defaultConnection = Misc.nvl(properties
10172: .get("DefaultConnection"), "");
10173:
10174: //properties.put("DefaultConnection", null); // No default connection...
10175: if (!defaultConnection.equals("")) {
10176: // Looking for a connection width this name..,
10177: Enumeration e = getConnections().elements();
10178: while (e.hasMoreElements()) {
10179: IReportConnection irc = (IReportConnection) e
10180: .nextElement();
10181: if (Misc.nvl(irc.getName(), "").equals(
10182: defaultConnection)) {
10183: properties.put("DefaultConnection", irc);
10184: break;
10185: }
10186: }
10187: } else if (getConnections().size() > 0) {
10188: IReportConnection irc = (IReportConnection) getConnections()
10189: .elementAt(0);
10190: properties.put("DefaultConnection", irc);
10191: }
10192:
10193: String currentDirectory = Misc.nvl(properties
10194: .get("CurrentDirectory"), "");
10195: if (!currentDirectory.equals("")) {
10196: this .setCurrentDirectory(new java.io.File(
10197: currentDirectory), false);
10198: }
10199:
10200: //I changed this from the working directory to the ireport IREPORT_DEFAULT_HOME_DIR
10201: // Now is set in setiReportPaths ... setHomeDirectory(Misc.nvl(System.getProperty("ireport.home"), IREPORT_DEFAULT_HOME_DIR));
10202: this .setDefaultCompilationDirectory(properties
10203: .getProperty("DefaultCompilationDirectory"));
10204:
10205: // We force to use classic expressions
10206: properties.put("usingMultiLineExpressions", "false");
10207:
10208: CompatibilitySupport.version = Integer.parseInt(properties
10209: .getProperty("Compatibility"));
10210:
10211: // Write iReport location...
10212: try {
10213: String locationFileName = IREPORT_USER_HOME_DIR
10214: + File.separator + "ireport"
10215: + MainFrame.constTitle.substring(8)
10216: + ".location";
10217: if (!(new File(locationFileName).exists())) {
10218: PrintWriter pw = new PrintWriter(
10219: new FileOutputStream(locationFileName));
10220: String s = new File(IREPORT_HOME_DIR)
10221: .getAbsolutePath();
10222: pw.print(s);
10223: pw.close();
10224: }
10225: } catch (Exception ex) {
10226: ex.printStackTrace();
10227: }
10228:
10229: } catch (SAXException e) {
10230: System.err.println(e);
10231: } catch (java.io.IOException e) {
10232: System.err.println(e);
10233: }
10234: }
10235:
10236: /* iReport configuration loader...
10237: */
10238: public void loadStyleLibrary() {
10239: loadStyleLibrary(IREPORT_STYLE_LIBRARY);
10240: }
10241:
10242: /* iReport configuration loader...
10243: */
10244: public void loadStyleLibrary(String fileName) {
10245: setStyleLibrarySet(Misc.loadStyleLibrary(fileName));
10246: }
10247:
10248: /* iReport style library configuration saver...
10249: */
10250: public void saveStyleLibrary() {
10251:
10252: saveStyleLibrary(IREPORT_STYLE_LIBRARY);
10253:
10254: }
10255:
10256: /* iReport style library configuration saver...
10257: */
10258: public void saveStyleLibrary(String fileName) {
10259:
10260: Misc.saveStyleLibrary(fileName, getStyleLibrarySet());
10261:
10262: }
10263:
10264: /**
10265: * Set the current directory.
10266: * If save = true, the config file is updates...
10267: */
10268: public File setCurrentDirectory(File f, boolean save) {
10269: String currentDirectory = "";
10270: if (f == null)
10271: return f;
10272:
10273: try {
10274: if (f.isDirectory()) {
10275: currentDirectory = f.getAbsolutePath();
10276: } else {
10277: currentDirectory = f.getParentFile().getAbsolutePath();
10278: }
10279:
10280: if (save) {
10281: getProperties().put("CurrentDirectory",
10282: currentDirectory);
10283: this .saveiReportConfiguration();
10284: }
10285: } catch (Exception ex) {
10286:
10287: }
10288: return f;
10289: }
10290:
10291: private void traverse(Node node) {
10292: //System.out.println("traverse");
10293: if (node.getNodeType() == Node.ELEMENT_NODE
10294: && node.getNodeName().equals("iReportProperties")) {
10295: //System.out.println("iReportProperties");
10296: // Get childs....
10297: NodeList children = node.getChildNodes();
10298: if (children != null) {
10299: for (int k = 0; k < children.getLength(); k++) {
10300: Node nodeChild = (Node) children.item(k);
10301: if (nodeChild.getNodeType() == Node.ELEMENT_NODE
10302: && nodeChild.getNodeName().equals(
10303: "iReportProperty")) {
10304:
10305: // Take the CDATA...
10306: String paramName = "";
10307: NamedNodeMap nnm = nodeChild.getAttributes();
10308: if (nnm.getNamedItem("name") != null)
10309: paramName = nnm.getNamedItem("name")
10310: .getNodeValue();
10311: //System.out.println(" iReportProperty "+nnm.getNamedItem("name").getNodeValue());
10312: properties
10313: .put(paramName, readPCDATA(nodeChild));
10314:
10315: } else if (nodeChild.getNodeType() == Node.ELEMENT_NODE
10316: && nodeChild.getNodeName().equals(
10317: "iReportConnection")) {
10318: // Take the CDATA...
10319: String connectionName = "";
10320: String connectionClass = "";
10321: HashMap hm = new HashMap();
10322: NamedNodeMap nnm = nodeChild.getAttributes();
10323: if (nnm.getNamedItem("name") != null)
10324: connectionName = nnm.getNamedItem("name")
10325: .getNodeValue();
10326: if (nnm.getNamedItem("connectionClass") != null)
10327: connectionClass = nnm.getNamedItem(
10328: "connectionClass").getNodeValue();
10329:
10330: // Get all connections parameters...
10331: NodeList list_child = nodeChild.getChildNodes();
10332: for (int ck = 0; ck < list_child.getLength(); ck++) {
10333: String parameterName = "";
10334: Node child_child = (Node) list_child
10335: .item(ck);
10336: if (child_child.getNodeType() == Node.ELEMENT_NODE
10337: && child_child
10338: .getNodeName()
10339: .equals(
10340: "connectionParameter")) {
10341:
10342: NamedNodeMap nnm2 = child_child
10343: .getAttributes();
10344: if (nnm2.getNamedItem("name") != null)
10345: parameterName = nnm2.getNamedItem(
10346: "name").getNodeValue();
10347: hm.put(parameterName,
10348: readPCDATA(child_child));
10349: }
10350: }
10351: try {
10352: IReportConnection con = (IReportConnection) Class
10353: .forName(connectionClass)
10354: .newInstance();
10355: con.loadProperties(hm);
10356: con.setName(connectionName);
10357: connections.addElement(con);
10358: } catch (Exception ex) {
10359: try {
10360:
10361: getLogPane()
10362: .getMainLogTextArea()
10363: .logOnConsole(
10364: I18n
10365: .getFormattedString(
10366: "messages.errorLoadingConnection",
10367: "Error loading: {0}\n{1}\n",
10368: new Object[] {
10369: connectionName,
10370: ex
10371: .getMessage() }),
10372: JOptionPane.ERROR_MESSAGE);
10373:
10374: } catch (Exception exsx) {
10375: }
10376: }
10377: } else if (nodeChild.getNodeType() == Node.ELEMENT_NODE
10378: && nodeChild.getNodeName().equals(
10379: "QueryExecuter")) {
10380: // Take the CDATA...
10381: QueryExecuterDef qe = new QueryExecuterDef();
10382:
10383: HashMap hm = new HashMap();
10384: NamedNodeMap nnm = nodeChild.getAttributes();
10385: if (nnm.getNamedItem("factory") != null)
10386: qe.setClassName(nnm.getNamedItem("factory")
10387: .getNodeValue());
10388: if (nnm.getNamedItem("fieldsProvider") != null)
10389: qe.setFieldsProvider(nnm.getNamedItem(
10390: "fieldsProvider").getNodeValue());
10391: qe.setLanguage(readPCDATA(nodeChild));
10392:
10393: getQueryExecuters().add(qe);
10394: }
10395: }
10396: }
10397: }
10398: }
10399:
10400: /** Getter for property connections.
10401: * @return Value of property connections.
10402: *
10403: */
10404: public java.util.Vector getConnections() {
10405: return connections;
10406: }
10407:
10408: /** Setter for property connections.
10409: * @param connections New value of property connections.
10410: *
10411: */
10412: public void setConnections(java.util.Vector connections) {
10413: this .connections = connections;
10414: }
10415:
10416: // public String getI18nString(String s) {
10417: // return it.businesslogic.ireport.util.I18n.getString(s, it.businesslogic.ireport.util.I18n.getCurrentLocale());
10418: // }
10419:
10420: /** Getter for property properties.
10421: * @return Value of property properties.
10422: *
10423: */
10424: public Properties getProperties() {
10425: return properties;
10426: }
10427:
10428: /** Setter for property properties.
10429: * @param properties New value of property properties.
10430: *
10431: */
10432: public void setProperties(Properties properties) {
10433: this .properties = properties;
10434: }
10435:
10436: private String readPCDATA(Node textNode) {
10437: NodeList list_child = textNode.getChildNodes();
10438: for (int ck = 0; ck < list_child.getLength(); ck++) {
10439: Node child_child = (Node) list_child.item(ck);
10440: if (child_child.getNodeType() == Node.CDATA_SECTION_NODE
10441: || child_child.getNodeType() == Node.TEXT_NODE) {
10442: return (String) child_child.getNodeValue();
10443: }
10444: }
10445: return "";
10446: }
10447:
10448: public boolean saveiReportConfiguration() {
10449: // Get the path of this class...
10450: // this.getClass().getResource("MainFrame");
10451: File dir = new File(IREPORT_USER_HOME_DIR);
10452: try {
10453: if (dir.exists()) {
10454: if (!dir.isDirectory()) {
10455: javax.swing.JOptionPane
10456: .showMessageDialog(
10457: this ,
10458: I18n
10459: .getFormattedString(
10460: "messages.errorIsDirectory",
10461: "{0} is not a directory!\nPlease rename this file and retry to save config!",
10462: new Object[] { dir
10463: .getPath()
10464: + "" }),
10465: "", JOptionPane.ERROR_MESSAGE);
10466: return false;
10467: }
10468: } else {
10469: dir.mkdirs();
10470: }
10471: } catch (Exception ex) {
10472: javax.swing.JOptionPane
10473: .showMessageDialog(
10474: this ,
10475: I18n
10476: .getFormattedString(
10477: "messages.errorSavingConfigDialog",
10478: "An error is occurred saving iReport config:\n{0}\nPlease try to save config again!",
10479: new Object[] { ""
10480: + ex.getMessage() }),
10481: "", JOptionPane.ERROR_MESSAGE);
10482: return false;
10483: }
10484:
10485: return saveiReportConfiguration(IREPORT_CONFIG_FILE);
10486: }
10487:
10488: public boolean saveiReportConfiguration(String xmlFile) {
10489: try {
10490: //PrintWriter pw = new PrintWriter( new FileWriter(xmlFile) );
10491:
10492: PrintWriter pw = new PrintWriter(new OutputStreamWriter(
10493: new FileOutputStream(xmlFile), "UTF-8"));
10494:
10495: // Find iReport configuration in the home directory...
10496: // 1. Save all properties using am XML style...
10497:
10498: if (getConnections().size() > 0
10499: && properties.get("DefaultConnection") == null) {
10500: IReportConnection irc = (IReportConnection) getConnections()
10501: .elementAt(0);
10502: properties.put("DefaultConnection", irc);
10503: }
10504: /*
10505: this.getProperties().setProperty("RightColumnVisible",""+ (jSplitPaneHelp.getDividerSize() != 0));
10506: if (jSplitPaneHelp.getDividerSize() != 0)
10507: {
10508: this.getProperties().setProperty("RightColumnWidth",""+ dockingContainerRight.getWidth());
10509: }
10510: */
10511: //System.out.println("divider location:" + jSplitPaneHelp.getDividerLocation() + " " + (jSplitPaneHelp.getWidth()-8-rightColumnWidth));
10512:
10513: pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
10514: pw.println("<!-- iReport 2 Configuration file - "
10515: + new Date() + " -->");
10516: pw
10517: .println("<!DOCTYPE iReportProperties PUBLIC \"-//iReport/DTD iReport Configuration//EN\" \"http://ireport.sourceforge.net/dtds/iReportProperties.dtd\">");
10518: pw.println("<iReportProperties>");
10519:
10520: Enumeration e = this .getProperties().keys();
10521: while (e.hasMoreElements()) {
10522: String key = (String) e.nextElement();
10523: pw.println("\t<iReportProperty name=\"" + key
10524: + "\"><![CDATA["
10525: + this .getProperties().get(key)
10526: + "]]></iReportProperty>");
10527: }
10528:
10529: e = this .getConnections().elements();
10530: while (e.hasMoreElements()) {
10531: IReportConnection con = (IReportConnection) e
10532: .nextElement();
10533: con.save(pw);
10534: }
10535:
10536: e = this .getQueryExecuters().elements();
10537: while (e.hasMoreElements()) {
10538: QueryExecuterDef qe = (QueryExecuterDef) e
10539: .nextElement();
10540: pw.println("\t<QueryExecuter factory=\""
10541: + qe.getClassName() + "\" fieldsProvider=\""
10542: + qe.getFieldsProvider() + "\"><![CDATA["
10543: + qe.getLanguage() + "]]></QueryExecuter>");
10544: }
10545:
10546: pw.println("</iReportProperties>");
10547: pw.close();
10548: } catch (Exception ex) {
10549: //ex.printStackTrace(s
10550: try {
10551:
10552: getLogPane()
10553: .getMainLogTextArea()
10554: .logOnConsole(
10555: I18n
10556: .getFormattedString(
10557: "messages.errorSavingConfig",
10558: "Error saving Configuration file: {0}\n{1}\n",
10559: new Object[] { xmlFile,
10560: ex.getMessage() }),
10561: JOptionPane.ERROR_MESSAGE);
10562:
10563: } catch (Exception exsx) {
10564: }
10565: return false;
10566: }
10567: try {
10568:
10569: getLogPane()
10570: .getMainLogTextArea()
10571: .logOnConsole(
10572: I18n
10573: .getFormattedString(
10574: "messages.configUpdated",
10575: "iReport configuration file {0} successfully updated!\n",
10576: new Object[] { xmlFile }),
10577: JOptionPane.INFORMATION_MESSAGE);
10578:
10579: } catch (Exception ex) {
10580: }
10581: return true;
10582: }
10583:
10584: public boolean saveFileList(Vector v, String xmlFile) {
10585: // Get the path of this class...
10586: // this.getClass().getResource("MainFrame");
10587:
10588: File dir = new File(IREPORT_USER_HOME_DIR);
10589: try {
10590: if (dir.exists()) {
10591: if (!dir.isDirectory()) {
10592: javax.swing.JOptionPane
10593: .showMessageDialog(
10594: this ,
10595: I18n
10596: .getFormattedString(
10597: "messages.errorIsDirectory",
10598: "{0} is not a directory!\nPlease rename this file and retry to save config!",
10599: new Object[] { dir
10600: .getPath()
10601: + "" }),
10602: "", JOptionPane.ERROR_MESSAGE);
10603: return false;
10604: }
10605: } else {
10606: dir.mkdirs();
10607: }
10608: } catch (Exception ex) {
10609: javax.swing.JOptionPane
10610: .showMessageDialog(
10611: this ,
10612: I18n
10613: .getFormattedString(
10614: "messages.errorSavingConfigDialog",
10615: "An error is occurred saving iReport config:\n{0}\nPlease try to save config again!",
10616: new Object[] { ""
10617: + ex.getMessage() }),
10618: "", JOptionPane.ERROR_MESSAGE);
10619: return false;
10620: }
10621:
10622: //xmlFile = dir.getPath()+ File.separatorChar + xmlFile;
10623:
10624: try {
10625: PrintWriter pw = new PrintWriter(new FileWriter(xmlFile));
10626: // Find iReport configuration in the home directory...
10627: // 1. Save all properties using am XML style...
10628: pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
10629: pw.println("<!-- iReport 2 file list - " + new Date()
10630: + " -->");
10631: pw
10632: .println("<!DOCTYPE iReportFilesList PUBLIC \"-//iReport/DTD iReport Configuration//EN\" \"http://ireport.sourceforge.net/dtds/iReportFilesList.dtd\">");
10633: pw.println("<iReportFilesList>");
10634:
10635: Enumeration e = v.elements();
10636: int i = 0;
10637: int max_files = 10;
10638: try {
10639: max_files = Integer.parseInt(getProperties()
10640: .getProperty("RecentFilesLength"));
10641: } catch (Exception ex) {
10642: getProperties().setProperty("RecentFilesLength", "10");
10643: }
10644:
10645: while (i < max_files && e.hasMoreElements()) {
10646: String file = (String) e.nextElement();
10647: pw.println("\t<iReportFile><![CDATA[" + file
10648: + "]]></iReportFile>");
10649: i++;
10650: }
10651: pw.println("</iReportFilesList>");
10652: pw.close();
10653: } catch (Exception ex) {
10654: //ex.printStackTrace(s
10655: try {
10656:
10657: getLogPane()
10658: .getMainLogTextArea()
10659: .logOnConsole(
10660: I18n
10661: .getFormattedString(
10662: "messages.errorSavingIReportFile",
10663: "Error saving iReport file: {0}\n{1}\n",
10664: new Object[] { xmlFile,
10665: ex.getMessage() }),
10666: JOptionPane.ERROR_MESSAGE);
10667:
10668: } catch (Exception exsx) {
10669: }
10670: return false;
10671: }
10672: try {
10673:
10674: getLogPane().getMainLogTextArea().logOnConsole(
10675: I18n.getFormattedString("messages.fileUpdated",
10676: "iReport file {0} successfully updated!\n",
10677: new Object[] { xmlFile }),
10678: JOptionPane.INFORMATION_MESSAGE);
10679:
10680: } catch (Exception ex) {
10681: }
10682: return true;
10683: }
10684:
10685: public void logOnConsole(String noHTML) {
10686: getLogPane().getMainLogTextArea().logOnConsole(noHTML, false);
10687: }
10688:
10689: public void logOnConsole(String s, boolean isHTML) {
10690: getLogPane().getMainLogTextArea().logOnConsole(s, isHTML);
10691: }
10692:
10693: /** Getter for property ttfFonts.
10694: * @return Value of property ttfFonts.
10695: *
10696: */
10697: public java.util.Vector getTtfFonts() {
10698: return ttfFonts;
10699: }
10700:
10701: /** Setter for property ttfFonts.
10702: * @param ttfFonts New value of property ttfFonts.
10703: *
10704: */
10705: public void setTtfFonts(java.util.Vector ttfFonts) {
10706: this .ttfFonts = ttfFonts;
10707: }
10708:
10709: public void reportBandChanged(ReportBandChangedEvent evt) {
10710: evt.getJReportFrame().getReport().incrementReportChanges();
10711: fireReportListenerReportBandChanged(evt);
10712: }
10713:
10714: public void reportElementsChanged(ReportElementChangedEvent evt) {
10715:
10716: fireReportListenerReportElementsChanged(evt);
10717: //we need to set the report to show it has been modified.
10718: Report mod = evt.getJReportFrame().getReport();
10719: mod.incrementReportChanges();
10720: //mod.setModified(true);
10721: this .enableSaveSpecific();
10722: this .enableSaveAllSpecific();
10723:
10724: }//end reportElementsChanged
10725:
10726: /**
10727: *Used to enable anything strictly save related. Not save all.
10728: */
10729: public void enableSaveSpecific() {
10730: //TODO add events to update gui when changes occur in expressions.
10731: //this had to be commented out until that day arrives.
10732: //brainjava will be working on this
10733: /*
10734: this.jButtonSave.setEnabled(true);
10735: this.jMenuItemSave.setEnabled(true);
10736: **/
10737: }
10738:
10739: /**
10740: *Used to disable anything Save. Not save all.
10741: */
10742: public void disableSaveSpecific() {
10743:
10744: //TODO add more events so code can be comented back in
10745: //this had to be removed until events can be added to
10746: //the expression updates so the gui will know changes have
10747: //occurred
10748: /*
10749: this.jButtonSave.setEnabled(false);
10750: this.jMenuItemSave.setEnabled(false);
10751: **/
10752: }//end disableSaveSpecific
10753:
10754: /**
10755: *Used to enable anything strictly save all related. Not save.
10756: */
10757: public void enableSaveAllSpecific() {
10758: this .jMenuItemSaveAll.setEnabled(true);
10759: this .jButtonSaveAll.setEnabled(true);
10760: }//end enableSaveAllSpecific
10761:
10762: /**
10763: *Used to disable anything Save. Not save all.
10764: */
10765: public void disableSaveAllSpecific() {
10766: this .jMenuItemSaveAll.setEnabled(false);
10767: this .jButtonSaveAll.setEnabled(false);
10768: }//end disableSaveAllSpecific
10769:
10770: /** This method is called when a new element is selected,
10771: * or deselected.
10772: *
10773: */
10774: public void reportElementsSelectionChanged(
10775: ReportElementsSelectionEvent evt) {
10776:
10777: Vector activeSelection = this
10778: .getActiveElementSelection(getActiveReportFrame());
10779:
10780: setDontHandleEvent(true);
10781:
10782: try {
10783:
10784: // we have to synchronize the selection with the toolbar state...
10785:
10786: boolean sameFontName = true;
10787: boolean sameFontSize = true;
10788:
10789: boolean isTheFirstElement = true;
10790:
10791: if (activeSelection.size() == 0) {
10792: ElementPropertiesDialog.setComboBoxText(
10793: isTheFirstElement, "SansSerif", jComboBoxFont);
10794: ElementPropertiesDialog.setElementComboNumber(
10795: isTheFirstElement, 10, jNumberComboBoxSize);
10796: } else {
10797: for (int i = 0; i < activeSelection.size(); ++i) {
10798: ReportElement re = (ReportElement) activeSelection
10799: .elementAt(i);
10800: if (re instanceof TextReportElement) {
10801: TextReportElement tre = (TextReportElement) re;
10802:
10803: String fontName = tre.getFontName();
10804: if (fontName == null
10805: || fontName.trim().length() == 0)
10806: fontName = "SansSerif";
10807:
10808: if (sameFontName)
10809: sameFontName = ElementPropertiesDialog
10810: .setComboBoxText(isTheFirstElement,
10811: fontName, jComboBoxFont);
10812: if (sameFontSize)
10813: sameFontSize = ElementPropertiesDialog
10814: .setElementComboNumber(
10815: isTheFirstElement, tre
10816: .getFontSize(),
10817: jNumberComboBoxSize);
10818:
10819: isTheFirstElement = false;
10820: }
10821: }
10822: }
10823:
10824: } catch (Exception ex) {
10825:
10826: } finally {
10827: setDontHandleEvent(false);
10828: }
10829:
10830: fireReportListenerReportElementsSelectionChanged(evt);
10831:
10832: }
10833:
10834: /** Getter for property dontHandleEvent.
10835: * @return Value of property dontHandleEvent.
10836: *
10837: */
10838: public boolean isDontHandleEvent() {
10839: return dontHandleEvent;
10840: }
10841:
10842: /** Setter for property dontHandleEvent.
10843: * @param dontHandleEvent New value of property dontHandleEvent.
10844: *
10845: */
10846: public void setDontHandleEvent(boolean dontHandleEvent) {
10847: this .dontHandleEvent = dontHandleEvent;
10848: }
10849:
10850: /** Getter for property recentFilesList.
10851: * @return Value of property recentFilesList.
10852: *
10853: */
10854: public java.util.Vector getRecentFilesList() {
10855: return recentFilesList;
10856: }
10857:
10858: /** Setter for property recentFilesList.
10859: * @param recentFilesList New value of property recentFilesList.
10860: *
10861: */
10862: public void setRecentFilesList(java.util.Vector recentFilesList) {
10863: this .recentFilesList = recentFilesList;
10864: }
10865:
10866: /** Getter for property recentProjectsList.
10867: * @return Value of property recentProjectsList.
10868: *
10869: */
10870: public java.util.Vector getRecentProjectsList() {
10871: return recentProjectsList;
10872: }
10873:
10874: /** Setter for property recentProjectsList.
10875: * @param recentProjectsList New value of property recentProjectsList.
10876: *
10877: */
10878: public void setRecentProjectsList(
10879: java.util.Vector recentProjectsList) {
10880: this .recentProjectsList = recentProjectsList;
10881: }
10882:
10883: /** Getter for property favoriteFilesList.
10884: * @return Value of property favoriteFilesList.
10885: *
10886: */
10887: public java.util.Vector getFavoriteFilesList() {
10888: return favoriteFilesList;
10889: }
10890:
10891: /** Setter for property favoriteFilesList.
10892: * @param favoriteFilesList New value of property favoriteFilesList.
10893: *
10894: */
10895: public void setFavoriteFilesList(java.util.Vector favoriteFilesList) {
10896: this .favoriteFilesList = favoriteFilesList;
10897: }
10898:
10899: private void jMenuItemRecentFileActionPerformed(
10900: java.awt.event.ActionEvent evt) {
10901: if (evt.getSource() instanceof JMenuItem) {
10902: JMenuItem menu = (JMenuItem) evt.getSource();
10903:
10904: // Is a recent file?!
10905: for (int i = 0; i < jMenuRecentFiles
10906: .getMenuComponentCount(); ++i) {
10907: if (jMenuRecentFiles.getMenuComponent(i) == menu) {
10908:
10909: // If not already Opened, open entry # i
10910: JReportFrame frameReport = openFile((String) recentFilesList
10911: .elementAt(i));
10912: if (frameReport != null) {
10913:
10914: Report report = frameReport.getReport();
10915:
10916: if (report.isModified()) {
10917: this .enableSaveSpecific();
10918: this .enableSaveAllSpecific();
10919: } else {
10920: this .disableSaveSpecific();
10921: if (this .isSaveAllRequired()) {
10922: this .enableSaveAllSpecific();
10923: } else {
10924: this .disableSaveAllSpecific();
10925: }
10926: }
10927: break;
10928: }
10929: }
10930: }
10931: }
10932: }
10933:
10934: public void updateRecentFileMenu(JMenu menu, Vector v) {
10935: menu.removeAll();
10936: Enumeration e = v.elements();
10937: int i = 1;
10938:
10939: int k = 0;
10940: int max_files = 10;
10941: try {
10942: max_files = Integer.parseInt(getProperties().getProperty(
10943: "RecentFilesLength"));
10944: } catch (Exception ex) {
10945: getProperties().setProperty("RecentFilesLength", "10");
10946: }
10947:
10948: while (k < max_files && e.hasMoreElements()) {
10949:
10950: JMenuItem subMenu = new JMenuItem(i + ". "
10951: + Misc.getShortFileName((String) e.nextElement()));
10952: subMenu
10953: .addActionListener(new java.awt.event.ActionListener() {
10954: public void actionPerformed(
10955: java.awt.event.ActionEvent evt) {
10956: jMenuItemRecentFileActionPerformed(evt);
10957: }
10958:
10959: });
10960: menu.add(subMenu);
10961: i++;
10962: k++;
10963: }
10964: }
10965:
10966: public void updateRecentProjectMenu(JMenu menu, Vector v) {
10967: }
10968:
10969: public void updateUndoMenu(JReportFrame jrf) {
10970:
10971: if (jrf == null) {
10972: this .jMenuItemUndo.setEnabled(false);
10973: this .jMenuItemRedo.setEnabled(false);
10974: return;
10975: }
10976: if (jrf.getUndoOperation() != null) {
10977: this .jMenuItemUndo.setEnabled(true);
10978: this .jMenuItemUndo
10979: .setText(it.businesslogic.ireport.util.I18n
10980: .getString("undo", "Undo")
10981: + " " + jrf.getUndoOperation());
10982: } else {
10983: this .jMenuItemUndo.setEnabled(false);
10984: this .jMenuItemUndo
10985: .setText(it.businesslogic.ireport.util.I18n
10986: .getString("undo", "Undo"));
10987: }
10988:
10989: if (jrf.getRedoOperation() != null) {
10990: this .jMenuItemRedo.setEnabled(true);
10991: this .jMenuItemRedo
10992: .setText(it.businesslogic.ireport.util.I18n
10993: .getString("redo", "Redo")
10994: + " " + jrf.getRedoOperation());
10995: } else {
10996: this .jMenuItemRedo.setEnabled(false);
10997: this .jMenuItemRedo
10998: .setText(it.businesslogic.ireport.util.I18n
10999: .getString("redo", "Redo"));
11000: }
11001: }
11002:
11003: public void setCrosstabActive(
11004: CrosstabReportElement crosstabReportElement) {
11005: boolean bMode = this .getActiveReportFrame() != null
11006: && crosstabReportElement == null;
11007: JReportFrame jrf = this .getActiveReportFrame();
11008: this .jToggleButtonCrosstabTool.setEnabled(bMode);
11009: this .jToggleButtonSubreportTool.setEnabled(bMode);
11010: this .jToggleButtonChartTool.setEnabled(bMode);
11011:
11012: jToolbarFormatPanel.setCrosstabMode(bMode);
11013:
11014: jMenuItemInsertPageBreak.setEnabled(bMode);
11015: jMenuItemAlignToBandBottom.setEnabled(bMode);
11016: jMenuItemAlignToBandTop.setEnabled(bMode);
11017: jMenuItemBands.setEnabled(bMode);
11018: jMenuItemCenterBackground.setEnabled(bMode);
11019: //jMenuItemCenterH.setEnabled(bMode);
11020: //jMenuItemCenterInBand.setEnabled(bMode);
11021: //jMenuItemCenterV.setEnabled(bMode);
11022: jMenuItemLeftMargin.setEnabled(bMode);
11023: jMenuItemOrganize.setEnabled(bMode);
11024: jMenuItemRemoveMargins.setEnabled(bMode);
11025: jMenuItemRightMargin.setEnabled(bMode);
11026: jMenuItemRightSide.setEnabled(bMode);
11027:
11028: this .getElementPropertiesDialog()
11029: .clearExpressionEditorContext();
11030:
11031: setActiveTool(0);
11032:
11033: crosstabMeasuresView
11034: .setCrosstabReportElement(crosstabReportElement);
11035:
11036: if (DockingManager
11037: .isDocked((Dockable) crosstabMeasuresPanelView)
11038: && crosstabReportElement == null) {
11039:
11040: SwingUtilities.invokeLater(new Runnable() {
11041: public void run() {
11042: DockingManager.close(crosstabMeasuresPanelView);
11043: /*
11044: if (getActiveReportFrame().isMaximum())
11045: {
11046: try {
11047: getActiveReportFrame().setMaximum(false);
11048: getActiveReportFrame().setMaximum(true);
11049: } catch (PropertyVetoException ex) {
11050: ex.printStackTrace();
11051: }
11052: }
11053: */
11054: }
11055: });
11056:
11057: }
11058:
11059: if (DockingManager.isDocked((Dockable) crosstabStructureView)
11060: && crosstabReportElement == null) {
11061: SwingUtilities.invokeLater(new Runnable() {
11062: public void run() {
11063: DockingManager.close(crosstabStructureView);
11064: /*
11065: if (getActiveReportFrame().isMaximum())
11066: {
11067: try {
11068: getActiveReportFrame().setMaximum(false);
11069: getActiveReportFrame().setMaximum(true);
11070: } catch (PropertyVetoException ex) {
11071: ex.printStackTrace();
11072: }
11073: }
11074: */
11075: }
11076: });
11077:
11078: }
11079:
11080: // dockingContainerRight.removePanel(crosstabMeasuresView);
11081: if (crosstabReportElement != null) {
11082: if (!DockingManager
11083: .isDocked((Dockable) crosstabMeasuresPanelView)) {
11084: desktop.dock(crosstabMeasuresPanelView,
11085: DockingConstants.EAST_REGION, 0.2f);
11086: }
11087: //CR-rg.flexdock.docking.DockingManager.setSplitProportion(crosstabMeasuresPanelView.getComponent(), 0.8f);
11088: crosstabMeasuresPanelView.setActive(true);
11089: // dockingContainerRight.insertPanel(0,"Crosstab objects", crosstabMeasuresView, dockingContainerRight.INSERT_MODE_NEWPOSITION, false);
11090: // dockingContainerRight.setSelectedComponent( crosstabMeasuresView );
11091: Vector elements = new Vector();
11092: if (jrf != null
11093: && jrf.getSelectedCrosstabEditorPanel() != null) {
11094: elements = jrf.getSelectedCrosstabEditorPanel()
11095: .getSelectedElements();
11096: }
11097: fireReportListenerReportElementsSelectionChanged(new ReportElementsSelectionEvent(
11098: jrf, crosstabReportElement, elements));
11099: } else if (jrf != null) {
11100: fireReportListenerReportElementsSelectionChanged(new ReportElementsSelectionEvent(
11101: jrf, crosstabReportElement, jrf
11102: .getSelectedElements()));
11103: }
11104:
11105: // dockingContainerLeft.removePanel(crosstabStructurePanel);
11106: crosstabStructurePanel.saveSelection();
11107:
11108: if (crosstabReportElement != null) {
11109: crosstabStructurePanel.updateDocumentStructureTree(
11110: getActiveReportFrame(), crosstabReportElement);
11111:
11112: if (!DockingManager
11113: .isDocked((Dockable) crosstabStructureView)) {
11114: crosstabMeasuresPanelView.dock(
11115: (Dockable) crosstabStructureView,
11116: DockingConstants.SOUTH_REGION, 0.5f);
11117: DockingManager.setSplitProportion(
11118: (Dockable) crosstabMeasuresPanelView, 0.5f);
11119: }
11120:
11121: //Misc.dockAt(crosstabStructureView, DockingConstants.EAST_REGION,0);
11122:
11123: /*
11124: //boolean b = org.flexdock.util.DockingUtility.dockRelative(crosstabStructureView, viewDocumentStructure, DockingConstants.SOUTH_REGION);
11125:
11126: if (!b)
11127: {
11128: b = DockingManager.dock((Dockable)crosstabStructureView, crosstabMeasuresPanelView.getDockingPort(),DockingConstants.SOUTH_REGION);
11129: System.out.println( "Docking on crosstabMeasuresPanelView CENTER " + b);
11130: }
11131:
11132: //crosstabMeasuresPanelView.dock( crosstabStructureView, DockingConstants.SOUTH_REGION);
11133: if (b)
11134: {
11135:
11136: java.awt.Component comp = crosstabStructureView.getComponent();
11137: //System.out.println( "Take " + comp);
11138: java.awt.Container parent = comp.getParent();
11139: //System.out.println( "Take parent1" + parent);
11140: if( parent instanceof javax.swing.JTabbedPane ) {
11141: parent = parent.getParent();
11142: //System.out.println( "Take parent2 (JTabbedPane) " + parent);
11143: }
11144:
11145: if (!(parent instanceof DockingPort))
11146: {
11147: //System.out.println( "Not a Docking port");
11148: }
11149: else
11150: {
11151: java.awt.Container grandParent = parent.getParent();
11152: if(grandParent instanceof JSplitPane)
11153: {
11154: javax.swing.JSplitPane jsp = (javax.swing.JSplitPane)grandParent;
11155: System.out.println( "JSplitPane found " + jsp.getOrientation() + " H=" + jsp.HORIZONTAL_SPLIT + " V=" + jsp.VERTICAL_SPLIT);
11156: jsp.setDividerLocation(0.5f);
11157: jsp.setResizeWeight(0.5f);
11158: }
11159: }
11160:
11161: }
11162: */
11163: //crosstabStructureView.setActive(true);
11164: // dockingContainerLeft.insertPanel(0, "Crosstab structure", crosstabStructurePanel, false);
11165: // dockingContainerLeft.setSelectedComponent( crosstabStructurePanel );
11166: }
11167:
11168: desktop.doLayout();
11169: // dockingContainerLeft.updateUI();
11170: }
11171:
11172: public void updateCutAndPasteMenu(JReportFrame jrf) {
11173:
11174: if (jrf == null) {
11175: setCutCopyEnabled(false);
11176: setPasteEnebled(false);
11177: return;
11178: }
11179:
11180: Vector selection = getActiveElementSelection(jrf);
11181: if (selection != null && selection.size() > 0) {
11182: setCutCopyEnabled(true);
11183: if (getClipBoard().size() > 0)
11184: setPasteEnebled(true);
11185: } else {
11186: setCutCopyEnabled(false);
11187: if (getClipBoard().size() > 0)
11188: setPasteEnebled(true);
11189: }
11190: }
11191:
11192: public Vector getActiveElementSelection(JReportFrame jrf) {
11193: if (jrf == null)
11194: return new Vector();
11195: if (jrf.getSelectedCrosstabEditorPanel() == null) {
11196: return jrf.getSelectedElements();
11197: } else {
11198: return jrf.getSelectedCrosstabEditorPanel()
11199: .getSelectedElements();
11200: }
11201: }
11202:
11203: public void undo() {
11204: jMenuItemUndoActionPerformed(new java.awt.event.ActionEvent(
11205: jMenuItemUndo, 0, ""));
11206: }
11207:
11208: public void redo() {
11209: jMenuItemRedoActionPerformed(new java.awt.event.ActionEvent(
11210: jMenuItemUndo, 0, ""));
11211:
11212: }
11213:
11214: /**
11215: * Update the jTreeDocumen (the tree with the opened files)
11216: */
11217: public void updateOpenedDocumentsList() {
11218:
11219: try {
11220: jTreeFiles.updateUI();
11221: } catch (Exception ex1) {
11222: ex1.printStackTrace();
11223: }
11224: }
11225:
11226: /** Getter for property activeClipboard.
11227: * @return Value of property activeClipboard.
11228: *
11229: */
11230: public int getActiveClipboard() {
11231: return activeClipboard;
11232: }
11233:
11234: /** Setter for property activeClipboard.
11235: * @param activeClipboard New value of property activeClipboard.
11236: *
11237: */
11238: public void setActiveClipboard(int activeClipboard) {
11239: this .activeClipboard = activeClipboard;
11240: }
11241:
11242: public Vector getClipBoard() {
11243: return clipboards[getActiveClipboard()];
11244: }
11245:
11246: public void setClipBoardContent(Vector elements) {
11247: clipboards[getActiveClipboard()] = elements;
11248:
11249: }
11250:
11251: /** Getter for property homeDirectory.
11252: * @return Value of property homeDirectory.
11253: *
11254: */
11255: public java.lang.String getHomeDirectory() {
11256: return homeDirectory;
11257: }
11258:
11259: /** Setter for property homeDirectory.
11260: * @param homeDirectory New value of property homeDirectory.
11261: *
11262: */
11263: public void setHomeDirectory(java.lang.String homeDirectory) {
11264: this .homeDirectory = homeDirectory;
11265: }
11266:
11267: public String getCurrentDirectory() {
11268: return ""
11269: + Misc.nvl(getProperties().getProperty(
11270: "CurrentDirectory"), ".");
11271: }
11272:
11273: public void run() {
11274:
11275: //System.out.println("Avvio controllo " + (new java.util.Date()) );
11276: //System.out.flush();
11277:
11278: if (catchFormActivated) {
11279: catchFormActivated = false;
11280: this .checkForModifiedFiles();
11281: catchFormActivated = true;
11282: }
11283:
11284: }
11285:
11286: public void saveBackup(String filename) {
11287: java.io.File f = new java.io.File(filename);
11288: if (f.exists()) {
11289: String path = f.getParent();
11290: String file = f.getName();
11291:
11292: if (getProperties().getProperty("DefaultBackupDirectory") != null
11293: && ("" + getProperties().getProperty(
11294: "DefaultBackupDirectory")).length() > 0)
11295: path = getProperties().getProperty(
11296: "DefaultBackupDirectory");
11297:
11298: if (getProperties().getProperty("BackupPolicy") != null
11299: && ("" + getProperties()
11300: .getProperty("BackupPolicy"))
11301: .equalsIgnoreCase("1")) {
11302: return;
11303: } else if (getProperties().getProperty("BackupPolicy") != null
11304: && ("" + getProperties()
11305: .getProperty("BackupPolicy"))
11306: .equalsIgnoreCase("2")) {
11307: file = Misc.changeFileExtension(file, "bak");
11308: } else {
11309: file += ".bak";
11310: }
11311: try {
11312: //String back_path = getProperties().getProperty( "
11313: File f2 = new java.io.File(path, file); // + ((path.endsWith(java.io.File.separatorChar+"")) ? "" : ""+java.io.File.separatorChar) + file);
11314: if (f2.exists()) {
11315: if (!f2.delete()) {
11316:
11317: getLogPane().getMainLogTextArea().logOnConsole(
11318: I18n.getFormattedString(
11319: "messages.cannotDelete",
11320: "Can not delete {0}",
11321: new Object[] { f2 + "" }),
11322: JOptionPane.ERROR_MESSAGE);
11323:
11324: }
11325: }
11326:
11327: f.renameTo(f2);
11328:
11329: getLogPane().getMainLogTextArea().logOnConsole(
11330: I18n.getFormattedString("messages.fileRenamed",
11331: "Renamed {0} to {1}", new Object[] {
11332: f + "", f2 + "" }),
11333: JOptionPane.INFORMATION_MESSAGE);
11334:
11335: //com.ms.wfc.io.File.copyOver( filename, com.ms.wfc.io.File.combine(path,file));
11336: } catch (Exception ex) {
11337: javax.swing.JOptionPane
11338: .showMessageDialog(
11339: this ,
11340: I18n
11341: .getFormattedString(
11342: "messages.errorSavingBackup",
11343: "An exception is occurred saving backup copy.\n{0}",
11344: new Object[] { ""
11345: + ex
11346: .getMessage() }),
11347: "",
11348: javax.swing.JOptionPane.ERROR_MESSAGE);
11349: }
11350: }
11351: }
11352:
11353: /* Thanks to James Fu */
11354: private void setElementValue(Object element, String method,
11355: String value) {
11356: setElementValue(element, method, value, String.class);
11357: }
11358:
11359: /* Thanks to James Fu */
11360: public void setElementsValue(String method, String value) {
11361: setElementsValue(method, value, String.class);
11362: }
11363:
11364: private void setElementValue(Object element, String method,
11365: Object value, Class clazz) {
11366:
11367: try {
11368: java.lang.reflect.Method setMethod = element.getClass()
11369: .getMethod(method, new Class[] { clazz });
11370: setMethod.invoke(element, new Object[] { value });
11371:
11372: } catch (Exception e) {
11373: e.printStackTrace();
11374: }
11375: }
11376:
11377: /* Thanks to James Fu */
11378: public void setElementsValue(String method, Object value,
11379: Class clazz) {
11380: JReportFrame jrf = (JReportFrame) jMDIDesktopPane
11381: .getSelectedFrame();
11382: if (jrf == null)
11383: return;
11384: // Set the new value for all selected elements...
11385: Enumeration e = getActiveElementSelection(jrf).elements();
11386: boolean adjusted = false;
11387: while (e.hasMoreElements()) {
11388: ReportElement repele = (ReportElement) e.nextElement();
11389: if (repele instanceof TextReportElement) {
11390: TextReportElement element = (TextReportElement) repele;
11391: setElementValue(element, method, value, clazz);
11392: element.setFont(null);
11393: if (IReportFont.adjustPdfFontName(element)) {
11394: adjusted = true;
11395: }
11396: }
11397: }
11398:
11399: ReportElementChangedEvent changedEvent = new ReportElementChangedEvent(
11400: jrf,
11401: (jrf.getSelectedCrosstabEditorPanel() != null) ? jrf
11402: .getSelectedCrosstabEditorPanel()
11403: .getCrosstabElement() : null,
11404: getActiveElementSelection(jrf),
11405: ReportElementChangedEvent.CHANGED);
11406: //changedEvent.setEventSource( this );
11407: //changedEvent.setPropertyChanged( "fontSize" );
11408: //changedEvent.setNewValue(value);
11409: jrf.fireReportListenerReportElementsChanged(changedEvent);
11410: this .getElementPropertiesDialog().updateSelection();
11411:
11412: CrosstabEditorPanel pa = getActiveReportFrame()
11413: .getSelectedCrosstabEditorPanel();
11414: if (pa == null)
11415: jrf.getJPanelReport().repaint();
11416: else
11417: pa.repaint();
11418: }
11419:
11420: //TODO */
11421: ////////////////////////////////////////
11422: /*
11423: *
11424: The methods below which are being used for pref settings need to be moved
11425: to another location. This is just a quick fix sort of thing.
11426: wade
11427: */
11428: ///////////////////////////////////////
11429: /**
11430: *Used to set the application preference/option/property UseMultiLineExpressions
11431: *@pram useMultiLineExpressions whether to use or not to use them.
11432: */
11433: public void setUsingMultiLineExpressions(
11434: boolean useMultiLineExpressions) {
11435:
11436: String boolVal = "" + false; //""+useMultiLineExpressions;
11437:
11438: this .properties.setProperty("usingMultiLineExpressions",
11439: boolVal);
11440: }//end setUseMultiLineExpressions
11441:
11442: /**
11443: *Used to tell whether or not to be using multi line expressions.
11444: *@return whether multiline expressions are being used or not.
11445: */
11446: public boolean isUsingMultiLineExpressions() {
11447: boolean ret = false;
11448: /*
11449: String prop = this.properties.getProperty("usingMultiLineExpressions");
11450: if(prop != null) {
11451: ret = prop.trim().equalsIgnoreCase("true");
11452: }
11453: else {
11454: ret = false;
11455: }
11456: */
11457: return ret;
11458: }//end isUsingMultiLineExpressions
11459:
11460: /**
11461: *Method used to tell compiler to use the directory the file being compiled in
11462: *for the compile directory. This is for simplicity of development.
11463: *@param useCurrentFilesDirectoryForCompiles speaks for itself
11464: */
11465: public void setUsingCurrentFilesDirectoryForCompiles(
11466: boolean usingCurrentFilesDirectoryForCompiles) {
11467: this .properties.setProperty(
11468: "useCurrentFilesDirectoryForCompiles", ""
11469: + usingCurrentFilesDirectoryForCompiles);
11470: }
11471:
11472: /**
11473: *Used to tell if the compiler should use the current files directory for the compile.
11474: *@return whether or not to use the current files directory for the compile.
11475: */
11476: public boolean isUsingCurrentFilesDirectoryForCompiles() {
11477: boolean ret = false;
11478: ret = this .properties.getProperty(
11479: "useCurrentFilesDirectoryForCompiles", "false").trim()
11480: .equalsIgnoreCase("true");
11481: return ret;
11482: }
11483:
11484: /**
11485: *Used to set the default compilation directory
11486: *@param defaultCompilationDirectory
11487: */
11488: public void setDefaultCompilationDirectory(
11489: String defaultCompilationDirectory) {
11490: IREPORT_TMP_DIR = defaultCompilationDirectory;
11491: }
11492:
11493: /**
11494: *Method used to get the default compilation directory
11495: *@return the default compilation directory for ireport
11496: */
11497: public String getDefaultCompilationDirectory() {
11498:
11499: if (IREPORT_TMP_DIR != null)
11500: return IREPORT_TMP_DIR;
11501: return IREPORT_HOME_DIR;
11502: /*
11503: String ret = this.properties.getProperty("ireport.temp", IREPORT_TMP_DIR);
11504: if( ret.trim().length() > 0 ) {
11505:
11506: }
11507: else {
11508: ret = IREPORT_TMP_DIR;
11509: }
11510: return ret;
11511: */
11512:
11513: }
11514:
11515: /**
11516: *Method used to translate properties that dictate where the compilation directory
11517: *should be so that the correct directory can be obtained and used.
11518: *@return the compilation directory to use for the reports.
11519: */
11520: public String getTranslatedCompileDirectory() {
11521: String ret = null;
11522: if (this .isUsingCurrentFilesDirectoryForCompiles()) {
11523: javax.swing.JInternalFrame f = this .jMDIDesktopPane
11524: .getSelectedFrame();
11525: if (f != null && f instanceof JReportFrame) {
11526: JReportFrame rf = (JReportFrame) f;
11527: String fileName = rf.getReport().getFilename();
11528: if (fileName != null) {
11529: java.io.File rfile = new java.io.File(fileName);
11530: ret = rfile.getParent();
11531: } else {
11532: ret = this .getDefaultCompilationDirectory();
11533: }
11534:
11535: } else {
11536: ret = this .getDefaultCompilationDirectory();
11537: }
11538: } else {
11539: ret = this .getDefaultCompilationDirectory();
11540: }
11541: return ret;
11542: }
11543:
11544: /**
11545: *Used to hold the viewer setting.
11546: *@param reportViewer the viewer to use
11547: */
11548: public void setReportViewer(int reportViewer) {
11549: switch (reportViewer) {
11550: case IREPORT_JAVA_VIEWER:
11551: this .jRadioButtonMenuItemPreviewJAVA.setSelected(true);
11552: break;
11553: case IREPORT_PDF_VIEWER:
11554: this .jRadioButtonMenuItemPreviewPDF.setSelected(true);
11555: break;
11556: case IREPORT_HTML_VIEWER:
11557: this .jRadioButtonMenuItemPreviewHTML.setSelected(true);
11558: break;
11559: case IREPORT_XLS_VIEWER:
11560: this .jRadioButtonMenuItemPreviewXLS.setSelected(true);
11561: break;
11562: case IREPORT_XLS2_VIEWER:
11563: this .jRadioButtonMenuItemPreviewXLS2.setSelected(true);
11564: break;
11565: case IREPORT_CSV_VIEWER:
11566: this .jRadioButtonMenuItemPreviewCSV.setSelected(true);
11567: break;
11568: case IREPORT_TXT_VIEWER:
11569: this .jRadioButtonMenuItemPreviewTXT.setSelected(true);
11570: break;
11571: case IREPORT_TXT_JR_VIEWER:
11572: this .jRadioButtonMenuItemPreviewTXTJR.setSelected(true);
11573: break;
11574: case IREPORT_RTF_VIEWER:
11575: this .jRadioButtonMenuItemPreviewRTF.setSelected(true);
11576: break;
11577: case IREPORT_ODF_VIEWER:
11578: this .jRadioButtonMenuItemPreviewODF.setSelected(true);
11579: break;
11580: case IREPORT_FLASH_VIEWER:
11581: this .jRadioButtonMenuItemPreviewFLASH.setSelected(true);
11582: break;
11583:
11584: case IREPORT_JASPER_VIEWER:
11585: default:
11586: reportViewer = IREPORT_JASPER_VIEWER;
11587: this .jRadioButtonMenuItemPreviewInternalViewer
11588: .setSelected(true);
11589: break;
11590: }//end switch report viewer
11591: this .properties.setProperty("DefaultReportViewer", ""
11592: + reportViewer);
11593:
11594: }//end setReportViewer
11595:
11596: /**
11597: *Used to get which viewer is in use
11598: *@returns the in representing the viewer in use.
11599: */
11600: public int getReportViewer() {
11601: int ret = IREPORT_JASPER_VIEWER;
11602: try {
11603: ret = Integer.parseInt(this .properties.getProperty(
11604: "DefaultReportViewer", "" + IREPORT_JASPER_VIEWER));
11605: } catch (Throwable e) {
11606: //hmm, don't guess we care...we'll correct it internally.
11607: }
11608: switch (ret) {
11609: case IREPORT_JAVA_VIEWER:
11610: break;
11611: case IREPORT_PDF_VIEWER:
11612: break;
11613: case IREPORT_HTML_VIEWER:
11614: break;
11615: case IREPORT_XLS_VIEWER:
11616: break;
11617: case IREPORT_XLS2_VIEWER:
11618: break;
11619: case IREPORT_CSV_VIEWER:
11620: break;
11621: case IREPORT_TXT_VIEWER:
11622: break;
11623: case IREPORT_TXT_JR_VIEWER:
11624: break;
11625: case IREPORT_RTF_VIEWER:
11626: break;
11627: case IREPORT_ODF_VIEWER:
11628: break;
11629: case IREPORT_FLASH_VIEWER:
11630: break;
11631: case IREPORT_JASPER_VIEWER:
11632: default:
11633: ret = IREPORT_JASPER_VIEWER;
11634: break;
11635: }//end switch report viewer
11636: return ret;
11637: }//end getReportViewer
11638:
11639: public void setEmbeddedIreport(boolean status) {
11640: this .embeddedIreport = status;
11641: }//end setEmbeddedIreport
11642:
11643: public boolean isEmbedded() {
11644: return this .embeddedIreport;
11645: }//end isEmbedded
11646:
11647: private static Locale lastLocale = null;
11648:
11649: public void applyI18n() {
11650:
11651: if (lastLocale != null && lastLocale == I18n.getCurrentLocale())
11652: return;
11653: lastLocale = I18n.getCurrentLocale();
11654:
11655: try {
11656:
11657: // Start autogenerated code ----------------------
11658: jCheckBoxMenuItemDocumentStructure.setText(I18n.getString(
11659: "mainFrame.checkBoxMenuItemDocumentStructure",
11660: "Document structure"));
11661: jCheckBoxMenuItemElementProperties.setText(I18n.getString(
11662: "mainFrame.checkBoxMenuItemElementProperties",
11663: "Element properties"));
11664: jCheckBoxMenuItemExplorer.setText(I18n.getString(
11665: "mainFrame.checkBoxMenuItemExplorer", "Files"));
11666: jCheckBoxMenuItemLibrary.setText(I18n.getString(
11667: "mainFrame.checkBoxMenuItemLibrary", "Library"));
11668: jCheckBoxMenuItemStylesLibrary.setText(I18n.getString(
11669: "mainFrame.checkBoxMenuItemStylesLibrary",
11670: "Styles Library"));
11671: jCheckBoxMenuItemThreadList.setText(I18n.getString(
11672: "mainFrame.checkBoxMenuItemThreadList",
11673: "Threads list"));
11674: // End autogenerated code ----------------------
11675: // Start autogenerated code ----------------------
11676: jMenuItemInsertPageBreak.setText(I18n.getString(
11677: "mainFrame.menuItemInsertPageBreak",
11678: "Insert page/column break"));
11679: jMenuItemChart.setText(I18n.getString(
11680: "mainFrame.menuItemChart", "Chart"));
11681: jMenuItemForum.setText(I18n.getString(
11682: "mainFrame.menuItemForum", "Forum..."));
11683:
11684: String homePage = I18n.getString(
11685: "mainFrame.menuItemHomePage", "iReport home page");
11686: homePage = Misc.string_replace(getBrandingProperties()
11687: .getProperty("ireport.name"), "iReport", homePage);
11688:
11689: jMenuItemHomePage.setText(homePage);
11690: jMenuItemLeftMargin.setText(I18n.getString(
11691: "mainFrame.menuItemLeftMargin",
11692: "Join left page margin"));
11693:
11694: jMenuItemQueryExecuters.setText(I18n.getString(
11695: "mainFrame.menuItemQueryExecuters",
11696: "Query executers"));
11697: jMenuItemReloadFonts.setText(I18n.getString(
11698: "mainFrame.menuItemReloadFonts", "Reload fonts"));
11699: jMenuItemRightMargin.setText(I18n.getString(
11700: "mainFrame.menuItemRightMargin",
11701: "Join right page margin"));
11702: jMenuItemSubDataset.setText(I18n.getString(
11703: "mainFrame.menuItemSubDataset", "Subdatasets"));
11704: jMenuItemSubDataset1.setText(I18n.getString(
11705: "mainFrame.menuItemSubDataset1", "Subdatasets"));
11706: jMenuPanels.setText(I18n.getString("mainFrame.menuPanels",
11707: "Docking panes"));
11708:
11709: jMenuItemCreateFromTemplate.setText(I18n.getString(
11710: "mainFrame.menuItemCreateFromTemplate",
11711: "Create from template"));
11712: // End autogenerated code ----------------------
11713:
11714: //added by Felix Firgau on Feb 06th 2006
11715: jButtonNew
11716: .setToolTipText(it.businesslogic.ireport.util.I18n
11717: .getString("newDocument", "New document"));
11718: jButtonOpen
11719: .setToolTipText(it.businesslogic.ireport.util.I18n
11720: .getString("open", "Open"));
11721: jButtonSave
11722: .setToolTipText(it.businesslogic.ireport.util.I18n
11723: .getString("save", "Save"));
11724: jButtonCut
11725: .setToolTipText(it.businesslogic.ireport.util.I18n
11726: .getString("cut", "Cut"));
11727: jButtonCopy
11728: .setToolTipText(it.businesslogic.ireport.util.I18n
11729: .getString("copy", "Copy"));
11730: jButtonPaste
11731: .setToolTipText(it.businesslogic.ireport.util.I18n
11732: .getString("paste", "Paste"));
11733: jToggleButtonLineTool
11734: .setToolTipText(it.businesslogic.ireport.util.I18n
11735: .getString("line", "Line"));
11736: jToggleButtonRectTool
11737: .setToolTipText(it.businesslogic.ireport.util.I18n
11738: .getString("rectangle", "Rectangle"));
11739: //jToggleButtonRectRoundTool.setToolTipText(it.businesslogic.ireport.util.I18n.getString("roundedRectangle", "Rounded rectangle"));
11740: jToggleButtonEllipseTool
11741: .setToolTipText(it.businesslogic.ireport.util.I18n
11742: .getString("ellipse", "Ellipse"));
11743: jToggleButtonImageTool
11744: .setToolTipText(it.businesslogic.ireport.util.I18n
11745: .getString("image", "Image"));
11746: jToggleButtonStaticTextTool
11747: .setToolTipText(it.businesslogic.ireport.util.I18n
11748: .getString("staticText", "Static text"));
11749: jToggleButtonTextFieldTool
11750: .setToolTipText(it.businesslogic.ireport.util.I18n
11751: .getString("textField", "Textfield"));
11752: jToggleButtonFrameTool
11753: .setToolTipText(it.businesslogic.ireport.util.I18n
11754: .getString("frame", "Frame"));
11755: jToggleButtonSubreportTool
11756: .setToolTipText(it.businesslogic.ireport.util.I18n
11757: .getString("subreport", "Subreport"));
11758: jButtonBands
11759: .setToolTipText(it.businesslogic.ireport.util.I18n
11760: .getString("bands", "Bands"));
11761: jButtonGroups
11762: .setToolTipText(it.businesslogic.ireport.util.I18n
11763: .getString("reportGroups", "Report groups"));
11764: jButtonParameters
11765: .setToolTipText(it.businesslogic.ireport.util.I18n
11766: .getString("parameters",
11767: "Report fields, variables and parameters"));
11768: jButtonDatabase
11769: .setToolTipText(it.businesslogic.ireport.util.I18n
11770: .getString("database", "Database"));
11771: jButtonCompiler
11772: .setToolTipText(it.businesslogic.ireport.util.I18n
11773: .getString("compile", "Compile"));
11774: jButtonRun1
11775: .setToolTipText(it.businesslogic.ireport.util.I18n
11776: .getString("executeReport",
11777: "Execute report"));
11778: jButtonRun2
11779: .setToolTipText(it.businesslogic.ireport.util.I18n
11780: .getString(
11781: "executeReportUsingActiveConnection",
11782: "Execute report using active connection"));
11783: jToggleButtonChartTool
11784: .setToolTipText(it.businesslogic.ireport.util.I18n
11785: .getString("chartTool", "Chart tool"));
11786: jToggleButtonBarcodeTool
11787: .setToolTipText(it.businesslogic.ireport.util.I18n
11788: .getString("barcodeTool", "Barcode tool"));
11789: jToggleButtonCrosstabTool
11790: .setToolTipText(it.businesslogic.ireport.util.I18n
11791: .getString("crossTab", "Crosstab"));
11792: jButtonLens1
11793: .setToolTipText(it.businesslogic.ireport.util.I18n
11794: .getString("increase", "Increase"));
11795: jButtonLens2
11796: .setToolTipText(it.businesslogic.ireport.util.I18n
11797: .getString("decrease", "Decrease"));
11798: jComboBoxFont
11799: .setToolTipText(it.businesslogic.ireport.util.I18n
11800: .getString("font", "Font"));
11801: jNumberComboBoxSize
11802: .setToolTipText(it.businesslogic.ireport.util.I18n
11803: .getString("fontSize", "Fontsize"));
11804: jButtonIncreaseSize
11805: .setToolTipText(it.businesslogic.ireport.util.I18n
11806: .getString("fontSizeInc",
11807: "Increase fonzsize"));
11808: jButtonDecreaseSize
11809: .setToolTipText(it.businesslogic.ireport.util.I18n
11810: .getString("fontSizeDec",
11811: "Decrease fonzsize"));
11812: jButtonBold
11813: .setToolTipText(it.businesslogic.ireport.util.I18n
11814: .getString("bold", "Bold"));
11815: jButtonItalic
11816: .setToolTipText(it.businesslogic.ireport.util.I18n
11817: .getString("italic", "Italic"));
11818: jButtonUnderline
11819: .setToolTipText(it.businesslogic.ireport.util.I18n
11820: .getString("underlined", "Underlined"));
11821: jButtonStrikethrought
11822: .setToolTipText(it.businesslogic.ireport.util.I18n
11823: .getString("striked", "Striked"));
11824: jButtonAlignLeft
11825: .setToolTipText(it.businesslogic.ireport.util.I18n
11826: .getString("alignLeft", "Align left"));
11827: jButtonAlignRight
11828: .setToolTipText(it.businesslogic.ireport.util.I18n
11829: .getString("alignRight", "Align right"));
11830: jButtonAlignJustify
11831: .setToolTipText(it.businesslogic.ireport.util.I18n
11832: .getString("alignJustify", "Align justify"));
11833: jButtonAlignCenter
11834: .setToolTipText(it.businesslogic.ireport.util.I18n
11835: .getString("alignCenter", "Align center"));
11836: jButtonAlignTop
11837: .setToolTipText(it.businesslogic.ireport.util.I18n
11838: .getString("alignTop", "Align top"));
11839: jButtonAlignMiddle
11840: .setToolTipText(it.businesslogic.ireport.util.I18n
11841: .getString("alignVerticalAxis",
11842: "Align on vertical axis"));
11843: jButtonAlignBottom
11844: .setToolTipText(it.businesslogic.ireport.util.I18n
11845: .getString("alignBottom", "Align bottom"));
11846: jMenuItemPrint.setText(it.businesslogic.ireport.util.I18n
11847: .getString("printDesign", "Print design"));
11848: jMenuToolBars.setText(it.businesslogic.ireport.util.I18n
11849: .getString("toolBars", "Toolbars"));
11850: //Modification end of Felix Firgau on Feb 06th 2006
11851:
11852: //Added by Felix Firgau on Feb 07th 2006
11853: jCheckBoxMenuItemElementsFormatting
11854: .setText(it.businesslogic.ireport.util.I18n
11855: .getString("elementsFormating",
11856: "Elements formating"));
11857: jCheckBoxMenuItemTextFormatting
11858: .setText(it.businesslogic.ireport.util.I18n
11859: .getString("textFormating",
11860: "Text formating"));
11861: //Modification end of Felix Firgau on Feb 07th 2006
11862:
11863: //Added by Felix Firgau on Feb 8th 2006
11864: jMenuItemImage.setText(it.businesslogic.ireport.util.I18n
11865: .getString("image", "Image"));
11866: jMenuItemExportOptions
11867: .setText(it.businesslogic.ireport.util.I18n
11868: .getString("exportOptions",
11869: "Export options"));
11870: //End
11871:
11872: //Added by Felix Firgau on Feb 9th 2006
11873: jMenuItemOrganize
11874: .setText(it.businesslogic.ireport.util.I18n
11875: .getString("organizeAsTable",
11876: "Organize as table"));
11877: jMenuItemKill.setText(it.businesslogic.ireport.util.I18n
11878: .getString("killThread", "Kill thread"));
11879: //End
11880:
11881: //Added by Felix Firgau on Feb 14th 2006
11882: jMenuItemRightSide
11883: .setText(it.businesslogic.ireport.util.I18n
11884: .getString("showHideRightSide",
11885: "Show/hide right side"));
11886: jMenuItemStyles.setText(it.businesslogic.ireport.util.I18n
11887: .getString("styles", "Styles"));
11888: //End
11889:
11890: jMenuFile.setText(it.businesslogic.ireport.util.I18n
11891: .getString("file", "File"));
11892: jMenuItemNewDocument
11893: .setText(it.businesslogic.ireport.util.I18n
11894: .getString("newDocument", "New document"));
11895: jMenuItemWizard.setText(it.businesslogic.ireport.util.I18n
11896: .getString("reportWizard", "Report Wizard"));
11897: jMenuItemOpen.setText(it.businesslogic.ireport.util.I18n
11898: .getString("open", "Open"));
11899: //jMenuItemQOpen.setText(it.businesslogic.ireport.util.I18n.getString("quickOpen","Quick open"));
11900: jMenuItemClose.setText(it.businesslogic.ireport.util.I18n
11901: .getString("close", "Close"));
11902: jMenuItemCloseAll
11903: .setText(it.businesslogic.ireport.util.I18n
11904: .getString("closeAll", "Close all"));
11905: jMenuItemCloseAllExceptThis
11906: .setText(it.businesslogic.ireport.util.I18n
11907: .getString("closeAllExceptThis",
11908: "Close all except this"));
11909: jMenuItemRevertToSaved
11910: .setText(it.businesslogic.ireport.util.I18n
11911: .getString("revertToSaved",
11912: "Revert to saved"));
11913: jMenuItemCloseFromList
11914: .setText(it.businesslogic.ireport.util.I18n
11915: .getString("close", "Close"));
11916: jMenuItemCloseAllFromList
11917: .setText(it.businesslogic.ireport.util.I18n
11918: .getString("closeAll", "Close all"));
11919: jMenuItemCloseAllExceptThisFromList
11920: .setText(it.businesslogic.ireport.util.I18n
11921: .getString("closeAllExceptThis",
11922: "Close all except this"));
11923: jMenuItemRevertToSavedFromList
11924: .setText(it.businesslogic.ireport.util.I18n
11925: .getString("revertToSaved",
11926: "Revert to saved"));
11927: jMenuItemSaveFromList
11928: .setText(it.businesslogic.ireport.util.I18n
11929: .getString("save", "Save"));
11930: jMenuItemSaveAsFromList
11931: .setText(it.businesslogic.ireport.util.I18n
11932: .getString("saveAs", "Save as..."));
11933: jMenuItemSaveAllFromList
11934: .setText(it.businesslogic.ireport.util.I18n
11935: .getString("saveAll", "Save all"));
11936: jMenuItemSave.setText(it.businesslogic.ireport.util.I18n
11937: .getString("save", "Save"));
11938: jMenuItemSaveAs.setText(it.businesslogic.ireport.util.I18n
11939: .getString("saveAs", "Save as..."));
11940: jMenuItemSaveAll.setText(it.businesslogic.ireport.util.I18n
11941: .getString("saveAll", "Save all"));
11942: jMenuRecentFiles.setText(it.businesslogic.ireport.util.I18n
11943: .getString("recentFiles", "Recent files"));
11944: //jMenuRecentProjects.setText(it.businesslogic.ireport.util.I18n.getString("recentProjects","Recent projects"));
11945: //jMenuItemFavorites.setText(it.businesslogic.ireport.util.I18n.getString("favoriteFiles","Favorites files"));
11946: jMenuItemQuit.setText(it.businesslogic.ireport.util.I18n
11947: .getString("quit", "Quit"));
11948: jMenuEdit.setText(it.businesslogic.ireport.util.I18n
11949: .getString("edit", "Edit"));
11950: jMenuItemUndo.setText(it.businesslogic.ireport.util.I18n
11951: .getString("undo", "Undo"));
11952: jMenuItemRedo.setText(it.businesslogic.ireport.util.I18n
11953: .getString("redo", "Redo"));
11954: jMenuItemCut.setText(it.businesslogic.ireport.util.I18n
11955: .getString("cut", "Cut"));
11956: jMenuItemCopy.setText(it.businesslogic.ireport.util.I18n
11957: .getString("copy", "Copy"));
11958: jMenuItemPaste.setText(it.businesslogic.ireport.util.I18n
11959: .getString("paste", "Paste"));
11960: jMenuItemDelete.setText(it.businesslogic.ireport.util.I18n
11961: .getString("delete", "Delete"));
11962: jCheckBoxMenuItemEMM
11963: .setText(it.businesslogic.ireport.util.I18n
11964: .getString("disableElementsMouseMove",
11965: "Disable elements mouse move"));
11966: jCheckBoxMenuItemReportVirtualizer
11967: .setText(it.businesslogic.ireport.util.I18n
11968: .getString("useReportVirtualizer",
11969: "Use Report Virtualizer"));
11970: jCheckBoxMenuItemIgnorePagination
11971: .setText(it.businesslogic.ireport.util.I18n
11972: .getString("ignorePagination",
11973: "Ignore pagination"));
11974: jCheckBoxMenuItemSnapToGrid
11975: .setText(it.businesslogic.ireport.util.I18n
11976: .getString("snapToGrid", "Snap to grid"));
11977: jMenuAdd.setText(it.businesslogic.ireport.util.I18n
11978: .getString("insertElement", "Insert element"));
11979: jMenuItemLine.setText(it.businesslogic.ireport.util.I18n
11980: .getString("line", "Line"));
11981: jMenuItemRectangle
11982: .setText(it.businesslogic.ireport.util.I18n
11983: .getString("rectangle", "Rectangle"));
11984: jMenuItemRoundRectangle
11985: .setText(it.businesslogic.ireport.util.I18n
11986: .getString("roundedRectangle",
11987: "Rounded rectangle"));
11988: jMenuItemEllipse.setText(it.businesslogic.ireport.util.I18n
11989: .getString("ellipse", "Ellipse"));
11990: jMenuItemStaticText
11991: .setText(it.businesslogic.ireport.util.I18n
11992: .getString("staticText", "Static text"));
11993: jMenuItemTextField
11994: .setText(it.businesslogic.ireport.util.I18n
11995: .getString("textField", "Textfield"));
11996: jMenuItemSubreport
11997: .setText(it.businesslogic.ireport.util.I18n
11998: .getString("subreport", "Subreport"));
11999: jMenuItemXMLSource
12000: .setText(it.businesslogic.ireport.util.I18n
12001: .getString("editXmlSource",
12002: "Edit XML source"));
12003: jMenuView.setText(it.businesslogic.ireport.util.I18n
12004: .getString("view", "View"));
12005: jCheckBoxMenuItemGrid
12006: .setText(it.businesslogic.ireport.util.I18n
12007: .getString("showGrid", "Show grid"));
12008: jCheckBoxMenuItemOutput
12009: .setText(it.businesslogic.ireport.util.I18n
12010: .getString("showOutputWindow",
12011: "Show output window"));
12012: //jCheckBoxMenuItemExplorer.setText(it.businesslogic.ireport.util.I18n.getString("showProjectBrowser","Show project browser"));
12013: jMenuItemReportProperties
12014: .setText(it.businesslogic.ireport.util.I18n
12015: .getString("reportProperties",
12016: "Report properties"));
12017: jMenuItemProperties
12018: .setText(it.businesslogic.ireport.util.I18n
12019: .getString("customProperties",
12020: "Custom properties"));
12021: jMenuItemReportQuery
12022: .setText(it.businesslogic.ireport.util.I18n
12023: .getString("reportQuery", "Report query"));
12024: jMenuItemFields.setText(it.businesslogic.ireport.util.I18n
12025: .getString("reportFields", "Report fields"));
12026: jMenuItemVariables
12027: .setText(it.businesslogic.ireport.util.I18n
12028: .getString("reportVariables",
12029: "Report variables"));
12030: jMenuItemParameters
12031: .setText(it.businesslogic.ireport.util.I18n
12032: .getString("reportParameters",
12033: "Report parameters"));
12034: jMenuItemFonts.setText(it.businesslogic.ireport.util.I18n
12035: .getString("reportFonts", "Report fonts"));
12036: jMenuItemBands.setText(it.businesslogic.ireport.util.I18n
12037: .getString("bands", "Bands"));
12038: jMenuItemGroups.setText(it.businesslogic.ireport.util.I18n
12039: .getString("reportGroups", "Report groups"));
12040: jMenuItemElementProperties
12041: .setText(it.businesslogic.ireport.util.I18n
12042: .getString("elementProperties",
12043: "Element properties"));
12044: //jMenuItemElementsBrowser.setText(it.businesslogic.ireport.util.I18n.getString("elementsBrowser","Elements browser"));
12045: jMenuItemScriptletEditor
12046: .setText(it.businesslogic.ireport.util.I18n
12047: .getString("scriptletEditor",
12048: "Scriptlet editor"));
12049: //jMenuItemReportSeries.setText(it.businesslogic.ireport.util.I18n.getString("reportSeries","Report series"));
12050: jMenuItemReportImports
12051: .setText(it.businesslogic.ireport.util.I18n
12052: .getString("reportImports",
12053: "Report imports"));
12054: //jMenuSearch.setText(it.businesslogic.ireport.util.I18n.getString("search","Search"));
12055: //jMenuItemFindNext.setText(it.businesslogic.ireport.util.I18n.getString("findNext","Find next"));
12056: //jMenuItemFindPrev.setText(it.businesslogic.ireport.util.I18n.getString("findPrevious","Find Prev"));
12057: //jMenuItemReplace.setText(it.businesslogic.ireport.util.I18n.getString("replace","Replace"));
12058: //jMenuProjects.setText(it.businesslogic.ireport.util.I18n.getString("project","Project"));
12059: //jMenuItemNewProject.setText(it.businesslogic.ireport.util.I18n.getString("newProject","New project"));
12060: //jMenuItemOpenProject.setText(it.businesslogic.ireport.util.I18n.getString("openProject","Open project"));
12061: //jMenuItemCloseProject.setText(it.businesslogic.ireport.util.I18n.getString("closeProject","Close project"));
12062: //jMenuItemAddFileToProject.setText(it.businesslogic.ireport.util.I18n.getString("addReportToProject","Add report to project..."));
12063: //jMenuItemProjectOptions.setText(it.businesslogic.ireport.util.I18n.getString("projectOptions","Project options..."));
12064: jMenuBuild.setText(it.businesslogic.ireport.util.I18n
12065: .getString("build", "Build"));
12066: jMenuItemCompile.setText(it.businesslogic.ireport.util.I18n
12067: .getString("compile", "Compile"));
12068: //jMenuItemCompileAll.setText(it.businesslogic.ireport.util.I18n.getString("compileAll","Compile All"));
12069: jMenuItemExecute.setText(it.businesslogic.ireport.util.I18n
12070: .getString("executeReport", "Execute report"));
12071: jMenuItemExecuteDB
12072: .setText(it.businesslogic.ireport.util.I18n
12073: .getString(
12074: "executeReportUsingActiveConnection",
12075: "Execute report (using active conn.) "));
12076: jRadioButtonMenuItemPreviewPDF
12077: .setText(it.businesslogic.ireport.util.I18n
12078: .getString("pdfPreview", "PDF preview"));
12079: jRadioButtonMenuItemPreviewHTML
12080: .setText(it.businesslogic.ireport.util.I18n
12081: .getString("htmlPreview", "HTML preview"));
12082: jRadioButtonMenuItemPreviewJAVA
12083: .setText(it.businesslogic.ireport.util.I18n
12084: .getString("java2DPreview",
12085: "JAVA 2D preview"));
12086: jRadioButtonMenuItemPreviewXLS
12087: .setText(it.businesslogic.ireport.util.I18n
12088: .getString("excelPreview", "Excel preview"));
12089: jRadioButtonMenuItemPreviewXLS2
12090: .setText(it.businesslogic.ireport.util.I18n
12091: .getString("excelPreview2",
12092: "Excel preview (using JExcelApi)"));
12093: jRadioButtonMenuItemPreviewCSV
12094: .setText(it.businesslogic.ireport.util.I18n
12095: .getString("csvPreview", "CSV preview"));
12096: jRadioButtonMenuItemPreviewTXTJR
12097: .setText(it.businesslogic.ireport.util.I18n
12098: .getString("txtPreview",
12099: "Text preview (JasperReports)"));
12100: jRadioButtonMenuItemPreviewRTF
12101: .setText(it.businesslogic.ireport.util.I18n
12102: .getString("rtfPreview", "RTF preview"));
12103: jRadioButtonMenuItemPreviewODF
12104: .setText(it.businesslogic.ireport.util.I18n
12105: .getString("odfPreview",
12106: "OpenOffice (ODF) preview"));
12107: jRadioButtonMenuItemPreviewTXT
12108: .setText(it.businesslogic.ireport.util.I18n
12109: .getString("textPreview",
12110: "Text preview (Experimental)"));
12111: jRadioButtonMenuItemPreviewInternalViewer
12112: .setText(it.businesslogic.ireport.util.I18n
12113: .getString("jrViewerPreview",
12114: "JRViewer preview"));
12115: jMenuItemActiveConnection
12116: .setText(it.businesslogic.ireport.util.I18n
12117: .getString("setActiveConnection",
12118: "Set active connection"));
12119: jMenuItemActiveConnection1
12120: .setText(it.businesslogic.ireport.util.I18n
12121: .getString("setActiveConnection",
12122: "Set active connection"));
12123: updateJMenuItemReportLocaleText();
12124: updateJMenuItemReportMaxRecords();
12125: updateJMenuItemReportTimeZone();
12126: jMenuItemActiveConnection
12127: .setToolTipText(it.businesslogic.ireport.util.I18n
12128: .getString("setTheConnection",
12129: "Set the connection that must be used to fill this report"));
12130: jMenuFormat.setText(it.businesslogic.ireport.util.I18n
12131: .getString("format", "Format"));
12132: jMenuAlign.setText(it.businesslogic.ireport.util.I18n
12133: .getString("align", "Align..."));
12134: jMenuItemAlignLeft
12135: .setText(it.businesslogic.ireport.util.I18n
12136: .getString("alignLeft", "Align left"));
12137: jMenuItemAlignRight
12138: .setText(it.businesslogic.ireport.util.I18n
12139: .getString("alignRight", "Align right"));
12140: jMenuItemAlignTop
12141: .setText(it.businesslogic.ireport.util.I18n
12142: .getString("alignTop", "Align top"));
12143: jMenuItemAlignBottom
12144: .setText(it.businesslogic.ireport.util.I18n
12145: .getString("alignBottom", "Align bottom"));
12146: jMenuItemAlignVerticalAxis
12147: .setText(it.businesslogic.ireport.util.I18n
12148: .getString("alignVerticalAxis",
12149: "Align vertical axis"));
12150: jMenuItemAlignHorizontalAxis
12151: .setText(it.businesslogic.ireport.util.I18n
12152: .getString("alignHorizontalAxis",
12153: "Align horizontal axis"));
12154: jMenuItemAlignToBandTop
12155: .setText(it.businesslogic.ireport.util.I18n
12156: .getString("alignToBandTop",
12157: "Align to band top"));
12158: jMenuItemAlignToBandBottom
12159: .setText(it.businesslogic.ireport.util.I18n
12160: .getString("alignToBandBottom",
12161: "Align to band bottom"));
12162: jMenuSize.setText(it.businesslogic.ireport.util.I18n
12163: .getString("size", "Size..."));
12164: jMenuItemSameWidth
12165: .setText(it.businesslogic.ireport.util.I18n
12166: .getString("sameWidth", "Same width"));
12167: jMenuItemSameWidthMax
12168: .setText(it.businesslogic.ireport.util.I18n
12169: .getString("sameWidthMax",
12170: "Same width (max)"));
12171: jMenuItemSameWidthMin
12172: .setText(it.businesslogic.ireport.util.I18n
12173: .getString("sameWidthMin",
12174: "Same width (min)"));
12175: jMenuItemSameHeight
12176: .setText(it.businesslogic.ireport.util.I18n
12177: .getString("sameHeight", "Same height"));
12178: jMenuItemSameHeightMin
12179: .setText(it.businesslogic.ireport.util.I18n
12180: .getString("sameHeightMin",
12181: "Same height (min)"));
12182: jMenuItemSameHeightMax
12183: .setText(it.businesslogic.ireport.util.I18n
12184: .getString("sameHeightMax",
12185: "Same height (max)"));
12186: jMenuItemSameSize
12187: .setText(it.businesslogic.ireport.util.I18n
12188: .getString("sameSize", "Same size"));
12189: jMenuPosition.setText(it.businesslogic.ireport.util.I18n
12190: .getString("position", "Position..."));
12191: jMenuItemCenterH.setText(it.businesslogic.ireport.util.I18n
12192: .getString("centerHorizontallyBandBased",
12193: "Center horizontally (band/cell based)"));
12194: jMenuItemCenterV.setText(it.businesslogic.ireport.util.I18n
12195: .getString("centerVerticallyBandBased",
12196: "Center vertically (band/cell based)"));
12197: jMenuItemCenterInBand
12198: .setText(it.businesslogic.ireport.util.I18n
12199: .getString("centerInBand",
12200: "Center in band/cell"));
12201: jMenuItemCenterBackground
12202: .setText(it.businesslogic.ireport.util.I18n
12203: .getString("centerInBackground",
12204: "Center in background"));
12205: jMenuItemJoinLeft
12206: .setText(it.businesslogic.ireport.util.I18n
12207: .getString("joinSidesLeft",
12208: "Join sides left"));
12209: jMenuItemJoinRight
12210: .setText(it.businesslogic.ireport.util.I18n
12211: .getString("joinSidesRight",
12212: "Join sides right"));
12213: jMenuHSpacing.setText(it.businesslogic.ireport.util.I18n
12214: .getString("horizontalSpacing",
12215: "Horizontal spacing..."));
12216: jMenuItemHSMakeEqual
12217: .setText(it.businesslogic.ireport.util.I18n
12218: .getString("makeEqual", "Make equal"));
12219: jMenuItemHSIncrease
12220: .setText(it.businesslogic.ireport.util.I18n
12221: .getString("increase", "Increase"));
12222: jMenuItemHSDecrease
12223: .setText(it.businesslogic.ireport.util.I18n
12224: .getString("decrease", "Decrease"));
12225: jMenuItemHSRemove
12226: .setText(it.businesslogic.ireport.util.I18n
12227: .getString("remove", "Remove"));
12228: jMenuVSpacing.setText(it.businesslogic.ireport.util.I18n
12229: .getString("verticalSpacing", "Vertical spacing"));
12230: jMenuItemVSMakeEqual
12231: .setText(it.businesslogic.ireport.util.I18n
12232: .getString("makeEqual", "Make equal"));
12233: jMenuItemVSIncrease
12234: .setText(it.businesslogic.ireport.util.I18n
12235: .getString("increase", "Increase"));
12236: jMenuItemVSDecrease
12237: .setText(it.businesslogic.ireport.util.I18n
12238: .getString("decrease", "Decrease"));
12239: jMenuItemVSRemove
12240: .setText(it.businesslogic.ireport.util.I18n
12241: .getString("remove", "Remove"));
12242: jMenuItemBringToFront
12243: .setText(it.businesslogic.ireport.util.I18n
12244: .getString("bringToFront", "Bring to front"));
12245: jMenuItemSendToBack
12246: .setText(it.businesslogic.ireport.util.I18n
12247: .getString("sendToBack", "Send to back"));
12248: jMenuDatabase.setText(it.businesslogic.ireport.util.I18n
12249: .getString("datasourceMenu", "Data"));
12250: jMenuItemConnections
12251: .setText(it.businesslogic.ireport.util.I18n
12252: .getString("connectionsDatasources",
12253: "Connections / Datasources"));
12254: jMenuItemReportQuery2
12255: .setText(it.businesslogic.ireport.util.I18n
12256: .getString("reportQuery", "Report query"));
12257: jMenuTools.setText(it.businesslogic.ireport.util.I18n
12258: .getString("optionsMenu", "Options"));
12259: jMenuItemOptions.setText(it.businesslogic.ireport.util.I18n
12260: .getString("options", "Settings..."));
12261: jMenuItemCompatibility
12262: .setText(it.businesslogic.ireport.util.I18n
12263: .getString("compatibility",
12264: "Compatibility..."));
12265: jMenuWindow.setText(it.businesslogic.ireport.util.I18n
12266: .getString("window", "Window"));
12267: jMenuItemCascade.setText(it.businesslogic.ireport.util.I18n
12268: .getString("cascade", "Cascade"));
12269: jMenuItemTileHorizontal
12270: .setText(it.businesslogic.ireport.util.I18n
12271: .getString("tileHorizontal",
12272: "Tile horizontal"));
12273: jMenuItemTileVertical
12274: .setText(it.businesslogic.ireport.util.I18n
12275: .getString("tileVertical", "Tile vertical"));
12276: jMenuItemtileAnodine
12277: .setText(it.businesslogic.ireport.util.I18n
12278: .getString("tileAnodine", "Tile anodine"));
12279: jMenuItemNextWin.setText(it.businesslogic.ireport.util.I18n
12280: .getString("nextWindow", "Next Window"));
12281: jMenuItemPrevWin.setText(it.businesslogic.ireport.util.I18n
12282: .getString("previousWindow", "Previous Window"));
12283: jMenuHelp.setText(it.businesslogic.ireport.util.I18n
12284: .getString("help", "Help"));
12285: jMenuItemHelp.setText(it.businesslogic.ireport.util.I18n
12286: .getString("help", "Help"));
12287:
12288: String aboutMenuItemText = I18n.getString("aboutiReport",
12289: "About iReport...");
12290: aboutMenuItemText = Misc
12291: .string_replace(getBrandingProperties()
12292: .getProperty("ireport.name"), "iReport",
12293: aboutMenuItemText);
12294:
12295: jMenuItemAbout.setText(aboutMenuItemText);
12296:
12297: //jMenuItemFind.setText(it.businesslogic.ireport.util.I18n.getString("find", "Find..."));
12298: jMenuItemPluginConfig
12299: .setText(it.businesslogic.ireport.util.I18n
12300: .getString("configurePlugins",
12301: "Configure plugins"));
12302: jMenuPlugins.setText(it.businesslogic.ireport.util.I18n
12303: .getString("plugins", "Plugins"));
12304: jMenuInternationalization
12305: .setText(it.businesslogic.ireport.util.I18n
12306: .getString("internationalization",
12307: "Internationalization"));
12308: //jMenuInternationalizationWizard.setText(it.businesslogic.ireport.util.I18n.getString("internationalizationWizard", "Internationalization Wizard"));
12309: jMenuLocaleFiles.setText(it.businesslogic.ireport.util.I18n
12310: .getString("internationalizationFiles",
12311: "Locale files"));
12312: jMenuItemRemoveMargins
12313: .setText(it.businesslogic.ireport.util.I18n
12314: .getString("removeMargins",
12315: "Remove margins"));
12316: jMenuItemClasspath
12317: .setText(it.businesslogic.ireport.util.I18n
12318: .getString("classPath", "Classpath"));
12319: jMenuItemAddGroup
12320: .setText(it.businesslogic.ireport.util.I18n
12321: .getString("newReportGroupWizard",
12322: "New report group wizard"));
12323: jMenuItemFontspath
12324: .setText(it.businesslogic.ireport.util.I18n
12325: .getString("pathToFonts", "Fonts path"));
12326: jMenuItemExpressions
12327: .setText(it.businesslogic.ireport.util.I18n
12328: .getString("Formulas", "Formulas"));
12329: jMenuItemPluginConfig
12330: .setText(it.businesslogic.ireport.util.I18n
12331: .getString("configurePlugins",
12332: "Configure plugins"));
12333:
12334: viewFiles.setTitle(it.businesslogic.ireport.util.I18n
12335: .getString("files", "Files"), true);
12336: viewDocumentStructure.setTitle(
12337: it.businesslogic.ireport.util.I18n.getString(
12338: "documentStructure", "Document structure"),
12339: true);
12340: viewPropertySheet.setTitle(
12341: it.businesslogic.ireport.util.I18n.getString(
12342: "properties", "Properties"), true);
12343: viewThreads.setTitle(it.businesslogic.ireport.util.I18n
12344: .getString("threads", "Threads"), true);
12345: viewLibrary.setTitle(it.businesslogic.ireport.util.I18n
12346: .getString("library", "Library"), true);
12347: logPaneView.setTitle(it.businesslogic.ireport.util.I18n
12348: .getString("output", "Output console"), true);
12349: stylesPanleView
12350: .setTitle(it.businesslogic.ireport.util.I18n
12351: .getString("stylesLibrary",
12352: "Styles Library"), true);
12353: crosstabMeasuresPanelView.setTitle(
12354: it.businesslogic.ireport.util.I18n.getString(
12355: "crosstabObjects", "Crosstab objects"),
12356: true);
12357: crosstabStructureView.setTitle(
12358: it.businesslogic.ireport.util.I18n.getString(
12359: "crosstabStructure", "Crosstab structure"),
12360: true);
12361:
12362: viewFiles.updateUI();
12363: viewDocumentStructure.updateUI();
12364: viewPropertySheet.updateUI();
12365: viewThreads.updateUI();
12366: viewLibrary.updateUI();
12367: logPaneView.updateUI();
12368: stylesPanleView.updateUI();
12369: crosstabMeasuresPanelView.updateUI();
12370: crosstabStructureView.updateUI();
12371:
12372: ((DefaultMutableTreeNode) this .jTreeFiles.getModel()
12373: .getRoot())
12374: .setUserObject(it.businesslogic.ireport.util.I18n
12375: .getString("openedFiles", "Opened files"));
12376:
12377: //if (libraryPanel != null && jTabbedPaneExplorer.indexOfComponent(libraryPanel) >= 0)
12378: // jTabbedPaneExplorer.setTitleAt(jTabbedPaneExplorer.indexOfComponent(libraryPanel), it.businesslogic.ireport.util.I18n.getString("gui.library", "Library"));
12379:
12380: } catch (Exception ex) {
12381:
12382: }
12383: }
12384:
12385: /** Getter for property eventsForm.
12386: * @return Value of property eventsForm.
12387: *
12388: */
12389: public it.businesslogic.ireport.gui.EventsForm getEventsForm() {
12390: return eventsForm;
12391: }
12392:
12393: /** Setter for property eventsForm.
12394: * @param eventsForm New value of property eventsForm.
12395: *
12396: */
12397: public void setEventsForm(
12398: it.businesslogic.ireport.gui.EventsForm eventsForm) {
12399: this .eventsForm = eventsForm;
12400: }
12401:
12402: public void loadPlugins(String plugins_dir) {
12403: // Adding default properties...
12404:
12405: ReportClassLoader rcl = this .getReportClassLoader();
12406: //rcl.rescanLibDirectory();
12407:
12408: java.util.Vector plugin_files_v = new java.util.Vector();
12409: File plugDir = null;
12410: try {
12411: plugDir = new File(plugins_dir);
12412: } catch (Exception ex) {
12413: }
12414: if (plugDir == null || !plugDir.exists() || plugDir.isFile()) {
12415: try {
12416:
12417: getLogPane()
12418: .getMainLogTextArea()
12419: .logOnConsole(
12420: I18n
12421: .getFormattedString(
12422: "messages.errorScanningPluginDir",
12423: "Error scanning iReport plugin directory: {0}\n",
12424: new Object[] { ""
12425: + plugins_dir }),
12426: JOptionPane.ERROR_MESSAGE);
12427:
12428: } catch (Exception exsx) {
12429: }
12430:
12431: } else {
12432:
12433: // Loading all xml files....
12434:
12435: File plugins_files[] = plugDir.listFiles();
12436:
12437: for (int i = 0; i < plugins_files.length; ++i) {
12438: if (!plugins_files[i].getName().endsWith(".xml"))
12439: continue;
12440: plugin_files_v.add(plugins_files[i]);
12441: }
12442: }
12443:
12444: try {
12445:
12446: //Enumeration enum_pl = this.getClass().getClassLoader().getResources("ireport/plugin.xml");
12447: //logOnConsole("Looking into: " + "\n");
12448: //for (int i=0; i< rcl.getCachedItems().size(); ++i)
12449: //{
12450: // logOnConsole(rcl.getCachedItems().get(i)+ "\n");
12451: //}
12452:
12453: Enumeration enum_pl = rcl
12454: .getResources("ireport/plugin.xml");
12455:
12456: while (enum_pl.hasMoreElements()) {
12457: Object oobj = enum_pl.nextElement();
12458: if (!plugin_files_v.contains(oobj)) {
12459: plugin_files_v.add(oobj);
12460: }
12461: }
12462:
12463: } catch (Exception ex) {
12464:
12465: getLogPane()
12466: .getMainLogTextArea()
12467: .logOnConsole(
12468: I18n
12469: .getString(
12470: "messages.errorLookingForPlugins",
12471: "Error searching ireport/plugin.xml resources\n"),
12472: JOptionPane.ERROR_MESSAGE);
12473:
12474: }
12475:
12476: for (int i = 0; i < plugin_files_v.size(); ++i) {
12477:
12478: Object source = plugin_files_v.elementAt(i);
12479: // Create a Xerces DOM Parser
12480: DOMParser parser = new DOMParser();
12481: // Parse the Document
12482: // and traverse the DOM
12483: try {
12484:
12485: parser
12486: .setEntityResolver(new org.xml.sax.EntityResolver() {
12487: /* Code by Teodor Danciu */
12488: public org.xml.sax.InputSource resolveEntity(
12489: String publicId, String systemId)
12490: throws SAXException//, java.io.IOException
12491: {
12492: org.xml.sax.InputSource inputSource = null;
12493:
12494: if (systemId != null) {
12495: String dtd = null;
12496:
12497: if (systemId
12498: .equals("http://ireport.sourceforge.net/dtds/iReportPlugin.dtd")) {
12499: dtd = "it/businesslogic/ireport/dtds/iReportPlugin.dtd";
12500: } else {
12501: return new org.xml.sax.InputSource(
12502: systemId);
12503: }
12504:
12505: ClassLoader classLoader = this
12506: .getClass()
12507: .getClassLoader();
12508:
12509: java.net.URL url = null;
12510:
12511: if (classLoader != null) {
12512: url = classLoader
12513: .getResource(dtd);
12514: }
12515: if (url == null) {
12516: classLoader = this .getClass()
12517: .getClassLoader();
12518: }
12519:
12520: java.io.InputStream is = classLoader
12521: .getResourceAsStream(dtd);
12522: if (is != null) {
12523: java.io.InputStreamReader isr = new java.io.InputStreamReader(
12524: is);
12525: inputSource = new org.xml.sax.InputSource(
12526: isr);
12527: }
12528:
12529: }
12530:
12531: return inputSource;
12532: }
12533: });
12534: /* End Code by Teodor Danciu */
12535: InputStream input_source = null;
12536: if (source instanceof java.io.File) {
12537: input_source = new FileInputStream(
12538: (java.io.File) source);
12539:
12540: } else if (source instanceof java.net.URL) {
12541:
12542: input_source = ((java.net.URL) source).openStream();
12543:
12544: }
12545:
12546: parser.parse(new org.xml.sax.InputSource(input_source));
12547: Document document = parser.getDocument();
12548:
12549: //System.out.println("traverse");
12550: Node node = document.getDocumentElement();
12551:
12552: PluginEntry pe = new PluginEntry();
12553: pe.setMainFrame(this );
12554:
12555: if (node.getNodeType() == Node.ELEMENT_NODE
12556: && node.getNodeName().equals("iReportPlugin")) {
12557: //System.out.println("iReportProperties");
12558: // Get childs....
12559: NamedNodeMap nnm_plugin = node.getAttributes();
12560: if (nnm_plugin.getNamedItem("name") != null)
12561: pe.setName(nnm_plugin.getNamedItem("name")
12562: .getNodeValue());
12563: if (nnm_plugin.getNamedItem("class") != null)
12564: pe.setClassName(nnm_plugin
12565: .getNamedItem("class").getNodeValue());
12566: if (nnm_plugin.getNamedItem("loadOnStartup") != null)
12567: pe.setLoadOnStartup(Misc
12568: .nvl(
12569: nnm_plugin.getNamedItem(
12570: "loadOnStartup")
12571: .getNodeValue().trim(),
12572: "false").toLowerCase().equals(
12573: "true"));
12574: if (nnm_plugin.getNamedItem("hide") != null)
12575: pe.setHide(Misc
12576: .nvl(
12577: nnm_plugin.getNamedItem("hide")
12578: .getNodeValue().trim(),
12579: "false").toLowerCase().equals(
12580: "true"));
12581: if (nnm_plugin.getNamedItem("configurable") != null)
12582: pe.setConfigurable(Misc
12583: .nvl(
12584: nnm_plugin.getNamedItem(
12585: "configurable")
12586: .getNodeValue().trim(),
12587: "false").toLowerCase().equals(
12588: "true"));
12589:
12590: NodeList children = node.getChildNodes();
12591: if (children != null) {
12592: for (int k = 0; k < children.getLength(); k++) {
12593: Node nodeChild = (Node) children.item(k);
12594: if (nodeChild.getNodeType() == Node.ELEMENT_NODE
12595: && nodeChild.getNodeName().equals(
12596: "IconFile")) {
12597:
12598: // Take the CDATA...
12599: // Load icon...
12600: String iconName = readPCDATA(nodeChild)
12601: .trim();
12602: try {
12603: pe
12604: .setIcon(new javax.swing.ImageIcon(
12605: getReportClassLoader()
12606: .getResource(
12607: iconName)));
12608: } catch (Exception ex) {
12609: ex.printStackTrace();
12610: }
12611: } else if (nodeChild.getNodeType() == Node.ELEMENT_NODE
12612: && nodeChild.getNodeName().equals(
12613: "Description")) {
12614: String description = readPCDATA(
12615: nodeChild).trim();
12616: pe.setDescription(description);
12617: }
12618: }
12619: }
12620: }
12621:
12622: if (!pe.isHide()) {
12623: javax.swing.JMenuItem pluginItem = new javax.swing.JMenuItem();
12624: pluginItem.setText(pe.getName());
12625: if (pe.getIcon() != null) {
12626: pluginItem.setIcon(pe.getIcon());
12627: }
12628:
12629: pluginEntries.put(pluginItem, pe);
12630:
12631: pluginItem
12632: .addActionListener(new java.awt.event.ActionListener() {
12633: public void actionPerformed(
12634: java.awt.event.ActionEvent evt) {
12635: jMenuItemPluginActionPerformed(evt);
12636: }
12637:
12638: });
12639:
12640: jMenuPlugins.add(pluginItem);
12641: }
12642:
12643: if (pe.isLoadOnStartup()) {
12644:
12645: pe.getPlugin().call();
12646: }
12647:
12648: } catch (SAXException e) {
12649: System.err.println(e);
12650: } catch (java.io.IOException e) {
12651: System.err.println(e);
12652: }
12653:
12654: } // End cycle on iReport plugin files...
12655: }
12656:
12657: private void jMenuItemPluginActionPerformed(
12658: java.awt.event.ActionEvent evt) {
12659:
12660: if (this .pluginEntries.containsKey(evt.getSource())) {
12661: PluginEntry pe = (PluginEntry) this .pluginEntries.get(evt
12662: .getSource());
12663: pe.getPlugin().call();
12664: }
12665:
12666: }
12667:
12668: /** Getter for property pluginConfigurationDialog.
12669: * @return Value of property pluginConfigurationDialog.
12670: *
12671: */
12672: public it.businesslogic.ireport.gui.PluginConfigurationDialog getPluginConfigurationDialog() {
12673:
12674: if (pluginConfigurationDialog == null) {
12675: pluginConfigurationDialog = new PluginConfigurationDialog(
12676: this );
12677: pluginConfigurationDialog.setPlugins(this
12678: .getPluginEntries().values());
12679: }
12680:
12681: return pluginConfigurationDialog;
12682: }
12683:
12684: /** Setter for property pluginConfigurationDialog.
12685: * @param pluginConfigurationDialog New value of property pluginConfigurationDialog.
12686: *
12687: */
12688: public void setPluginConfigurationDialog(
12689: it.businesslogic.ireport.gui.PluginConfigurationDialog pluginConfigurationDialog) {
12690: this .pluginConfigurationDialog = pluginConfigurationDialog;
12691: }
12692:
12693: /** Getter for property pluginEntries.
12694: * @return Value of property pluginEntries.
12695: *
12696: */
12697: public java.util.HashMap getPluginEntries() {
12698: return pluginEntries;
12699: }
12700:
12701: /** Setter for property pluginEntries.
12702: * @param pluginEntries New value of property pluginEntries.
12703: *
12704: */
12705: public void setPluginEntries(java.util.HashMap pluginEntries) {
12706: this .pluginEntries = pluginEntries;
12707: }
12708:
12709: public void languageChanged(LanguageChangedEvent evt) {
12710:
12711: nickyb.sqleonardo.common.util.I18n.setBaseName(I18n.baseName);
12712: nickyb.sqleonardo.common.util.I18n
12713: .setLocalPackageName(I18n.localPackageName);
12714: nickyb.sqleonardo.common.util.I18n.setCurrentLocale(evt
12715: .getLocale());
12716:
12717: this .applyI18n();
12718: }
12719:
12720: /**
12721: * Return the active Report frame. return null if no report frame is actually activated.
12722: */
12723: public JReportFrame getActiveReportFrame() {
12724: if (jMDIDesktopPane.getSelectedFrame() != null
12725: && jMDIDesktopPane.getSelectedFrame() instanceof JReportFrame) {
12726: return (JReportFrame) jMDIDesktopPane.getSelectedFrame();
12727: }
12728: return null;
12729: }
12730:
12731: /** Getter for property reportClassLoader.
12732: * @return Value of property reportClassLoader.
12733: *
12734: */
12735: public it.businesslogic.ireport.ReportClassLoader getReportClassLoader() {
12736: if (reportClassLoader == null) {
12737: reportClassLoader = new ReportClassLoader();
12738: }
12739: reportClassLoader.rescanLibDirectory();
12740: return reportClassLoader;
12741: }
12742:
12743: /** Setter for property reportClassLoader.
12744: * @param reportClassLoader New value of property reportClassLoader.
12745: *
12746: */
12747: public void setReportClassLoader(
12748: it.businesslogic.ireport.ReportClassLoader reportClassLoader) {
12749: this .reportClassLoader = reportClassLoader;
12750: }
12751:
12752: /**
12753: * Getter for property activeStyleClipboard.
12754: * @return Value of property activeStyleClipboard.
12755: */
12756: public int getActiveStyleClipboard() {
12757: return activeStyleClipboard;
12758: }
12759:
12760: /**
12761: * Setter for property activeStyleClipboard.
12762: * @param activeStyleClipboard New value of property activeStyleClipboard.
12763: */
12764: public void setActiveStyleClipboard(int activeStyleClipboard) {
12765: this .activeStyleClipboard = activeStyleClipboard;
12766: }
12767:
12768: public it.businesslogic.ireport.ReportElement getStyleClipboard() {
12769: return styleClipboards[getActiveStyleClipboard()];
12770: }
12771:
12772: public void setStyleClipbardContent(
12773: it.businesslogic.ireport.ReportElement element) {
12774: styleClipboards[getActiveStyleClipboard()] = element;
12775:
12776: }
12777:
12778: // Hack for MacOS X suggested by Gary Nunes
12779: public java.awt.Dimension getMinimumSize() {
12780: return new java.awt.Dimension(50, 50); // arbitrary minimum size value
12781: }
12782:
12783: /**
12784: * Getter for property currentZoomFactor.
12785: * @return Value of property currentZoomFactor.
12786: */
12787: public double getCurrentZoomFactor() {
12788: return currentZoomFactor;
12789: }
12790:
12791: /**
12792: * Setter for property currentZoomFactor.
12793: * @param currentZoomFactor New value of property currentZoomFactor.
12794: */
12795: public void setCurrentZoomFactor(double currentZoomFactor) {
12796: this .currentZoomFactor = currentZoomFactor;
12797: }
12798:
12799: public void setComboBoxZoomFactor(double zoomFactor) {
12800: this .jNumberComboBoxZoom.setValue(zoomFactor);
12801: //logOnConsole(this.jNumberComboBoxZoom.getValue() + "\n" ) ;
12802: }
12803:
12804: /**
12805: * Getter for property libraryPanel.
12806: * @return Value of property libraryPanel.
12807: */
12808: public LibraryPanel getLibraryPanel() {
12809: return this .libraryPanel;
12810: }
12811:
12812: /**
12813: * Getter for the LibraryView
12814: * this is used to insert tabs for Plugins
12815: * @return View
12816: */
12817: public View getLibraryView() {
12818: return this .viewLibrary;
12819: }
12820:
12821: /**
12822: * Setter for property libraryPanel.
12823: * @param libraryPanel New value of property libraryPanel.
12824: */
12825: public void setLibraryPanel(LibraryPanel libraryPanel) {
12826: this .libraryPanel = libraryPanel;
12827: }
12828:
12829: public void clearConsole() {
12830: getLogPane().getMainLogTextArea().clearConsole();
12831: }
12832:
12833: public LocaleResourceFilesDialog getLocaleFilesDialog() {
12834: return localeFilesDialog;
12835: }
12836:
12837: public void setLocaleFilesDialog(
12838: LocaleResourceFilesDialog localeFilesDialog) {
12839: this .localeFilesDialog = localeFilesDialog;
12840: }
12841:
12842: /**
12843: * Registers ReportListener to receive events.
12844: * @param listener The listener to register.
12845: */
12846: public synchronized void addReportListener(
12847: it.businesslogic.ireport.gui.event.ReportListener listener) {
12848:
12849: if (listenerList == null) {
12850: listenerList = new javax.swing.event.EventListenerList();
12851: }
12852: listenerList
12853: .add(
12854: it.businesslogic.ireport.gui.event.ReportListener.class,
12855: listener);
12856: }
12857:
12858: /**
12859: * Removes ReportListener from the list of listeners.
12860: * @param listener The listener to remove.
12861: */
12862: public synchronized void removeReportListener(
12863: it.businesslogic.ireport.gui.event.ReportListener listener) {
12864:
12865: listenerList
12866: .remove(
12867: it.businesslogic.ireport.gui.event.ReportListener.class,
12868: listener);
12869: }
12870:
12871: /**
12872: * Notifies all registered listeners about the event.
12873: *
12874: * @param event The event to be fired
12875: */
12876: private void fireReportListenerReportElementsSelectionChanged(
12877: it.businesslogic.ireport.gui.event.ReportElementsSelectionEvent event) {
12878:
12879: if (listenerList == null)
12880: return;
12881: Object[] listeners = listenerList.getListenerList();
12882: for (int i = listeners.length - 2; i >= 0; i -= 2) {
12883:
12884: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportListener.class) {
12885: ((it.businesslogic.ireport.gui.event.ReportListener) listeners[i + 1])
12886: .reportElementsSelectionChanged(event);
12887: }
12888: }
12889: }
12890:
12891: /**
12892: * Notifies all registered listeners about the event.
12893: *
12894: * @param event The event to be fired
12895: */
12896: private void fireReportListenerReportElementsChanged(
12897: it.businesslogic.ireport.gui.event.ReportElementChangedEvent event) {
12898:
12899: if (listenerList == null)
12900: return;
12901: Object[] listeners = listenerList.getListenerList();
12902: for (int i = listeners.length - 2; i >= 0; i -= 2) {
12903: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportListener.class) {
12904: ((it.businesslogic.ireport.gui.event.ReportListener) listeners[i + 1])
12905: .reportElementsChanged(event);
12906: }
12907: }
12908: }
12909:
12910: /**
12911: * Notifies all registered listeners about the event.
12912: *
12913: * @param event The event to be fired
12914: */
12915: private void fireReportListenerReportBandChanged(
12916: it.businesslogic.ireport.gui.event.ReportBandChangedEvent event) {
12917:
12918: if (listenerList == null)
12919: return;
12920: Object[] listeners = listenerList.getListenerList();
12921: for (int i = listeners.length - 2; i >= 0; i -= 2) {
12922: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportListener.class) {
12923: ((it.businesslogic.ireport.gui.event.ReportListener) listeners[i + 1])
12924: .reportBandChanged(event);
12925: }
12926: }
12927: }
12928:
12929: public Vector getClasspath() {
12930:
12931: if (classpath == null || classpath.size() == 0) {
12932: classpath = new Vector();
12933:
12934: // Each line is a path/jar...
12935: StringTokenizer st = new StringTokenizer(getProperties()
12936: .getProperty("classpath", ""), "\n");
12937: while (st.hasMoreTokens()) {
12938: String token = st.nextToken();
12939: if (token != null && token.trim().length() > 0) {
12940: classpath.addElement(token.trim());
12941: }
12942: }
12943:
12944: }
12945: return classpath;
12946: }
12947:
12948: public void setClasspath(Vector classpath) {
12949: this .classpath = classpath;
12950: String cp_property = "";
12951: for (int i = 0; i < classpath.size(); ++i) {
12952: cp_property += classpath.elementAt(i) + "\n";
12953: }
12954: getProperties().setProperty("classpath", cp_property);
12955: }
12956:
12957: public Vector getFontspath() {
12958:
12959: if (fontspath == null || fontspath.size() == 0) {
12960: fontspath = new Vector();
12961:
12962: // Each line is a path/jar...
12963: StringTokenizer st = new StringTokenizer(getProperties()
12964: .getProperty("fontspath", ""), "\n");
12965: while (st.hasMoreTokens()) {
12966: String token = st.nextToken();
12967: if (token != null && token.trim().length() > 0) {
12968: fontspath.addElement(token.trim());
12969: }
12970: }
12971:
12972: }
12973: return fontspath;
12974: }
12975:
12976: public void setFontspath(Vector fontspath) {
12977: this .fontspath = fontspath;
12978: String cp_property = "";
12979: for (int i = 0; i < fontspath.size(); ++i) {
12980: cp_property += fontspath.elementAt(i) + "\n";
12981: }
12982: getProperties().setProperty("fontspath", cp_property);
12983: }
12984:
12985: // Indicate whether Report Name must be synchronized
12986: public boolean isSynchronizeReportName() {
12987: return getProperties().getProperty("SynchronizeReportName", "")
12988: .equals("true");
12989: }
12990:
12991: public boolean isShowOptionDialogSynchronize(String reportName,
12992: String filename) {
12993:
12994: return false;
12995: /*
12996: int ret = I18nOptionPane.showOptionDialog(this,
12997: "gui.MainFrame.SynchronizeReportName",
12998: "",
12999: JOptionPane.YES_NO_OPTION,
13000: JOptionPane.WARNING_MESSAGE,
13001: null, new String[]{"yes", "no"},
13002: "no",
13003: "Report Name: " + reportName + "\n" + "File Name: " + filename );
13004:
13005: return (ret==0);
13006: */
13007: }
13008:
13009: public JReportFrame getSelectedJRFFromFilesTree() {
13010: TreePath path = jTreeFiles.getSelectionPath();
13011: if (path == null)
13012: return null;
13013: javax.swing.tree.TreeNode node = (javax.swing.tree.TreeNode) path
13014: .getLastPathComponent();
13015: if (node instanceof DefaultMutableTreeNode) {
13016: DefaultMutableTreeNode nodem = (DefaultMutableTreeNode) node;
13017: Object obj = nodem.getUserObject();
13018: if (obj != null && obj instanceof DocumentTreeEntry) {
13019: DocumentTreeEntry dtn = (DocumentTreeEntry) obj;
13020: return dtn.getJrf();
13021: }
13022: }
13023:
13024: return null;
13025: }
13026:
13027: /**
13028: * List of JReportFrames selected in the files tree
13029: */
13030: public List getSelectedJRFsFromFilesTree() {
13031: TreePath[] paths = jTreeFiles.getSelectionPaths();
13032: List jReportFrames = new java.util.ArrayList();
13033: if (paths == null)
13034: return jReportFrames;
13035: for (int i = 0; i < paths.length; ++i) {
13036: TreePath path = paths[i];
13037: if (path == null)
13038: continue;
13039:
13040: javax.swing.tree.TreeNode node = (javax.swing.tree.TreeNode) path
13041: .getLastPathComponent();
13042: if (node instanceof DefaultMutableTreeNode) {
13043: DefaultMutableTreeNode nodem = (DefaultMutableTreeNode) node;
13044: Object obj = nodem.getUserObject();
13045: if (obj != null && obj instanceof DocumentTreeEntry) {
13046: DocumentTreeEntry dtn = (DocumentTreeEntry) obj;
13047: jReportFrames.add(dtn.getJrf());
13048: }
13049: }
13050: }
13051: return jReportFrames;
13052: }
13053:
13054: public JMDIDesktopPane getJMDIDesktopPane() {
13055: return jMDIDesktopPane;
13056: }
13057:
13058: public void updateAntialiasMode() {
13059: javax.swing.JInternalFrame[] frames = jMDIDesktopPane
13060: .getAllFrames();
13061: for (int i = 0; i < frames.length; ++i) {
13062: if (frames[i] instanceof JReportFrame) {
13063: JReportFrame jrf = (JReportFrame) frames[i];
13064: jrf.updateAntialiasMode();
13065: }
13066: }
13067: }
13068:
13069: public Vector getChartSeriesClipBoard() {
13070: return chartSeriesClipBoard;
13071: }
13072:
13073: public void setChartSeriesClipBoard(Vector chartSeriesClipBoard) {
13074: this .chartSeriesClipBoard = chartSeriesClipBoard;
13075: }
13076:
13077: public it.businesslogic.ireport.chart.Dataset getChartDatasetClipBoard() {
13078: return chartDatasetClipBoard;
13079: }
13080:
13081: public void setChartDatasetClipBoard(
13082: it.businesslogic.ireport.chart.Dataset chartDatasetClipBoard) {
13083: this .chartDatasetClipBoard = chartDatasetClipBoard;
13084: }
13085:
13086: public LogPane getLogPane() {
13087: return logPane;
13088: }
13089:
13090: public void setLogPane(LogPane logPane) {
13091: this .logPane = logPane;
13092: }
13093:
13094: public DocumentStructurePanel getDocumentStructurePanel() {
13095: return documentStructurePanel;
13096: }
13097:
13098: public void setDocumentStructurePanel(
13099: DocumentStructurePanel documentStructurePanel) {
13100: this .documentStructurePanel = documentStructurePanel;
13101: }
13102:
13103: public void styleChanged(StyleChangedEvent evt) {
13104: if (this .getActiveReportFrame() != null) {
13105: this .getActiveReportFrame().getReportPanel().repaint();
13106: this .getElementPropertiesDialog().updateSelection();
13107: }
13108: }
13109:
13110: public void templateChanged(TemplateChangedEvent evt) {
13111: if (this .getActiveReportFrame() != null) {
13112: this .getActiveReportFrame().getReportPanel().repaint();
13113: this .getElementPropertiesDialog().updateSelection();
13114: }
13115: }
13116:
13117: public Vector getMeasuresClipBoard() {
13118: return measuresClipBoard;
13119: }
13120:
13121: public void setMeasuresClipBoard(Vector measuresClipBoard) {
13122: this .measuresClipBoard = measuresClipBoard;
13123: }
13124:
13125: /**
13126: * Registers ReportFrameActivatedListener to receive events.
13127: * @param listener The listener to register.
13128: */
13129: public synchronized void addReportFrameActivatedListener(
13130: it.businesslogic.ireport.gui.event.ReportFrameActivatedListener listener) {
13131:
13132: if (listenerList == null) {
13133: listenerList = new javax.swing.event.EventListenerList();
13134: }
13135: listenerList
13136: .add(
13137: it.businesslogic.ireport.gui.event.ReportFrameActivatedListener.class,
13138: listener);
13139: }
13140:
13141: /**
13142: * Removes ReportFrameActivatedListener from the list of listeners.
13143: * @param listener The listener to remove.
13144: */
13145: public synchronized void removeReportFrameActivatedListener(
13146: it.businesslogic.ireport.gui.event.ReportFrameActivatedListener listener) {
13147:
13148: listenerList
13149: .remove(
13150: it.businesslogic.ireport.gui.event.ReportFrameActivatedListener.class,
13151: listener);
13152: }
13153:
13154: /**
13155: * Notifies all registered listeners about the event.
13156: *
13157: * @param event The event to be fired
13158: */
13159: private void fireReportFrameActivatedListenerReportFrameActivated(
13160: it.businesslogic.ireport.gui.event.ReportFrameActivatedEvent event) {
13161:
13162: if (listenerList == null)
13163: return;
13164: Object[] listeners = listenerList.getListenerList();
13165: for (int i = listeners.length - 2; i >= 0; i -= 2) {
13166: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportFrameActivatedListener.class) {
13167: ((it.businesslogic.ireport.gui.event.ReportFrameActivatedListener) listeners[i + 1])
13168: .reportFrameActivated(event);
13169: }
13170: }
13171: }
13172:
13173: public Vector getSelectedElements() {
13174: JReportFrame newJrf = getActiveReportFrame();
13175: Vector selection = new Vector();
13176: if (newJrf != null) {
13177: if (newJrf.getSelectedCrosstabEditorPanel() == null) {
13178: selection.addAll(newJrf.getSelectedElements());
13179: } else {
13180: selection.addAll(newJrf
13181: .getSelectedCrosstabEditorPanel()
13182: .getSelectedElements());
13183: }
13184: }
13185: return selection;
13186: }
13187:
13188: /*
13189: public it.businesslogic.ireport.gui.docking.DockingContainer getDockingContainerRight() {
13190: return dockingContainerRight;
13191: }
13192:
13193: public void setDockingContainerRight(it.businesslogic.ireport.gui.docking.DockingContainer dockingContainerRight) {
13194: this.dockingContainerRight = dockingContainerRight;
13195: }
13196:
13197: public it.businesslogic.ireport.gui.docking.DockingContainer getDockingContainerLeft() {
13198: return dockingContainerLeft;
13199: }
13200:
13201: */
13202:
13203: public java.util.Vector getToolBarControls() {
13204: return toolBarControls;
13205: }
13206:
13207: public StylesView getStylesView() {
13208: return stylesView;
13209: }
13210:
13211: public void setStylesView(StylesView stylesView) {
13212: this .stylesView = stylesView;
13213: }
13214:
13215: public Vector getStyleLibrarySet() {
13216: return styleLibrarySet;
13217: }
13218:
13219: public void setStyleLibrarySet(Vector styleLibrarySet) {
13220: this .styleLibrarySet = styleLibrarySet;
13221: }
13222:
13223: /**
13224: * Used to update dynamically the LAF
13225: */
13226: public void upadateLAF() {
13227: PlafManager.setPreferredTheme("win32");
13228: SwingUtilities.updateComponentTreeUI(MainFrame
13229: .getMainInstance());
13230: SwingUtilities
13231: .updateComponentTreeUI(getElementPropertiesDialog());
13232: SwingUtilities.updateComponentTreeUI(getBandsDialog());
13233: SwingUtilities.updateComponentTreeUI(getGroupsDialog());
13234: SwingUtilities.updateComponentTreeUI(getLocaleFilesDialog());
13235: SwingUtilities.updateComponentTreeUI(getReportQueryDialog());
13236: SwingUtilities
13237: .updateComponentTreeUI(getPluginConfigurationDialog());
13238: }
13239:
13240: /**
13241: * This method can be used by plugins that needs to add new custom fonts...
13242: */
13243: public void updateFontsLists() {
13244: fireFontsListChangedListenerFontsListChanged(new FontsListChangedEvent(
13245: getTtfFonts()));
13246: }
13247:
13248: /**
13249: * Reload the fonts list...
13250: *
13251: */
13252: public void reloadFontsLists() {
13253: FontLoaderDialog fll = new FontLoaderDialog(this , false);
13254: this .ttfFonts = FontListLoader.loadTTFFonts(fll);
13255:
13256: try {
13257: SwingUtilities.invokeAndWait(new Runnable() {
13258: public void run() {
13259: fireFontsListChangedListenerFontsListChanged(new FontsListChangedEvent(
13260: getTtfFonts()));
13261: }
13262: });
13263:
13264: } catch (Exception ex) {
13265: ex.printStackTrace();
13266: }
13267: }
13268:
13269: /**
13270: * Registers FontsListChangedListener to receive events.
13271: * @param listener The listener to register.
13272: */
13273: public synchronized void addFontsListChangedListener(
13274: it.businesslogic.ireport.gui.event.FontsListChangedListener listener) {
13275:
13276: if (listenerList == null) {
13277: listenerList = new javax.swing.event.EventListenerList();
13278: }
13279: listenerList
13280: .add(
13281: it.businesslogic.ireport.gui.event.FontsListChangedListener.class,
13282: listener);
13283: }
13284:
13285: /**
13286: * Removes FontsListChangedListener from the list of listeners.
13287: * @param listener The listener to remove.
13288: */
13289: public synchronized void removeFontsListChangedListener(
13290: it.businesslogic.ireport.gui.event.FontsListChangedListener listener) {
13291:
13292: listenerList
13293: .remove(
13294: it.businesslogic.ireport.gui.event.FontsListChangedListener.class,
13295: listener);
13296: }
13297:
13298: /**
13299: * Notifies all registered listeners about the event.
13300: *
13301: * @param event The event to be fired
13302: */
13303: private void fireFontsListChangedListenerFontsListChanged(
13304: FontsListChangedEvent event) {
13305:
13306: if (listenerList == null)
13307: return;
13308: Object[] listeners = listenerList.getListenerList();
13309: for (int i = listeners.length - 2; i >= 0; i -= 2) {
13310: if (listeners[i] == it.businesslogic.ireport.gui.event.FontsListChangedListener.class) {
13311: ((it.businesslogic.ireport.gui.event.FontsListChangedListener) listeners[i + 1])
13312: .fontsListChanged(event);
13313: }
13314: }
13315: }
13316:
13317: public void reportDocumentStatusChanged(
13318: ReportDocumentStatusChangedEvent evt) {
13319:
13320: jTreeFiles.updateUI();
13321:
13322: }
13323:
13324: private void jBoxButtonActionPerformed(
13325: java.awt.event.ActionEvent evt) {
13326: setElementsValue("setBox", jBoxButton.getLastBox(),
13327: it.businesslogic.ireport.Box.class);
13328: }
13329:
13330: /**
13331: * When a view is closed, we should update the menu...
13332: *
13333: */
13334: protected void closedView(View view) {
13335: if (view == viewFiles)
13336: jCheckBoxMenuItemExplorer.setSelected(false);
13337: if (view == viewDocumentStructure)
13338: jCheckBoxMenuItemDocumentStructure.setSelected(false);
13339: if (view == viewPropertySheet)
13340: jCheckBoxMenuItemElementProperties.setSelected(false);
13341: if (view == viewThreads)
13342: jCheckBoxMenuItemThreadList.setSelected(false);
13343: if (view == viewLibrary)
13344: jCheckBoxMenuItemLibrary.setSelected(false);
13345: if (view == logPaneView)
13346: jCheckBoxMenuItemOutput.setSelected(false);
13347: if (view == stylesPanleView)
13348: jCheckBoxMenuItemStylesLibrary.setSelected(false);
13349: // Can not be closed... if (view == crosstabStructureView = null;
13350: // Can not be closed... if (view == crosstabMeasuresView = null;
13351: }
13352:
13353: private View createView(String id, String text, boolean closable,
13354: boolean pin, Component c) {
13355: View view = new View(id, text);
13356:
13357: if (closable) {
13358: view.getTitlebar().addAction(DockingConstants.CLOSE_ACTION);
13359: if (view.getTitlebar().getActionButton(
13360: DockingConstants.CLOSE_ACTION) != null) {
13361: view.getTitlebar().getActionButton(
13362: DockingConstants.CLOSE_ACTION)
13363: .addActionListener(new ActionListener() {
13364: public void actionPerformed(ActionEvent e) {
13365: View viewx = (View) javax.swing.SwingUtilities
13366: .getAncestorOfClass(View.class,
13367: (java.awt.Component) e
13368: .getSource());
13369: closedView(viewx);
13370: //System.out.println( "Closed: " + viewx.getPersistentId());
13371: }
13372: });
13373: }
13374: }
13375: if (pin)
13376: view.addAction(DockingConstants.PIN_ACTION);
13377:
13378: JPanel p = new JPanel();
13379: // p.setBackground(Color.WHITE);
13380: p.setLayout(new BorderLayout());
13381: p.setBorder(new LineBorder(java.awt.Color.GRAY, 1));
13382:
13383: p.add(c, BorderLayout.CENTER);
13384:
13385: view.setContentPane(p);
13386: return view;
13387: }
13388:
13389: private View createDesktopPage() {
13390: String id = "Desktop";
13391: View view = new View(id, null, null);
13392: view.setTerritoryBlocked(DockingConstants.CENTER_REGION, true);
13393: view.setTitlebar(null);
13394: view.setContentPane(jMDIDesktopPane);
13395: view.setSize(1000, 100);
13396: return view;
13397: }
13398:
13399: public View getDesktopView() {
13400: return desktop;
13401: }
13402:
13403: public Vector getQueryExecuters() {
13404: return queryExecuters;
13405: }
13406:
13407: public void setQueryExecuters(Vector queryExecuters) {
13408: this .queryExecuters = queryExecuters;
13409: }
13410:
13411: public boolean isNoExit() {
13412: return noExit;
13413: }
13414:
13415: public void setNoExit(boolean noExit) {
13416: this .noExit = noExit;
13417: }
13418:
13419: public boolean isUsingWS() {
13420: return usingWS;
13421: }
13422:
13423: public void setUsingWS(boolean usingWS) {
13424: this .usingWS = usingWS;
13425: }
13426:
13427: public List getUserChoicesWizardTemplates() {
13428:
13429: if (userChoicesWizardTemplates == null) {
13430: userChoicesWizardTemplates = UserChoicesWizardTemplate
13431: .loadWizardTemplates();
13432: }
13433:
13434: return userChoicesWizardTemplates;
13435: }
13436:
13437: public void setUserChoicesWizardTemplates(
13438: List userChoicesWizardTemplates) {
13439: this .userChoicesWizardTemplates = userChoicesWizardTemplates;
13440: }
13441:
13442: /**
13443: * getSpecialParamters
13444: * added by Felix Firgau on March 3rd 2007
13445: * Returns a HashMap with parameters for a Datasource of generated a Report.
13446: * This method is used for subclassing.
13447: * @param hm Map
13448: * @param report Report
13449: * @return Map
13450: */
13451: public Map getSpecialParameters(Map hm, Report report) {
13452: return hm;
13453: }
13454:
13455: public void reportBandsSelectionChanged(
13456: ReportBandsSelectionEvent evt) {
13457: fireReportListenerReportBandsSelectionChanged(evt);
13458: }
13459:
13460: public void reportObjectsSelectionChanged(
13461: ReportObjectsSelectionEvent evt) {
13462: fireReportListenerReportObjectsSelectionChanged(evt);
13463: }
13464:
13465: /** Notifies all registered listeners about the event.
13466: *
13467: * @param event The event to be fired
13468: *
13469: */
13470: public void fireReportListenerReportBandsSelectionChanged(
13471: it.businesslogic.ireport.gui.event.ReportBandsSelectionEvent event) {
13472: if (listenerList == null)
13473: return;
13474: Object[] listeners = listenerList.getListenerList();
13475: for (int i = listeners.length - 2; i >= 0; i -= 2) {
13476: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportListener.class) {
13477: ((it.businesslogic.ireport.gui.event.ReportListener) listeners[i + 1])
13478: .reportBandsSelectionChanged(event);
13479: }
13480: }
13481: }
13482:
13483: /** Notifies all registered listeners about the event.
13484: *
13485: * @param event The event to be fired
13486: *
13487: */
13488: public void fireReportListenerReportObjectsSelectionChanged(
13489: it.businesslogic.ireport.gui.event.ReportObjectsSelectionEvent event) {
13490: if (listenerList == null)
13491: return;
13492: Object[] listeners = listenerList.getListenerList();
13493: for (int i = listeners.length - 2; i >= 0; i -= 2) {
13494: if (listeners[i] == it.businesslogic.ireport.gui.event.ReportListener.class) {
13495: ((it.businesslogic.ireport.gui.event.ReportListener) listeners[i + 1])
13496: .reportObjectsSelectionChanged(event);
13497: }
13498: }
13499: }
13500:
13501: public boolean getMagnetEnabled() {
13502: return magnetEnabled;
13503: }
13504:
13505: public void setMagnetEnabled(boolean magnetEnabled) {
13506: this .magnetEnabled = magnetEnabled;
13507: }
13508:
13509: public DocumentSheetPanel getReportSheetPanel() {
13510: return reportSheetPanel;
13511: }
13512:
13513: /**
13514: * Get the list of ConnectionImplementations.
13515: * To add new connection implementations, please use the method #addConnectionImplementation
13516: */
13517: public java.util.List getConnectionImplementations() {
13518: return connectionImplementations;
13519: }
13520:
13521: public void setConnectionImplementations(
13522: java.util.List connectionImplementations) {
13523: this .connectionImplementations = connectionImplementations;
13524: }
13525:
13526: /**
13527: * This method provides the preferred way to register a new connection type
13528: */
13529: public boolean addConnectionImplementation(String className) {
13530: if (getConnectionImplementations().contains(className))
13531: return true;
13532:
13533: try {
13534:
13535: Class.forName(className, true, this .getReportClassLoader());
13536: getConnectionImplementations().add(className);
13537: return true;
13538: } catch (Throwable t) {
13539: t.printStackTrace();
13540: }
13541: return false;
13542: }
13543:
13544: /**
13545: * This method provides the preferred way to register a new connection type
13546: * Return false if a custom QueryExecuter is already defined for the specified
13547: * language and overrideSameLanguage is false.
13548: *
13549: * if qed is null, the method returns false.
13550: */
13551: public boolean addQueryExecuterDef(QueryExecuterDef qed,
13552: boolean overrideSameLanguage) {
13553: if (qed == null)
13554: return false;
13555: // Look for another qed with the same language...
13556: boolean found = false; // Override the QE at that position...
13557:
13558: for (int i = 0; i < getQueryExecuters().size(); ++i) {
13559: QueryExecuterDef tqe = (QueryExecuterDef) getQueryExecuters()
13560: .get(i);
13561: if (tqe.getLanguage().equals(qed.getLanguage())) {
13562: if (overrideSameLanguage) {
13563: getQueryExecuters().setElementAt(qed, i);
13564: found = true;
13565: break;
13566: } else {
13567: return false;
13568: }
13569: }
13570: }
13571:
13572: if (!found) {
13573: getQueryExecuters().add(qed);
13574: }
13575:
13576: // register the QE in the JasperServer properties...
13577: net.sf.jasperreports.engine.util.JRProperties.setProperty(
13578: "net.sf.jasperreports.query.executer.factory."
13579: + qed.getLanguage(), qed.getClassName());
13580:
13581: if (this .reportQueryDialog != null) {
13582: this .reportQueryDialog.updateQueryLanguages();
13583: }
13584: return true;
13585: }
13586:
13587: public void addDefaultConnectionImplementations() {
13588: addConnectionImplementation("it.businesslogic.ireport.connection.JDBCConnection");
13589: addConnectionImplementation("it.businesslogic.ireport.connection.JRXMLDataSourceConnection");
13590: addConnectionImplementation("it.businesslogic.ireport.connection.JavaBeanDataSourceConnection");
13591: addConnectionImplementation("it.businesslogic.ireport.connection.JRCSVDataSourceConnection");
13592: addConnectionImplementation("it.businesslogic.ireport.connection.JRDataSourceProviderConnection");
13593: addConnectionImplementation("it.businesslogic.ireport.connection.JRCustomDataSourceConnection");
13594: addConnectionImplementation("it.businesslogic.ireport.connection.JREmptyDatasourceConnection");
13595: addConnectionImplementation("it.businesslogic.ireport.connection.JRHibernateConnection");
13596: addConnectionImplementation("it.businesslogic.ireport.connection.JRSpringLoadedHibernateConnection");
13597: addConnectionImplementation("it.businesslogic.ireport.connection.EJBQLConnection");
13598: addConnectionImplementation("it.businesslogic.ireport.connection.JRXMLADataSourceConnection");
13599: addConnectionImplementation("it.businesslogic.ireport.connection.MondrianConnection");
13600: //addConnectionImplementation("it.businesslogic.ireport.connection.NullConnection");
13601: //addConnectionImplementation("it.businesslogic.ireport.connection.JRCustomConnection");
13602: addConnectionImplementation("it.businesslogic.ireport.connection.QueryExecuterConnection");
13603: }
13604:
13605: public static java.util.Properties getBrandingProperties() {
13606: return brandingProperties;
13607: }
13608:
13609: public static void setBrandingProperties(
13610: java.util.Properties v_brandingProperties) {
13611: brandingProperties = v_brandingProperties;
13612: }
13613:
13614: public static void loadRebrandingProperties() {
13615: Misc
13616: .addProperties(
13617: "/it/businesslogic/ireport/res/default.branding.properties",
13618: getBrandingProperties());
13619: Misc.addProperties("/ireport/branding.properties",
13620: getBrandingProperties());
13621: }
13622:
13623: public Vector getLinkTypes() {
13624: return linkTypes;
13625: }
13626:
13627: public void addDefaultLinkTypes() {
13628: addLinkType("None", false);
13629: addLinkType("Reference", false);
13630: addLinkType("LocalAnchor", false);
13631: addLinkType("LocalPage", false);
13632: addLinkType("RemoteAnchor", false);
13633: addLinkType("RemotePage", true);
13634: }
13635:
13636: /**
13637: * This method provides the preferred way to register a new connection type
13638: * Return false if a custom QueryExecuter is already defined for the specified
13639: * language and overrideSameLanguage is false.
13640: *
13641: * if qed is null, the method returns false.
13642: */
13643: public void addLinkType(String linkType) {
13644: addLinkType(linkType, true);
13645: }
13646:
13647: private void addLinkType(String linkType,
13648: boolean updatePropertiedFrame) {
13649: if (linkTypes.contains(linkType))
13650: return;
13651: linkTypes.add(linkType);
13652: if (updatePropertiedFrame && elementPropertiesDialog != null) {
13653: elementPropertiesDialog.updateLinkTypes();
13654: }
13655: }
13656:
13657: }//end class MainFrame
|