1 18 package org.apache.batik.apps.svgbrowser; 19 20 import java.awt.Component ; 21 import java.awt.GridBagConstraints ; 22 import java.awt.GridBagLayout ; 23 import java.awt.Insets ; 24 25 import javax.swing.JCheckBox ; 26 import javax.swing.JLabel ; 27 28 import org.apache.batik.util.gui.ExtendedGridBagConstraints; 29 30 37 public class PNGOptionPanel extends OptionPanel { 38 39 42 protected JCheckBox check; 43 44 47 public PNGOptionPanel() { 48 super(new GridBagLayout ()); 49 50 ExtendedGridBagConstraints constraints = 51 new ExtendedGridBagConstraints(); 52 53 54 constraints.insets = new Insets (5, 5, 5, 5); 55 56 constraints.weightx = 0; 57 constraints.weighty = 0; 58 constraints.fill = GridBagConstraints.NONE; 59 constraints.setGridBounds(0, 0, 1, 1); 60 add(new JLabel (resources.getString("PNGOptionPanel.label")), 61 constraints); 62 63 check=new JCheckBox (); 64 65 constraints.weightx = 1.0; 66 constraints.fill = GridBagConstraints.HORIZONTAL; 67 constraints.setGridBounds(1, 0, 1, 1); 68 add(check, constraints); 69 } 70 71 74 public boolean isIndexed() { 75 return check.isSelected(); 76 } 77 78 81 public static boolean showDialog(Component parent) { 82 String title = resources.getString("PNGOptionPanel.dialog.title"); 83 PNGOptionPanel panel = new PNGOptionPanel(); 84 Dialog dialog = new Dialog(parent, title, panel); 85 dialog.pack(); 86 dialog.show(); 87 return panel.isIndexed(); 88 } 89 } 90 | Popular Tags |