elementpropertiesdialog.java

来自「优秀的打印控件全源代码,类似水晶表的设计器!」· Java 代码 · 共 1,340 行 · 第 1/5 页

JAVA
1,340
字号
/* * ElementPropertiesDialog.java * * iReport  --  Visual designer for generating JasperReports Documents *  Copyright (C) 2002-2003  Giulio Toffoli gt@businesslogic.it * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *  Giulio Toffoli *  Via T.Aspetti, 233 *  35100 Padova ITALY *  gt@businesslogic.it * * * How this window work. * This form has an attribute that rappresents the JReportForm active. * If the jrf is null, this frame hides. * When something changes, the program can call "updateSelection". This * class retrive from jrf the selected elements and update all * interface. * * Created on 28 aprile 2003, 23.53 */package it.businesslogic.ireport.gui;import it.businesslogic.ireport.util.*;import it.businesslogic.ireport.gui.event.*;import it.businesslogic.ireport.chart.*;import java.util.*;import java.awt.*;import javax.swing.table.*;import it.businesslogic.ireport.*;/** * * @author <a href="mailto:gt78@users.sourceforge.net">Giulio Toffoli</a> * @author <a href="mailto:phenderson@users.sourceforge.net">Peter Henderson</a> */public class ElementPropertiesDialog extends javax.swing.JDialog {        public static final int GRAPHICS_TAB = 1;    public static final int RECTANGLE_TAB = 2;    public static final int LINE_TAB = 3;    public static final int IMAGE_TAB = 4;    public static final int FONT_TAB = 5;    public static final int STATITEXT_TAB = 6;    public static final int TEXTFIELD_TAB = 7;    public static final int HYPERLINK_TAB = 8;    public static final int SUBREPORT1_TAB = 9;    public static final int SUBREPORT2_TAB = 10;    public static final int CHART_TAB = 11;    public static final int COMMON_TAB = 12;    public static final int BARCODE_TAB = 13;            private JReportFrame jrf = null;    private String lastSelectedPaneName = "Common";    private javax.swing.JPanel lastSelectedPanel = null;            /** Creates new form ElementPropertiesDialog */    public ElementPropertiesDialog(java.awt.Frame parent, boolean modal) {        super(parent, modal);        initComponents();                //System.out.println(">>> 1");                jTabbedPane.removeAll();        this.setSize(370, 380);                // Position types...        jComboBoxPositionType.addItem("FixRelativeToTop");        jComboBoxPositionType.addItem("Float");        jComboBoxPositionType.addItem("FixRelativeToBottom");                // Pens...        jComboBoxPen.addItem("None");        jComboBoxPen.addItem("Thin");        jComboBoxPen.addItem("1Point");        jComboBoxPen.addItem("2Point");        jComboBoxPen.addItem("4Point");        jComboBoxPen.addItem("Dotted");                // StretchTypes...        jComboBoxStretchType.addItem("NoStretch");        jComboBoxStretchType.addItem("RelativeToTallestObject");        jComboBoxStretchType.addItem("RelativeToBandHeight");                // Fill...        jComboBoxFill.addItem("Solid");                // Line...        jComboBoxLineDirection.addItem("TopDown");        jComboBoxLineDirection.addItem("BottomUp");                // Rotate        jComboBoxRotation.addItem("None");        jComboBoxRotation.addItem("Left");        jComboBoxRotation.addItem("Right");                        // Scale Image...        jComboBoxScale.addItem("Clip");        jComboBoxScale.addItem("FillFrame");        jComboBoxScale.addItem("RetainShape");                // Image Evaluation Time...        jComboBoxEvaluationTime.addItem("Now");        jComboBoxEvaluationTime.addItem("Report");        jComboBoxEvaluationTime.addItem("Page");        jComboBoxEvaluationTime.addItem("Column");        jComboBoxEvaluationTime.addItem("Group");                // Image Expression Classes...        jComboBoxImageExpressionClass.addItem("java.lang.String");        jComboBoxImageExpressionClass.addItem("java.io.File");        jComboBoxImageExpressionClass.addItem("java.net.URL");        jComboBoxImageExpressionClass.addItem("java.io.InputStream");        jComboBoxImageExpressionClass.addItem("java.awt.Image");                // Image Vertical Alignments...        jComboBoxVerticalAlignment.addItem("Top");        jComboBoxVerticalAlignment.addItem("Middle");        jComboBoxVerticalAlignment.addItem("Bottom");                // Image Horizontal Alignments...        jComboBoxHorizontalAlignment.addItem("Left");        jComboBoxHorizontalAlignment.addItem("Center");        jComboBoxHorizontalAlignment.addItem("Right");                // Image Horizontal Alignments...        jComboBoxPDFFontName.addItem("Helvetica");        jComboBoxPDFFontName.addItem("Helvetica-Bold");        jComboBoxPDFFontName.addItem("Helvetica-BoldOblique");        jComboBoxPDFFontName.addItem("Helvetica-Oblique");        jComboBoxPDFFontName.addItem("Courier");        jComboBoxPDFFontName.addItem("Courier-Bold");        jComboBoxPDFFontName.addItem("Courier-BoldOblique");        jComboBoxPDFFontName.addItem("Courier-Oblique");        jComboBoxPDFFontName.addItem("Symbol");        jComboBoxPDFFontName.addItem("Times-Roman");        jComboBoxPDFFontName.addItem("Times-Bold");        jComboBoxPDFFontName.addItem("Times-BoldItalic");        jComboBoxPDFFontName.addItem("Times-Italic");        jComboBoxPDFFontName.addItem("ZapfDingbats");        jComboBoxPDFFontName.addItem("STSong-Light");        jComboBoxPDFFontName.addItem("MHei-Medium");        jComboBoxPDFFontName.addItem("MSung-Light");        jComboBoxPDFFontName.addItem("HeiseiKakuGo-W5");        jComboBoxPDFFontName.addItem("HeiseiMin-W3");        jComboBoxPDFFontName.addItem("HYGoThic-Medium");        jComboBoxPDFFontName.addItem("HYSMyeongJo-Medium");        jComboBoxPDFFontName.addItem("External TTF font...");                // Text Vertical Alignments...        jComboBoxVAlign.addItem("Top");        jComboBoxVAlign.addItem("Middle");        jComboBoxVAlign.addItem("Bottom");                // Image Horizontal Alignments...        jComboBoxHAlign.addItem("Left");        jComboBoxHAlign.addItem("Center");        jComboBoxHAlign.addItem("Right");        jComboBoxHAlign.addItem("Justified");                jNumberComboBoxSize.addEntry("3",3);        jNumberComboBoxSize.addEntry("5",5);        jNumberComboBoxSize.addEntry("8",8);        jNumberComboBoxSize.addEntry("10",10);        jNumberComboBoxSize.addEntry("12",12);        jNumberComboBoxSize.addEntry("14",14);        jNumberComboBoxSize.addEntry("18",18);        jNumberComboBoxSize.addEntry("24",24);        jNumberComboBoxSize.addEntry("36",36);        jNumberComboBoxSize.addEntry("48",48);                jComboBoxLineSpacing.addItem("Single");        jComboBoxLineSpacing.addItem("1_1_2");        jComboBoxLineSpacing.addItem("Double");                jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1250","CP1250 (Central European)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1251","CP1251 (Cyrillic)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1252","CP1252 (Western European ANSI aka WinAnsi)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1253","CP1253 (Greek)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1254","CP1254 (Turkish)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1255","CP1255 (Hebrew)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1256","CP1256 (Arabic)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1257","CP1257 (Baltic)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Cp1258","CP1258 (Vietnamese)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniGB-UCS2-H","UniGB-UCS2-H (Chinese Simplified)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniGB-UCS2-V","UniGB-UCS2-V (Chinese Simplified)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniCNS-UCS2-H","UniCNS-UCS2-H (Chinese traditional)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniCNS-UCS2-V","UniCNS-UCS2-V (Chinese traditional)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniJIS-UCS2-H","UniJIS-UCS2-H (Japanese)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniJIS-UCS2-V","UniJIS-UCS2-V (Japanese)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-H (Japanese)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniJIS-UCS2-HW-V","UniJIS-UCS2-HW-V (Japanese)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniKS-UCS2-H","UniKS-UCS2-H (Korean)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("UniKS-UCS2-V","UniKS-UCS2-V (Korean)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Identity-H","Identity-H (Unicode with horizontal writing)"));        jComboBoxPdfEncoding.addItem(new PdfEncoding("Identity-V","Identity-V (Unicode with vertical writing)"));                jComboBoxPattern.addItem(new PdfEncoding("#,##0.00"," #,##0.00 (example 1,234.56)"));                jComboBoxTextFieldExpressionClass.addItem("java.lang.Boolean");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Byte");        jComboBoxTextFieldExpressionClass.addItem("java.util.Date");        jComboBoxTextFieldExpressionClass.addItem("java.sql.Timestamp");        jComboBoxTextFieldExpressionClass.addItem("java.sql.Time");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Double");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Float");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Integer");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Long");        jComboBoxTextFieldExpressionClass.addItem("java.lang.Short");        jComboBoxTextFieldExpressionClass.addItem("java.math.BigDecimal");        jComboBoxTextFieldExpressionClass.addItem("java.lang.String");                // Text field Evaluation Time...        jComboBoxTextFieldEvaluationTime.addItem("Now");        jComboBoxTextFieldEvaluationTime.addItem("Report");        jComboBoxTextFieldEvaluationTime.addItem("Page");        jComboBoxTextFieldEvaluationTime.addItem("Column");        jComboBoxTextFieldEvaluationTime.addItem("Group");                jComboBoxSubreportConnectionType.addItem("Don't use connection or datasource");        jComboBoxSubreportConnectionType.addItem("Use connection expression");        jComboBoxSubreportConnectionType.addItem("Use datasource expression");                        jComboBoxSubreportExpressionClass.addItem("java.lang.String");        jComboBoxSubreportExpressionClass.addItem("java.io.File");        jComboBoxSubreportExpressionClass.addItem("java.net.URL");        jComboBoxSubreportExpressionClass.addItem("java.io.InputStream");        jComboBoxSubreportExpressionClass.addItem("dori.jasper.engine.JasperReport");                jComboBoxLinkType.addItem("None");        jComboBoxLinkType.addItem("Reference");        jComboBoxLinkType.addItem("LocalAnchor");        jComboBoxLinkType.addItem("LocalPage");        jComboBoxLinkType.addItem("RemoteAnchor");        jComboBoxLinkType.addItem("RemotePage");                // Barcode Evaluation Time...        jComboBoxEvaluationTimeBarcode.addItem("Now");        jComboBoxEvaluationTimeBarcode.addItem("Report");        jComboBoxEvaluationTimeBarcode.addItem("Page");        jComboBoxEvaluationTimeBarcode.addItem("Column");        jComboBoxEvaluationTimeBarcode.addItem("Group");                // Load Fonts...        String[] fontFamilies = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();        for (int i=0; i<fontFamilies.length; ++i) {            jComboBoxFontName.addItem(fontFamilies[i]);        }                this.jRTextExpressionAreaPrintWhenExpression.getDocument().addDocumentListener( new javax.swing.event.DocumentListener() {

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?