equal
deleted
inserted
replaced
1943 // |
1943 // |
1944 /** |
1944 /** |
1945 * Sets the table's selection mode to allow only single selections, a single |
1945 * Sets the table's selection mode to allow only single selections, a single |
1946 * contiguous interval, or multiple intervals. |
1946 * contiguous interval, or multiple intervals. |
1947 * <P> |
1947 * <P> |
1948 * <bold>Note:</bold> |
1948 * <b>Note:</b> |
1949 * <code>JTable</code> provides all the methods for handling |
1949 * <code>JTable</code> provides all the methods for handling |
1950 * column and row selection. When setting states, |
1950 * column and row selection. When setting states, |
1951 * such as <code>setSelectionMode</code>, it not only |
1951 * such as <code>setSelectionMode</code>, it not only |
1952 * updates the mode for the row selection model but also sets similar |
1952 * updates the mode for the row selection model but also sets similar |
1953 * values in the selection model of the <code>columnModel</code>. |
1953 * values in the selection model of the <code>columnModel</code>. |
2059 firePropertyChange("cellSelectionEnabled", old, cellSelectionEnabled); |
2059 firePropertyChange("cellSelectionEnabled", old, cellSelectionEnabled); |
2060 } |
2060 } |
2061 |
2061 |
2062 /** |
2062 /** |
2063 * Returns true if both row and column selection models are enabled. |
2063 * Returns true if both row and column selection models are enabled. |
2064 * Equivalent to <code>getRowSelectionAllowed() && |
2064 * Equivalent to <code>getRowSelectionAllowed() && |
2065 * getColumnSelectionAllowed()</code>. |
2065 * getColumnSelectionAllowed()</code>. |
2066 * |
2066 * |
2067 * @return true if both row and column selection models are enabled |
2067 * @return true if both row and column selection models are enabled |
2068 * |
2068 * |
2069 * @see #setCellSelectionEnabled |
2069 * @see #setCellSelectionEnabled |
3032 * <li> AUTO_RESIZE_ALL_COLUMNS: Spread the delta amongst all the columns |
3032 * <li> AUTO_RESIZE_ALL_COLUMNS: Spread the delta amongst all the columns |
3033 * in the <code>JTable</code>, including the one that is being |
3033 * in the <code>JTable</code>, including the one that is being |
3034 * adjusted. |
3034 * adjusted. |
3035 * </ul> |
3035 * </ul> |
3036 * <p> |
3036 * <p> |
3037 * <bold>Note:</bold> When a <code>JTable</code> makes adjustments |
3037 * <b>Note:</b> When a <code>JTable</code> makes adjustments |
3038 * to the widths of the columns it respects their minimum and |
3038 * to the widths of the columns it respects their minimum and |
3039 * maximum values absolutely. It is therefore possible that, |
3039 * maximum values absolutely. It is therefore possible that, |
3040 * even after this method is called, the total width of the columns |
3040 * even after this method is called, the total width of the columns |
3041 * is still not equal to the width of the table. When this happens |
3041 * is still not equal to the width of the table. When this happens |
3042 * the <code>JTable</code> does not put itself |
3042 * the <code>JTable</code> does not put itself |
3084 * <pre> |
3084 * <pre> |
3085 * size[i] = pref[i] + delta[i] |
3085 * size[i] = pref[i] + delta[i] |
3086 * </pre> |
3086 * </pre> |
3087 * where each individual delta[i] is calculated according to: |
3087 * where each individual delta[i] is calculated according to: |
3088 * <p> |
3088 * <p> |
3089 * If (DELTA < 0) we are in shrink mode where: |
3089 * If (DELTA < 0) we are in shrink mode where: |
3090 * <p> |
3090 * <p> |
3091 * <PRE> |
3091 * <PRE> |
3092 * DELTA |
3092 * DELTA |
3093 * delta[i] = ------------ * (pref[i] - min[i]) |
3093 * delta[i] = ------------ * (pref[i] - min[i]) |
3094 * (PREF - MIN) |
3094 * (PREF - MIN) |
3095 * </PRE> |
3095 * </PRE> |
3096 * If (DELTA > 0) we are in expand mode where: |
3096 * If (DELTA > 0) we are in expand mode where: |
3097 * <p> |
3097 * <p> |
3098 * <PRE> |
3098 * <PRE> |
3099 * DELTA |
3099 * DELTA |
3100 * delta[i] = ------------ * (max[i] - pref[i]) |
3100 * delta[i] = ------------ * (max[i] - pref[i]) |
3101 * (MAX - PREF) |
3101 * (MAX - PREF) |
3366 /** |
3366 /** |
3367 * Overrides <code>JComponent</code>'s <code>getToolTipText</code> |
3367 * Overrides <code>JComponent</code>'s <code>getToolTipText</code> |
3368 * method in order to allow the renderer's tips to be used |
3368 * method in order to allow the renderer's tips to be used |
3369 * if it has text set. |
3369 * if it has text set. |
3370 * <p> |
3370 * <p> |
3371 * <bold>Note:</bold> For <code>JTable</code> to properly display |
3371 * <b>Note:</b> For <code>JTable</code> to properly display |
3372 * tooltips of its renderers |
3372 * tooltips of its renderers |
3373 * <code>JTable</code> must be a registered component with the |
3373 * <code>JTable</code> must be a registered component with the |
3374 * <code>ToolTipManager</code>. |
3374 * <code>ToolTipManager</code>. |
3375 * This is done automatically in <code>initializeLocalVars</code>, |
3375 * This is done automatically in <code>initializeLocalVars</code>, |
3376 * but if at a later point <code>JTable</code> is told |
3376 * but if at a later point <code>JTable</code> is told |
3578 // |
3578 // |
3579 // Managing TableUI |
3579 // Managing TableUI |
3580 // |
3580 // |
3581 |
3581 |
3582 /** |
3582 /** |
3583 * Returns the L&F object that renders this component. |
3583 * Returns the L&F object that renders this component. |
3584 * |
3584 * |
3585 * @return the <code>TableUI</code> object that renders this component |
3585 * @return the <code>TableUI</code> object that renders this component |
3586 */ |
3586 */ |
3587 public TableUI getUI() { |
3587 public TableUI getUI() { |
3588 return (TableUI)ui; |
3588 return (TableUI)ui; |
3589 } |
3589 } |
3590 |
3590 |
3591 /** |
3591 /** |
3592 * Sets the L&F object that renders this component and repaints. |
3592 * Sets the L&F object that renders this component and repaints. |
3593 * |
3593 * |
3594 * @param ui the TableUI L&F object |
3594 * @param ui the TableUI L&F object |
3595 * @see UIDefaults#getUI |
3595 * @see UIDefaults#getUI |
3596 * @beaninfo |
3596 * @beaninfo |
3597 * bound: true |
3597 * bound: true |
3598 * hidden: true |
3598 * hidden: true |
3599 * attribute: visualUpdate true |
3599 * attribute: visualUpdate true |
3605 repaint(); |
3605 repaint(); |
3606 } |
3606 } |
3607 } |
3607 } |
3608 |
3608 |
3609 /** |
3609 /** |
3610 * Notification from the <code>UIManager</code> that the L&F has changed. |
3610 * Notification from the <code>UIManager</code> that the L&F has changed. |
3611 * Replaces the current UI object with the latest version from the |
3611 * Replaces the current UI object with the latest version from the |
3612 * <code>UIManager</code>. |
3612 * <code>UIManager</code>. |
3613 * |
3613 * |
3614 * @see JComponent#updateUI |
3614 * @see JComponent#updateUI |
3615 */ |
3615 */ |
3645 |
3645 |
3646 setUI((TableUI)UIManager.getUI(this)); |
3646 setUI((TableUI)UIManager.getUI(this)); |
3647 } |
3647 } |
3648 |
3648 |
3649 /** |
3649 /** |
3650 * Returns the suffix used to construct the name of the L&F class used to |
3650 * Returns the suffix used to construct the name of the L&F class used to |
3651 * render this component. |
3651 * render this component. |
3652 * |
3652 * |
3653 * @return the string "TableUI" |
3653 * @return the string "TableUI" |
3654 * @see JComponent#getUIClassID |
3654 * @see JComponent#getUIClassID |
3655 * @see UIDefaults#getUI |
3655 * @see UIDefaults#getUI |