Changeset 15206

Show
Ignore:
Timestamp:
23.04.2008 17:28:06 (12 years ago)
Author:
oranfry
Message:

work on the GUI of the installer

Location:
release-kits/shared/ant-installer
Files:
28 modified

Legend:

Unmodified
Added
Removed
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java

    r14982 r15206  
    1818import java.awt.Dimension; 
    1919import java.awt.Font; 
     20import java.awt.Color; 
    2021 
     22import javax.swing.JTextArea; 
    2123import javax.swing.JLabel; 
    2224import javax.swing.JPanel; 
     
    3032    extends SwingOutputFieldRenderer { 
    3133 
    32     protected AILabel fieldLabel = new AILabel(); 
     34    protected JTextArea fieldLabel = new JTextArea(); 
     35    //protected AILabel fieldLabel = new AILabel(); 
    3336    // hack callback, should move this to superclass 
    3437    protected JTextComponent explanatoryTextField; 
     
    5154 
    5255    public void initComponent(JPanel parent){ 
     56        fieldLabel.setLineWrap(true); 
     57        fieldLabel.setWrapStyleWord(true); 
     58        fieldLabel.setEditable(false); 
     59        fieldLabel.setBackground( parent.getBackground() ); 
    5360        try { 
    5461            jbInit(); 
     
    98105    } 
    99106    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        /* 
    101120        if(overflow){ 
    102121            fieldLabel.setOverflow(SizeConstants.OVERFLOW_TOTAL_SIZE); 
     
    104123            fieldLabel.setOverflow(new Dimension(SizeConstants.FIELD_WIDTH + SizeConstants.LABEL_WIDTH, SizeConstants.FIELD_HEIGHT)); 
    105124        } 
     125        */ 
    106126        return ++row; 
    107127    } 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java

    r14982 r15206  
    1717 
    1818import java.awt.BorderLayout; 
     19import java.awt.FlowLayout; 
     20import javax.swing.BoxLayout; 
    1921import java.awt.Dimension; 
    2022import java.awt.event.ActionEvent; 
     
    2527import javax.swing.JFileChooser; 
    2628import javax.swing.JPanel; 
     29import javax.swing.JLabel; 
    2730 
    2831import org.tp23.antinstaller.input.DirectoryInput; 
     
    4144    private DefaultingDirectoryChooser chooser = null; 
    4245 
    43     protected AILabel fieldLabel = new AILabel(); 
     46    protected JLabel fieldLabel = new AILabel(); 
    4447    protected AIShortTextField jTextField = new AIShortTextField(); 
    4548    protected AIButton browseButton = new AIButton(); 
     
    125128 
    126129    } 
    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); 
    130136        if(overflow){ 
    131137            jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java

    r14982 r15206  
    2121import java.awt.Font; 
    2222import java.awt.GridBagLayout; 
     23import java.awt.GridLayout; 
     24import javax.swing.BoxLayout; 
     25import java.awt.FlowLayout; 
    2326import java.awt.Insets; 
    2427import java.util.ArrayList; 
    2528 
    2629import javax.swing.BorderFactory; 
     30import javax.swing.JFrame; 
    2731import javax.swing.JLabel; 
    2832import javax.swing.JPanel; 
    2933import javax.swing.JScrollPane; 
    3034import javax.swing.JTextArea; 
     35import javax.swing.ToolTipManager; 
    3136 
    3237import org.tp23.antinstaller.ValidationException; 
     
    5459 
    5560    private JPanel contentPanel = new JPanel(); 
     61 
    5662     
    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(); 
    5866    private GBCF cf = new GBCF(); // GridBagConstraintsFactory 
    5967    private boolean overflow = false; 
     
    9199 
    92100    public void instanceInit() throws Exception { 
     101 
     102        ToolTipManager.sharedInstance().setInitialDelay(0); 
     103        ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE); 
     104 
     105 
    93106        overflow = ((SimpleInputPage)page).isOverflow(); 
    94107        if(overflow){ 
    95108            //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)); 
    97110            scroller = new JScrollPane(); 
    98111            scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
     
    102115                            BorderFactory.createEtchedBorder()               
    103116                            )); 
    104             add(scroller, BorderLayout.CENTER); 
    105117            scroller.getViewport().add(contentPanel); 
     118 
     119            masterPanel.add( scroller, BorderLayout.CENTER ); 
    106120            //contentPanel.setBackground(Color.red); 
    107121        } 
    108122        else { 
    109             this.add(contentPanel, BorderLayout.CENTER); 
     123            masterPanel.add(contentPanel, BorderLayout.CENTER); 
    110124            contentPanel.setBorder(BorderFactory.createEmptyBorder(SizeConstants.TOP_INDENT, 4, 4, 4)); 
    111125        } 
     
    113127        OutputField[] fields = page.getOutputField(); 
    114128        contentPanel.setDoubleBuffered(true); 
    115         contentPanel.setLayout(gridLayout); 
     129        contentPanel.setLayout(layout); 
    116130        int row = 0; 
    117131        for (int i = 0; i < fields.length; i++) { 
    118132            SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); 
    119             String text = fields[i].getExplanatoryText(); 
     133/*          String text = fields[i].getExplanatoryText(); 
    120134            if(fields[i].getExplanatoryText() != null){ 
    121135                JTextArea area = new DisplayTextArea(contentPanel.getBackground(), contentPanel.getForeground()); 
     136                //JTextArea area = new JTextArea(); 
     137                //area.setBackground( new Color(0xaaaaff) ); 
    122138                area.setIgnoreRepaint(true); 
    123                 area.setFont( defaultFont ); 
    124                 area.setText(text); 
     139            area.setFont( defaultFont ); 
     140            area.setText(text); 
     141                //area.setLineWrap(true); 
    125142                contentPanel.add(area, cf.getSpan(row++)); 
    126                 if(fields[i] instanceof CommentOutput){ 
    127                     CommentOutputRenderer crenderer = (CommentOutputRenderer)renderer; 
    128                     crenderer.setExplanatoryTextField(area); 
    129                     if(fields[i].getDisplayText() == null){ 
    130                         continue; 
    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               } 
    132149                } 
    133150            } 
     151*/ 
    134152            renderer.setOutputField(fields[i]); 
    135153            renderer.setInstallerContext(ctx); 
     
    160178    } 
    161179 
    162     public Dimension getPreferredSize(){ 
     180/*  public Dimension getPreferredSize(){ 
    163181        Dimension pref = super.getPreferredSize(); 
    164182        return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); 
     
    167185        Dimension pref = super.getMinimumSize(); 
    168186        return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); 
    169     } 
     187    }*/ 
    170188} 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java

    r14982 r15206  
    2424 
    2525    // Page size constants 
    26     public static int PAGE_WIDTH = 472; // orig value 472 
    27     public static int PAGE_HEIGHT = 400;// orig value 400 
    28     public static int LABEL_WIDTH = 175;// orig value 175 
     26    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 
    2929     
    3030    public static int TITLE_IMAGE_HEIGHT = 100; 
     
    3838    public static int FIELD_WIDTH = SizeConstants.PAGE_WIDTH - SizeConstants.LABEL_WIDTH - SizeConstants.LEFT_INDENT; 
    3939    public static int SHORT_FIELD_WIDTH = FIELD_WIDTH - SizeConstants.BUTTON_WIDTH; 
     40 
    4041    // overflow resizing 
    41     // in the gridbaglayout is seems that only preferred size 
     42    // in the gridbaglayout it seems that only preferred size 
    4243    // is significant 
    4344    private static int OVERFLOW_REDUCTION = 40; 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java

    r14982 r15206  
    6161    private JButton nextButton = new JButton(); 
    6262    private JButton finishButton = new JButton(); 
     63 
     64    public JPanel masterPanel = new JPanel( new BorderLayout() ); 
    6365 
    6466    private JPanel titlePanel = new JPanel(); 
     
    120122        controlPanel.setBorder(tripleBorder); 
    121123 
    122         this.add(titlePanel, BorderLayout.NORTH); 
     124        masterPanel.add(titlePanel, BorderLayout.NORTH); 
     125        this.add(masterPanel, BorderLayout.NORTH); 
    123126        this.add(controlPanel, BorderLayout.SOUTH); 
    124127 
     
    132135        titleLayout.setRows(2); 
    133136        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)); 
    137140 
    138141        titleLabel.setText(page.getDisplayText()); 
    139142        titleLabel.setFont(titleFont); 
    140143        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)); 
    144147 
    145148        // Ctrl Panel 
     
    266269        return backButton; 
    267270    } 
    268  
    269271} 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java

    r14982 r15206  
    1919import java.awt.event.ActionListener; 
    2020 
     21import java.awt.BorderLayout; 
     22import java.awt.FlowLayout; 
     23import java.awt.Dimension; 
     24 
    2125import javax.swing.JPanel; 
     26import javax.swing.JLabel; 
     27import javax.swing.JCheckBox; 
    2228 
    2329import org.tp23.antinstaller.input.InputField; 
     
    3137    protected TargetInput outputField; 
    3238 
    33     protected AILabel fieldLabel = new AILabel(); 
    34     protected AICheckBox targetCheckBox = new AICheckBox(); 
     39    protected AILabel fieldLabel = new AILabel(); 
     40    protected JCheckBox targetCheckBox = new JCheckBox(); 
    3541 
    3642    public TargetInputRenderer() { 
     
    8793    } 
    8894    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        //} 
    94119        return ++row; 
    95120    } 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java

    r14982 r15206  
    2020import java.awt.event.KeyAdapter; 
    2121import java.awt.event.KeyEvent; 
     22import java.awt.Dimension; 
     23import java.awt.Insets; 
    2224 
     25import java.awt.FlowLayout; 
     26import java.awt.GridLayout; 
     27import java.awt.BorderLayout; 
    2328import javax.swing.JPanel; 
    2429 
     
    6469    private void jbInit() throws Exception { 
    6570        fieldLabel.setText(inputField.getDisplayText()); 
     71        fieldLabel.setMinimumSize( new Dimension( SizeConstants.LABEL_WIDTH, 0) ); 
     72 
    6673        jTextField.setText(inputField.getDefaultValue()); 
    6774        jTextField.addActionListener(new ActionListener() { 
     
    8087    } 
    8188    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 
    84103        if(overflow){ 
    85104            jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/runtime/SwingRunner.java

    r14982 r15206  
    9797            frame.setSize(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT); 
    9898            frame.getRootPane().setDoubleBuffered(true); 
    99             setLocation(frame); 
     99            frame.setResizable( true ); 
     100            //setLocation(frame); 
    100101            setIcon(frame, installer); 
    101102