1696N/A private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XListPeer");
0N/A // The index is used at the moment of the post of ACTION_PERFORMED event after the mouse double click event.
0N/A // Used for tracking selection/deselection between mousePress/Release
0N/A // This variable is set to true after the "mouse pressed" event and to false after the "mouse released" event
0N/A // Fixed 6293432: Key events ('SPACE', 'UP', 'DOWN') aren't blocked if mouse is kept in 'PRESSED' state for List, XAWT
0N/A return minimumSize(v);
0N/A fgColorSet = true;
0N/A super.setForeground(c);
0N/A bgColorSet = true;
0N/A super.setBackground(c);
0N/A if (bgColorSet) {
0N/A if (fgColorSet) {
222N/A private void repaint(int firstItem, int lastItem, int options, Rectangle source, Point distance) {
0N/A super.focusGained(e);
0N/A boolean vsbWasVisible;
0N/A int origVSBVal;
0N/A return focusIndex;
0N/A super.handleJavaMouseEvent(e);
0N/A mousePressed(e);
0N/A mouseReleased(e);
0N/A mouseDragged(e);
1696N/A if (log.isLoggable(PlatformLogger.FINER)) log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
0N/A if (multipleSelections) {
0N/A if (isSelected(i)) {
0N/A deselectItem(i);
0N/A eventIndex = i;
0N/A selectItem(i);
0N/A eventIndex = i;
0N/A selectItem(i);
0N/A eventIndex = i;
0N/A setFocusIndex(i);
0N/A isMousePressed = true;
0N/A isMousePressed = false;
0N/A if (multipleSelections) {
0N/A if (i != eventIndex) {
0N/A selectItem(i);
0N/A eventIndex = i;
0N/A setFocusIndex(i);
0N/A * Start or stop vertical scrolling when mouse dragged in / out the area of the list if it's required
0N/A if (!mouseDraggedOutVertically){
0N/A mouseDraggedOutVertically = true;
0N/A mouseDraggedOutVertically = false;
0N/A if (!mouseDraggedOutHorizontally){
0N/A mouseDraggedOutHorizontally = true;
0N/A mouseDraggedOutHorizontally = false;
0N/A mouseDraggedOutVertically = false;
0N/A mouseDraggedOutHorizontally = false;
0N/A if (!isMousePressed){
0N/A keyPressed(e);
0N/A if (!multipleSelections) {
0N/A if (!multipleSelections) {
0N/A // 6190768 pressing pg-up on AWT multiple selection lists the items but no item event is triggered, on XToolkit
0N/A if (!multipleSelections){
0N/A // 6190768 pressing pg-down on AWT multiple selection list selects the items but no item event is triggered, on XToolkit
0N/A if (!multipleSelections){
0N/A if (!multipleSelections) {
0N/A if (!multipleSelections) {
0N/A // Fixed 6299853: XToolkit: Pressing space triggers ItemStateChanged event after List.removeAll called
1696N/A if (log.isLoggable(PlatformLogger.FINE)) log.fine("Notify value changed on " + obj + " to " + v);
0N/A if (multipleSelections != v) {
0N/A multipleSelections = v;
0N/A // Why we set this variable to -1 in spite of the fact that selected[] is changed in other way?
0N/A addedIndex = i;
1696N/A if (log.isLoggable(PlatformLogger.FINER)) log.finer("Adding item '" + item + "' to " + addedIndex);
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last visible: " + getLastVisibleItem() +
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() +
0N/A if (getFocusIndex() > e) {
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Multiple selections: " + multipleSelections);
0N/A repaintNeeded |= (vsbWasVisible ^ vsbVis) || (hsbWasVisible ^ hsbVis); // If scrollbars visibility changed
0N/A if (repaintNeeded) {
0N/A // 6190746 List does not trigger ActionEvent when double clicking a programmatically selected item, XToolkit
0N/A // If we invoke select(int) before setVisible(boolean), then variable currentIndex will equals -1. At the same time isSelected may be true.
0N/A if (!multipleSelections) {
0N/A if (!multipleSelections) {
0N/A int h = getItemHeight();
0N/A int n = itemsInWindow();
0N/A int h = getItemHeight();
0N/A int pixelsToScroll = y * h;
222N/A if (y < itemsInWin) {
222N/A source = new Rectangle(MARGIN, MARGIN + pixelsToScroll, width - SCROLLBAR_AREA, h * (itemsInWin - y - 1)-1);
0N/A int w = getListWidth();
0N/A if (scrollbarVisible) {
0N/A return (h / getItemHeight());
0N/A int w = getListWidth();
0N/A int w = getListWidth();
0N/A if (e instanceof MouseEvent) {
0N/A return super.prePostEvent(e);
0N/A isScrollBarOriginated = false;
0N/A isScrollBarOriginated = true;
0N/A if (fgColorSet) {
0N/A if (bgColorSet) {
0N/A return (backgroundColor.equals(Color.BLACK)) ? foregroundColor.darker() : backgroundColor.darker();
1696N/A if (log.isLoggable(PlatformLogger.FINE)) log.fine("Creating buffer " + width + "x" + height);
1696N/A if (log.isLoggable(PlatformLogger.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
0N/A if (createBuffer()) {
0N/A invalidate();
0N/A paintVerScrollbar(g, true);
0N/A paintHorScrollbar(g, true);
1696N/A if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
1696N/A if (log.isLoggable(PlatformLogger.FINER)) log.finer("Actually painting items from " + firstItem + " to " + lastItem +
0N/A int w = getItemWidth();
0N/A int h = getItemHeight();
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2)));
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Filling " + new Rectangle(x, y, w, h));
0N/A void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) {
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting scrollbar " + scr + " width " +
0N/A int w = getListWidth();
0N/A paintFocus = false;
1696N/A if (log.isLoggable(PlatformLogger.FINE)) log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " +
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight));
1696N/A if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Erasing previous focus rect " + prevFocusRect);
0N/A if (paintFocus) {