compilation window ui improvement (by nfi)
This commit is contained in:
parent
f1d9702b68
commit
8403776cf1
1 changed files with 7 additions and 4 deletions
|
@ -26,14 +26,14 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: MessageList.java,v 1.3 2007/04/02 15:45:44 nifi Exp $
|
* $Id: MessageList.java,v 1.4 2007/04/04 07:47:02 fros4943 Exp $
|
||||||
*
|
*
|
||||||
* -----------------------------------------------------------------
|
* -----------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne, Fredrik Osterlind
|
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne, Fredrik Osterlind
|
||||||
* Created : 2006-06-14
|
* Created : 2006-06-14
|
||||||
* Updated : $Date: 2007/04/02 15:45:44 $
|
* Updated : $Date: 2007/04/04 07:47:02 $
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*/
|
*/
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
@ -133,9 +133,12 @@ public class MessageList extends JList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMessage(String message, int type) {
|
public void addMessage(String message, int type) {
|
||||||
|
boolean scroll = getLastVisibleIndex() >= getModel().getSize() - 1;
|
||||||
MessageContainer msg = new MessageContainer(message, type);
|
MessageContainer msg = new MessageContainer(message, type);
|
||||||
((DefaultListModel) getModel()).addElement(msg);
|
((DefaultListModel) getModel()).addElement(msg);
|
||||||
ensureIndexIsVisible(getModel().getSize() - 1);
|
if (scroll) {
|
||||||
|
ensureIndexIsVisible(getModel().getSize() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearMessages() {
|
public void clearMessages() {
|
||||||
|
|
Loading…
Reference in a new issue