0001: /*
0002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003: *
0004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005: *
0006: * The contents of this file are subject to the terms of either the GNU
0007: * General Public License Version 2 only ("GPL") or the Common
0008: * Development and Distribution License("CDDL") (collectively, the
0009: * "License"). You may not use this file except in compliance with the
0010: * License. You can obtain a copy of the License at
0011: * http://www.netbeans.org/cddl-gplv2.html
0012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013: * specific language governing permissions and limitations under the
0014: * License. When distributing the software, include this License Header
0015: * Notice in each file and include the License file at
0016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
0017: * particular file as subject to the "Classpath" exception as provided
0018: * by Sun in the GPL Version 2 section of the License file that
0019: * accompanied this code. If applicable, add the following below the
0020: * License Header, with the fields enclosed by brackets [] replaced by
0021: * your own identifying information:
0022: * "Portions Copyrighted [year] [name of copyright owner]"
0023: *
0024: * Contributor(s):
0025: *
0026: * The Original Software is NetBeans. The Initial Developer of the Original
0027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
0028: * Microsystems, Inc. All Rights Reserved.
0029: *
0030: * If you wish your version of this file to be governed by only the CDDL
0031: * or only the GPL Version 2, indicate your decision by adding
0032: * "[Contributor] elects to include this software in this distribution
0033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034: * single choice of license, a recipient has the option to distribute
0035: * your version of this file under either the CDDL, the GPL Version 2 or
0036: * to extend the choice of license to its licensees as provided above.
0037: * However, if you add GPL Version 2 code and therefore, elected the GPL
0038: * Version 2 license, then the option applies only if the new code is
0039: * made subject to such option by the copyright holder.
0040: */
0041: /*
0042: * SVGAnimationRasterizer.java
0043: *
0044: * Created on November 30, 2005, 10:53 AM
0045: */
0046:
0047: package org.netbeans.modules.mobility.svgcore.export;
0048:
0049: import java.io.IOException;
0050: import javax.swing.ImageIcon;
0051: import javax.swing.JComboBox;
0052: import javax.swing.JComponent;
0053: import javax.swing.JLabel;
0054: import javax.swing.JSpinner;
0055: import javax.swing.SpinnerNumberModel;
0056: import javax.swing.SwingConstants;
0057: import javax.swing.SwingUtilities;
0058: import javax.swing.event.ChangeEvent;
0059: import javax.swing.event.ChangeListener;
0060: import javax.swing.text.BadLocationException;
0061: import org.netbeans.modules.mobility.svgcore.SVGDataObject;
0062: import org.netbeans.modules.mobility.svgcore.export.AnimationRasterizer.ColorReductionMethod;
0063: import org.netbeans.modules.mobility.svgcore.export.AnimationRasterizer.ImageType;
0064: import org.openide.util.Exceptions;
0065: import org.openide.util.RequestProcessor;
0066:
0067: /**
0068: *
0069: * @author Pavel Benes
0070: */
0071: public final class SVGImageRasterizerPanel extends SVGRasterizerPanel {
0072: private final ComponentGroup m_currentTime;
0073:
0074: /** Creates new form SVGAnimationRasterizer */
0075: public SVGImageRasterizerPanel(SVGDataObject dObj, String elementId)
0076: throws IOException, BadLocationException {
0077: super (dObj, elementId);
0078: initComponents();
0079:
0080: m_currentTime = createTimeGroup(currentTimeSpinner,
0081: animationSlider, true);
0082: createCompressionGroup(compressionLevelCombo,
0083: compressionQualitySpinner);
0084:
0085: radioExportAll.setEnabled(isInProject() && m_elementId == null);
0086: radioExportCurrent.setEnabled(isInProject());
0087:
0088: m_ratio = m_dim.getHeight() / m_dim.getWidth();
0089: spinnerHeight.setModel(new SpinnerNumberModel((int) m_dim
0090: .getHeight(), 1, 2048, 1));
0091: spinnerWidth.setModel(new SpinnerNumberModel((int) m_dim
0092: .getWidth(), 1, 2048, 1));
0093: spinnerWidth.getModel().addChangeListener(new ChangeListener() {
0094: public void stateChanged(ChangeEvent e) {
0095: if (keepRatio.isSelected()) {
0096: spinnerHeight.setValue(new Integer(
0097: (int) (((Integer) spinnerWidth.getValue())
0098: .doubleValue() * m_ratio)));
0099: }
0100: updateImage(spinnerWidth, true);
0101: }
0102: });
0103:
0104: updateImage(null, true);
0105: }
0106:
0107: /** This method is called from within the constructor to
0108: * initialize the form.
0109: * WARNING: Do NOT modify this code. The content of this method is
0110: * always regenerated by the Form Editor.
0111: */
0112: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
0113: private void initComponents() {
0114:
0115: buttonGroup1 = new javax.swing.ButtonGroup();
0116: sizePanel = new javax.swing.JPanel();
0117: javax.swing.JLabel jLabel11 = new javax.swing.JLabel();
0118: spinnerWidth = new javax.swing.JSpinner();
0119: javax.swing.JLabel jLabel12 = new javax.swing.JLabel();
0120: spinnerHeight = new javax.swing.JSpinner();
0121: keepRatio = new javax.swing.JCheckBox();
0122: optionsPanel = new javax.swing.JPanel();
0123: javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
0124: formatComboBox = new javax.swing.JComboBox();
0125: jPanel1 = new javax.swing.JPanel();
0126: progressiveCheckBox = new javax.swing.JCheckBox();
0127: compressionLabel = new javax.swing.JLabel();
0128: compressionLevelCombo = new JComboBox(
0129: AnimationRasterizer.CompressionLevel.values());
0130: compressionQualityLabel = new javax.swing.JLabel();
0131: transparentCheckBox = new javax.swing.JCheckBox();
0132: compressionQualitySpinner = new javax.swing.JSpinner();
0133: reductionLabel = new javax.swing.JLabel();
0134: reductionCombo = new JComboBox(
0135: AnimationRasterizer.ColorReductionMethod.values());
0136: timeLinePanel = new javax.swing.JPanel();
0137: currentTimeSpinner = new JSpinner(new SpinnerNumberModel(0.0,
0138: 0.0, 30.0, 1.0));
0139: javax.swing.JLabel startTimeLabel = new javax.swing.JLabel();
0140: animationSlider = new javax.swing.JSlider();
0141: exportPanel = new javax.swing.JPanel();
0142: radioExportCurrent = new javax.swing.JRadioButton();
0143: radioExportAll = new javax.swing.JRadioButton();
0144: jPanel3 = new javax.swing.JPanel();
0145: imageHolder = new javax.swing.JScrollPane();
0146: jPanel4 = new javax.swing.JPanel();
0147: javax.swing.JLabel previewFormatLabel = new javax.swing.JLabel();
0148: javax.swing.JLabel previewSizeLabel = new javax.swing.JLabel();
0149: javax.swing.JLabel previewFileLabel = new javax.swing.JLabel();
0150: previewFormatText = new javax.swing.JTextField();
0151: previewSizeText = new javax.swing.JTextField();
0152: previewFileText = new javax.swing.JTextField();
0153:
0154: sizePanel.setBorder(javax.swing.BorderFactory
0155: .createTitledBorder(org.openide.util.NbBundle
0156: .getMessage(SVGImageRasterizerPanel.class,
0157: "LBL_ImageSize"))); // NOI18N
0158:
0159: jLabel11.setLabelFor(spinnerWidth);
0160: org.openide.awt.Mnemonics.setLocalizedText(jLabel11,
0161: org.openide.util.NbBundle.getBundle(
0162: SVGImageRasterizerPanel.class).getString(
0163: "LBL_AnimationImageWidth")); // NOI18N
0164: jLabel11.setName(""); // NOI18N
0165:
0166: jLabel12.setLabelFor(spinnerHeight);
0167: org.openide.awt.Mnemonics.setLocalizedText(jLabel12,
0168: org.openide.util.NbBundle.getBundle(
0169: SVGImageRasterizerPanel.class).getString(
0170: "LBL_AnimationImageHeight")); // NOI18N
0171:
0172: spinnerHeight.setEnabled(false);
0173:
0174: keepRatio.setSelected(true);
0175: org.openide.awt.Mnemonics.setLocalizedText(keepRatio,
0176: org.openide.util.NbBundle.getBundle(
0177: SVGImageRasterizerPanel.class).getString(
0178: "LBL_AnimationKeepRatio")); // NOI18N
0179: keepRatio
0180: .setToolTipText("Images for other configurations are transformed using screen ratio.");
0181: keepRatio.setMargin(new java.awt.Insets(0, 0, 0, 0));
0182: keepRatio
0183: .addActionListener(new java.awt.event.ActionListener() {
0184: public void actionPerformed(
0185: java.awt.event.ActionEvent evt) {
0186: keepRatioActionPerformed(evt);
0187: }
0188: });
0189:
0190: org.jdesktop.layout.GroupLayout sizePanelLayout = new org.jdesktop.layout.GroupLayout(
0191: sizePanel);
0192: sizePanel.setLayout(sizePanelLayout);
0193: sizePanelLayout
0194: .setHorizontalGroup(sizePanelLayout
0195: .createParallelGroup(
0196: org.jdesktop.layout.GroupLayout.LEADING)
0197: .add(
0198: sizePanelLayout
0199: .createSequentialGroup()
0200: .add(
0201: sizePanelLayout
0202: .createParallelGroup(
0203: org.jdesktop.layout.GroupLayout.LEADING)
0204: .add(
0205: sizePanelLayout
0206: .createSequentialGroup()
0207: .addContainerGap()
0208: .add(
0209: sizePanelLayout
0210: .createParallelGroup(
0211: org.jdesktop.layout.GroupLayout.LEADING)
0212: .add(
0213: jLabel11)
0214: .add(
0215: jLabel12))
0216: .addPreferredGap(
0217: org.jdesktop.layout.LayoutStyle.RELATED)
0218: .add(
0219: sizePanelLayout
0220: .createParallelGroup(
0221: org.jdesktop.layout.GroupLayout.LEADING)
0222: .add(
0223: spinnerHeight,
0224: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0225: 56,
0226: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0227: .add(
0228: spinnerWidth,
0229: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0230: 56,
0231: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
0232: .add(
0233: sizePanelLayout
0234: .createSequentialGroup()
0235: .add(
0236: 12,
0237: 12,
0238: 12)
0239: .add(
0240: keepRatio)))
0241: .addContainerGap(104,
0242: Short.MAX_VALUE)));
0243: sizePanelLayout
0244: .setVerticalGroup(sizePanelLayout
0245: .createParallelGroup(
0246: org.jdesktop.layout.GroupLayout.LEADING)
0247: .add(
0248: sizePanelLayout
0249: .createSequentialGroup()
0250: .add(
0251: sizePanelLayout
0252: .createParallelGroup(
0253: org.jdesktop.layout.GroupLayout.BASELINE)
0254: .add(jLabel11)
0255: .add(
0256: spinnerWidth,
0257: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0258: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0259: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0260: .addPreferredGap(
0261: org.jdesktop.layout.LayoutStyle.RELATED)
0262: .add(
0263: sizePanelLayout
0264: .createParallelGroup(
0265: org.jdesktop.layout.GroupLayout.BASELINE)
0266: .add(jLabel12)
0267: .add(
0268: spinnerHeight,
0269: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0270: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0271: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0272: .addPreferredGap(
0273: org.jdesktop.layout.LayoutStyle.RELATED)
0274: .add(keepRatio)));
0275:
0276: jLabel11.getAccessibleContext().setAccessibleName(
0277: org.openide.util.NbBundle.getMessage(
0278: SVGImageRasterizerPanel.class,
0279: "ACCESSIBLE_NAME_jLabel11")); // NOI18N
0280: jLabel11.getAccessibleContext().setAccessibleDescription(
0281: org.openide.util.NbBundle.getMessage(
0282: SVGImageRasterizerPanel.class,
0283: "ACCESSIBLE_DESCRIPTION_jLabel11")); // NOI18N
0284: spinnerWidth.getAccessibleContext().setAccessibleName(
0285: org.openide.util.NbBundle.getMessage(
0286: SVGImageRasterizerPanel.class,
0287: "ACCESSIBLE_NAME_spinnerWidth")); // NOI18N
0288: spinnerWidth.getAccessibleContext().setAccessibleDescription(
0289: org.openide.util.NbBundle.getMessage(
0290: SVGImageRasterizerPanel.class,
0291: "ACCESSIBLE_DESCRIPTION_spinnerWidth")); // NOI18N
0292: jLabel12.getAccessibleContext().setAccessibleName(
0293: org.openide.util.NbBundle.getMessage(
0294: SVGImageRasterizerPanel.class,
0295: "ACCESSIBLE_NAME_jLabel12")); // NOI18N
0296: jLabel12.getAccessibleContext().setAccessibleDescription(
0297: org.openide.util.NbBundle.getMessage(
0298: SVGImageRasterizerPanel.class,
0299: "ACCESSIBLE_DESCRIPTION_jLabel12")); // NOI18N
0300: spinnerHeight.getAccessibleContext().setAccessibleName(
0301: "Image height");
0302: keepRatio.getAccessibleContext().setAccessibleName(
0303: org.openide.util.NbBundle.getMessage(
0304: SVGImageRasterizerPanel.class,
0305: "ACCESSIBLE_NAME_keepRatio")); // NOI18N
0306: keepRatio.getAccessibleContext().setAccessibleDescription(
0307: org.openide.util.NbBundle.getMessage(
0308: SVGImageRasterizerPanel.class,
0309: "ACCESSIBLE_DESCRIPTION_keepRatio")); // NOI18N
0310:
0311: optionsPanel.setBorder(javax.swing.BorderFactory
0312: .createTitledBorder(org.openide.util.NbBundle
0313: .getMessage(SVGImageRasterizerPanel.class,
0314: "LBL_ImageOptions"))); // NOI18N
0315:
0316: jLabel2.setLabelFor(formatComboBox);
0317: org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
0318: org.openide.util.NbBundle.getMessage(
0319: SVGImageRasterizerPanel.class,
0320: "LBL_OptionsFormat")); // NOI18N
0321:
0322: formatComboBox.setModel(createImageTypeComboBoxModel());
0323: formatComboBox
0324: .addActionListener(new java.awt.event.ActionListener() {
0325: public void actionPerformed(
0326: java.awt.event.ActionEvent evt) {
0327: formatComboBoxActionPerformed(evt);
0328: }
0329: });
0330:
0331: jPanel1.setLayout(new java.awt.GridBagLayout());
0332:
0333: org.openide.awt.Mnemonics.setLocalizedText(progressiveCheckBox,
0334: org.openide.util.NbBundle.getMessage(
0335: SVGImageRasterizerPanel.class,
0336: "LBL_OptionsProgressive")); // NOI18N
0337: progressiveCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
0338:
0339: compressionLabel.setLabelFor(compressionLevelCombo);
0340: org.openide.awt.Mnemonics.setLocalizedText(compressionLabel,
0341: org.openide.util.NbBundle.getMessage(
0342: SVGImageRasterizerPanel.class,
0343: "LBL_OptionsQuality")); // NOI18N
0344:
0345: compressionQualityLabel.setLabelFor(compressionQualitySpinner);
0346: org.openide.awt.Mnemonics.setLocalizedText(
0347: compressionQualityLabel, org.openide.util.NbBundle
0348: .getMessage(SVGImageRasterizerPanel.class,
0349: "LBL_OptionsRate")); // NOI18N
0350:
0351: org.openide.awt.Mnemonics.setLocalizedText(transparentCheckBox,
0352: org.openide.util.NbBundle.getMessage(
0353: SVGImageRasterizerPanel.class,
0354: "LBL_OptionsTransparent")); // NOI18N
0355: transparentCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
0356: transparentCheckBox
0357: .addActionListener(new java.awt.event.ActionListener() {
0358: public void actionPerformed(
0359: java.awt.event.ActionEvent evt) {
0360: transparencyChanged(evt);
0361: }
0362: });
0363:
0364: reductionLabel.setLabelFor(reductionCombo);
0365: org.openide.awt.Mnemonics.setLocalizedText(reductionLabel,
0366: org.openide.util.NbBundle.getMessage(
0367: SVGImageRasterizerPanel.class,
0368: "LBL_OptionsColorReduction")); // NOI18N
0369:
0370: reductionCombo
0371: .addActionListener(new java.awt.event.ActionListener() {
0372: public void actionPerformed(
0373: java.awt.event.ActionEvent evt) {
0374: colorReductionChanged(evt);
0375: }
0376: });
0377:
0378: org.jdesktop.layout.GroupLayout optionsPanelLayout = new org.jdesktop.layout.GroupLayout(
0379: optionsPanel);
0380: optionsPanel.setLayout(optionsPanelLayout);
0381: optionsPanelLayout
0382: .setHorizontalGroup(optionsPanelLayout
0383: .createParallelGroup(
0384: org.jdesktop.layout.GroupLayout.LEADING)
0385: .add(
0386: optionsPanelLayout
0387: .createSequentialGroup()
0388: .addContainerGap()
0389: .add(
0390: optionsPanelLayout
0391: .createParallelGroup(
0392: org.jdesktop.layout.GroupLayout.LEADING)
0393: .add(
0394: optionsPanelLayout
0395: .createSequentialGroup()
0396: .add(
0397: 245,
0398: 245,
0399: 245)
0400: .add(
0401: jPanel1,
0402: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0403: 48,
0404: Short.MAX_VALUE))
0405: .add(
0406: optionsPanelLayout
0407: .createSequentialGroup()
0408: .add(
0409: transparentCheckBox)
0410: .addContainerGap(
0411: 119,
0412: Short.MAX_VALUE))
0413: .add(
0414: optionsPanelLayout
0415: .createSequentialGroup()
0416: .add(
0417: compressionLabel)
0418: .addContainerGap(
0419: 89,
0420: Short.MAX_VALUE))
0421: .add(
0422: optionsPanelLayout
0423: .createSequentialGroup()
0424: .add(
0425: optionsPanelLayout
0426: .createParallelGroup(
0427: org.jdesktop.layout.GroupLayout.TRAILING,
0428: false)
0429: .add(
0430: org.jdesktop.layout.GroupLayout.LEADING,
0431: reductionCombo,
0432: 0,
0433: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0434: Short.MAX_VALUE)
0435: .add(
0436: org.jdesktop.layout.GroupLayout.LEADING,
0437: reductionLabel,
0438: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0439: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0440: Short.MAX_VALUE))
0441: .addContainerGap(
0442: 62,
0443: Short.MAX_VALUE))
0444: .add(
0445: org.jdesktop.layout.GroupLayout.TRAILING,
0446: optionsPanelLayout
0447: .createSequentialGroup()
0448: .add(
0449: optionsPanelLayout
0450: .createParallelGroup(
0451: org.jdesktop.layout.GroupLayout.TRAILING)
0452: .add(
0453: org.jdesktop.layout.GroupLayout.LEADING,
0454: optionsPanelLayout
0455: .createSequentialGroup()
0456: .add(
0457: jLabel2)
0458: .addPreferredGap(
0459: org.jdesktop.layout.LayoutStyle.UNRELATED)
0460: .add(
0461: formatComboBox,
0462: 0,
0463: 88,
0464: Short.MAX_VALUE))
0465: .add(
0466: org.jdesktop.layout.GroupLayout.LEADING,
0467: progressiveCheckBox)
0468: .add(
0469: optionsPanelLayout
0470: .createSequentialGroup()
0471: .add(
0472: compressionLevelCombo,
0473: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0474: 93,
0475: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0476: .addPreferredGap(
0477: org.jdesktop.layout.LayoutStyle.UNRELATED)
0478: .add(
0479: compressionQualityLabel)
0480: .addPreferredGap(
0481: org.jdesktop.layout.LayoutStyle.RELATED,
0482: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0483: Short.MAX_VALUE)
0484: .add(
0485: compressionQualitySpinner,
0486: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0487: 46,
0488: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
0489: .add(
0490: 106,
0491: 106,
0492: 106)))));
0493: optionsPanelLayout
0494: .setVerticalGroup(optionsPanelLayout
0495: .createParallelGroup(
0496: org.jdesktop.layout.GroupLayout.LEADING)
0497: .add(
0498: optionsPanelLayout
0499: .createSequentialGroup()
0500: .add(
0501: optionsPanelLayout
0502: .createParallelGroup(
0503: org.jdesktop.layout.GroupLayout.BASELINE)
0504: .add(jLabel2)
0505: .add(
0506: formatComboBox,
0507: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0508: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0509: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0510: .addPreferredGap(
0511: org.jdesktop.layout.LayoutStyle.RELATED)
0512: .add(progressiveCheckBox)
0513: .addPreferredGap(
0514: org.jdesktop.layout.LayoutStyle.RELATED)
0515: .add(transparentCheckBox)
0516: .add(14, 14, 14)
0517: .add(
0518: optionsPanelLayout
0519: .createParallelGroup(
0520: org.jdesktop.layout.GroupLayout.LEADING)
0521: .add(
0522: jPanel1,
0523: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0524: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0525: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0526: .add(
0527: reductionLabel))
0528: .addPreferredGap(
0529: org.jdesktop.layout.LayoutStyle.RELATED,
0530: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0531: Short.MAX_VALUE)
0532: .add(
0533: reductionCombo,
0534: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0535: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0536: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0537: .addPreferredGap(
0538: org.jdesktop.layout.LayoutStyle.UNRELATED)
0539: .add(compressionLabel)
0540: .addPreferredGap(
0541: org.jdesktop.layout.LayoutStyle.RELATED)
0542: .add(
0543: optionsPanelLayout
0544: .createParallelGroup(
0545: org.jdesktop.layout.GroupLayout.CENTER)
0546: .add(
0547: compressionQualitySpinner,
0548: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0549: 25,
0550: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0551: .add(
0552: compressionLevelCombo,
0553: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0554: 25,
0555: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0556: .add(
0557: compressionQualityLabel))
0558: .addContainerGap()));
0559:
0560: jLabel2.getAccessibleContext().setAccessibleName(
0561: org.openide.util.NbBundle.getMessage(
0562: SVGImageRasterizerPanel.class,
0563: "ACCESSIBLE_NAME_jLabel2")); // NOI18N
0564: jLabel2.getAccessibleContext().setAccessibleDescription(
0565: org.openide.util.NbBundle.getMessage(
0566: SVGImageRasterizerPanel.class,
0567: "ACCESSIBLE_DESCRIPTION_jLabel2")); // NOI18N
0568: formatComboBox.getAccessibleContext().setAccessibleName(
0569: org.openide.util.NbBundle.getMessage(
0570: SVGImageRasterizerPanel.class,
0571: "ACCESSIBLE_NAME_formatComboBox")); // NOI18N
0572: formatComboBox.getAccessibleContext().setAccessibleDescription(
0573: org.openide.util.NbBundle.getMessage(
0574: SVGImageRasterizerPanel.class,
0575: "ACCESSIBLE_DESCRIPTION_formatComboBox")); // NOI18N
0576: progressiveCheckBox.getAccessibleContext().setAccessibleName(
0577: org.openide.util.NbBundle.getMessage(
0578: SVGImageRasterizerPanel.class,
0579: "ACCESSIBLE_NAME_progressiveCheckBox")); // NOI18N
0580: progressiveCheckBox
0581: .getAccessibleContext()
0582: .setAccessibleDescription(
0583: org.openide.util.NbBundle
0584: .getMessage(
0585: SVGImageRasterizerPanel.class,
0586: "ACCESSIBLE_DESCRIPTION_progressiveCheckBox")); // NOI18N
0587: compressionLabel.getAccessibleContext().setAccessibleName(
0588: org.openide.util.NbBundle.getMessage(
0589: SVGImageRasterizerPanel.class,
0590: "ACCESSIBLE_NAME_compressionLabel")); // NOI18N
0591: compressionLabel
0592: .getAccessibleContext()
0593: .setAccessibleDescription(
0594: org.openide.util.NbBundle
0595: .getMessage(
0596: SVGImageRasterizerPanel.class,
0597: "ACCESSIBLE_DESCRIPTION_compressionLabel")); // NOI18N
0598: compressionLevelCombo.getAccessibleContext().setAccessibleName(
0599: org.openide.util.NbBundle.getMessage(
0600: SVGImageRasterizerPanel.class,
0601: "ACCESSIBLE_NAME_compressionLevelCombo")); // NOI18N
0602: compressionLevelCombo.getAccessibleContext()
0603: .setAccessibleDescription("Compression level");
0604: compressionQualityLabel
0605: .getAccessibleContext()
0606: .setAccessibleName(
0607: org.openide.util.NbBundle
0608: .getMessage(
0609: SVGImageRasterizerPanel.class,
0610: "ACCESSIBLE_NAME_compressionQualityLevel")); // NOI18N
0611: compressionQualityLabel
0612: .getAccessibleContext()
0613: .setAccessibleDescription(
0614: org.openide.util.NbBundle
0615: .getMessage(
0616: SVGImageRasterizerPanel.class,
0617: "ACCESSIBLE_DESCRIPTION_compressionQualityLevel")); // NOI18N
0618: transparentCheckBox.getAccessibleContext().setAccessibleName(
0619: org.openide.util.NbBundle.getMessage(
0620: SVGImageRasterizerPanel.class,
0621: "ACCESSIBLE_NAME_transparentCheckBox")); // NOI18N
0622: transparentCheckBox
0623: .getAccessibleContext()
0624: .setAccessibleDescription(
0625: org.openide.util.NbBundle
0626: .getMessage(
0627: SVGImageRasterizerPanel.class,
0628: "ACCESSIBLE_DESCRIPTION_transparentCheckBox")); // NOI18N
0629: compressionQualitySpinner
0630: .getAccessibleContext()
0631: .setAccessibleName(
0632: org.openide.util.NbBundle
0633: .getMessage(
0634: SVGImageRasterizerPanel.class,
0635: "ACCESSIBLE_NAME_compressionQualitySpinner")); // NOI18N
0636: compressionQualitySpinner
0637: .getAccessibleContext()
0638: .setAccessibleDescription(
0639: org.openide.util.NbBundle
0640: .getMessage(
0641: SVGImageRasterizerPanel.class,
0642: "ACCESSIBLE_DESCRIPTION_compressionQualitySpinner")); // NOI18N
0643: reductionLabel.getAccessibleContext().setAccessibleName(
0644: org.openide.util.NbBundle.getMessage(
0645: SVGImageRasterizerPanel.class,
0646: "ACCESSIBLE_NAME_reductionLabel")); // NOI18N
0647: reductionLabel.getAccessibleContext().setAccessibleDescription(
0648: org.openide.util.NbBundle.getMessage(
0649: SVGImageRasterizerPanel.class,
0650: "ACCESSIBLE_DESCRIPTION_reductionLabel")); // NOI18N
0651: reductionCombo.getAccessibleContext().setAccessibleName(
0652: org.openide.util.NbBundle.getMessage(
0653: SVGImageRasterizerPanel.class,
0654: "ACCESSIBLE_NAME_reductionCombo")); // NOI18N
0655: reductionCombo.getAccessibleContext().setAccessibleDescription(
0656: org.openide.util.NbBundle.getMessage(
0657: SVGImageRasterizerPanel.class,
0658: "ACCESSIBLE_DESCRIPTION_reductionCombo")); // NOI18N
0659:
0660: timeLinePanel.setBorder(javax.swing.BorderFactory
0661: .createTitledBorder(org.openide.util.NbBundle
0662: .getMessage(SVGImageRasterizerPanel.class,
0663: "LBL_AnimationFrameTime"))); // NOI18N
0664:
0665: startTimeLabel.setLabelFor(currentTimeSpinner);
0666: org.openide.awt.Mnemonics.setLocalizedText(startTimeLabel,
0667: org.openide.util.NbBundle.getBundle(
0668: SVGImageRasterizerPanel.class).getString(
0669: "LBL_AnimationTime")); // NOI18N
0670:
0671: org.jdesktop.layout.GroupLayout timeLinePanelLayout = new org.jdesktop.layout.GroupLayout(
0672: timeLinePanel);
0673: timeLinePanel.setLayout(timeLinePanelLayout);
0674: timeLinePanelLayout
0675: .setHorizontalGroup(timeLinePanelLayout
0676: .createParallelGroup(
0677: org.jdesktop.layout.GroupLayout.LEADING)
0678: .add(
0679: timeLinePanelLayout
0680: .createSequentialGroup()
0681: .addContainerGap()
0682: .add(
0683: timeLinePanelLayout
0684: .createParallelGroup(
0685: org.jdesktop.layout.GroupLayout.LEADING)
0686: .add(
0687: timeLinePanelLayout
0688: .createSequentialGroup()
0689: .add(
0690: startTimeLabel)
0691: .addPreferredGap(
0692: org.jdesktop.layout.LayoutStyle.RELATED)
0693: .add(
0694: currentTimeSpinner,
0695: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0696: 56,
0697: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0698: .add(
0699: animationSlider,
0700: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0701: 202,
0702: Short.MAX_VALUE))
0703: .addContainerGap()));
0704: timeLinePanelLayout
0705: .setVerticalGroup(timeLinePanelLayout
0706: .createParallelGroup(
0707: org.jdesktop.layout.GroupLayout.LEADING)
0708: .add(
0709: timeLinePanelLayout
0710: .createSequentialGroup()
0711: .add(
0712: timeLinePanelLayout
0713: .createParallelGroup(
0714: org.jdesktop.layout.GroupLayout.BASELINE)
0715: .add(
0716: startTimeLabel)
0717: .add(
0718: currentTimeSpinner,
0719: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0720: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0721: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0722: .addPreferredGap(
0723: org.jdesktop.layout.LayoutStyle.RELATED)
0724: .add(
0725: animationSlider,
0726: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0727: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0728: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
0729:
0730: currentTimeSpinner.getAccessibleContext().setAccessibleName(
0731: org.openide.util.NbBundle.getMessage(
0732: SVGImageRasterizerPanel.class,
0733: "ACCESSIBLE_NAME_currentTimeSpinner")); // NOI18N
0734: currentTimeSpinner
0735: .getAccessibleContext()
0736: .setAccessibleDescription(
0737: org.openide.util.NbBundle
0738: .getMessage(
0739: SVGImageRasterizerPanel.class,
0740: "ACCESSIBLE_DESCRIPTION_startTimeLabel")); // NOI18N
0741: startTimeLabel.getAccessibleContext().setAccessibleName(
0742: org.openide.util.NbBundle.getMessage(
0743: SVGImageRasterizerPanel.class,
0744: "ACCESSIBLE_NAME_startTimeLabel")); // NOI18N
0745: startTimeLabel.getAccessibleContext().setAccessibleDescription(
0746: org.openide.util.NbBundle.getMessage(
0747: SVGImageRasterizerPanel.class,
0748: "ACCESSIBLE_DESCRIPTION_startTimeLabel")); // NOI18N
0749: animationSlider.getAccessibleContext().setAccessibleName(
0750: org.openide.util.NbBundle.getMessage(
0751: SVGImageRasterizerPanel.class,
0752: "ACCESSIBLE_NAME_animationSlider")); // NOI18N
0753: animationSlider
0754: .getAccessibleContext()
0755: .setAccessibleDescription(
0756: org.openide.util.NbBundle
0757: .getMessage(
0758: SVGImageRasterizerPanel.class,
0759: "ACCESSIBLE_DESCRIPTION_animationSlider")); // NOI18N
0760:
0761: exportPanel.setBorder(javax.swing.BorderFactory
0762: .createTitledBorder(org.openide.util.NbBundle
0763: .getMessage(SVGImageRasterizerPanel.class,
0764: "LBL_ExportLabel"))); // NOI18N
0765:
0766: buttonGroup1.add(radioExportCurrent);
0767: radioExportCurrent.setSelected(true);
0768: org.openide.awt.Mnemonics.setLocalizedText(radioExportCurrent,
0769: org.openide.util.NbBundle.getBundle(
0770: SVGImageRasterizerPanel.class).getString(
0771: "LBL_AnimationOnlyActiveConfiguration")); // NOI18N
0772: radioExportCurrent.setMargin(new java.awt.Insets(0, 0, 0, 0));
0773:
0774: buttonGroup1.add(radioExportAll);
0775: org.openide.awt.Mnemonics.setLocalizedText(radioExportAll,
0776: org.openide.util.NbBundle.getBundle(
0777: SVGImageRasterizerPanel.class).getString(
0778: "LBL_AnimationAllConfigurations")); // NOI18N
0779: radioExportAll.setMargin(new java.awt.Insets(0, 0, 0, 0));
0780:
0781: org.jdesktop.layout.GroupLayout exportPanelLayout = new org.jdesktop.layout.GroupLayout(
0782: exportPanel);
0783: exportPanel.setLayout(exportPanelLayout);
0784: exportPanelLayout
0785: .setHorizontalGroup(exportPanelLayout
0786: .createParallelGroup(
0787: org.jdesktop.layout.GroupLayout.LEADING)
0788: .add(
0789: exportPanelLayout
0790: .createSequentialGroup()
0791: .addContainerGap()
0792: .add(
0793: exportPanelLayout
0794: .createParallelGroup(
0795: org.jdesktop.layout.GroupLayout.LEADING)
0796: .add(
0797: radioExportCurrent)
0798: .add(
0799: radioExportAll))
0800: .addContainerGap(
0801: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0802: Short.MAX_VALUE)));
0803: exportPanelLayout
0804: .setVerticalGroup(exportPanelLayout
0805: .createParallelGroup(
0806: org.jdesktop.layout.GroupLayout.LEADING)
0807: .add(
0808: exportPanelLayout
0809: .createSequentialGroup()
0810: .add(radioExportCurrent)
0811: .addPreferredGap(
0812: org.jdesktop.layout.LayoutStyle.RELATED,
0813: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0814: Short.MAX_VALUE).add(
0815: radioExportAll)));
0816:
0817: radioExportCurrent.getAccessibleContext().setAccessibleName(
0818: org.openide.util.NbBundle.getMessage(
0819: SVGImageRasterizerPanel.class,
0820: "ACCESSIBLE_NAME_radioExportCurrent")); // NOI18N
0821: radioExportCurrent
0822: .getAccessibleContext()
0823: .setAccessibleDescription(
0824: org.openide.util.NbBundle
0825: .getMessage(
0826: SVGImageRasterizerPanel.class,
0827: "ACCESSIBLE_DESCRIPTION_radioExportCurrent")); // NOI18N
0828: radioExportAll.getAccessibleContext().setAccessibleName(
0829: org.openide.util.NbBundle.getMessage(
0830: SVGImageRasterizerPanel.class,
0831: "ACCESSIBLE_NAME_radioExportAll")); // NOI18N
0832: radioExportAll.getAccessibleContext().setAccessibleDescription(
0833: org.openide.util.NbBundle.getMessage(
0834: SVGImageRasterizerPanel.class,
0835: "ACCESSIBLE_DESCRIPTION_radioExportAll")); // NOI18N
0836:
0837: jPanel3.setBorder(javax.swing.BorderFactory
0838: .createTitledBorder(org.openide.util.NbBundle
0839: .getMessage(SVGImageRasterizerPanel.class,
0840: "LBL_PreviewTitle"))); // NOI18N
0841:
0842: imageHolder.setBorder(javax.swing.BorderFactory
0843: .createEtchedBorder());
0844:
0845: jPanel4.setBorder(javax.swing.BorderFactory
0846: .createEtchedBorder());
0847:
0848: previewFormatLabel.setLabelFor(previewFormatText);
0849: previewFormatLabel.setText(org.openide.util.NbBundle
0850: .getMessage(SVGImageRasterizerPanel.class,
0851: "LBL_PreviewFormat")); // NOI18N
0852:
0853: previewSizeLabel.setLabelFor(previewSizeText);
0854: previewSizeLabel.setText(org.openide.util.NbBundle.getMessage(
0855: SVGImageRasterizerPanel.class, "LBL_PreviewSize")); // NOI18N
0856:
0857: previewFileLabel.setLabelFor(previewFileText);
0858: previewFileLabel.setText(org.openide.util.NbBundle.getMessage(
0859: SVGImageRasterizerPanel.class, "LBL_PreviewFile")); // NOI18N
0860:
0861: previewFormatText.setEditable(false);
0862: previewFormatText.setText("JPEG");
0863:
0864: previewSizeText.setEditable(false);
0865: previewSizeText.setText("200 KBytes");
0866:
0867: previewFileText.setEditable(false);
0868: previewFileText.setText("C:\\Program Files\\about.svg");
0869:
0870: org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(
0871: jPanel4);
0872: jPanel4.setLayout(jPanel4Layout);
0873: jPanel4Layout
0874: .setHorizontalGroup(jPanel4Layout
0875: .createParallelGroup(
0876: org.jdesktop.layout.GroupLayout.LEADING)
0877: .add(
0878: jPanel4Layout
0879: .createSequentialGroup()
0880: .addContainerGap()
0881: .add(
0882: jPanel4Layout
0883: .createParallelGroup(
0884: org.jdesktop.layout.GroupLayout.LEADING)
0885: .add(
0886: previewFormatLabel)
0887: .add(
0888: previewSizeLabel)
0889: .add(
0890: previewFileLabel))
0891: .addPreferredGap(
0892: org.jdesktop.layout.LayoutStyle.UNRELATED)
0893: .add(
0894: jPanel4Layout
0895: .createParallelGroup(
0896: org.jdesktop.layout.GroupLayout.LEADING)
0897: .add(
0898: previewSizeText,
0899: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0900: 82,
0901: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
0902: .add(
0903: previewFileText,
0904: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0905: 269,
0906: Short.MAX_VALUE)
0907: .add(
0908: previewFormatText,
0909: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0910: 64,
0911: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0912: .addContainerGap()));
0913: jPanel4Layout
0914: .setVerticalGroup(jPanel4Layout
0915: .createParallelGroup(
0916: org.jdesktop.layout.GroupLayout.LEADING)
0917: .add(
0918: jPanel4Layout
0919: .createSequentialGroup()
0920: .addContainerGap()
0921: .add(
0922: jPanel4Layout
0923: .createParallelGroup(
0924: org.jdesktop.layout.GroupLayout.BASELINE)
0925: .add(
0926: previewFormatLabel)
0927: .add(
0928: previewFormatText,
0929: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0930: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0931: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0932: .addPreferredGap(
0933: org.jdesktop.layout.LayoutStyle.RELATED)
0934: .add(
0935: jPanel4Layout
0936: .createParallelGroup(
0937: org.jdesktop.layout.GroupLayout.BASELINE)
0938: .add(
0939: previewSizeLabel)
0940: .add(
0941: previewSizeText,
0942: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0943: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0944: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0945: .addPreferredGap(
0946: org.jdesktop.layout.LayoutStyle.RELATED)
0947: .add(
0948: jPanel4Layout
0949: .createParallelGroup(
0950: org.jdesktop.layout.GroupLayout.BASELINE)
0951: .add(
0952: previewFileLabel)
0953: .add(
0954: previewFileText,
0955: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
0956: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0957: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
0958: .addContainerGap(
0959: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
0960: Short.MAX_VALUE)));
0961:
0962: previewFormatLabel.getAccessibleContext().setAccessibleName(
0963: org.openide.util.NbBundle.getMessage(
0964: SVGImageRasterizerPanel.class,
0965: "ACCESSIBLE_NAME_previewFormatLabel")); // NOI18N
0966: previewFormatLabel
0967: .getAccessibleContext()
0968: .setAccessibleDescription(
0969: org.openide.util.NbBundle
0970: .getMessage(
0971: SVGImageRasterizerPanel.class,
0972: "ACCESSIBLE_DESCRIPTION_previewFormatLabel")); // NOI18N
0973: previewSizeLabel.getAccessibleContext().setAccessibleName(
0974: org.openide.util.NbBundle.getMessage(
0975: SVGImageRasterizerPanel.class,
0976: "ACCESSIBLE_NAME_previewSizeLabel")); // NOI18N
0977: previewSizeLabel
0978: .getAccessibleContext()
0979: .setAccessibleDescription(
0980: org.openide.util.NbBundle
0981: .getMessage(
0982: SVGImageRasterizerPanel.class,
0983: "ACCESSIBLE_DESCRIPTION_previewSizeLabel")); // NOI18N
0984: previewFileLabel.getAccessibleContext().setAccessibleName(
0985: org.openide.util.NbBundle.getMessage(
0986: SVGImageRasterizerPanel.class,
0987: "ACCESSIBLE_NAME_previewFileLabel")); // NOI18N
0988: previewFileLabel
0989: .getAccessibleContext()
0990: .setAccessibleDescription(
0991: org.openide.util.NbBundle
0992: .getMessage(
0993: SVGImageRasterizerPanel.class,
0994: "ACCESSIBLE_DESCRIPTION_previewFileLabel")); // NOI18N
0995: previewFormatText.getAccessibleContext().setAccessibleName(
0996: org.openide.util.NbBundle.getMessage(
0997: SVGImageRasterizerPanel.class,
0998: "ACCESSIBLE_NAME_previewFormatText")); // NOI18N
0999: previewFormatText
1000: .getAccessibleContext()
1001: .setAccessibleDescription(
1002: org.openide.util.NbBundle
1003: .getMessage(
1004: SVGImageRasterizerPanel.class,
1005: "ACCESSIBLE_DESCRIPTION_previewFormatLabel")); // NOI18N
1006: previewSizeText.getAccessibleContext().setAccessibleName(
1007: org.openide.util.NbBundle.getMessage(
1008: SVGImageRasterizerPanel.class,
1009: "ACCESSIBLE_NAME_previewSizeText")); // NOI18N
1010: previewSizeText
1011: .getAccessibleContext()
1012: .setAccessibleDescription(
1013: org.openide.util.NbBundle
1014: .getMessage(
1015: SVGImageRasterizerPanel.class,
1016: "ACCESSIBLE_DESCRIPTION_previewSizeText")); // NOI18N
1017: previewFileText.getAccessibleContext().setAccessibleName(
1018: org.openide.util.NbBundle.getMessage(
1019: SVGImageRasterizerPanel.class,
1020: "ACCESSIBLE_NAME_previewFileText")); // NOI18N
1021: previewFileText
1022: .getAccessibleContext()
1023: .setAccessibleDescription(
1024: org.openide.util.NbBundle
1025: .getMessage(
1026: SVGImageRasterizerPanel.class,
1027: "ACCESSIBLE_DESCRIPTION_previewFileText")); // NOI18N
1028:
1029: org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(
1030: jPanel3);
1031: jPanel3.setLayout(jPanel3Layout);
1032: jPanel3Layout
1033: .setHorizontalGroup(jPanel3Layout
1034: .createParallelGroup(
1035: org.jdesktop.layout.GroupLayout.LEADING)
1036: .add(
1037: jPanel3Layout
1038: .createSequentialGroup()
1039: .addContainerGap()
1040: .add(
1041: jPanel3Layout
1042: .createParallelGroup(
1043: org.jdesktop.layout.GroupLayout.LEADING)
1044: .add(
1045: org.jdesktop.layout.GroupLayout.TRAILING,
1046: imageHolder,
1047: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1048: 371,
1049: Short.MAX_VALUE)
1050: .add(
1051: org.jdesktop.layout.GroupLayout.TRAILING,
1052: jPanel4,
1053: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1054: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1055: Short.MAX_VALUE))
1056: .addContainerGap()));
1057: jPanel3Layout
1058: .setVerticalGroup(jPanel3Layout
1059: .createParallelGroup(
1060: org.jdesktop.layout.GroupLayout.LEADING)
1061: .add(
1062: org.jdesktop.layout.GroupLayout.TRAILING,
1063: jPanel3Layout
1064: .createSequentialGroup()
1065: .add(
1066: imageHolder,
1067: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1068: 349, Short.MAX_VALUE)
1069: .addPreferredGap(
1070: org.jdesktop.layout.LayoutStyle.RELATED)
1071: .add(
1072: jPanel4,
1073: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
1074: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1075: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
1076: .addContainerGap()));
1077:
1078: imageHolder.getAccessibleContext().setAccessibleName(
1079: org.openide.util.NbBundle.getMessage(
1080: SVGImageRasterizerPanel.class,
1081: "ACCESSIBLE_NAME_imageHolder")); // NOI18N
1082: imageHolder.getAccessibleContext().setAccessibleDescription(
1083: org.openide.util.NbBundle.getMessage(
1084: SVGImageRasterizerPanel.class,
1085: "ACCESSIBLE_DESCRIPTION_imageHolder")); // NOI18N
1086:
1087: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
1088: this );
1089: this .setLayout(layout);
1090: layout
1091: .setHorizontalGroup(layout
1092: .createParallelGroup(
1093: org.jdesktop.layout.GroupLayout.LEADING)
1094: .add(
1095: org.jdesktop.layout.GroupLayout.TRAILING,
1096: layout
1097: .createSequentialGroup()
1098: .addContainerGap()
1099: .add(
1100: jPanel3,
1101: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1102: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1103: Short.MAX_VALUE)
1104: .addPreferredGap(
1105: org.jdesktop.layout.LayoutStyle.RELATED)
1106: .add(
1107: layout
1108: .createParallelGroup(
1109: org.jdesktop.layout.GroupLayout.LEADING,
1110: false)
1111: .add(
1112: sizePanel,
1113: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1114: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1115: Short.MAX_VALUE)
1116: .add(
1117: timeLinePanel,
1118: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1119: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1120: Short.MAX_VALUE)
1121: .add(
1122: exportPanel,
1123: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1124: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1125: Short.MAX_VALUE)
1126: .add(
1127: optionsPanel,
1128: 0,
1129: 248,
1130: Short.MAX_VALUE))
1131: .addContainerGap()));
1132: layout
1133: .setVerticalGroup(layout
1134: .createParallelGroup(
1135: org.jdesktop.layout.GroupLayout.LEADING)
1136: .add(
1137: org.jdesktop.layout.GroupLayout.TRAILING,
1138: layout
1139: .createSequentialGroup()
1140: .addContainerGap()
1141: .add(
1142: layout
1143: .createParallelGroup(
1144: org.jdesktop.layout.GroupLayout.TRAILING)
1145: .add(
1146: org.jdesktop.layout.GroupLayout.LEADING,
1147: jPanel3,
1148: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1149: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1150: Short.MAX_VALUE)
1151: .add(
1152: org.jdesktop.layout.GroupLayout.LEADING,
1153: layout
1154: .createSequentialGroup()
1155: .add(
1156: sizePanel,
1157: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
1158: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1159: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
1160: .addPreferredGap(
1161: org.jdesktop.layout.LayoutStyle.RELATED)
1162: .add(
1163: optionsPanel,
1164: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
1165: 233,
1166: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
1167: .addPreferredGap(
1168: org.jdesktop.layout.LayoutStyle.RELATED)
1169: .add(
1170: timeLinePanel,
1171: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
1172: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1173: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
1174: .addPreferredGap(
1175: org.jdesktop.layout.LayoutStyle.RELATED)
1176: .add(
1177: exportPanel,
1178: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
1179: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
1180: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
1181: .addContainerGap()));
1182:
1183: sizePanel.getAccessibleContext().setAccessibleName(
1184: org.openide.util.NbBundle.getMessage(
1185: SVGImageRasterizerPanel.class,
1186: "ACCESSIBLE_NAME_sizePanel")); // NOI18N
1187: sizePanel.getAccessibleContext().setAccessibleDescription(
1188: org.openide.util.NbBundle.getMessage(
1189: SVGImageRasterizerPanel.class,
1190: "ACCESSIBLE_DESCRIPTION_sizePanel")); // NOI18N
1191: optionsPanel.getAccessibleContext().setAccessibleName(
1192: org.openide.util.NbBundle.getMessage(
1193: SVGImageRasterizerPanel.class,
1194: "ACCESSIBLE_NAME_optionsPanel")); // NOI18N
1195: optionsPanel.getAccessibleContext().setAccessibleDescription(
1196: org.openide.util.NbBundle.getMessage(
1197: SVGImageRasterizerPanel.class,
1198: "ACCESSIBLE_DESCRIPTION_optionsPanel")); // NOI18N
1199: timeLinePanel.getAccessibleContext().setAccessibleName(
1200: org.openide.util.NbBundle.getMessage(
1201: SVGImageRasterizerPanel.class,
1202: "ACCESSIBLE_NAME_timeLinePanel")); // NOI18N
1203: timeLinePanel.getAccessibleContext().setAccessibleDescription(
1204: org.openide.util.NbBundle.getMessage(
1205: SVGImageRasterizerPanel.class,
1206: "ACCESSIBLE_DESCRIPTION_timeLinePanel")); // NOI18N
1207: exportPanel.getAccessibleContext().setAccessibleName(
1208: org.openide.util.NbBundle.getMessage(
1209: SVGImageRasterizerPanel.class,
1210: "ACCESSIBLE_NAME_exportPanel")); // NOI18N
1211: exportPanel.getAccessibleContext().setAccessibleDescription(
1212: org.openide.util.NbBundle.getMessage(
1213: SVGImageRasterizerPanel.class,
1214: "ACCESSIBLE_DESCRIPTION_exportPanel")); // NOI18N
1215: jPanel3.getAccessibleContext().setAccessibleName(
1216: org.openide.util.NbBundle.getMessage(
1217: SVGImageRasterizerPanel.class,
1218: "ACCESSIBLE_NAME_jPanel3")); // NOI18N
1219: jPanel3.getAccessibleContext().setAccessibleDescription(
1220: org.openide.util.NbBundle.getMessage(
1221: SVGImageRasterizerPanel.class,
1222: "ACCESSIBLE_DESCRIPTION_jpanel3")); // NOI18N
1223: }// </editor-fold>//GEN-END:initComponents
1224:
1225: private void colorReductionChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorReductionChanged
1226: updateImage((JComponent) evt.getSource(), true);
1227: }//GEN-LAST:event_colorReductionChanged
1228:
1229: private void transparencyChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transparencyChanged
1230: updateImage((JComponent) evt.getSource(), true);
1231: }//GEN-LAST:event_transparencyChanged
1232:
1233: private void formatComboBoxActionPerformed(
1234: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_formatComboBoxActionPerformed
1235: updateImage((JComponent) evt.getSource(), true);
1236: }//GEN-LAST:event_formatComboBoxActionPerformed
1237:
1238: private void keepRatioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepRatioActionPerformed
1239: spinnerHeight.setEnabled(!keepRatio.isSelected());
1240: }//GEN-LAST:event_keepRatioActionPerformed
1241:
1242: // Variables declaration - do not modify//GEN-BEGIN:variables
1243: private javax.swing.JSlider animationSlider;
1244: private javax.swing.ButtonGroup buttonGroup1;
1245: private javax.swing.JLabel compressionLabel;
1246: private javax.swing.JComboBox compressionLevelCombo;
1247: private javax.swing.JLabel compressionQualityLabel;
1248: private javax.swing.JSpinner compressionQualitySpinner;
1249: private javax.swing.JSpinner currentTimeSpinner;
1250: private javax.swing.JPanel exportPanel;
1251: private javax.swing.JComboBox formatComboBox;
1252: private javax.swing.JScrollPane imageHolder;
1253: private javax.swing.JPanel jPanel1;
1254: private javax.swing.JPanel jPanel3;
1255: private javax.swing.JPanel jPanel4;
1256: private javax.swing.JCheckBox keepRatio;
1257: private javax.swing.JPanel optionsPanel;
1258: private javax.swing.JTextField previewFileText;
1259: private javax.swing.JTextField previewFormatText;
1260: private javax.swing.JTextField previewSizeText;
1261: private javax.swing.JCheckBox progressiveCheckBox;
1262: private javax.swing.JRadioButton radioExportAll;
1263: private javax.swing.JRadioButton radioExportCurrent;
1264: private javax.swing.JComboBox reductionCombo;
1265: private javax.swing.JLabel reductionLabel;
1266: private javax.swing.JPanel sizePanel;
1267: private javax.swing.JSpinner spinnerHeight;
1268: private javax.swing.JSpinner spinnerWidth;
1269: private javax.swing.JPanel timeLinePanel;
1270: private javax.swing.JCheckBox transparentCheckBox;
1271:
1272: // End of variables declaration//GEN-END:variables
1273:
1274: public int getImageWidth() {
1275: return m_overrideWidth != -1 ? m_overrideWidth
1276: : ((Integer) spinnerWidth.getValue()).intValue();
1277: }
1278:
1279: public int getImageHeight() {
1280: return m_overrideHeight != -1 ? m_overrideHeight
1281: : ((Integer) spinnerHeight.getValue()).intValue();
1282: }
1283:
1284: public boolean isForAllConfigurations() {
1285: return radioExportAll.isSelected();
1286: }
1287:
1288: public float getCompressionQuality() {
1289: int sliderValue = ((Number) compressionQualitySpinner
1290: .getValue()).intValue();
1291: return ((float) sliderValue) / 100f;
1292: }
1293:
1294: public boolean isProgressive() {
1295: return progressiveCheckBox.isSelected();
1296: }
1297:
1298: public boolean isTransparent() {
1299: return transparentCheckBox.isSelected();
1300: }
1301:
1302: public AnimationRasterizer.ImageType getImageType() {
1303: return (AnimationRasterizer.ImageType) formatComboBox
1304: .getSelectedItem();
1305: }
1306:
1307: public ColorReductionMethod getColorReductionMethod() {
1308: return (ColorReductionMethod) reductionCombo.getSelectedItem();
1309: }
1310:
1311: public float getStartTime() {
1312: return m_currentTime.getValue();
1313: }
1314:
1315: public int getNumberFrames() {
1316: return 1;
1317: }
1318:
1319: public boolean isInSingleImage() {
1320: return true;
1321: }
1322:
1323: protected void updateImage(JComponent source,
1324: boolean isOutputChanged) {
1325: final JLabel label = new JLabel("Updating image...");
1326: label.setHorizontalAlignment(SwingConstants.CENTER);
1327: label.setVerticalAlignment(SwingConstants.CENTER);
1328: imageHolder.setViewportView(label);
1329:
1330: final ImageType imgType = getImageType();
1331: boolean supportsCompression = imgType.supportsCompression();
1332:
1333: compressionQualitySpinner.setEnabled(supportsCompression);
1334: compressionLevelCombo.setEnabled(supportsCompression);
1335: compressionLabel.setEnabled(supportsCompression);
1336: compressionQualityLabel.setEnabled(supportsCompression);
1337:
1338: boolean needsColorReduction = imgType.needsColorReduction();
1339: reductionCombo.setEnabled(needsColorReduction);
1340: reductionLabel.setEnabled(needsColorReduction);
1341:
1342: if (imgType.supportsTransparency()) {
1343: transparentCheckBox.setEnabled(true);
1344: } else {
1345: transparentCheckBox.setEnabled(false);
1346: transparentCheckBox.setSelected(false);
1347: }
1348:
1349: String filenameRoot = AnimationRasterizer.createFileNameRoot(
1350: m_dObj, this , null, true);
1351: final String fileName = AnimationRasterizer.createFileName(
1352: filenameRoot, this , -1, -1);
1353: final float currentTime = m_currentTime.getValue();
1354:
1355: RequestProcessor.getDefault().post(new Runnable() {
1356: public void run() {
1357: try {
1358: final AnimationRasterizer.PreviewInfo preview = AnimationRasterizer
1359: .previewFrame(getSVGImage(),
1360: SVGImageRasterizerPanel.this , -1,
1361: currentTime);
1362: SwingUtilities.invokeLater(new Runnable() {
1363: public void run() {
1364: String sizeText;
1365: if (preview.m_imageSize < 1024) {
1366: sizeText = preview.m_imageSize
1367: + " Bytes";
1368: } else {
1369: sizeText = (Math
1370: .round(preview.m_imageSize / 102.4) / 10.0)
1371: + " KBytes";
1372: }
1373: previewSizeText.setText(sizeText);
1374: previewFormatText
1375: .setText(preview.m_imageFormat);
1376: //TODO Handle images not saved yet
1377: previewFileText.setText(fileName);
1378: label.setText(null);
1379: label
1380: .setIcon(new ImageIcon(
1381: preview.m_image));
1382: label.invalidate();
1383: imageHolder.validate();
1384: imageHolder.repaint();
1385: }
1386: });
1387: } catch (Exception ex) {
1388: Exceptions.printStackTrace(ex);
1389: }
1390: }
1391: });
1392: }
1393: }
|