Fixed Issue 41. Made title displayed on the center.

This commit is contained in:
magenoxx 2010-12-08 16:21:16 +00:00
parent 7efd24464c
commit 14b8069afc
2 changed files with 11 additions and 1 deletions

View file

@ -210,7 +210,7 @@ public class MageFrame extends javax.swing.JFrame {
if (arrowsPanel != null) arrowsPanel.setSize(width, height);
if (title != null) {
//title.setBorder(BorderFactory.createLineBorder(Color.red));
title.setBounds((int)(width - titleRectangle.getWidth())/2, 180, titleRectangle.width, titleRectangle.height);
title.setBounds((int)(width - titleRectangle.getWidth())/2, (int)(height - titleRectangle.getHeight())/2, titleRectangle.width, titleRectangle.height);
}
}
});
@ -311,6 +311,7 @@ public class MageFrame extends javax.swing.JFrame {
String server = prefs.get("serverAddress", "");
int port = Integer.parseInt(prefs.get("serverPort", ""));
try {
server = "192.168.121.201";
setCursor(new Cursor(Cursor.WAIT_CURSOR));
if (MageFrame.connect(userName, server, port)) {
return true;

View file

@ -70,6 +70,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane implements Compon
protected static DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance();
protected static Map<UUID, PermanentView> battlefield;
protected static Map<UUID, Integer> attachmentCache = new HashMap<UUID, Integer>();
/** Creates new form BattlefieldPanel */
public BattlefieldPanel(JScrollPane jScrollPane) {
@ -99,6 +100,14 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane implements Compon
changed = true;
}
else {
MagePermanent p = permanents.get(permanent.getId());
if (!changed) {
int s1 = permanent.getAttachments() == null ? 0 : permanent.getAttachments().size();
int s2 = p.getLinks().size();
if (s1 != s2) {
changed = true;
}
}
permanents.get(permanent.getId()).update(permanent);
}
}