Fixed table window sizing issues

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@499 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Jared Gould 2007-02-06 23:11:34 +00:00
parent 337f613ac4
commit 8783528c6c
5 changed files with 14 additions and 8 deletions

View File

@ -275,7 +275,8 @@ public class ECUEditor extends JFrame implements WindowListener, PropertyChangeL
// table is already open, so set focus
frame.requestFocus();
}
frame.setSize(frame.getTable().getFrameSize());
//frame.setSize(frame.getTable().getFrameSize());
frame.pack();
rightPanel.repaint();
}

View File

@ -60,7 +60,7 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
public DataCell() {
}
public DataCell(Scale scale) {
public DataCell(Scale scale, Dimension size) {
this.scale = scale;
this.setHorizontalAlignment(CENTER);
this.setVerticalAlignment(CENTER);
@ -69,6 +69,7 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
this.setOpaque(true);
this.setVisible(true);
this.addMouseListener(this);
this.setPreferredSize(size);
}
public void updateDisplayValue() {

View File

@ -159,7 +159,8 @@ public class Rom implements Serializable {
// apply settings to tables
for (int i = 0; i < tables.size(); i++) {
tables.get(i).applyColorSettings(container.getSettings());
tables.get(i).resize();
//tables.get(i).resize();
tables.get(i).getFrame().pack();
}
}

View File

@ -342,7 +342,7 @@ public abstract class Table extends JPanel implements Serializable {
for (int i = 0; i < data.length; i++) {
if (data[i] == null) {
data[i] = new DataCell(scales.get(scaleIndex));
data[i] = new DataCell(scales.get(scaleIndex), settings.getCellSize());
data[i].setTable(this);
// populate data cells
@ -643,7 +643,8 @@ public abstract class Table extends JPanel implements Serializable {
public void setFrame(TableFrame frame) {
this.frame = frame;
frame.setSize(getFrameSize());
//frame.setSize(getFrameSize());
frame.pack();
}
public Dimension getFrameSize() {
@ -1028,7 +1029,8 @@ public abstract class Table extends JPanel implements Serializable {
}
public void resize() {
frame.setSize(getFrameSize());
//frame.setSize(getFrameSize());
frame.pack();
}
public Color getMaxColor() {

View File

@ -143,7 +143,7 @@ public class Table3D extends Table {
for (int x = 0; x < yAxis.getDataSize(); x++) {
centerPanel.add(yAxis.getDataCell(x));
for (int y = 0; y < xAxis.getDataSize(); y++) {
data[y][x] = new DataCell(scales.get(scaleIndex));
data[y][x] = new DataCell(scales.get(scaleIndex), settings.getCellSize());
data[y][x].setTable(this);
// populate data cells
@ -330,7 +330,8 @@ public class Table3D extends Table {
this.frame = frame;
xAxis.setFrame(frame);
yAxis.setFrame(frame);
frame.setSize(getFrameSize());
//frame.setSize(getFrameSize());
frame.pack();
}
public Dimension getFrameSize() {