fix the throbber and tweak documentation

This commit is contained in:
rj.keller%beonex.com 2005-05-06 23:44:23 +00:00
parent e8a593bb2b
commit dba8c3b6ca
7 changed files with 67 additions and 77 deletions

View File

@ -21,20 +21,8 @@ Building Grendel:
8. To clean out the dist directory of all build products, type 'ant clean'.
NOTE TO MAC USERS:
We are no longer supporting JDK 1.4.x, so Grendel will not run on MacOS 9.x or earlier. You'll have
to upgrade to Mac OS X if you want to run Grendel. Support for building with Project Builder is
forthcoming. Please note also that the application settings in Project Builder (especially the
MRJAppBuilder related settings) should NOT be changed without a VERY compelling reason. Changing
these settings may cause Grendel to fail to run in your particular environment. The creator code
'GRen' is registered with Apple, so please don't change that setting. If you want to use Icon
Composer to change the application icons to something you like better than an envelope, go ahead.
You'll find the Project Builder project and resource files in PBProj/Grendel.pbproj and
PBProj/Grendel.icns. Project Builder will put the build products in PBProj/build. You can double-
click Grendel in the Finder to launch Grendel. Note that I'm still working on figuring out how to
get Project Builder to copy the jars from extlib into the right place in the app bundle, so if you
get a "NoClassDefFound" exception at startup (you'll see it if you run Grendel from within Project
Builder after building it), you'll need to use Terminal to copy the jars into
Grendel.app/Contents/Resources/Java/ , at least for now.
We are no longer supporting JDK 1.4.x, so Grendel will not run on MacOS 10.2 or earlier. You'll have
to upgrade to Mac OS 10.3 if you want to run Grendel.
Happy haquing!

View File

@ -24,6 +24,7 @@ package calypso.util;
import java.net.*;
import java.util.*;
import java.util.logging.*;
import java.util.zip.*;
import java.io.*;

View File

@ -37,6 +37,7 @@ import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.util.logging.*;
import javax.swing.*;
import javax.swing.text.*;
@ -67,6 +68,8 @@ public class AddressBook extends GeneralFrame {
protected int mColumnSorted;
Preferences prefs = PreferencesFactory.Get();
private static final Logger logger = Logger.getLogger("calypso.util");
public static void main(String[] args) {
AddressBook AddressBookFrame = new AddressBook();
AddressBookFrame.addWindowListener(new AppCloser());
@ -99,7 +102,7 @@ public class AddressBook extends GeneralFrame {
// try {
//open a connection to the LDAP server
System.out.println ("Opening server " + mReadableName);
logger.info("Opening server " + mReadableName);
ICardSource Four11AddressBook = getCardSource();
@ -109,7 +112,7 @@ public class AddressBook extends GeneralFrame {
String[] attributes = {"givenName", "sn", "cn", "o", "mail", "telephoneNumber", "city"};
//query the LDAP server.
System.out.println ("Send query" + query);
logger.info("Send query" + query);
ICardSet cardSet = Four11AddressBook.getCardSet (query, attributes);
//Sort the list.
@ -122,7 +125,7 @@ public class AddressBook extends GeneralFrame {
//enumerate thru the cards.
for (Enumeration cardEnum = cardSet.getEnumeration();
cardEnum.hasMoreElements(); ) {
System.out.println ("got card");
logger.info ("got card");
//get the addres card
ICard card = (ICard) cardEnum.nextElement();
//get the attributes for this card
@ -181,10 +184,10 @@ public class AddressBook extends GeneralFrame {
}
// }
// catch( LDAPException e ) {
// System.out.println( "Error: " + e.toString() );
// infologger.info( "Error: " + e.toString() );
// }
System.out.println ("Done.");
logger.info ("Done.");
return retVecVec;
}
}
@ -220,7 +223,7 @@ public class AddressBook extends GeneralFrame {
}
protected ICardSource getCardSource() {
System.out.println("Entering in the getCardSource");
logger.info("Entering in the getCardSource");
return new ACS_Personal (mFileName, false);
}
public String getFileName () { return mFileName; }
@ -570,9 +573,9 @@ public class AddressBook extends GeneralFrame {
if (!mSortAscending) {
mSortAscending = true;
DataModel dm = (DataModel) mTable.getModel ();
System.out.println("Column Name is " + ColumnName);
logger.info("Column Name is " + ColumnName);
int colnumber = dm.findColumn(ColumnName);
System.out.println("Column Number for " + ColumnName + " is: " + colnumber);
logger.info("Column Number for " + ColumnName + " is: " + colnumber);
dm.sortData(colnumber,mSortAscending);
@ -591,13 +594,13 @@ public class AddressBook extends GeneralFrame {
this.setEnabled(true);
}
public void actionPerformed(ActionEvent e) {
System.out.println("I'm in sort descending");
logger.info("I'm in sort descending");
if (mSortAscending) {
DataModel dm = (DataModel) mTable.getModel ();
mSortAscending = false;
System.out.println("Column Name is " + ColumnName);
logger.info("Column Name is " + ColumnName);
int colnumber = dm.findColumn(ColumnName);
System.out.println("Column Number for " + ColumnName + " is: " + colnumber);
logger.info("Column Number for " + ColumnName + " is: " + colnumber);
dm.sortData(colnumber,mSortAscending);
@ -620,7 +623,7 @@ public class AddressBook extends GeneralFrame {
ColumnName = myLocalColumnName;
int colnumber = dm.findColumn(ColumnName);
System.out.println("Column Number for " + ColumnName + " is: " + colnumber);
logger.info("Column Number for " + ColumnName + " is: " + colnumber);
dm.sortData(colnumber,mSortAscending);
@ -723,7 +726,7 @@ public class AddressBook extends GeneralFrame {
b.setToolTipText(aToolTip);
// URL iconUrl = getClass().getResource("images/" + gifName + ".gif");
// b.setIcon(new ImageIcon(getClass().getResource(aImageName)));
// b.setIcon(new ImageIcon("getClass().getResource(aImageName)));
File resourceFile = new File(aImageName);
try {
@ -731,7 +734,7 @@ public class AddressBook extends GeneralFrame {
b.setIcon(new ImageIcon(resourceFile.getCanonicalPath()));
}
} catch (IOException e) {
System.out.println("IOException occured");
logger.warning("IOException occured");
}
// iconUrl = getClass().getResource("images/" + gifName + "-disabled.gif");
// button.setDisabledIcon(ImageIcon.createImageIcon(iconUrl));
@ -768,7 +771,7 @@ public class AddressBook extends GeneralFrame {
// try {
//open a connection to the LDAP server
System.out.println ("Opening server " + aServerName);
logger.info ("Opening server " + aServerName);
ICardSource Four11AddressBook = new LDAP_Server (aServerName);
@ -778,7 +781,7 @@ public class AddressBook extends GeneralFrame {
String[] attributes = {"sn", "cn", "o", "mail", "city"};
//query the LDAP server.
System.out.println ("Send query" + query);
logger.info ("Send query" + query);
ICardSet cardSet = Four11AddressBook.getCardSet (query, attributes);
//Sort the list.
@ -791,7 +794,7 @@ public class AddressBook extends GeneralFrame {
//enumerate thru the cards.
for (Enumeration cardEnum = cardSet.getEnumeration();
cardEnum.hasMoreElements(); ) {
System.out.println ("got card");
logger.info ("got card");
//get the addres card
ICard card = (ICard) cardEnum.nextElement();
//get the attributes for this card
@ -850,10 +853,10 @@ public class AddressBook extends GeneralFrame {
}
// }
// catch( LDAPException e ) {
// System.out.println( "Error: " + e.toString() );
// logger.info( "Error: " + e.toString() );
// }
System.out.println ("Done.");
logger.info ("Done.");
return retVecVec;
}
*/
@ -907,9 +910,9 @@ public class AddressBook extends GeneralFrame {
ColumnValues[row][1] = new Integer(row).toString();
}
System.out.println("Values before sorting");
logger.info("Values before sorting");
for(row = 0; row < ColumnValues.length ; ++row) {
System.out.println(ColumnValues[row][0] + " row: "
logger.info(ColumnValues[row][0] + " row: "
+ ColumnValues[row][1]);
}
@ -929,9 +932,9 @@ public class AddressBook extends GeneralFrame {
});
sorter.sort(ColumnValues);
System.out.println("Values after sorting");
logger.info("Values after sorting");
for(row = 0; row < ColumnValues.length ; ++row) {
System.out.println(ColumnValues[row][0] + " row: "
logger.info(ColumnValues[row][0] + " row: "
+ ColumnValues[row][1]);
}

View File

@ -145,7 +145,7 @@ public class GeneralFrame extends JFrame
fPanel = getContentPane();
fAnimation = new Animation();
fAnimation.setImageTemplate("/grendel/ui/images/animation/Contest{0,number,00}.gif",
fAnimation.setImageTemplate("ui/images/animation/Contest{0,number,00}.gif",
30);
fToolBarPanel = new CollapsiblePanel(true);

View File

@ -37,7 +37,7 @@ public class Animation extends Component implements Runnable
Thread fThread;
Icon fGlyphs[];
int fCurrent = 0;
boolean runAnimation = true;
boolean runAnimation = true;
public void run()
{
@ -114,12 +114,12 @@ public class Animation extends Component implements Runnable
{
if (fThread != null) {
fThread.interrupt( );
try {
fThread.join( );
}
catch ( InterruptedException ie ) {
// ignore
}
try {
fThread.join( );
}
catch ( InterruptedException ie ) {
// ignore
}
}
fThread = new Thread(this, "Animation");
fThread.start();
@ -128,13 +128,13 @@ public class Animation extends Component implements Runnable
public synchronized void stop()
{
if (fThread != null) {
fThread.interrupt( );
try {
fThread.join( );
}
catch ( InterruptedException ie ) {
// ignore
}
fThread.interrupt( );
try {
fThread.join( );
}
catch ( InterruptedException ie ) {
// ignore
}
fThread = null;
}
fCurrent = 0;

View File

@ -19,7 +19,7 @@
* Copyright (C) 1997 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Contributor(s):
*
* Created: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
@ -42,20 +42,19 @@ import javax.swing.plaf.metal.MetalIconFactory;
import javax.swing.ImageIcon;
import grendel.ui.ToolBarLayout;
import grendel.widgets.Animation;
import grendel.widgets.Collapsible;
import grendel.widgets.Spring;
/**
* This is an implementation of the grendel.widgets.Collapsible interface,
* which provides the standard Communicator-style collapsing toolbar panel.
*
*
* @author Jeff Galyan
* @see Collapsible
*/
public class CollapsiblePanel extends JPanel implements Collapsible {
private boolean collapsed = false;
private Component myComponents[];
private int componentCount;
@ -64,21 +63,21 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
private GridBagConstraints constraints;
private Box aBox;
int width = 10, height = 50;
private ToolBarLayout layout;
/**
/**
* Constructor
*/
public CollapsiblePanel(boolean isDoubleBuffered) {
super(isDoubleBuffered);
constraints = new GridBagConstraints();
constraints.ipadx = 0;
constraints.ipady = 0;
layout = new ToolBarLayout();
layout.setInsets(new Insets(0,0,0,0));
layout.setIPadX(0);
@ -87,7 +86,7 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
constraints.insets = new Insets(0,0,0,0);
constraints.anchor = GridBagConstraints.NORTHWEST;
constraints.fill = GridBagConstraints.NONE;
CollapseButton collapseButton = new CollapseButton(VERTICAL);
add(collapseButton, constraints);
Dimension dim = collapseButton.getSize();
@ -100,7 +99,7 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
}
/**
* Collapses the panel.
* Collapses the panel.
*/
public void collapse() {
@ -129,17 +128,17 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
add(new Spring(), constraints);
revalidate();
collapsed = true;
}
/**
* Uncollapses the panel.
*/
public void expand() {
Dimension dim = new Dimension(height, width);
// layout.defaultConstraints.anchor = GridBagConstraints.WEST;
removeAll();
Dimension dim2 = getSize();
@ -149,14 +148,14 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
for (int i = 0; i < componentCount; i++) {
add(myComponents[i]);
}
revalidate();
collapsed = false;
}
/**
* Tells you whether this component is collapsible.
* Tells you whether this component is collapsible.
* @returns a boolean indicating this component is collapsible.
*/
@ -165,7 +164,7 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
}
/**
* Tells you whether this component is currently collapsed.
* Tells you whether this component is currently collapsed.
* Useful for checking the component's status.
* @returns true if this component is collapsed, false if it is not.
*/
@ -175,7 +174,7 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
}
class CollapseListener implements ActionListener {
public void actionPerformed(ActionEvent evt) {
if (isCollapsed() == true) {
expand();
@ -215,12 +214,12 @@ public class CollapsiblePanel extends JPanel implements Collapsible {
setRolloverIcon(collapseButtonHorizontalRollover);
setPressedIcon(collapseButtonHorizontalPressed);
}
addActionListener(new CollapseListener());
}
}
}

View File

@ -36,7 +36,6 @@ import javax.swing.JButton;
import grendel.ui.ToolBarLayout;
import grendel.widgets.Animation;
import grendel.widgets.Spring;
import com.trfenv.parsers.Event;