javax.swing.plaf.ListUI Java Examples

The following examples show how to use javax.swing.plaf.ListUI. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiListUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #2
Source File: JListOperator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Maps {@code JList.setUI(ListUI)} through queue
 */
public void setUI(final ListUI listUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JList) getSource()).setUI(listUI);
        }
    });
}
 
Example #3
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #4
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #5
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #6
Source File: SwingUtils.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
public static void disableSelection(JList<?> jl) {
  ListUI ui = (ListUI) jl.getUI();
  if (ui instanceof WebListUI) {
    WebListUI wlui = (WebListUI) ui;
    wlui.setHighlightRolloverCell(false);
    wlui.setDecorateSelection(false);
  }

}
 
Example #7
Source File: MultiListUI.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #8
Source File: MultiListUI.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #9
Source File: MultiListUI.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #10
Source File: MultiListUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #11
Source File: MultiListUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #12
Source File: MultiListUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #13
Source File: MultiListUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #14
Source File: MultiListUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #15
Source File: MultiListUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #16
Source File: JListOperator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Maps {@code JList.getUI()} through queue
 */
public ListUI getUI() {
    return (runMapping(new MapAction<ListUI>("getUI") {
        @Override
        public ListUI map() {
            return ((JList) getSource()).getUI();
        }
    }));
}
 
Example #17
Source File: MultiListUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #18
Source File: MultiListUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #19
Source File: MultiListUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #20
Source File: MultiListUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #21
Source File: MultiListUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #22
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #23
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #24
Source File: MultiListUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #25
Source File: MultiListUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>locationToIndex</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int locationToIndex(JList a, Point b) {
    int returnValue =
        ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
    }
    return returnValue;
}
 
Example #26
Source File: MultiListUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>indexToLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Point indexToLocation(JList a, int b) {
    Point returnValue =
        ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
    }
    return returnValue;
}
 
Example #27
Source File: MultiListUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getCellBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getCellBounds(JList a, int b, int c) {
    Rectangle returnValue =
        ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
    }
    return returnValue;
}
 
Example #28
Source File: WebListCellRenderer.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Updates custom renderer states based on render cycle settings.
 *
 * @param parameters {@link ListCellParameters}
 */
protected void updateStates ( final P parameters )
{
    // Resetting states
    states.clear ();

    // Selection state
    states.add ( parameters.isSelected () ? DecorationState.selected : DecorationState.unselected );

    // Focus state
    if ( parameters.isFocused () )
    {
        states.add ( DecorationState.focused );
    }

    // Hover state
    final ListUI ui = parameters.list ().getUI ();
    if ( ui instanceof WListUI )
    {
        if ( ( ( WListUI ) ui ).getHoverIndex () == parameters.index () )
        {
            states.add ( DecorationState.hover );
        }
    }

    // Extra states provided by value
    states.addAll ( DecorationUtils.getExtraStates ( parameters.value () ) );
}
 
Example #29
Source File: JBList.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void repaint(long tm, int x, int y, int width, int height) {
  if (width > 0 && height > 0) {
    ListUI ui = getUI();
    // do not paint a line background if layout orientation is not vertical
    if (ui instanceof WideSelectionListUI && JList.VERTICAL == getLayoutOrientation()) {
      x = 0;
      width = getWidth();
    }
    super.repaint(tm, x, y, width, height);
  }
}
 
Example #30
Source File: JBList.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void setUI(ListUI ui) {
  if (ui != null && Registry.is("ide.wide.selection.list.ui")) {
    Class<? extends ListUI> type = ui.getClass();
    if (type == BasicListUI.class) {
      ui = new WideSelectionListUI();
    }
  }
  super.setUI(ui);
}