Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /antelope/src/ise/antelope/app/

antelope
Discussion topic

Back to topic list

CVS update: /antelope/src/ise/antelope/app/

Author danson
Full name Dale Anson
Date 2004-05-18 21:51:35 PDT
Message User: danson
Date: 04/05/18 21:51:35

Added:
 /antelope/src/ise/antelope/app/
  StatusBar.java

Modified:
 /antelope/src/ise/antelope/app/
  Antelope.java

Log:
 general commit
 
 Issue number:
 Obtained from:
 Submitted by:
 Reviewed by:

File Changes:

Directory: /antelope/src/ise/antelope/app/
====================​====================​==

File [changed]: Antelope.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/app/Antelope.​java?r1=1.8&r2=1​.9
Delta lines: +819 -793
-----------------------
--- Antelope.java 8 May 2004 02:42:55 -0000 1.8
+++ Antelope.java 19 May 2004 04:51:33 -0000 1.9
@@ -1,4 +1,4 @@
-// $Id: Antelope.java,v 1.8 2004/05/08 02:42:55 danson Exp $
+// $Id: Antelope.java,v 1.9 2004/05/19 04:51:33 danson Exp $
 
 /*
  * Based on the Apache Software License, Version 1.1
@@ -68,7 +68,8 @@
 /**
  * Main entry point for Antelope application.
  *
- * @version $Revision: 1.8 $
+ * @author Dale Anson
+ * @version $Revision: 1.9 $
  */
 public class Antelope extends JFrame implements Constants, CommonHelper {
 
@@ -98,6 +99,8 @@
    
    private File _build_file = null;
 
+ private StatusBar status = null;
+
    /** Constructor for the Antelope object */
    public Antelope() {
       this( null );
@@ -121,8 +124,24 @@
       }
       _antelope_panel = new AntelopePanel( build_file, this, false );
 
+ _antelope_panel.addA​ctionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ String cmd = ae.getActionCommand();
+ if (cmd == null || cmd.length() == 0)
+ return ;
+ status.setStatus(cmd);
+
+ }
+ }
+ );
+
+
+ JPanel contents = new JPanel(new BorderLayout());
       JSplitPane split_pane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, _antelope_panel, _tabs );
- setContentPane( split_pane );
+ contents.add(split_pane, BorderLayout.CENTER);
+ status = new StatusBar();
+ contents.add(status, BorderLayout.SOUTH);
+ setContentPane( contents );
 
       String font_family = Constants.PREFS.get( FONT_FAMILY, "Monospaced" );
       int font_style = Constants.PREFS.getInt( FONT_STYLE, Font.PLAIN );
@@ -414,6 +433,13 @@
          }
       );
       _editor = new JEditTextArea();
+ _editor.addCaretListener(new CaretListener() {
+ public void caretUpdate(CaretEvent ce) {
+ int dot = ce.getDot();
+ status.setLine(_edit​or.getLineOfOffset(d​ot), _editor.getLineCount());
+ }
+ }
+ );
       OptionSettings settings = new OptionSettings();
       settings.load();
       settings.apply( _editor );
@@ -516,6 +542,7 @@
       GUIUtils.fillScreen( this );
       split_pane.setDividerLocation( 0.25 );
       setVisible( true );
+ status.setStatus("Antelope ready.");
    }
 
 
@@ -567,11 +594,11 @@
    public void openFile( File file ) {
       final File build_file = file;
       if (build_file == null)
- return;
+ return ;
       if (build_file.isDirectory())
- return;
+ return ;
       if (build_file.equals(_​build_file))
- return;
+ return ;
       try {
          FileReader reader = new FileReader( build_file );
          StringWriter writer = new StringWriter();
@@ -780,8 +807,7 @@
       return null;
    }
 
- public void reloadAnt() {
- }
+ public void reloadAnt() {}
 
    /**
     * Expects the name of a target as the action command. Moves the cursor to
@@ -848,7 +874,7 @@
       try {
          Class.forName("ise.a​ntelope.common.Const​ants");
       }
- catch(Exception e) {
+ catch (Exception e) {
          e.printStackTrace();
       }
       

File [added]: StatusBar.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/app/StatusBar​.java?rev=1.1&co​ntent-type=text/vnd.​viewcvs-markup
Added lines: 40
---------------
package ise.antelope.app;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import ise.library.*;

public class StatusBar extends JPanel {
    
    private JTextField _field;
    private JTextField _line;
    
    public StatusBar() {
        setLayout(new LambdaLayout());
        _field = new JTextField(80);
        _field.setEditable(false);
        _field.setBackground​(Color.WHITE);
        _line = new JTextField();
        _line.setEditable(false);
        _line.setBackground(​Color.WHITE);
        add(_field, "0, 0, 10, 1, 0, wh, 1");
        add(_line, "11, 0, R, 1, 0, wh, 1");
    }
    
    public void setStatus(String status) {
        if (status == null)
            status = "";
        _field.setText(status);
    }
    
    public String getStatus() {
        return _field.getText();
    }
    
    public void setLine(int line, int total) {
        _line.setText(String​.valueOf(line) + ":" + String.valueOf(total));
    }
    
}




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@ante​lope.tigris.org
For additional commands, e-mail: cvs-help at antelope dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /antelope/src/ise/antelope/app/ danson Dale Anson 2004-05-18 21:51:35 PDT
Messages per page: