@@ -78,22 +78,22 @@ public static final class EditableProperty {
7878 ChartStylePanel csp ;
7979 Object additionalParameter ;
8080
81- static HashMap <Class , TableCellEditor > editorMap ;
82- static Class [] assignableClasses = {
81+ static HashMap <Class <?> , TableCellEditor > editorMap ;
82+ static Class <?> [] assignableClasses = {
8383 Theme .class , BasicStroke .class , Marker .class , TimeZone .class
8484 };
8585
8686 static {
87- editorMap = new HashMap <Class , TableCellEditor >();
87+ editorMap = new HashMap <>();
8888 {
89- JComboBox comboBox = new JComboBox (new Boolean [] {Boolean .TRUE , Boolean .FALSE });
89+ JComboBox < Boolean > comboBox = new JComboBox <> (new Boolean [] {Boolean .TRUE , Boolean .FALSE });
9090 TableCellEditor cellEditor = new DefaultCellEditor (comboBox );
9191 editorMap .put (Boolean .class , cellEditor );
9292 editorMap .put (Boolean .TYPE , cellEditor );
9393 }
9494
9595 {
96- Class [][] clsArr = {
96+ Class <?> [][] clsArr = {
9797 {int .class , Integer .class },
9898 {byte .class , Byte .class },
9999 {short .class , Short .class },
@@ -103,17 +103,17 @@ public static final class EditableProperty {
103103 {String .class , String .class }
104104 };
105105
106- for (Class [] classes : clsArr ) {
106+ for (Class <?> [] classes : clsArr ) {
107107 GenericEditorWithClass editor = new GenericEditorWithClass (classes [1 ]);
108- for (Class class1 : classes ) {
108+ for (Class <?> class1 : classes ) {
109109 editorMap .put (class1 , editor );
110110 }
111111 }
112112 }
113113
114114 {
115- JComboBox comboBox =
116- new JComboBox (new Theme [] {new XChartTheme (), new GGPlot2Theme (), new MatlabTheme ()});
115+ JComboBox < Theme > comboBox =
116+ new JComboBox <> (new Theme [] {new XChartTheme (), new GGPlot2Theme (), new MatlabTheme ()});
117117 editorMap .put (Theme .class , new DefaultCellEditor (comboBox ));
118118 }
119119
@@ -125,7 +125,7 @@ public static final class EditableProperty {
125125 new LabelValue ("DASH_DASH" , SeriesLines .DASH_DASH ),
126126 new LabelValue ("DASH_DOT" , SeriesLines .DASH_DOT )
127127 };
128- JComboBox comboBox = new JComboBox (values );
128+ JComboBox < LabelValue > comboBox = new JComboBox <> (values );
129129 editorMap .put (BasicStroke .class , new DefaultCellEditor (comboBox ));
130130 }
131131 {
@@ -156,13 +156,13 @@ public static final class EditableProperty {
156156 new LabelValue ("GGPlot2 Tick Marks" , new BasicStroke (1.5f )), //
157157 new LabelValue ("Matlab Tick Marks" , new BasicStroke (.5f )), //
158158 };
159- JComboBox comboBox = new JComboBox (values );
159+ JComboBox < LabelValue > comboBox = new JComboBox <> (values );
160160 editorMap .put (Stroke .class , new DefaultCellEditor (comboBox ));
161161 }
162162
163163 {
164164 Marker [] seriesMarkers = new BaseSeriesMarkers ().getSeriesMarkers ();
165- JComboBox comboBox = new JComboBox (seriesMarkers );
165+ JComboBox < Marker > comboBox = new JComboBox <> (seriesMarkers );
166166 editorMap .put (Marker .class , new DefaultCellEditor (comboBox ));
167167 }
168168
@@ -178,7 +178,7 @@ public static final class EditableProperty {
178178 Locale .GERMAN ,
179179 Locale .forLanguageTag ("tr-TR" )
180180 };
181- JComboBox comboBox = new JComboBox (values );
181+ JComboBox < Locale > comboBox = new JComboBox <> (values );
182182 editorMap .put (Locale .class , new DefaultCellEditor (comboBox ));
183183 }
184184
@@ -188,7 +188,7 @@ public static final class EditableProperty {
188188 for (int i = 0 ; i < values .length ; i ++) {
189189 values [i ] = TimeZone .getTimeZone (availableIDs [i ]);
190190 }
191- JComboBox comboBox = new JComboBox (values );
191+ JComboBox < TimeZone > comboBox = new JComboBox <> (values );
192192 editorMap .put (TimeZone .class , new DefaultCellEditor (comboBox ));
193193 }
194194 }
@@ -220,19 +220,19 @@ private void initEditor() {
220220
221221 try {
222222 Object val = getValue ();
223- Class cls = val == null ? getValueClass () : val .getClass ();
223+ Class <?> cls = val == null ? getValueClass () : val .getClass ();
224224 cellEditor = editorMap .get (cls );
225225 if (cellEditor != null ) {
226226 return ;
227227 }
228228
229229 if (cls .isEnum ()) {
230- JComboBox comboBox = new JComboBox (cls .getEnumConstants ());
230+ JComboBox < Object > comboBox = new JComboBox <> (cls .getEnumConstants ());
231231 cellEditor = new DefaultCellEditor (comboBox );
232232 return ;
233233 }
234234
235- for (Class class1 : assignableClasses ) {
235+ for (Class <?> class1 : assignableClasses ) {
236236 if (class1 .isAssignableFrom (cls )) {
237237 cellEditor = editorMap .get (class1 );
238238 return ;
@@ -316,7 +316,7 @@ public TableCellEditor getTableCellEditor() {
316316 return cellEditor ;
317317 }
318318
319- public Class getValueClass () {
319+ public Class <?> getValueClass () {
320320
321321 if (readMethod == null ) {
322322 // obj is array
@@ -354,11 +354,11 @@ public Component getTableCellEditorComponent(
354354
355355 static class GenericEditorWithClass extends DefaultCellEditor {
356356
357- Class [] argTypes = new Class [] {String .class };
358- java .lang .reflect .Constructor constructor ;
357+ Class <?> [] argTypes = new Class <?> [] {String .class };
358+ java .lang .reflect .Constructor <?> constructor ;
359359 Object value ;
360360
361- public GenericEditorWithClass (Class cls ) {
361+ public GenericEditorWithClass (Class <?> cls ) {
362362 super (new JTextField ());
363363 getComponent ().setName ("Table.editor" );
364364 try {
@@ -409,19 +409,19 @@ public Object getCellEditorValue() {
409409
410410 public static class EditorTableModel extends DefaultTableModel {
411411 ArrayList <EditableProperty > properties ;
412- Chart chart ;
412+ Chart <?, ?> chart ;
413413 int rowCount ;
414414 ChartStylePanel csp ;
415415
416- public EditorTableModel (ChartStylePanel csp , Chart chart ) {
416+ public EditorTableModel (ChartStylePanel csp , Chart <?, ?> chart ) {
417417 this .csp = csp ;
418418 addColumn ("Name" );
419419 addColumn ("Type" );
420420 addColumn ("Value" );
421421 changeChart (chart );
422422 }
423423
424- public void changeChart (Chart chart ) {
424+ public void changeChart (Chart <?, ?> chart ) {
425425
426426 this .chart = chart ;
427427 properties = getProperties (csp , chart );
@@ -487,7 +487,7 @@ public int getRowCount() {
487487 public static class EditorTable extends JTable {
488488 EditorTableModel tableModel ;
489489
490- public EditorTable (ChartStylePanel csp , Chart chart ) {
490+ public EditorTable (ChartStylePanel csp , Chart <?, ?> chart ) {
491491 tableModel = new EditorTableModel (csp , chart );
492492
493493 setModel (tableModel );
@@ -503,7 +503,7 @@ public EditorTable(ChartStylePanel csp, Chart chart) {
503503 setAutoCreateRowSorter (true );
504504 }
505505
506- public void changeChart (Chart chart ) {
506+ public void changeChart (Chart <?, ?> chart ) {
507507
508508 tableModel .changeChart (chart );
509509 }
@@ -517,7 +517,7 @@ public TableCellEditor getCellEditor(int row, int column) {
517517 if (editor != null ) {
518518 return editor ;
519519 }
520- Class valueClass = se .getValueClass ();
520+ Class <?> valueClass = se .getValueClass ();
521521 TableCellEditor defaultEditor = getDefaultEditor (valueClass );
522522
523523 // System.out.println(valueClass + "=>" + defaultEditor);
@@ -526,9 +526,9 @@ public TableCellEditor getCellEditor(int row, int column) {
526526 }
527527
528528 private EditorTable table ;
529- private XChartPanel chartPanel ;
529+ private XChartPanel <?> chartPanel ;
530530
531- public ChartStylePanel (XChartPanel chartPanel ) {
531+ public ChartStylePanel (XChartPanel <?> chartPanel ) {
532532 this .chartPanel = chartPanel ;
533533 table = new EditorTable (this , chartPanel .getChart ());
534534 JScrollPane scrollpane = new JScrollPane (table );
@@ -538,7 +538,7 @@ public ChartStylePanel(XChartPanel chartPanel) {
538538 setPreferredSize (new Dimension (800 , 600 ));
539539 }
540540
541- public void changeChart (XChartPanel chartPanel ) {
541+ public void changeChart (XChartPanel <?> chartPanel ) {
542542
543543 this .chartPanel = chartPanel ;
544544 table .changeChart (chartPanel .getChart ());
@@ -575,7 +575,7 @@ protected void repaintChart() {
575575 "YAxisAlignment" ,
576576 "YAxisGroupPosition" ));
577577
578- public static ArrayList <EditableProperty > getProperties (ChartStylePanel csp , Chart chart ) {
578+ public static ArrayList <EditableProperty > getProperties (ChartStylePanel csp , Chart <?, ?> chart ) {
579579
580580 if (chart == null ) {
581581 return new ArrayList <EditableProperty >();
@@ -585,10 +585,10 @@ public static ArrayList<EditableProperty> getProperties(ChartStylePanel csp, Cha
585585 getObjectProperties (csp , chart .getStyler (), "styler." , skipSet );
586586 list .addAll (list2 );
587587
588- Map <String , Series > seriesMap = chart .getSeriesMap ();
588+ Map <String , ? extends Series > seriesMap = chart .getSeriesMap ();
589589 int ind = 0 ;
590590 TreeSet <Integer > seriesIndSet = new TreeSet <Integer >();
591- for (Entry <String , Series > e : seriesMap .entrySet ()) {
591+ for (Entry <String , ? extends Series > e : seriesMap .entrySet ()) {
592592 Series series = e .getValue ();
593593 list2 = getObjectProperties (csp , series , "series[" + e .getKey () + "]." , skipSet );
594594 list .addAll (list2 );
0 commit comments