messed around with the NOOP to cut down needless chatter...
tail = null;
return o;
}
+
+ public boolean empty() {
+ return( head == null );
+ }
}
class QElement {
user theUser;
roomMap rooms;
roomFrame rf;
+ whoOnlineWindow wo = null;
public static void main( String args[] ) {
new citadel();
String blurb;
String message;
- public message( int count, int cur_pos, citReply r ) {
+ public message( roomInfo ri, int count, int cur_pos, citReply r ) {
Vector msg = r.listing;
String s, from="", time="", room="", node="", rcpt="";
blurb = blurb + " (@"+node+")";
if( !rcpt.equals( "" ) )
blurb = blurb + " to " + rcpt;
- /* if( !room.equals(name) ) FIXME
- blurb = blurb + " in " + room; */
+ if( !room.equals( ri.name) )
+ blurb = blurb + " in " + room;
/* this relies on the fact that we've removed
the header lines above. probably a messy way
blurb.setText( "<error>" );
message.setText( r.getArg(0) );
} else {
- message msg = new message( msgs.size(), cur_pos, r );
+ message msg = new message( ri, msgs.size(), cur_pos, r );
blurb.setText( msg.getBlurb() );
message.setText( msg.getText() );
int n = citadel.atoi( num );
} catch( Exception e ) {}
System.out.println( "Idle event" );
- citadel.me.networkEvent( "NOOP" );
+ if( citadel.me.wo == null ) {
+ if( theQueue.empty() )
+ citadel.me.networkEvent( "NOOP" );
+ else
+ System.out.println( "...events pending" );
+ }
+ else
+ citadel.me.wo.refresh();
}
} };
}
try {
+ if( theSocket != null )
theSocket.close();
} catch( IOException ioe ) {
}
} } );
citadel.me.registerWindow( this );
+ citadel.me.wo = this;
refresh();
pack();
show();
public void closeWin() {
citadel.me.removeWindow( this );
+ citadel.me.wo = null;
dispose();
}
}
+
+/*
+ class MyCellRenderer extends JLabel implements ListCellRenderer {
+ final static ImageIcon longIcon = new ImageIcon("long.gif");
+ final static ImageIcon shortIcon = new ImageIcon("short.gif");
+
+ // This is the only method defined by ListCellRenderer. We just
+ // reconfigure the Jlabel each time we're called.
+
+ public Component getListCellRendererComponent(
+ JList list,
+ Object value, // value to display
+ int index, // cell index
+ boolean isSelected, // is the cell selected
+ boolean cellHasFocus) // the list and the cell have the focus
+ {
+ String s = value.toString();
+ setText(s);
+ setIcon((s.length() > 10) ? longIcon : shortIcon);
+ if (isSelected) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ }
+ else {
+ setBackground(list.getBackground());
+ setForeground(list.getForeground());
+ }
+ setEnabled(list.isEnabled());
+ setFont(list.getFont());
+ return this;
+ }
+ }
+
+ String[] data = {"one", "two", "free", "four"};
+ JList dataList = new JList(data);
+ dataList.setCellRenderer(new MyCellRenderer());
+*/