Issue #2436 - disposed of the sort color
Former-commit-id:a4ba355169
[formerlyf27781b74e
] [formerly8c8adf8be6
] [formerly8c8adf8be6
[formerly9c97908f36
]] [formerlya4ba355169
[formerlyf27781b74e
] [formerly8c8adf8be6
] [formerly8c8adf8be6
[formerly9c97908f36
]] [formerlyc4ddd46b44
[formerly8c8adf8be6
[formerly9c97908f36
] [formerlyc4ddd46b44
[formerly 4545de35a0fdbfc5817a8725bf07ae0c405efb39]]]]] Former-commit-id:c4ddd46b44
Former-commit-id:44c47d86e3
[formerlyccbc44f9d3
] [formerly2ed106cac4
] [formerly ed77fa3c8112f6aa7a0adaa23cbfad2968c0e127 [formerly b50a8d2a19218358b07a31a6ee2f605c0ead6152] [formerly2ed106cac4
[formerly46db8998a6
]]] Former-commit-id: 78a08380a35cf7a9d6da44f56a31ca753afeada3 [formerly d130264f10b1958114f77cf64c39663d19c8c154] [formerlyb0af7745a6
[formerly1000147d0c
]] Former-commit-id:b0af7745a6
Former-commit-id:c328869516
This commit is contained in:
parent
25328da2ff
commit
905873e1a9
1 changed files with 76 additions and 64 deletions
|
@ -64,6 +64,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 7, 2009 lvenable Initial creation
|
||||
* Oct 7, 2013 #2436 lvenable Disposed of the sort color.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -119,9 +120,13 @@ public abstract class TableComp extends Composite {
|
|||
protected boolean columnMinimumSize = false;
|
||||
|
||||
private int imageWidth = 0;
|
||||
|
||||
private int imageHeight = 0;
|
||||
|
||||
private int textWidth = 0;
|
||||
|
||||
private int textHeight = 0;
|
||||
|
||||
private Color sortColor;
|
||||
|
||||
/**
|
||||
|
@ -185,6 +190,7 @@ public abstract class TableComp extends Composite {
|
|||
tiFont.dispose();
|
||||
lineColor.dispose();
|
||||
sortImage.dispose();
|
||||
sortColor.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -338,13 +344,15 @@ public abstract class TableComp extends Composite {
|
|||
for (int j = 0; j < cols.length; j++) {
|
||||
cols[j].setImage(null);
|
||||
cols[j].setWidth(defaultColWidth);
|
||||
cols[j].setText(getColumnAttribteData(colnkeys[j]).getColumnName());
|
||||
cols[j].setText(getColumnAttribteData(colnkeys[j])
|
||||
.getColumnName());
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the sort image, pack the column and sort the data.
|
||||
*/
|
||||
tc.setImage(getSortHeaderImage(getColumnAttribteData(sortCol).getColumnName()));
|
||||
tc.setImage(getSortHeaderImage(getColumnAttribteData(
|
||||
sortCol).getColumnName()));
|
||||
tc.setText("");
|
||||
tc.pack();
|
||||
|
||||
|
@ -358,14 +366,16 @@ public abstract class TableComp extends Composite {
|
|||
});
|
||||
|
||||
/**
|
||||
* DR#10701: The first column is selected for
|
||||
* sorting by default when a Zone table or Station
|
||||
* table is first displayed (not for History table)
|
||||
* DR#10701: The first column is selected for sorting by default
|
||||
* when a Zone table or Station table is first displayed (not for
|
||||
* History table)
|
||||
*/
|
||||
if (i == 0) {
|
||||
if ( getColumnAttribteData(columns[i]).getSortDir() != SortDirection.None.getSortDir() ) {
|
||||
if (getColumnAttribteData(columns[i]).getSortDir() != SortDirection.None
|
||||
.getSortDir()) {
|
||||
tc.setText("");
|
||||
tc.setImage(getSortHeaderImage(getColumnAttribteData(columns[0]).getColumnName()));
|
||||
tc.setImage(getSortHeaderImage(getColumnAttribteData(
|
||||
columns[0]).getColumnName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,8 +424,8 @@ public abstract class TableComp extends Composite {
|
|||
|
||||
for (int i = 0; i < cellData.length; i++) {
|
||||
ti.setText(i, cellData[i].displayString());
|
||||
Color c = new Color(parent.getDisplay(), cellData[i]
|
||||
.getBackgroungRGB());
|
||||
Color c = new Color(parent.getDisplay(),
|
||||
cellData[i].getBackgroungRGB());
|
||||
ti.setBackground(i, c);
|
||||
c.dispose();
|
||||
}
|
||||
|
@ -510,10 +520,12 @@ public abstract class TableComp extends Composite {
|
|||
maxTextLen = tmpArray[j].length();
|
||||
}
|
||||
}
|
||||
xCoord = Math.round( (imageWidth / 2) - (maxTextLen*textWidth / 2) ) - 2;
|
||||
xCoord = Math
|
||||
.round((imageWidth / 2) - (maxTextLen * textWidth / 2)) - 2;
|
||||
yCoord = 0;
|
||||
} else {
|
||||
xCoord = Math.round( (imageWidth / 2) - (header.length()*textWidth / 2) ) - 2;
|
||||
xCoord = Math.round((imageWidth / 2)
|
||||
- (header.length() * textWidth / 2)) - 2;
|
||||
yCoord = imageHeight / 2 - textHeight / 2 - 1;
|
||||
}
|
||||
gc.drawText(header, xCoord, yCoord, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue