367 else {
368 for(int i = 0; i < column; i++) {
369 r.x += cm.getColumn(i).getWidth();
370 }
371 if( !getComponentOrientation().isLeftToRight() ) {
372 r.x = getWidthInRightToLeft() - r.x - cm.getColumn(column).getWidth();
373 }
374
375 r.width = cm.getColumn(column).getWidth();
376 }
377 return r;
378 }
379
380
381 /**
382 * Allows the renderer's tips to be used if there is text set.
383 * @param event the location of the event identifies the proper
384 * renderer and, therefore, the proper tip
385 * @return the tool tip for this component
386 */
387 public String getToolTipText(MouseEvent event) {
388 String tip = null;
389 Point p = event.getPoint();
390 int column;
391
392 // Locate the renderer under the event location
393 if ((column = columnAtPoint(p)) != -1) {
394 TableColumn aColumn = columnModel.getColumn(column);
395 TableCellRenderer renderer = aColumn.getHeaderRenderer();
396 if (renderer == null) {
397 renderer = defaultRenderer;
398 }
399 Component component = renderer.getTableCellRendererComponent(
400 getTable(), aColumn.getHeaderValue(), false, false,
401 -1, column);
402
403 // Now have to see if the component is a JComponent before
404 // getting the tip
405 if (component instanceof JComponent) {
406 // Convert the event to the renderer's coordinate system
|
367 else {
368 for(int i = 0; i < column; i++) {
369 r.x += cm.getColumn(i).getWidth();
370 }
371 if( !getComponentOrientation().isLeftToRight() ) {
372 r.x = getWidthInRightToLeft() - r.x - cm.getColumn(column).getWidth();
373 }
374
375 r.width = cm.getColumn(column).getWidth();
376 }
377 return r;
378 }
379
380
381 /**
382 * Allows the renderer's tips to be used if there is text set.
383 * @param event the location of the event identifies the proper
384 * renderer and, therefore, the proper tip
385 * @return the tool tip for this component
386 */
387 @SuppressWarnings("deprecation")
388 public String getToolTipText(MouseEvent event) {
389 String tip = null;
390 Point p = event.getPoint();
391 int column;
392
393 // Locate the renderer under the event location
394 if ((column = columnAtPoint(p)) != -1) {
395 TableColumn aColumn = columnModel.getColumn(column);
396 TableCellRenderer renderer = aColumn.getHeaderRenderer();
397 if (renderer == null) {
398 renderer = defaultRenderer;
399 }
400 Component component = renderer.getTableCellRendererComponent(
401 getTable(), aColumn.getHeaderValue(), false, false,
402 -1, column);
403
404 // Now have to see if the component is a JComponent before
405 // getting the tip
406 if (component instanceof JComponent) {
407 // Convert the event to the renderer's coordinate system
|