< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 210,267 **** void createHorScrollbar() { hsb = new XHorizontalScrollbar(this); hsb.setValues(0, 0, 0, 0, HORIZ_SCROLL_AMT, HORIZ_SCROLL_AMT); } - /* New method name for 1.1 */ public void add(String item, int index) { addItem(item, index); } - /* New method name for 1.1 */ public void removeAll() { clear(); maxLength = 0; } - /* New method name for 1.1 */ public void setMultipleMode (boolean b) { setMultipleSelections(b); } ! /* New method name for 1.1 */ ! public Dimension getPreferredSize(int rows) { ! return preferredSize(rows); ! } ! ! /* New method name for 1.1 */ ! public Dimension getMinimumSize(int rows) { ! return minimumSize(rows); ! } ! ! /** ! * Minimum size. ! */ ! public Dimension minimumSize() { ! return minimumSize(DEFAULT_VISIBLE_ROWS); } ! /** ! * return the preferredSize ! */ ! public Dimension preferredSize(int v) { ! return minimumSize(v); } ! /** ! * return the minimumsize ! */ ! public Dimension minimumSize(int v) { FontMetrics fm = getFontMetrics(getFont()); initFontMetrics(); return new Dimension(20 + fm.stringWidth("0123456789abcde"), ! getItemHeight() * v + (2*MARGIN)); } /** * Calculate font metrics */ --- 210,245 ---- void createHorScrollbar() { hsb = new XHorizontalScrollbar(this); hsb.setValues(0, 0, 0, 0, HORIZ_SCROLL_AMT, HORIZ_SCROLL_AMT); } public void add(String item, int index) { addItem(item, index); } public void removeAll() { clear(); maxLength = 0; } public void setMultipleMode (boolean b) { setMultipleSelections(b); } ! public Dimension getMinimumSize() { ! return getMinimumSize(DEFAULT_VISIBLE_ROWS); } ! public Dimension getPreferredSize(int rows) { ! return getMinimumSize(rows); } ! public Dimension getMinimumSize(int rows) { FontMetrics fm = getFontMetrics(getFont()); initFontMetrics(); return new Dimension(20 + fm.stringWidth("0123456789abcde"), ! getItemHeight() * rows + (2*MARGIN)); } /** * Calculate font metrics */
< prev index next >