Changeset 15206 for release-kits
- Timestamp:
- 2008-04-23T17:28:06+12:00 (16 years ago)
- Location:
- release-kits/shared/ant-installer
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java
r14982 r15206 18 18 import java.awt.Dimension; 19 19 import java.awt.Font; 20 import java.awt.Color; 20 21 22 import javax.swing.JTextArea; 21 23 import javax.swing.JLabel; 22 24 import javax.swing.JPanel; … … 30 32 extends SwingOutputFieldRenderer { 31 33 32 protected AILabel fieldLabel = new AILabel(); 34 protected JTextArea fieldLabel = new JTextArea(); 35 //protected AILabel fieldLabel = new AILabel(); 33 36 // hack callback, should move this to superclass 34 37 protected JTextComponent explanatoryTextField; … … 51 54 52 55 public void initComponent(JPanel parent){ 56 fieldLabel.setLineWrap(true); 57 fieldLabel.setWrapStyleWord(true); 58 fieldLabel.setEditable(false); 59 fieldLabel.setBackground( parent.getBackground() ); 53 60 try { 54 61 jbInit(); … … 98 105 } 99 106 public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { 100 content.add(fieldLabel, cf.getSpan(row)); 107 108 //JPanel np = new JPanel(); 109 //np.setLayout( new FlowLayout() ); 110 //np.add( fieldLabel ); 111 112 content.add(fieldLabel); 113 114 JPanel p = new JPanel(); 115 p.setMinimumSize( new Dimension(0,1) ); 116 content.add(p); 117 118 //content.add(fieldLabel); 119 /* 101 120 if(overflow){ 102 121 fieldLabel.setOverflow(SizeConstants.OVERFLOW_TOTAL_SIZE); … … 104 123 fieldLabel.setOverflow(new Dimension(SizeConstants.FIELD_WIDTH + SizeConstants.LABEL_WIDTH, SizeConstants.FIELD_HEIGHT)); 105 124 } 125 */ 106 126 return ++row; 107 127 } -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java
r14982 r15206 17 17 18 18 import java.awt.BorderLayout; 19 import java.awt.FlowLayout; 20 import javax.swing.BoxLayout; 19 21 import java.awt.Dimension; 20 22 import java.awt.event.ActionEvent; … … 25 27 import javax.swing.JFileChooser; 26 28 import javax.swing.JPanel; 29 import javax.swing.JLabel; 27 30 28 31 import org.tp23.antinstaller.input.DirectoryInput; … … 41 44 private DefaultingDirectoryChooser chooser = null; 42 45 43 protected AILabel fieldLabel = new AILabel();46 protected JLabel fieldLabel = new AILabel(); 44 47 protected AIShortTextField jTextField = new AIShortTextField(); 45 48 protected AIButton browseButton = new AIButton(); … … 125 128 126 129 } 127 public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { 128 content.add(fieldLabel,cf.getCell(row,0)); 129 content.add(browsePanel,cf.getCell(row,1)); 130 public int addSelf(JPanel content,GBCF cf, int row, boolean overflow) { 131 FlowLayout l = new FlowLayout(FlowLayout.LEFT); 132 JPanel p = new JPanel(l); 133 p.add(fieldLabel); 134 content.add(p); 135 content.add(browsePanel); 130 136 if(overflow){ 131 137 jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java
r14982 r15206 21 21 import java.awt.Font; 22 22 import java.awt.GridBagLayout; 23 import java.awt.GridLayout; 24 import javax.swing.BoxLayout; 25 import java.awt.FlowLayout; 23 26 import java.awt.Insets; 24 27 import java.util.ArrayList; 25 28 26 29 import javax.swing.BorderFactory; 30 import javax.swing.JFrame; 27 31 import javax.swing.JLabel; 28 32 import javax.swing.JPanel; 29 33 import javax.swing.JScrollPane; 30 34 import javax.swing.JTextArea; 35 import javax.swing.ToolTipManager; 31 36 32 37 import org.tp23.antinstaller.ValidationException; … … 54 59 55 60 private JPanel contentPanel = new JPanel(); 61 56 62 57 private GridBagLayout gridLayout = new GridBagLayout(); 63 //private GridBagLayout gridLayout = new GridBagLayout(); 64 private BoxLayout layout = new BoxLayout(contentPanel,BoxLayout.Y_AXIS); 65 //private BorderLayout layout = new BorderLayout(); 58 66 private GBCF cf = new GBCF(); // GridBagConstraintsFactory 59 67 private boolean overflow = false; … … 91 99 92 100 public void instanceInit() throws Exception { 101 102 ToolTipManager.sharedInstance().setInitialDelay(0); 103 ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE); 104 105 93 106 overflow = ((SimpleInputPage)page).isOverflow(); 94 107 if(overflow){ 95 108 //WARNING this causes flickering in the UI 96 contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH - 50, SizeConstants.PAGE_HEIGHT));109 //contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH - 50, SizeConstants.PAGE_HEIGHT)); 97 110 scroller = new JScrollPane(); 98 111 scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); … … 102 115 BorderFactory.createEtchedBorder() 103 116 )); 104 add(scroller, BorderLayout.CENTER);105 117 scroller.getViewport().add(contentPanel); 118 119 masterPanel.add( scroller, BorderLayout.CENTER ); 106 120 //contentPanel.setBackground(Color.red); 107 121 } 108 122 else { 109 this.add(contentPanel, BorderLayout.CENTER);123 masterPanel.add(contentPanel, BorderLayout.CENTER); 110 124 contentPanel.setBorder(BorderFactory.createEmptyBorder(SizeConstants.TOP_INDENT, 4, 4, 4)); 111 125 } … … 113 127 OutputField[] fields = page.getOutputField(); 114 128 contentPanel.setDoubleBuffered(true); 115 contentPanel.setLayout( gridLayout);129 contentPanel.setLayout(layout); 116 130 int row = 0; 117 131 for (int i = 0; i < fields.length; i++) { 118 132 SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); 119 String text = fields[i].getExplanatoryText();133 /* String text = fields[i].getExplanatoryText(); 120 134 if(fields[i].getExplanatoryText() != null){ 121 135 JTextArea area = new DisplayTextArea(contentPanel.getBackground(), contentPanel.getForeground()); 136 //JTextArea area = new JTextArea(); 137 //area.setBackground( new Color(0xaaaaff) ); 122 138 area.setIgnoreRepaint(true); 123 area.setFont( defaultFont ); 124 area.setText(text); 139 area.setFont( defaultFont ); 140 area.setText(text); 141 //area.setLineWrap(true); 125 142 contentPanel.add(area, cf.getSpan(row++)); 126 127 128 129 130 131 143 if(fields[i] instanceof CommentOutput){ 144 CommentOutputRenderer crenderer = (CommentOutputRenderer)renderer; 145 crenderer.setExplanatoryTextField(area); 146 if(fields[i].getDisplayText() == null){ 147 continue; 148 } 132 149 } 133 150 } 151 */ 134 152 renderer.setOutputField(fields[i]); 135 153 renderer.setInstallerContext(ctx); … … 160 178 } 161 179 162 public Dimension getPreferredSize(){180 /* public Dimension getPreferredSize(){ 163 181 Dimension pref = super.getPreferredSize(); 164 182 return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); … … 167 185 Dimension pref = super.getMinimumSize(); 168 186 return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); 169 } 187 }*/ 170 188 } -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java
r14982 r15206 24 24 25 25 // Page size constants 26 public static int PAGE_WIDTH = 472; // orig value 47227 public static int PAGE_HEIGHT = 4 00;// orig value 40028 public static int LABEL_WIDTH = 175;// orig value 17526 public static int PAGE_WIDTH = 640; // orig value 472 27 public static int PAGE_HEIGHT = 480;// orig value 400 28 public static int LABEL_WIDTH = 200;// orig value 175 29 29 30 30 public static int TITLE_IMAGE_HEIGHT = 100; … … 38 38 public static int FIELD_WIDTH = SizeConstants.PAGE_WIDTH - SizeConstants.LABEL_WIDTH - SizeConstants.LEFT_INDENT; 39 39 public static int SHORT_FIELD_WIDTH = FIELD_WIDTH - SizeConstants.BUTTON_WIDTH; 40 40 41 // overflow resizing 41 // in the gridbaglayout i sseems that only preferred size42 // in the gridbaglayout it seems that only preferred size 42 43 // is significant 43 44 private static int OVERFLOW_REDUCTION = 40; -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java
r14982 r15206 61 61 private JButton nextButton = new JButton(); 62 62 private JButton finishButton = new JButton(); 63 64 public JPanel masterPanel = new JPanel( new BorderLayout() ); 63 65 64 66 private JPanel titlePanel = new JPanel(); … … 120 122 controlPanel.setBorder(tripleBorder); 121 123 122 this.add(titlePanel, BorderLayout.NORTH); 124 masterPanel.add(titlePanel, BorderLayout.NORTH); 125 this.add(masterPanel, BorderLayout.NORTH); 123 126 this.add(controlPanel, BorderLayout.SOUTH); 124 127 … … 132 135 titleLayout.setRows(2); 133 136 titleLayout.setVgap(2); 134 titlePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT));135 titlePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT));136 titlePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT));137 //titlePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); 138 //titlePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); 139 //titlePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); 137 140 138 141 titleLabel.setText(page.getDisplayText()); 139 142 titleLabel.setFont(titleFont); 140 143 setImage(page.getImageResource()); 141 imagePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT));142 imagePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT));143 imagePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT));144 //imagePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); 145 //imagePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); 146 //imagePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); 144 147 145 148 // Ctrl Panel … … 266 269 return backButton; 267 270 } 268 269 271 } -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java
r14982 r15206 19 19 import java.awt.event.ActionListener; 20 20 21 import java.awt.BorderLayout; 22 import java.awt.FlowLayout; 23 import java.awt.Dimension; 24 21 25 import javax.swing.JPanel; 26 import javax.swing.JLabel; 27 import javax.swing.JCheckBox; 22 28 23 29 import org.tp23.antinstaller.input.InputField; … … 31 37 protected TargetInput outputField; 32 38 33 34 protected AICheckBox targetCheckBox = new AICheckBox();39 protected AILabel fieldLabel = new AILabel(); 40 protected JCheckBox targetCheckBox = new JCheckBox(); 35 41 36 42 public TargetInputRenderer() { … … 87 93 } 88 94 public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { 89 content.add(fieldLabel,cf.getCell(row, 0)); 90 content.add(targetCheckBox,cf.getCell(row, 1)); 91 if(overflow){ 92 targetCheckBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); 93 } 95 96 JLabel h = new JLabel("help"); 97 h.setToolTipText(outputField.getExplanatoryText()); 98 99 JPanel p, pp; 100 101 pp = new JPanel(new FlowLayout(FlowLayout.LEFT)); 102 pp.add( targetCheckBox ); 103 pp.add( h ); 104 105 p = new JPanel(new BorderLayout()); 106 p.add( fieldLabel, BorderLayout.WEST ); 107 p.add( pp, BorderLayout.CENTER ); 108 content.add(p); 109 110 p = new JPanel(); 111 p.setMinimumSize( new Dimension(0,1) ); 112 content.add(p); 113 114 115 116 //if(overflow){ 117 // targetCheckBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); 118 //} 94 119 return ++row; 95 120 } -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java
r14982 r15206 20 20 import java.awt.event.KeyAdapter; 21 21 import java.awt.event.KeyEvent; 22 import java.awt.Dimension; 23 import java.awt.Insets; 22 24 25 import java.awt.FlowLayout; 26 import java.awt.GridLayout; 27 import java.awt.BorderLayout; 23 28 import javax.swing.JPanel; 24 29 … … 64 69 private void jbInit() throws Exception { 65 70 fieldLabel.setText(inputField.getDisplayText()); 71 fieldLabel.setMinimumSize( new Dimension( SizeConstants.LABEL_WIDTH, 0) ); 72 66 73 jTextField.setText(inputField.getDefaultValue()); 67 74 jTextField.addActionListener(new ActionListener() { … … 80 87 } 81 88 public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { 82 content.add(fieldLabel,cf.getCell(row,0)); 83 content.add(jTextField,cf.getCell(row,1)); 89 JPanel p; 90 91 //p = new JPanel(new FlowLayout(FlowLayout.LEFT)); 92 BorderLayout l = new BorderLayout(); 93 p = new JPanel(l); 94 p.add( fieldLabel, BorderLayout.WEST ); 95 p.add( jTextField, BorderLayout.CENTER ); 96 content.add(p); 97 98 p = new JPanel(); 99 p.setMinimumSize( new Dimension(0,1) ); 100 content.add(p); 101 102 84 103 if(overflow){ 85 104 jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); -
release-kits/shared/ant-installer/src/org/tp23/antinstaller/runtime/SwingRunner.java
r14982 r15206 97 97 frame.setSize(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT); 98 98 frame.getRootPane().setDoubleBuffered(true); 99 setLocation(frame); 99 frame.setResizable( true ); 100 //setLocation(frame); 100 101 setIcon(frame, installer); 101 102
Note:
See TracChangeset
for help on using the changeset viewer.