Skip to content

Commit 9a6f419

Browse files
hansonrhansonr
authored andcommitted
minor adjustments
1 parent d4e2cf7 commit 9a6f419

File tree

3 files changed

+18
-43
lines changed

3 files changed

+18
-43
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSTextUI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public boolean checkStopPropagation(Object ev, boolean handled) {
240240
protected void installDefaults() {
241241
String prefix = getPropertyPrefix();
242242
Font f = editor.getFont();
243-
if ((f == null && !editor.秘isAWT()) || (f instanceof UIResource)) {
243+
if ((f == null && !isAWT) || (f instanceof UIResource)) {
244244
editor.setFont(UIManager.getFont(prefix + ".font"));
245245
}
246246

@@ -293,7 +293,7 @@ protected void setColors(String prefix) {
293293
if ((dfg == null) || (dfg instanceof UIResource)) {
294294
editor.setDisabledTextColor(UIManager.getColor(prefix + ".inactiveForeground"));
295295
}
296-
dfg = UIManager.getColor(editor.秘isAWT() ? "control" : prefix + ".inactiveBackground");
296+
dfg = UIManager.getColor(isAWT ? "control" : prefix + ".inactiveBackground");
297297
if (dfg != null)
298298
inactiveBackground = dfg;
299299

sources/net.sf.j2s.java.core/src/test/Test_Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static void main(String[] args) {
8686
public boolean dispatchEvent(AWTEvent e) {
8787
if (allowEventInfo && e.getID() != MouseEvent.MOUSE_MOVED) {
8888
if (e.getID() == MouseEvent.MOUSE_PRESSED) { //
89-
System.out.println("FocusMan mousepreseed event");
89+
System.out.println("FocusMan mousepressed event");
9090
}
9191
System.out.println(
9292
"FocusMan dispatching activeElement=" + (/** @j2sNative document.activeElement.id || */

sources/net.sf.j2s.java.core/src/test/components/TableDemo.java

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131

3232
package test.components;
3333

34+
import java.awt.Color;
35+
import java.awt.Component;
36+
import java.awt.Dimension;
37+
import java.awt.GridLayout;
38+
import java.awt.event.MouseEvent;
39+
import java.awt.event.MouseListener;
40+
3441
/*
3542
* TableDemo.java requires no other files.
3643
*/
@@ -45,15 +52,6 @@
4552
import javax.swing.table.AbstractTableModel;
4653
import javax.swing.table.TableCellRenderer;
4754

48-
import java.awt.Color;
49-
import java.awt.Component;
50-
import java.awt.Dimension;
51-
import java.awt.Font;
52-
import java.awt.Graphics;
53-
import java.awt.GridLayout;
54-
import java.awt.event.MouseEvent;
55-
import java.awt.event.MouseListener;
56-
5755
/**
5856
* TableDemo is just like SimpleTableDemo, except that it uses a custom
5957
* TableModel.
@@ -90,37 +88,6 @@ public TableDemo() {
9088

9189

9290
JTable table = new JTable(new MyTableModel());
93-
table.addMouseListener(new MouseListener() {
94-
95-
@Override
96-
public void mouseClicked(MouseEvent e) {
97-
// TODO Auto-generated method stub
98-
99-
}
100-
101-
@Override
102-
public void mousePressed(MouseEvent e) {
103-
// TODO Auto-generated method stub
104-
105-
}
106-
107-
@Override
108-
public void mouseReleased(MouseEvent e) {
109-
// TODO Auto-generated method stub
110-
111-
}
112-
113-
@Override
114-
public void mouseEntered(MouseEvent e) {
115-
System.out.println("Table mouse entered " + e.getSource().getClass().getName());
116-
}
117-
118-
@Override
119-
public void mouseExited(MouseEvent e) {
120-
System.out.println("Table mouse exited " + e.getSource().getClass().getName());
121-
}
122-
123-
});
12491
table.setRowHeight(40);
12592
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
12693
table.setFillsViewportHeight(true);
@@ -162,18 +129,22 @@ class MyTableModel extends AbstractTableModel {
162129
{ ++i, color, "Joe", "Brown", "Pool", new Integer(10), new Boolean(false) }
163130
};
164131

132+
@Override
165133
public int getColumnCount() {
166134
return columnNames.length;
167135
}
168136

137+
@Override
169138
public int getRowCount() {
170139
return data.length;
171140
}
172141

142+
@Override
173143
public String getColumnName(int col) {
174144
return columnNames[col];
175145
}
176146

147+
@Override
177148
public Object getValueAt(int row, int col) {
178149
return data[row][col];
179150
}
@@ -183,13 +154,15 @@ public Object getValueAt(int row, int col) {
183154
* cell. If we didn't implement this method, then the last column would contain
184155
* text ("true"/"false"), rather than a check box.
185156
*/
157+
@Override
186158
public Class getColumnClass(int c) {
187159
return getValueAt(0, c).getClass();
188160
}
189161

190162
/*
191163
* Don't need to implement this method unless your table's editable.
192164
*/
165+
@Override
193166
public boolean isCellEditable(int row, int col) {
194167
// Note that the data/cell address is constant,
195168
// no matter where the cell appears onscreen.
@@ -203,6 +176,7 @@ public boolean isCellEditable(int row, int col) {
203176
/*
204177
* Don't need to implement this method unless your table's data can change.
205178
*/
179+
@Override
206180
public void setValueAt(Object value, int row, int col) {
207181
if (DEBUG) {
208182
System.out.println("Setting value at " + row + "," + col + " to " + value + " (an instance of "
@@ -256,6 +230,7 @@ public static void main(String[] args) {
256230
// Schedule a job for the event-dispatching thread:
257231
// creating and showing this application's GUI.
258232
javax.swing.SwingUtilities.invokeLater(new Runnable() {
233+
@Override
259234
public void run() {
260235
createAndShowGUI();
261236
}

0 commit comments

Comments
 (0)