Skip to content

Commit 458e7bc

Browse files
hansonrhansonr
authored andcommitted
various JTableUI work
1 parent 469bca0 commit 458e7bc

File tree

17 files changed

+3060
-2940
lines changed

17 files changed

+3060
-2940
lines changed
3.01 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181124120031
1+
20181204022550
3.01 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181124120031
1+
20181204022550

sources/net.sf.j2s.java.core/.settings/org.eclipse.jdt.core.prefs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
88
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
99
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
1010
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
11+
org.eclipse.jdt.core.compiler.problem.APILeak=warning
1112
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
1213
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
1314
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
3.01 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Container.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4766,12 +4766,10 @@ void retargetMouseEvent(Component target, int id, MouseEvent e) {
47664766

47674767
int x = e.getX(), y = e.getY();
47684768
Component component = target;
4769-
if (target.parent == null && component != nativeContainer) {
4770-
component = ((JSComponentUI) ((JSComponent) target).getUI()).getTargetParent();
4771-
if (component != null)
4772-
target = component;
4769+
Component p = ((JSComponentUI) ((JSComponent) target).getUI()).getTargetParent();
4770+
if (p != null) {
4771+
target = component = p;
47734772
}
4774-
// SwingJS - TableCellRenderers do not have parents
47754773
for (; component != null && component != nativeContainer; component = component.getParent()) {
47764774
x -= component.x;
47774775
y -= component.y;

sources/net.sf.j2s.java.core/src/java/awt/JSComponent.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,6 @@ public void checkBackgroundPainted(JSGraphics2D jsg) {
277277
}
278278
}
279279

280-
public boolean selfOrParentBackgroundPainted() {
281-
JSComponent c = this;
282-
while (c != null) {
283-
if (c._isBackgroundPainted)
284-
return true;
285-
c = (JSComponent) c.getParent();
286-
}
287-
return false;
288-
}
289-
290280
@Override
291281
public boolean isBackgroundSet() {
292282
return background != null;// false;// TODO (background != null &&

sources/net.sf.j2s.java.core/src/javax/swing/CellRendererPane.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ public void paintComponent(Graphics g, Component c, Container p, int x, int y, i
142142
this.add(c);
143143
}
144144

145+
c.setBounds(-w, -h, 0, 0); // force new bounds
145146
c.setBounds(x, y, w, h);
146-
147+
147148
if(shouldValidate) {
148149
c.validate();
149150
} else {

sources/net.sf.j2s.java.core/src/javax/swing/JTable.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,16 @@ public void setShowGrid(boolean showGrid) {
11791179
repaint();
11801180
}
11811181

1182+
@Override
1183+
public void repaint() {
1184+
super.repaint();
1185+
}
1186+
1187+
@Override
1188+
public void repaint(int x, int y, int width, int height) {
1189+
super.repaint(x, y, width, height);
1190+
}
1191+
11821192
/**
11831193
* Sets whether the table draws horizontal lines between cells. If
11841194
* <code>showHorizontalLines</code> is true it does; if it is false it
@@ -5523,7 +5533,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
55235533
int row, int column) {
55245534
if (isSelected) {
55255535
setForeground(table.getSelectionForeground());
5526-
super.setBackground(table.getSelectionBackground());
5536+
setBackground(table.getSelectionBackground());
55275537
} else {
55285538
setForeground(table.getForeground());
55295539
setBackground(table.getBackground());

0 commit comments

Comments
 (0)