summaryrefslogtreecommitdiff
path: root/libjava/javax/swing/plaf
diff options
context:
space:
mode:
authorgraydon <graydon@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-30 23:59:12 +0000
committergraydon <graydon@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-30 23:59:12 +0000
commit6598d56fcd3c34ff2ffa56e6ba73665e0db896c7 (patch)
tree35ad0bbb429ac9e5e658fea57b904ce331b0a4dd /libjava/javax/swing/plaf
parent8e0d64c61b8b7c63bf36b8c94f87672ffd198c31 (diff)
downloadgcc-6598d56fcd3c34ff2ffa56e6ba73665e0db896c7.tar.gz
2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphics.java (drawImage variants): Update image observer. * gnu/java/awt/peer/gtk/GtkComponentPeer.java (createImage): Start image production. * gnu/java/awt/peer/gtk/GtkFramePeer.java (setMenuBar): Protect against negative menu bar widths. (setBounds): Likewise. (postConfigureEvent): Likewise. * gnu/java/awt/peer/gtk/GtkImage.java (imageComplete): Don't remove consumer unless only a single frame has completed. * gnu/java/awt/peer/gtk/GtkImagePainter.java (GtkImagePainter): Add observer parameter. (setPixels): Update image observer. (imageComplete): Likewise. * java/applet/Applet.java (width): New field. (height): Likewise. (setStub): Set size if width or height field has been set. (resize): If stub is null save width and height values. * java/awt/Component.java (reshape): Protect against null parent. * java/awt/image/MemoryImageSource.java (MemoryImageSource(int,int,ColorModel,byte[],int,int)): Document. (MemoryImageSource(int,int,ColorModel,int[],int,int)): Likewise. (MemoryImageSource(int,int,ColorModel,byte[],int,int,Hashtable)): Reference pixel array directly, rather than creating a local copy. (MemoryImageSource(int,int,ColorModel,int[],int,int,Hashtable)): Likewise. (newPixels(int,int,int,int)): Fix for loop and array copy bounds. (newPixels(int,int,int,int,boolean)): Likewise. (startProduction): If animated call imageComplete with SINGLEFRAME. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c: Uncomment gdk_flush lines. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c (drawPixels): Return if g is null or g->drawable is not a gdk drawable. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/DefaultSingleSelectionModel.java, javax/swing/JPasswordField.java, javax/swing/tree/AbstractLayoutCache.java: Reformatted and javadocs cleaned up. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/Component.java: Fixed argument names to match javadocs. (setFont): Rewritten set property first and then fire event. (setLocale): Likewise. * javax/swing/text/JTextComponent.java (setEditable): Likewise. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Button.java (AccessibleAWTButton.getAccessibleActionDescription): Explain the source of 'click'. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Checkbox.java: Remove stub comments. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Button.java (AccessibleAWTButton.getAccessibleActionDescription): Return 'click'. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/CardLayout.java: Made some constants static. (serialVersionUID): Made private. (addLayoutComponent): Simplified code. * java/awt/event/InputEvent.java (getModifiersEx): Added missing @param tag. * java/awt/image/RGBImageFilter.java (filterRGBPixels): Reformatted, removed wrong @param tag. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/text/FieldView.java, javax/swing/text/JTextComponent.java: Removed debug code. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/BorderFactory.java (BorderFactory): Added private constructor. * javax/swing/SwingUtilities.java (SwingUtilities): Likewise. (computeStringWidth): New method. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/color/ICC_Profile.java (icSigNamedColorTag): Removed. * java/awt/datatransfer/DataFlavor.java (isMimeTypeEqual): Made final. * java/awt/image/AffineTransformOp.java: Reworked javadocs. (TYPE_BICUBIC): Added @since tag. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Checkbox.java (AccessibleAWTCheckBox): Remove todo comments. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Checkbox.java (itemStateChanged): Implement function. (getAccessibleContext): Add AccessibleAWTCheckBox to item listeners. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/Polygon.java (contains): Reimplemented. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/print/PrinterJob.java: Reformatted. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/image/AffineTransformOp.java, java/awt/image/ColorConvertOp.java, java/awt/image/LookupOp.java, java/awt/image/RescaleOp.java: Added final keywords where they belong. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/CardLayout.java, java/awt/Component.java, java/awt/Font.java, java/awt/image/SinglePixelPackedSampleModel.java: Fixed javadocs and argument names all over. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/image/DataBufferShort.java: Fixed file header. * java/awt/image/DataBufferUShort.java: Likewise. (DataBufferUShort): Throw NullPointerException if dataArray is null. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/Arc2D.java (setAngleStart): Corrected (wrong sign on atan2 y parameter). (setAngles): Likewise. (containsAngle): Return false on zero extent, don't include final angle. (contains): Treat OPEN-type arcs like CHORD ones, not as PIE ones. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/AffineTransform.java, (inverseTransform): Fixed bug and simplified code. (createTransformedShape): Return null on null parameter. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/color/ICC_ColorSpace.java, java/awt/color/ICC_Profile.java, java/awt/color/ICC_ProfileGray.java, java/awt/color/ICC_ProfileRGB.java: Re-indent copyright header to be standardish. * java/awt/datatransfer/StringSelection.java: Reformatted. * java/awt/geom/Area.java (EPSILON): Made static. (RS_EPSILON): Likewise. (PE_EPSILON): Likewide. 2004-11-30 Sven de Marothy <sven@physto.se> * javax/swing/SwingUtilities.java: (computeDifference): Implemented (computeIntersection): Likewise (computeUnion): Likewise (isRectangleContainingRectangle): Likewise 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/BasicStroke.java, java/awt/Button.java, java/awt/Canvas.java, java/awt/CheckboxMenuItem.java, java/awt/Container.java, java/awt/EventQueue.java, java/awt/FileDialog.java, java/awt/FlowLayout.java, java/awt/FontMetrics.java, java/awt/Graphics.java, java/awt/GridLayout.java, java/awt/KeyboardFocusManager.java, java/awt/Label.java, java/awt/LayoutManager2.java, java/awt/List.java, java/awt/MenuBar.java, java/awt/Scrollbar.java, java/awt/Toolkit.java, java/awt/Window.java, java/awt/datatransfer/DataFlavor.java, java/awt/datatransfer/FlavorTable.java, java/awt/event/ActionListener.java, java/awt/event/HierarchyBoundsAdapter.java, java/awt/geom/Arc2D.java, java/awt/geom/Rectangle2D.java, java/awt/geom/RectangularShape.java, java/awt/im/spi/InputMethod.java, java/awt/image/ByteLookupTable.java, java/awt/image/ColorModel.java, java/awt/image/DirectColorModel.java, java/awt/image/ShortLookupTable.java, java/awt/print/Book.java: Fixed javadocs and method argument names all over. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GdkFontPeer.java (buildString): Optimise String building. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/TextArea.java (AccessibleAWTTextArea, getAccessibleContext): Implement. * java/awt/TextField.java (AccessibleAWTTextField, getAccessibleContext): Implement. 2004-11-30 Tom Tromey <tromey@redhat.com> * Makefile.in: Rebuilt. * Makefile.am (jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo): Fixed typo. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Menu.java (AccessibleAWTMenu, getAccessibleContext): Implement. * java/awt/PopupMenu.java (AccessibleAWTMenu, getAccessibleContext): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/print/PrinterJob.java (lookupPrintServices, getPrintService, setPrintService): Implement. (lookupStreamPrintServices): Add commented out implementation. (printer): New field. 2004-11-30 Mark Wielaard <mark@klomp.org> * javax/swing/ToolTipManager.java (mouseMoved): Set currentComponent when not yet set. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/GeneralPath.java (evaluateCrossings): Fixed epsilon value, should always be nonzero. 2004-11-30 Paul Jenner <psj.home@ntlworld.com> * java/awt/image/Raster.java (createPackedRaster): Implemented. 2004-11-30 Graydon Hoare <graydon@redhat.com> * javax/swing/plaf/basic/BasicTextUI.java: Listen to focus events, indicate focus via caret. * javax/swing/text/GapContent.java (getString): Return substring. * javax/swing/text/PlainDocument.java (reindex): New method. (createDefaultRoot): Call it. (insertUpdate): Likewise. (removeUpdate): Likewise. * javax/swing/text/Utilities.java (drawTabbedText): Always advance on tab and newline, even if no painting happens. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am: List peer JNI header: Java source file dependencies explicitly. Likewise for JNI .lo: JNI header dependencies. * Makefile.in: Regenerate. 2004-11-30 Graydon Hoare <graydon@redhat.com> * Makefile.am: Add entry for BasicTextPaneUI.java * Makefile.in: Regenerate. * gnu/java/awt/peer/gtk/GdkGraphics2D.java (GdkGraphics2D): Set clip after transform. (drawImage): Protect against null image. * gnu/java/awt/peer/gtk/GtkFramePeer.java (setIconImage): Protect against non-GtkImage args. * gnu/java/awt/peer/gtk/GtkToolkit.java (checkImage): Protect against non-GtkImage args. * java/awt/print/PrinterJob.java: (print): Add variant taking PrintRequestAttributeSet. (printDialog): Likewise. * javax/swing/JComponent.java: (transferHandler): New field. (getComponentGraphics): Build new Graphics for each sub-paint. (getTransferHandler): New method. (setTransferHandler): New method. * javax/swing/JDesktopPane.java (setDragMode): Force LIVE_DRAG_MODE. * javax/swing/JMenuItem.java (menuSelectionChanged): Protect against null parent. * javax/swing/JTable.java (setDefaultRenderer): New method. * javax/swing/JTree.java: Get basic ctors and UI working. * javax/swing/JViewport.java (JViewport): Set scroll mode. * javax/swing/RepaintManager.java (addDirtyRegion): Skip empty regions. * javax/swing/ScrollPaneLayout.java (minimumLayoutSize): Do not bound scrollpane minimum by central view minimum. * javax/swing/ToolTipManager.java (showTip): Guard against null component. * javax/swing/TransferHandler.java: Stub out. * javax/swing/plaf/basic/BasicLookAndFeel.java: Add entry for TextPaneUI, change Tree icons to pngs. * javax/swing/plaf/basic/BasicMenuItemUI.java: (installDefaults): Set text position and alignment. (paintMenuItem): Layout icon with normal compound function. * javax/swing/plaf/basic/BasicTableHeaderUI.java: (getMaximumSize): Delete. (getMinimumSize): Delete. (getPreferredSize): Use column model's total width. * javax/swing/plaf/basic/BasicTextPaneUI.java: New file. * javax/swing/plaf/basic/BasicTextUI.java (modelChanged): Make resilient against nulls. * javax/swing/plaf/basic/BasicTreeUI.java: Add some simplistic config / painting functions. * javax/swing/plaf/basic/BasicViewportUI.java (paintSimple): Add new non-backingstore paint mode. (paintBackingStore): Split out backing store code. (paint): Switch on painting mode. * javax/swing/text/SimpleAttributeSet.java (SimpleAttributeSet): Resist nulls. * javax/swing/tree/DefaultTreeCellRenderer.java: Implement. * javax/swing/tree/DefaultTreeModel.java: Partially implement. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c (setFont): Set pango context's description and language. 2004-11-30 Mark Wielaard <mark@klomp.org> * java/awt/image/LookupOp.java: Comments and indentation fixes. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Checkbox.java (AccessibleAWTCheckBox): Implement. (getAccessibleContext): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/TextComponent.java (AccessibleAWTTextComponent): Implement. (getIndexAtPoint, getCharacterBounds): New methods. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Button.java (AccessibleAWTButton): Implement. 2004-11-30 Mark Wielaard <mark@klomp.org> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (filenameFilterCallback): Made static. 2004-11-30 Michael Koch <konqueror@gmx.de> * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (cairoShowGlyphs) Removed. 2004-11-30 Sven de Marothy <sven@physto.se> * gnu/java/awt/color/RgbProfileConverter.java (RgbProfileConverter): Don't invert matrix when reverse CLUT is available. * gnu/java/awt/color/LinearRGBConverter.java: Documentation update. * java/awt/color/ICC_ColorSpace.java: Likewise. * java/awt/color/ICC_Profile.java: Likewise. * java/awt/color/ICC_ProfileGray.java: Likewise. * java/awt/color/ICC_ProfileRGB.java: Likewise. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/MenuItem.java (AccessibleAWTMenuItem): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/Choice.java (AccessibleAWTChoice): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/BandedSampleModel.java (scanlineStride): Remove field hiding ComponentSampleModel.scanlineStride. 2004-11-30 Noa Resare <noa@resare.com> * java/awt/geom/GeneralPath.java (currentSegment): Fix typo in transform.transform() invocation. 2004-11-30 Sven de Marothy <sven@physto.se> * gnu/java/awt/peer/gtk/GtkComponentPeer.java (createImage): Created bitmap should be filled with bg color 2004-11-30 Noa Resare <noa@resare.com> * java/awt/Choice.java (add): Implement correct selection behavior when peer == null. (insert): Likewise. (remove): Likewise. 2004-11-30 Mark Wielaard <mark@klomp.org> * gnu/java/awt/peer/gtk/GtkChoicePeer.java (GtkChoicePeer): Call select() when Choice has a selected item. 2004-11-30 Michael Koch <address@bogus.example.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c: Fixed method names to start at begin of line. This is desired by GNU coding style guide. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GtkComponentPeer.java (gtkWidgetSetVisible): Unused. Removed. (connectJObject): Likewise. * gnu/java/awt/peer/gtk/GtkScrollPanePeer.java (gtkScrolledWindowSetScrollPosition): Commented out. 2004-11-30 Mark Wielaard <mark@klomp.org> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c (Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText): Installed and renamed from Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText. 2004-11-30 Mark Wielaard <mark@klomp.org> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText): Removed. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (init_dpi_conversion_factor): Correct prototype. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/image/ConvolveOp.java: Added missing copyright notice. 2004-11-30 Robert Schuster <theBohemian@gmx.net> Fixes bug #10908 * gnu/java/beans/IntrospectionIncubator.java: (addMethod): static methods are discarded now, too. 2004-11-30 Mark Wielaard <mark@klomp.org> * Makefile.am (awt_java_source_files): Add new gnu/java/awt/color java source files. * Makefile.in: Regenerated. 2004-11-30 Sven de Marothy <sven@physto.se> * gnu/java/awt/color/CieXyzConverter.java, gnu/java/awt/color/GrayScaleConverter.java, gnu/java/awt/color/SrgbConverter.java, gnu/java/awt/color/ClutProfileConverter.java, gnu/java/awt/color/LinearRGBConverter.java, gnu/java/awt/color/TagEntry.java, gnu/java/awt/color/ColorLookUpTable.java, gnu/java/awt/color/ProfileHeader.java, gnu/java/awt/color/ToneReproductionCurve.java, gnu/java/awt/color/ColorSpaceConverter.java, gnu/java/awt/color/PyccConverter.java, gnu/java/awt/color/GrayProfileConverter.java, gnu/java/awt/color/RgbProfileConverter.java: New files. * java/awt/color/ICC_ColorSpace.java, java/awt/color/ICC_Profile.java, java/awt/color/ICC_ProfileGray.java, java/awt/color/ICC_ProfileRGB.java: Implemented (sans PhotoYCC color space). 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/AffineTransformOp.java (filter): Implement bilinear interpolation for Rasters. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java (IndexColorModel): Actually use the provided colormap. Throw documented exceptions. Document exceptions. 2004-11-30 Paul Jenner <psj.home@ntlworld.com> * java/awt/image/IndexColorModel.java (IndexColorModel): Fix constructor. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/AffineTransformOp.java: Add TYPE_BICUBIC. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/AffineTransformOp.java (filter): Implement Raster filtering. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ComponentSampleModel.java (getDataElements, setDataElements): Implement SHORT, FLOAT, and INT transfer types. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * java/awt/Font.java (name): New field. (size): Likewise. (style): Likewise. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/Raster.java (createBandedRaster): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ConvolveOp.java: New class. * Makefile.am: Add ConvolveOp. * Makefile.in: Regenerate. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/RescaleOp.java (BandCombineOp, ColorConvertOp, LookupOp, RescaleOp): Fix loop bounds. 2004-11-30 jlquinn <jlquinn@optonline.net> * Makefile.am: Fix typo in BandCombineOp. * Makefile.in: Regenerate. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/BandCombineOp.java: New class. * Makefile.am: Add BandCombineOp. * Makefile.in: Regenerate. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/LookupOp.java: New class. * Makefile.am: Add LookupOp. * Makefile.in: Regenerate. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/SampleModel.java (createSubsetSampleModel): Add javadocs. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ColorModel.java (cloneColorModel): Fix line wrap. Use Boolean.valueOf. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GdkGraphics2D.java (releasePeerGraphicsResource): Fixed typo in method name. * gnu/java/awt/peer/gtk/GdkFontPeer.java (finalize): Fixed typo in releasePeerGraphicsResource. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/font/TextAttribute.java (RUN_DIRECTION_LTR): Initialie with static value instead of calculating it. (RUN_DIRECTION_RTL): Likewise. (STRIKETHROUGH_ON): Likewise. (SWAP_COLORS_ON): Likewise. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ColorConvertOp.java: New class. * java/awt/image/ColorModel.java (cloneColorModel): New method. * Makefile.am: Add ColorConvertOp. * Makefile.in: Regenerate. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * java/awt/DefaultKeyboardFocusManager.java (dispatchEvent): Track Window focus owner on FOCUS_GAINED events. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c (nativeSetIconImage): Rename to nativeSetIconImageFromDecoder. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c (Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun): Fix pointer warning. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter): Fix pointer warning. * jni/gtk-peer/gtkpeer.h: Introduce widget_union to fix type punned warnings. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect): Use widget_union to fix type punned pointer warning. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Likewise. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (window_get_new_state): Introduce unions to fix warnings as above. (window_property_changed_cb): Likewise. (window_active_state_change_cb): Mark unused variables unused. (window_focus_state_change_cb): Likewise. (window_focus_in_cb): Likewise. (window_focus_out_cb): Likewise. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c (Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont): Convert PangoFontMap correctly with PANGO_FT2FONT_MAP macro. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JMenuBar.java (updateUI): Simplified. * javax/swing/tree/DefaultTreeSelectionModel.java: Reorganized import statements. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/font/TextAttribute.java, javax/swing/JComponent.java, javax/swing/JInternalFrame.java, javax/swing/table/TableColumn.java, javax/swing/text/StyleConstants.java: Replaced "new Boolean(boolean)" with "Boolean.valueOf(boolean)". 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/tree/DefaultTreeCellEditor.java, javax/swing/tree/DefaultTreeModel.java, javax/swing/tree/DefaultTreeSelectionModel.java: Jalopied. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/tree/DefaultTreeCellEditor.java (EditorContainer.EditorContainer): Fixed arguments. (EditorContainer.EditorContainer): New method. (DefaultTextField.DefaultTextField): Fixed arguments, implemented. (DefaultTextField.getBorder): Implemented. (listenerList): New field. (addCellEditorListener): Implemented. (removeCellEditorListener): Implemented. (getCellEditorListeners): New method. * javax/swing/tree/DefaultTreeModel.java (addTreeModelListener): Fixed javadoc. (removeTreeModelListener): Likewise. (getTreeModelListeners): New method. (fireTreeNodesChanged): Implemented. (fireTreeNodesInserted): Likewise. (fireTreeNodesRemoved): Likewise. (fireTreeStructureChanged): Likewise. (getListeners): Fixed javadoc. * javax/swing/tree/DefaultTreeSelectionModel.java (addTreeSelectionListener): Implemented. (removeTreeSelectionListener): Likewise. (fireValueChanged): Likewise. (getListeners): Likewise. (addPropertyChangeListener): Likewise. (removePropertyChangeListener): Likewise. (getTreeSelectionListeners): New method. (getPropertyChangeListeners): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/basic/BasicScrollBarUI.java (maximumThumbSize): Removed static keyword. (minimumThumbSize): Likewise. * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java (CloseAction): Made public. (IconifyAction): Likewise. (MaximizeAction): Likewise. (MoveAction): Likewise. (RestoreAction): Likewise. (SizeAction): Likewise. (SystemMenuBar): Likewise. * javax/swing/plaf/basic/BasicSliderUI.java (TrackListener): Likewise. * javax/swing/plaf/basic/BasicSplitPaneUI.java (KeyboardDownRightHandler): Likewise. (KeyboardEndHandler): Likewise. (KeyboardHomeHandler): Likewise. (KeyboardResizeToggleHandler): Likewise. (KeyboardUpLeftHandler): Likewise. (PropertyHandler): Likewise. * javax/swing/plaf/basic/BasicTabbedPaneUI.java (PropertyChangeHandler): Likewise. (TabSelectionHandler): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/text/JTextComponent.java (getKeymap): Made public. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JEditorPane.java (getStream): Throws IOException. (read): Likewise. * javax/swing/JRootPane.java (createContentPane): Fixed return type. * javax/swing/JSpinner.java (commitEdit): Throws ParseException. * javax/swing/plaf/metal/MetalLookAndFeel.java (serialVersionUID): New field. * javax/swing/table/TableColumn.java (resizedPostingDisableCount): Added @deprecated tag. (disableResizedPosting): Likewise. (enableResizedPosting): Likewise. * javax/swing/text/Document.java (TitleProperty): Fixed value. * javax/swing/tree/TreeCellEditor.java (TreeCellEditor): Extends CellEditor. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JWindow.java javax/swing/SpinnerModel.java javax/swing/Timer.java javax/swing/event/MenuKeyEvent.java javax/swing/plaf/basic/BasicButtonUI.java javax/swing/plaf/basic/BasicIconFactory.java javax/swing/plaf/basic/BasicTabbedPaneUI.java javax/swing/text/AttributeSet.java javax/swing/text/Highlighter.java javax/swing/text/StyleConstants.java javax/swing/tree/TreeCellEditor.java: Removed redundant and reordered modifiers. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/basic/BasicToolTipUI.java: Reformatted copyright header. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractAction.java, javax/swing/AbstractButton.java, javax/swing/AbstractCellEditor.java, javax/swing/AbstractListModel.java, javax/swing/AbstractSpinnerModel.java, javax/swing/ActionMap.java, javax/swing/BorderFactory.java, javax/swing/Box.java, javax/swing/ButtonModel.java, javax/swing/CellEditor.java, javax/swing/CellRendererPane.java, javax/swing/DefaultBoundedRangeModel.java, javax/swing/DefaultButtonModel.java, javax/swing/DefaultCellEditor.java, javax/swing/DefaultDesktopManager.java, javax/swing/DefaultListCellRenderer.java, javax/swing/DefaultListSelectionModel.java, javax/swing/DefaultSingleSelectionModel.java, javax/swing/GrayFilter.java, javax/swing/InputMap.java, javax/swing/JApplet.java, javax/swing/JCheckBoxMenuItem.java, javax/swing/JColorChooser.java, javax/swing/JComboBox.java, javax/swing/JComponent.java, javax/swing/JDesktopPane.java, javax/swing/JDialog.java, javax/swing/JEditorPane.java, javax/swing/JFileChooser.java, javax/swing/JFormattedTextField.java, javax/swing/JFrame.java, javax/swing/JInternalFrame.java, javax/swing/JLabel.java, javax/swing/JLayeredPane.java, javax/swing/JList.java, javax/swing/JMenu.java, javax/swing/JMenuBar.java, javax/swing/JMenuItem.java, javax/swing/JOptionPane.java, javax/swing/JPanel.java, javax/swing/JPasswordField.java, javax/swing/JPopupMenu.java, javax/swing/JRadioButtonMenuItem.java, javax/swing/JRootPane.java, javax/swing/JSpinner.java, javax/swing/JSplitPane.java, javax/swing/JTabbedPane.java, javax/swing/JTable.java, javax/swing/JTextArea.java, javax/swing/JTextPane.java, javax/swing/JToggleButton.java, javax/swing/JToolBar.java, javax/swing/JToolTip.java, javax/swing/JTree.java, javax/swing/JViewport.java, javax/swing/ListModel.java, javax/swing/LookAndFeel.java, javax/swing/MenuSelectionManager.java, javax/swing/ProgressMonitorInputStream.java, javax/swing/RepaintManager.java, javax/swing/RootPaneContainer.java, javax/swing/ScrollPaneLayout.java, javax/swing/SpringLayout.java, javax/swing/SwingUtilities.java, javax/swing/Timer.java, javax/swing/ToolTipManager.java, javax/swing/UIDefaults.java, javax/swing/UIManager.java, javax/swing/border/MatteBorder.java, javax/swing/colorchooser/AbstractColorChooserPanel.java, javax/swing/colorchooser/ColorSelectionModel.java, javax/swing/colorchooser/DefaultColorSelectionModel.java, javax/swing/colorchooser/DefaultHSBChooserPanel.java, javax/swing/colorchooser/DefaultPreviewPanel.java, javax/swing/colorchooser/DefaultRGBChooserPanel.java, javax/swing/colorchooser/DefaultSwatchChooserPanel.java, javax/swing/event/AncestorEvent.java, javax/swing/event/HyperlinkEvent.java, javax/swing/event/InternalFrameEvent.java, javax/swing/event/MenuDragMouseEvent.java, javax/swing/event/TableColumnModelEvent.java, javax/swing/event/TableModelEvent.java, javax/swing/event/TreeExpansionEvent.java, javax/swing/event/TreeModelEvent.java, javax/swing/event/TreeSelectionEvent.java, javax/swing/event/TreeWillExpandListener.java, javax/swing/event/UndoableEditEvent.java, javax/swing/filechooser/FileView.java, javax/swing/plaf/BorderUIResource.java, javax/swing/plaf/ComponentUI.java, javax/swing/plaf/FileChooserUI.java, javax/swing/plaf/IconUIResource.java, javax/swing/plaf/ListUI.java, javax/swing/plaf/PopupMenuUI.java, javax/swing/plaf/SplitPaneUI.java, javax/swing/plaf/TabbedPaneUI.java, javax/swing/plaf/TextUI.java, javax/swing/plaf/TreeUI.java, javax/swing/plaf/basic/BasicArrowButton.java, javax/swing/plaf/basic/BasicBorders.java, javax/swing/plaf/basic/BasicButtonUI.java, javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java, javax/swing/plaf/basic/BasicColorChooserUI.java, javax/swing/plaf/basic/BasicComboBoxEditor.java, javax/swing/plaf/basic/BasicComboBoxRenderer.java, javax/swing/plaf/basic/BasicComboBoxUI.java, javax/swing/plaf/basic/BasicComboPopup.java, javax/swing/plaf/basic/BasicDesktopIconUI.java, javax/swing/plaf/basic/BasicDesktopPaneUI.java, javax/swing/plaf/basic/BasicIconFactory.java, javax/swing/plaf/basic/BasicInternalFrameTitlePane.java, javax/swing/plaf/basic/BasicInternalFrameUI.java, javax/swing/plaf/basic/BasicListUI.java, javax/swing/plaf/basic/BasicLookAndFeel.java, javax/swing/plaf/basic/BasicMenuBarUI.java, javax/swing/plaf/basic/BasicMenuItemUI.java, javax/swing/plaf/basic/BasicMenuUI.java, javax/swing/plaf/basic/BasicOptionPaneUI.java, javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java, javax/swing/plaf/basic/BasicPopupMenuUI.java, javax/swing/plaf/basic/BasicProgressBarUI.java, javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java, javax/swing/plaf/basic/BasicRootPaneUI.java, javax/swing/plaf/basic/BasicScrollBarUI.java, javax/swing/plaf/basic/BasicSeparatorUI.java, javax/swing/plaf/basic/BasicSliderUI.java, javax/swing/plaf/basic/BasicSpinnerUI.java, javax/swing/plaf/basic/BasicSplitPaneDivider.java, javax/swing/plaf/basic/BasicSplitPaneUI.java, javax/swing/plaf/basic/BasicTabbedPaneUI.java, javax/swing/plaf/basic/BasicTableHeaderUI.java, javax/swing/plaf/basic/BasicTableUI.java, javax/swing/plaf/basic/BasicTextAreaUI.java, javax/swing/plaf/basic/BasicTextFieldUI.java, javax/swing/plaf/basic/BasicTextUI.java, javax/swing/plaf/basic/BasicToolBarSeparatorUI.java, javax/swing/plaf/basic/BasicToolBarUI.java, javax/swing/plaf/basic/BasicToolTipUI.java, javax/swing/plaf/basic/BasicTreeUI.java, javax/swing/plaf/basic/BasicViewportUI.java, javax/swing/plaf/basic/ComboPopup.java, javax/swing/table/AbstractTableModel.java, javax/swing/table/DefaultTableCellRenderer.java, javax/swing/table/DefaultTableColumnModel.java, javax/swing/table/DefaultTableModel.java, javax/swing/table/JTableHeader.java, javax/swing/table/TableCellEditor.java, javax/swing/table/TableCellRenderer.java, javax/swing/table/TableColumn.java, javax/swing/table/TableColumnModel.java, javax/swing/text/AbstractDocument.java, javax/swing/text/Caret.java, javax/swing/text/DefaultCaret.java, javax/swing/text/DefaultEditorKit.java, javax/swing/text/DefaultHighlighter.java, javax/swing/text/EditorKit.java, javax/swing/text/JTextComponent.java, javax/swing/text/LayeredHighlighter.java, javax/swing/text/PasswordView.java, javax/swing/text/SimpleAttributeSet.java, javax/swing/text/StyleConstants.java, javax/swing/text/StyleContext.java, javax/swing/text/StyledEditorKit.java, javax/swing/text/TextAction.java, javax/swing/text/View.java, javax/swing/tree/AbstractLayoutCache.java, javax/swing/tree/DefaultTreeCellRenderer.java, javax/swing/tree/DefaultTreeModel.java, javax/swing/tree/DefaultTreeSelectionModel.java, javax/swing/tree/FixedHeightLayoutCache.java, javax/swing/tree/TreeCellRenderer.java, javax/swing/tree/TreeSelectionModel.java, javax/swing/tree/VariableHeightLayoutCache.java, javax/swing/undo/AbstractUndoableEdit.java, javax/swing/undo/UndoableEditSupport.java: Imports cleaned up. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/Container.java, java/awt/Font.java, java/awt/font/TextLayout.java: Imports cleaned up. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java (getLabel): Added @deprecated tag. (setLabel): Likewise. * javax/swing/FocusManager.java (disableSwingFocusManager): Likewise. (isFocusManagerEnabled): Likewise. * javax/swing/JComponent.java (isManagingFocus): Added version to @deprecated tag. (getNextFocusableComponent): Moved @deprecated tag to bottom of javadoc. (getConditionForKeyStroke): Likewise. (getActionForKeyStroke): Likewise. * javax/swing/JDesktopPane.java (LIVE_DRAG_MODE): Added @specnote tag. (OUTLINE_DRAG_MODE): Likewise. * javax/swing/JInternalFrame.java (MENU_BAR_PROPERTY): Fixed value. (getMenuBar): Added @deprecated tag. (setMenuBar): Likewise. * javax/swing/JViewport.java (isBackingStoreEnabled): Likewise. (setBackingStoreEnabled): Likewise. * javax/swing/plaf/basic/BasicDesktopPaneUI.java (closeKey): Likewise. (maximizeKey): Likewise. (minimizeKey): Likewise. (navigateKey): Likewise. (navigateKey2): Likewise. * javax/swing/plaf/basic/BasicInternalFrameUI.java (openMenuKey): Likewise. * javax/swing/plaf/basic/BasicSplitPaneUI.java (keyboardDownRightListener): Likewise. (keyboardEndListener): Likewise. (keyboardHomeListener): Likewise. (keyboardResizeToggleListener): Likewise. (keyboardUpLeftListener): Likewise. (dividerResizeToggleKey): Likewise. (downKey): Likewise. (endKey): Likewise. (homeKey): Likewise. (leftKey): Likewise. (rightKey): Likewise. (upKey): Likewise. (createKeyboardUpLeftListener): Likewise. (createKeyboardDownRightListener): Likewise. (createKeyboardHomeListener): Likewise. (createKeyboardEndListener): Likewise. (createKeyboardResizeToggleListener): Likewise. (getDividerBorderSize): Likewise. * javax/swing/plaf/basic/BasicTabbedPaneUI.java (downKey): Likewise. (leftKey): Likewise. (rightKey): Likewise. (upKey): Likewise. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the GTK_TEXT_VIEW macro. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (connect_awt_hook_cb): Mark unused variable unused. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c (selection_get): Do the cast right. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to the gtk API gtk_combo_box_new_text actually returns a GtkWidget. Remove unused var menu. (selection_changed): Remove unused value. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer warning with using an intermediate variable. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c (area_updated): Fix unused var warning for BE archs. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused var. (realize_cb): Mark unused variable unused. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c (seek_glyphstring_idx): Fix a C90 warning. * jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c (Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun): Mark unused arguments unused. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState), (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setGlyphCodes), (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex), (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIsHorizontal): Likewise. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c (Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerFontMetrics), (Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerTextMetrics): Likewise. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter): Likewise. (filenameFilterCallback): Remove unused var. (handle_response): Declare str_fileName and remove last else statement. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c: New File. (nativeGetNumFontsFamilies) New function. (nativeGetFontFamilies) Likewise. * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java (getAvailableFontFamilyNames): Implement. * Makefile.am (gtk_c_source_files): Add GdkGraphicsEnvironment.c. * Makefile.in: Regenerate. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/ClasspathFontPeer.java (setStandardAttributes(String,Map)): If size attribute doesn't exist, default to size 12. Clamp size value to a minimum of 1. 2004-11-30 Jeroen Frijters <jeroen@frijters.net> * javax/swing/JDialog.java (decorated): Likewise. * javax/swing/JFrame.java (defaultLookAndFeelDecorated): Likewise. 2004-11-30 Jeroen Frijters <jeroen@frijters.net> * javax/swing/plaf/basic/BasicToolBarUI.java (offset, regular): Made final. * javax/swing/plaf/basic/BasicScrollBarUI.java (DECREASE_HIGHLIGHT, INCREASE_HIGHLIGHT, NO_HIGHLIGHT, POSITIVE_SCROLL, NEGATIVE_SCROLL): Made final. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/BitwiseXORComposite.java, gnu/java/awt/ClasspathToolkit.java, gnu/java/awt/image/XBMDecoder.java, gnu/java/awt/peer/GLightweightPeer.java, gnu/java/awt/peer/gtk/GdkGlyphVector.java: Reorganized import statements. 2004-11-30 Jeroen Frijters <jeroen@frijters.net> * java/awt/Button.java (next_button_number): Removed useless initializer. * java/awt/Frame.java (next_frame_number): Likewise. * java/awt/Panel.java (next_panel_number): Likewise, * java/awt/Scrollbar.java (next_scrollbar_number): Likewise. * java/awt/TextArea.java (next_text_number): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/image/ByteLookupTable.java (ByteLookupTable) :Fixed HTML entities in javadocs. (lookupPixel): Fix case when dst is null. * java/awt/image/ShortLookupTable.java (ShortLookupTable) :Fixed HTML entities in javadocs. (lookupPixel): Fix case when dst is null. * java/awt/image/DataBufferByte.java, java/awt/image/DataBufferDouble.java, java/awt/image/DataBufferFloat.java, java/awt/image/DataBufferInt.java, java/awt/image/DataBufferShort.java, java/awt/image/DataBufferUShort.java: Fix initialization of bankData in constructors. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkButtonPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (setNativeBounds): Set GtkEventBox, GtkButton and GtkLabel size requests. * gnu/java/awt/peer/gtk/GtkComponentPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (setNativeBounds): Make package private. Set size request even if GTK parent is NULL. * gnu/java/awt/peer/gtk/GtkLabelPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (setNativeBounds): Set GtkEventBox and GtkLabel size requests. 2004-11-30 Mark Wielaard <mark@klomp.org> Workaround for bug #17952. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (request_frame_extents): Check window->window != NULL. 2004-11-30 Mark Wielaard <mark@klomp.org> * jni/gtk-peer/gdkfont.h: Include gtkpeer.h not gtkcairopeer.h. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c: Use native_text_layout_state_table here. * jni/gtk-peer/gdkfont.h: Mark native_text_layout_state_table extern. 2004-11-30 Mark Wielaard <mark@klomp.org> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c (setChars): Only call pango_itemize() when vec->glyphitems != NULL. Only call pango_shape() when gi->glyphs->num_glyphs > 0. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GtkToolkit.java: Merged import statements. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GdkGraphics2D.java (isBufferedImageGraphics): Simplified. 2004-11-30 Paul Jenner <psj.home@ntlworld.com> * javax/swing/JTree.java (isRootVisible): Fixed typo in method name. * javax/swing/JScrollBar.java (setValues): Likewise. * javax/swing/JScrollPane.java (createScrollListener): Call JScrollBar.setValues. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkContainerPeer.java (endValidate): Don't call setParentAndBounds on GtkWindowPeers. * java/awt/Component.java (static): Don't set default keyboard focus manager. * java/awt/KeyboardFocusManager.java (getCurrentKeyboardFocusManager): If current keyboard focus manager is null set a default. * gnu/java/awt/peer/gtk/GtkButtonPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (gtkWidgetSetBackground): New method. (block_expose_events_cb): New function. (connectSignals): Block the AWT's expose event processing on button press and release. (gtkSetLabel): Set text on proper widget. (gtkWidgetModifyFont): Modify font on proper widget. (gtkWidgetSetBackground): Set normal, active and prelight colours. (gtkWidgetSetForeground): Set forground colour of proper widget. (gtkActivate): Activate the correct widget. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (clearRect): Only clear rectangle if the backing component is not an event box. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (beginNativeRepaintID): New variable. (endNativeRepaintID): Likewise. (gtkInit): Initialize new fields with method IDs. * jni/gtk-peer/gtkpeer.h (beginNativeRepaintID): Declare extern. (endNativeRepaintID): Likewise. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * javax/swing/JList.java (init): Revert accidental commit. * gnu/java/awt/peer/gtk/GdkGraphics.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (GdkGraphics): Call initComponentGraphics or connectSignals depending on component's realization status. (realize_cb): New function. (initComponentGraphics): New method. (connectSignals): New method. (clipRect): Return immediately if component is not realized. (setClip): Likewise. (translate): Likewise. (drawImage variants): Return false immediately if component is not realized. * gnu/java/awt/peer/gtk/GdkGraphics2D.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (connectSignals): New method. (GdkGraphics2D): Call initComponentGraphics2D or connectSignals depending on component's realization status. Move other initialization calls to ... (initComponentGraphics2D): New method. (realize_cb): New function. (cairoSetMatrix): Return immediately if gr is NULL. (cairoNewPath): Likewise. (cairoRectangle): Likewise. (cairoClip): Likewise. * gnu/java/awt/peer/gtk/GtkComponentPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (gtkWidgetRepaintArea): Remove method. (isRealized): New method. (GtkComponentPeer): Move setParent, connectJObject and setCursor calls to setParentAndBounds. Call setParentAndBounds. (setParentAndBounds): New method. (setComponentBounds): Return immediately if bounds are all zero. (repaint): Remove call to gtkWidgetRepaintArea. Return immediately if requested paint region is 0x0. (setCursor): New method. (gtkWidgetSetParent): Only set widget's parent if its parent is currently NULL. (setNativeBounds): Only set widget's bounds if it has a parent. (connectSignals): Don't call gtk_widget_realize. Connect "realize" signal to connect_awt_hook_cb handler. * gnu/java/awt/peer/gtk/GtkContainerPeer.java (isValidating): New field. (beginValidate): Set isValidating true. (endValidate): Set parents and bounds for children first, then for this. Set isValidating false. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (connectJObject): Remove method. (connectSignals): Don't call gtk_widget_realize. * gnu/java/awt/peer/gtk/GtkListPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (connectJObject): Remove method. (connectSignals): Don't call gtk_widget_realize. * gnu/java/awt/peer/gtk/GtkPanelPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (connectJObject): Remove method. * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c (connectJObject): Remove method. * gnu/java/awt/peer/gtk/GtkWindowPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create): Don't call gtk_widget_realize. (connectJObject): Remove method. (connectSignals): Don't call gtk_widget_realize. Connect "realize" signal to connect_awt_hook_cb handler. (nativeSetBounds): Don't attempt to move GDK window if it is NULL. * java/awt/Container.java (addImpl): Don't call comp.addNotify if peer is not null. (validateTree): Create peers for all children before calling doLayout. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectSignals): Don't call gtk_widget_realize. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (connect_awt_hook_cb): New function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (initComponentGraphicsID): New variable. (initComponentGraphics2DID): Likewise. (setCursorID): Likewise. (gtkInit): Initialize new fields with method IDs. * jni/gtk-peer/gtkpeer.h (initComponentGraphicsID): Declare extern. (initComponentGraphics2DID): Declare extern. (setCursorID): Likewise. (connect_awt_hook_cb): Declare function. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java, gnu/java/awt/peer/gtk/GdkGlyphVector.java, gnu/java/awt/peer/gtk/GdkGraphics2D.java, gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java, gnu/java/awt/peer/gtk/GdkPixbufDecoder.java, gnu/java/awt/peer/gtk/GtkButtonPeer.java, gnu/java/awt/peer/gtk/GtkClipboard.java, gnu/java/awt/peer/gtk/GtkDialogPeer.java, gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, gnu/java/awt/peer/gtk/GtkFontPeer.java, gnu/java/awt/peer/gtk/GtkListPeer.java, gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, gnu/java/awt/peer/gtk/GtkToolkit.java, gnu/java/awt/peer/gtk/GtkWindowPeer.java: Import statements reworked. Some little reformattings. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/image/AffineTransformOp.java (TYPE_BILINEAR): Initialize with 2. * java/awt/print/Printable.java: Jalopied. (PAGE_EXISTS): Initialize with 0; (NO_SUCH_PAGE): Initialized with 1. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * Makefile.am: Add BufferedImageFilter.java. * Makefile.in: Regenerate. 2004-11-30 Graydon Hoare <graydon@redhat.com> * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (install_font_peer): Minor bug fixes to track cairo font semantics. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/BufferedImageFilter.java: Implement. 2004-11-30 Graydon Hoare <graydon@redhat.com> * Makefile.am (jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c) (jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c) (gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java) (gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java): Remove. (jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c) (jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c) (gnu/java/awt/peer/gtk/GdkTextLayout.java) (gnu/java/awt/peer/gtk/GdkFontPeer.java) (gnu/java/awt/peer/ClasspathTextLayoutPeer.java): Add * Makefile.in: Regenerate. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Add stub. * gnu/java/awt/ClasspathToolkit.java (getClasspathTextLayoutPeer) Add. * gnu/java/awt/peer/ClasspathFontPeer.java (copyStyleToAttrs) (copySizeToAttrs): Make public. * gnu/java/awt/peer/ClasspathTextLayoutPeer.java: New file. * gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java: Remove. * gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java: Remove. * gnu/java/awt/peer/gtk/GdkFontMetrics.java: Rewrite. * gnu/java/awt/peer/gtk/GdkFontPeer.java: New file. * gnu/java/awt/peer/gtk/GdkGlyphVector.java: Adjust type names. * gnu/java/awt/peer/gtk/GdkGraphics.java (getFontPeer): New function. (drawString): Pass font peer to native side. * gnu/java/awt/peer/gtk/GdkGraphics2D.java (cairoSetFont) (cairoShowGlyphs) (PainterThread): Remove. (GdkGraphics2D): Set hints during construction. (shifted) (walkPath) (draw) (setRenderingHint) (setRenderingHints): Reimplement normalization logic. (getDefaultHints) (updateBufferedImage) (isBufferedImageGraphics) (updateImagePixels) (drawImage): Make final. (drawImage): Always paint synchronously. (drawString) (drawGlyphVector): Rewrite. (releasePeerGraphicResource) (getPeerTextMetrics) (getPeerFontMetrics) (drawGdkGlyphVector) (drawGdkTextLayout) (cairoDrawGdkGlyphVector) (cairoDrawGdkTextLayout) (cairoDrawString) (getFontPeer): New functions. * gnu/java/awt/peer/gtk/GdkTextLayout.java: New file. * gnu/java/awt/peer/gtk/GtkComponentPeer.java (getFontMetrics): Get metrics via toolkit, to hit cache. * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java: Use getFontMetrics. * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java: Likewise. * gnu/java/awt/peer/gtk/GtkToolkit.java (LRUCache): New class. (fontCache) (metricsCache) (imageCache): New members. (getFontMetrics) (getImage) (getClasspathFontPeer): Use caches. (getFontPeer): Route through getClasspathFontPeer. * java/awt/Font.java (attrsToMap): Remove, adjust ctors. * java/awt/font/TextLayout.java: Implement in terms of peer. * javax/swing/plaf/basic/BasicSliderUI.java (paintThumb): Use polyline rather than polygon. * javax/swing/plaf/basic/BasicGraphicsUtils.java: Update comment but, alas, still do not switch to using TextLayouts. * javax/swing/text/Utilities.java (drawTabbedText): Draw text run-at-a-time, not char-at-a-time. * jni/gtk-peer/gdkfont.h: Publicize some of the font interface, add layout table. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c: * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c: Remove files. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c: Rewrite to incorporate brains of old GdkClasspathFontPeerMetrics. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c: Rewrite to incorporate brains of old GdkClasspathFontPeer. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c: New file. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (drawString): Rewrite to use persistent layout in peer font. Comment out extraneous gdk_flush calls. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (metrics_cairo) (metrics_surface): New static variables. (paint_glyph_run) (install_font_peer): New helper functions. (releasePeerGraphicResource) (getPeerTextMetrics) (getPeerFontMetrics) (cairoDrawGdkTextLayout) (cairoDrawGdkGlyphVector): New native methods. (cairoDrawString): Rewrite, leaving layout-based version commented out for the time being. * jni/gtk-peer/gtkpeer.h (graphics): Add fields for pango stuff. 2004-11-30 David Gilbert <david.gilbert@object-refinery.com> * java/awt/geom/AffineTransform.java: Fixed javadocs overall. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ComponentColorModel.java: Remove FIXME comment since it's correct. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java: Fix use of immutable BigIntegers. 2004-11-30 Tom Tromey <tromey@redhat.com> * javax/swing/plaf/basic/BasicOptionPaneUI.java (MessageIcon): Renamed from 'messageIcon'. (errorIcon, infoIcon, warningIcon, questionIcon): Updated. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/RescaleOp.java: Fix formatting. 2004-11-30 Olga Rodimina <rodimina@redhat.com> * javax/swing/plaf/basic/BasicComboPopup.java (SCROLL_DOWN): made final. (SCROLL_UP): made final. 2004-11-30 Olga Rodimina <rodimina@redhat.com> * javax/swing/plaf/basic/BasicComboPopup.java: Added javadocs for undocumented fields. (show): scroll down to the selected item and highlight selected item. (startAutoScrolling): Implemented. (stopAutoScrolling): Implemented. (autoScrollUp): Implemented. (autoScrollDown): Implemented. (InvocationMouseHandler.mouseReleased): Implemented. (InvocationMouseMotionHandler.mouseDragged): Implemented. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/RescaleOp.java: Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java (getRGBs, convertToIntDiscrete): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java: Add class docs. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java (isValid, getValidPixels): Implement. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/MenuBar.java, java/awt/peer/MenuBarPeer.java: Revert accidentally commited changes. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/AWTKeyStroke.java, java/awt/Canvas.java, java/awt/CardLayout.java, java/awt/CheckboxMenuItem.java, java/awt/Component.java, java/awt/Container.java, java/awt/DefaultKeyboardFocusManager.java, java/awt/EventDispatchThread.java, java/awt/FileDialog.java, java/awt/FlowLayout.java, java/awt/Font.java, java/awt/Frame.java, java/awt/Graphics2D.java, java/awt/GraphicsEnvironment.java, java/awt/GridBagConstraints.java, java/awt/GridBagLayout.java, java/awt/GridLayout.java, java/awt/Image.java, java/awt/KeyboardFocusManager.java, java/awt/Label.java, java/awt/List.java, java/awt/MediaTracker.java, java/awt/Menu.java, java/awt/MenuBar.java, java/awt/MenuComponent.java, java/awt/Panel.java, java/awt/PopupMenu.java, java/awt/ScrollPane.java, java/awt/Scrollbar.java, java/awt/SystemColor.java, java/awt/TextArea.java, java/awt/TextField.java, java/awt/Toolkit.java, java/awt/Window.java, java/awt/color/ICC_Profile.java, java/awt/datatransfer/DataFlavor.java, java/awt/datatransfer/StringSelection.java, java/awt/datatransfer/SystemFlavorMap.java, java/awt/dnd/Autoscroll.java, java/awt/dnd/DropTarget.java, java/awt/dnd/DropTargetContext.java, java/awt/dnd/DropTargetDragEvent.java, java/awt/dnd/peer/DropTargetContextPeer.java, java/awt/event/AdjustmentEvent.java, java/awt/event/InputEvent.java, java/awt/event/InvocationEvent.java, java/awt/event/KeyEvent.java, java/awt/event/MouseEvent.java, java/awt/font/TextLayout.java, java/awt/geom/GeneralPath.java, java/awt/geom/Point2D.java, java/awt/im/InputContext.java, java/awt/im/spi/InputMethodContext.java, java/awt/image/AffineTransformOp.java, java/awt/image/BufferedImage.java, java/awt/image/ColorModel.java, java/awt/image/ComponentColorModel.java, java/awt/image/CropImageFilter.java, java/awt/image/DirectColorModel.java, java/awt/image/MemoryImageSource.java, java/awt/image/PackedColorModel.java, java/awt/image/PixelGrabber.java, java/awt/image/RasterOp.java, java/awt/peer/MenuBarPeer.java: Some fixes for checkstyle. Import statement and modifier order redordering. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JTable.java (setModel): Reimplemented. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JTextArea.java (append): Re-implemented. (insert): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JSpinner.java (serialVersionUID): New static field. * javax/swing/JToggleButton.java (JToggleButton): Fixed email addresses. * javax/swing/SpinnerNumberModel.java (serialVersionUID): Added javadoc. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JTextArea.java: Don't use JTextComponent.doc directly. GCJ from java-gui-branch has a bug here which is fixed in HEAD ... 2004-11-30 Andrew John Hughes <address@hidden> * javax/swing/JTextArea.java: Added additional documentation. 2004-11-30 Andrew John Hughes <address@hidden> * javax/swing/JRadioButton.java: Implemented additional constructors and accessibility classes. Added documentation and fixed a typo in AbstractButton. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/IndexColorModel.java (IndexColorModel): Implement missing constructor. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ComponentColorModel.java (ComponentColorModel): Implement missing 1.4 constructor. 2004-11-30 Andrew John Hughes <address@hidden> * javax/swing/JToggleButton.java: Implemented additional constructors and accessibility classes. Added documentation and fixed a typo in AbstractButton. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ColorModel.java (getDataElement, getDataElements): Document since 1.4. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/BandedSampleModel.java: Implement. * Makefile.am: Add java/awt/image/BandedSampleModel.java. * Makefile.in: Regenerated. 2004-11-30 Michael Koch <konqueror@gmx.de> * java/awt/Window.java: Fixed whitespace difference with GNU classpath. 2004-11-30 Mark Wielaard <mark@klomp.org> * Makefile.am: Add javax/swing/SpinnerListModel.java. * Makefile.in: Regenerated. 2004-11-30 Andrew John Hughes <gnu_andrew@member.fsf.org> * javax/swing/SpinnerListModel.java, javax/swing/SpinnerModel.java Implemented SpinnerListModel. Added documentation to SpinnerModel. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (init_dpi_conversion_factor): Apply the patch from main correctly. 2004-06-26 Andreas Tobler <a.tobler@schweiz.ch> 2004-11-30 Tom Tromey <tromey@redhat.com> Bug 9948. * javax/swing/JDesktopPane.java (LIVE_DRAG_MODE): Now final. (OUTLINE_DRAG_MODE): LIVE_DRAG_MODE. * javax/swing/plaf/basic/BasicSplitPaneUI.java (NON_CONTINUOUS_DIVIDER): Now final. Initialize. 2004-11-30 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/awt/Canvas.java (AccessibleAWTCanvas): added serialization UID * java/awt/Label.java (AccessibleAWTLabel): added serialization UID * javax/swing/JRootPane.java (AccessibleJRootPane): added comment to existing UID * javax/swing/JSpinner.java (DefaultEditor): added serialization UID (NumberEditor): added serialization UID * javax/swing/text/html/HTML.java (UnknownTag): added serialization UID 2004-11-30 Jeroen Frijters <jeroen@frijters.net> * javax/swing/JInternalFrame.java (CONTENT_PANE_PROPERTY,FRAME_ICON_PROPERTY,GLASS_PANE_PROPERTY, IS_CLOSED_PROPERTY,IS_ICON_PROPERTY,IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY,LAYERED_PANE_PROPERTY,MENU_BAR_PROPERTY, ROOT_PANE_PROPERTY,TITLE_PROPERTY): Made final as per API spec. * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java (CLOSE_CMD,ICONIFY_CMD,MAXIMIZE_CMD,MOVE_CMD,RESTORE_CMD,SIZE_CMD): Made final as per API spec. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * jni/gtk-peer/gtkpeer.h: Remove duplicated copyright string. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/Arc2D.java: Reformatted. (setArc): Correct documentation to say 'upper left corner'. (setArcByTangent,contains,intersects): Implemented. (containsAngle): Corrected to handle negative extents. (ArcIterator): Set to private. (ArcIterator): Corrected for CHORD-type arcs, negative extents. (intersects): Fix: Now checks the arc segment. (contains): Cleaned up. * java/awt/geom/CubicCurve2a.javaD: Fix insideness-test. Reindent. (contains): Implemented. (intersects): Implemented. * java/awt/geom/QuadCurve2D.java: Fix insideness-test. Reindent. * java/awt/geom/GeneralPath: Fix insideness-test. Reindent and document. Fully (re)implemented using separate xpoints and ypoints float[] coords. 2004-11-30 Andreas Tobler <a.tobler@schweiz.ch> * configure.ac: Introduce AC_C_BIGENDIAN_CROSS for WORDS_BIGENDIAN. * configure: Regenerate. * include/config.h.in: Likewise. * jni/gtk-peer/gtkpeer.h (SWAPU32): Introduce macro to swap pixels. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c: Moved SWAPU32 macro to gtkpeer.h. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getImagePixels): Convert pixels from 0xBBGGRRAA to 0xAARRGGBB only on Little Endian architectures. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c (area_updated): Likewise. 2004-11-30 David Gilbert <david.gilbert@object-refinery.com> * java/awt/SystemColor.java: Fix @link doc entries. 2004-11-30 David Gilbert <david.gilbert@object-refinery.com> * java/awt/RenderingHints.java: Documented. (RenderingHints): Accept null init Map. (putAll): Preprocess map to generate appropriate exceptions. (remove): Cast object to Key and remove from hintMap. 2004-11-30 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/awt/MenuComponent.java, java/awt/MenuBar.java: Implementation of accessibility classes and methods for these two components. 2004-11-30 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/awt/KeyboardFocusManager.java: Added missing documentation. 2004-11-30 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/awt/Label.java, java/awt/Canvas.java: Added accessibility classes to AWT Label and Canvas, as well as additional documentation for Canvas. 2004-11-30 David Gilbert <address@bogus.example.com> * java/awt/image/DataBuffer.java: Update API documentation. * java/awt/image/DataBufferByte.java: Likewise. * java/awt/image/DataBufferDouble.java: Likewise. * java/awt/image/DataBufferFloat.java: Likewise. * java/awt/image/DataBufferInt.java: Likewise. * java/awt/image/DataBufferShort.java: Likewise. * java/awt/image/DataBufferUShort.java: Likewise. 2004-11-30 Dalibor Topic <robilad@kaffe.org> * java/awt/Component.java (postEvent): Only delegate to parent if a parent exists. Reported by: Stephane Meslin-Weber <steph@tangency.co.uk> 2004-11-30 Sven de Marothy <sven@physto.se> *java/awt/AWTEventMulticaster.java, java/awt/Adjustable.java, java/awt/Point.java, java/awt/Polygon.java, java/awt/Rectangle.java, java/awt/Shape.java, java/awt/geom/Area.java, java/awt/geom/Ellipse2D.java, java/awt/geom/PathIterator.java, java/awt/geom/Point2D.java, java/awt/geom/Rectangle2D.java, java/lang/Comparable.java, java/util/Arrays.java: Fixed documentation errors 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ComponentSampleModel.java: Add documentation. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ComponentSampleModel.java (constructor): Initialize numBanks when figuring out the max bank index. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/Raster.java (createPackedRaster): Implement MultiPixelPackedSampleModel codepath. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/MultiPixelPackedSampleModel.java: Implement. * Makefile.am: Add MultiPixelPackedSampleModel.java. * Makefile.in: Regenerate. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/Raster.java (getNumBands): Implement. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/Raster.java (createPackedRaster(int,int,int,int,int,Point)): Implement for bands>1. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/SinglePixelPackedSampleModel.java (SinglePixelPackedSampleModel): Throw exception for unsupported datatype. 2004-11-30 Jerry Quinn <jlquinn@optonline.net> * java/awt/image/ColorModel.java (getDataElement): Implemented. Update javadoc. (getDataElements): Add missing version. Remove bogus version. Update javadoc. 2004-11-30 Olga Rodimina <rodimina@redhat.com> * javax/swing/plaf/basic/BasicComboBoxUI.java: (paintCurrentValue): Pass correct parameters to getListCellRendererComponent(). (ListDataHandler.intervalRemoved): Implemented. (PropertyChangeHandler.propertyChange): Handle changes in MODEL_CHANGED_PROPERTY of the JComboBox * javax/swing/plaf/basic/BasicComboPopup.java: (BasicComboPopup): Moved code that configures popup to configurePopup() and call it instead. (firePopupMenuWillBecomeVisible): Implemented. (firePopupMenuWillBecomeInvisible): Likewise. (firePopupMenuCanceled): Likewise. (configureList): Set list's visibleRowCount same as comboBox's visibleRowCount. (configurePopup): Implemented. (getPopupHeightForRowCount): Get item's from JComboBox's model and not from model of the JList. (ListMouseMotionHandler.mouseMoved): Implemented. (PropertyChangeHandler.propertyChange): Handles change in the JComboBox's model. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JComponent.java (isMaximumSizeSet): New method. (isMinimumSizeSet): Likewise. (isPreferredSizeSet): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JSpinner.java: Some Re-formatting. (spinner): New field. (DefaultEditor): New method. (getSpinner): Likewise. (NumberEdito): Likewise. (getModel): Likewise 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/InputVerifier.java: Re-formatted. * javax/swing/JComponent.java (inputVerifier): New property field. (getInputVerifier): New method. (setInputVerifier): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JComponent.java (JComponent): Added javadoc comment. (setBorder): Fire property change eventr. (setEnabled): Likewise. (setMaximumSize): Likewise. (setMinimumSize): Likewise. (setPreferredSize): Likewise. (setOpaque): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JTextField.java (action): New field. (actionCommand): Likewise. (actionPropertyChangeListener): Likewise. (setHorizontalAlignment): Abort soon if new value == old value. Fire event before repainting. (postActionEvent): New method. (getAction): Likewise. (setAction): Likewise. (getActionCommand): Likewise. (setActionCommand): Likewise. (createActionPropertyChangeListener): Likewise. (configurePropertiesFromAction): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/DebugGraphics.java: Re-formatted. Fixed some javadocs. * javax/swing/JApplet.java (rootPaneCheckingEnabled): Renamed from checking. * javax/swing/JCheckBox.java (BORDER_PAINTED_FLAT_CHANGED_PROPERTY): New statif field. * javax/swing/JFrame.java: Re-formatted a bit and reordered some methods. (rootPaneCheckingEnabled): Renamed from checking. (getPreferredSize): Simplified. * javax/swing/JTextArea.java (getColumnWidth): New method. (getLineCount): Likewise. (getLineStartOffset): Likewise. (getLineEndOffset): Likewise. (getLineOfOffset): Likewise. (getRowHeight): Likewise. (insert): Likewise. (replaceRange): Likewise. * javax/swing/JTextField.java (scrollOffset): new field. (getScrollOffset): New method. (setScrollOffset): Likewise. (getColumnWidth): Likewise. * javax/swing/JTree.java (ANCHOR_SELECTION_PATH_PROPERTY): New static field. (CELL_EDITOR_PROPERTY): Likewise. (CELL_RENDERER_PROPERTY): Likewise. (EDITABLE_PROPERTY): Likewise. (EXPANDS_SELECTED_PATHS_PROPERTY): Likewise. (INVOKES_STOP_CELL_EDITING_PROPERTY): Likewise. (LARGE_MODEL_PROPERTY): Likewise. (LEAD_SELECTION_PATH_PROPERTY): Likewise. (ROOT_VISIBLE_PROPERTY): Likewise. (ROW_HEIGHT_PROPERTY): Likewise. (SCROLLS_ON_EXPAND_PROPERTY): Likewise. (SELECTION_MODEL_PROPERTY): Likewise. (SHOWS_ROOT_HANDLES_PROPERTY): Likewise. (TOGGLE_CLICK_COUNT_PROPERTY): Likewise. (TREE_MODEL_PROPERTY): Likewise. (VISIBLE_ROW_COUNT_PROPERTY): Likewise. (cellEditor): New field. (invokesStopCellEditing): Likewise. (largeModel): Likewise. (rowHeight): Likewise. (scrollsOnExpand): Likewise. (selectionModel): Likewise. (toggleClickCount): Likewise. (visibleRowCount): Likewise. (setShowsRootHandles): Fixed typo in method name. (getCellEditor): New method. (setCellEditor): Likewise. (getSelectionModel): Likewise. (setSelectionModel): Likewise. (getVisibleRowCount): Likewise. (setVisibleRowCount): Likewise. (isLargeModel): Likewise. (setLargeModel): Likewise. (getRowHeight): Likewise. (setRowHeight): Likewise. (getInvokesStopCellEditing): Likewise. (setInvokesStopCellEditing): Likewise. (getToggleClickCount): Likewise. (setToggleClickCount): Likewise. (getScrollsOnExpand): Likewise. (setScrollsOnExpand): Likewise. * javax/swing/table/DefaultTableColumnModel.java (addColumnModelListener): Fixed javadoc. (removeColumnModelListener): Implemented. Fixed javadoc. (getColumnModelListeners): New method. * javax/swing/table/JTableHeader.java (columnModel): Made protected. (draggedColumn): Likewise. (draggedDistance): Likewise. (reorderingAllowed): Likewise. (resizingAllowed): Likewise. (resizingColumn): Likewise. (table): Likewise. (updateTableInRealTime): Likewise. (createDefaultColumnModel): Renamed from createDefaultTableColumnModel. (setDefaultRenderer): New method. * javax/swing/table/TableColumn.java (getPropertyChangeListeners): New method. * javax/swing/text/DefaultHighlighter.java (drawsLayeredHighlights): New field. (getDrawsLayeredHighlights): New method. (setDrawsLayeredHighlights): Likewise. * javax/swing/text/DocumentFilter.java (FilterBypass): New inner class. (insertString): New method. (remove): Likewise. (replace): Likewise. * javax/swing/text/JTextComponent.java (dragEnabled): New field. (getSelectedText): New method. (getDragEnabled): Likewise. (setDragEnabled): Likewise. (replaceSelection): Reimplemented. * javax/swing/text/NavigationFilter.java (FilterBypass): New inner class. (NavigationFilter): New method. (moveDot): Likewise. (setDot): Likewise. * javax/swing/text/SimpleAttributeSet.java (EMPTY): Made public final. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/SpinnerNumberModel.java (getMinimum): New method. (setMinimum): Likewise. (getMaximum): Likewise. (setMaximum): Likewise. (getStepSize): Likewise. (setStepSize): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JMenu.java (getMenuListeners): New method. (fireMenuSelected): Simplified. * javax/swing/JRootPane.java (NONE): New static field. (FRAME): Likewise. (PLAIN_DIALOG): Likewise. (INFORMATION_DIALOG): Likewise. (ERROR_DIALOG): Likewise. (COLOR_CHOOSER_DIALOG): Likewise. (FILE_CHOOSER_DIALOG): Likewise. (QUESTION_DIALOG): Likewise. (WARNING_DIALOG): Likewise. (defaultButton): New field. (getDefaultButton): New method. (setDefaultButton): Likewise. * javax/swing/JScrollPane.java (getUI): New method. (setUI): Likewise. * javax/swing/JTable.java (getUI): Javadoc added. (setUI): New method. * javax/swing/JViewport.java (getUI): New method. (setUI): Likewise. * javax/swing/UIDefaults.java (removePropertyChangeListener): Made public. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JApplet.java, javax/swing/JFrame.java: Re-indented. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java: Little re-formatting. (changeEvent): Made protected. (fireStateChanged): Removed argument. (setHorizontalAlignment): Abort method when old value is equal too new value. (setHorizontalTextPosition): Likewise. (setVerticalAlignment): Likewise. (setVerticalTextPosition): Likewise. (setBorderPainted): Likewise. (setIcon): Likewise. (setText): Likewise. (setIconTextGap): Likewise. (setMargin): Likewise. (setPressedIcon): Likewise. (setFocusPainted): Likewise. (setDisabledSelectedIcon): Likewise. (setRolloverIcon): Likewise. (setRolloverSelectedIcon): Likewise. (setSelectedIcon): Likewise. (setContentAreaFilled): Likewise. 2004-11-30 Kim Ho <kho@redhat.com> * javax/swing/plaf/basic/BasicArrowButton.java: Jalopy. Reimplement. * javax/swing/plaf/basic/BasicScrollBarUI.java: Jalopy. (arrowIcon, upIcon, downIcon, leftIcon, rightIcon): Removed. (createIncreaseButton): Use BasicArrowButton. (createDecreaseButton): Ditto. * javax/swing/plaf/basic/BasicSplitPaneDivider.java: (createRightOneTouchButton): Remove button border. (createLeftOneTouchButton): Ditto. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JSpinner.java (setModel): New method. * javax/swing/SpringLayout.java (Constraints): May not be final. 2004-11-30 Michael Koch <konqueror@gmx.de> * gnu/java/awt/peer/gtk/GtkClipboard.java, java/awt/datatransfer/Clipboard.java, java/awt/datatransfer/ClipboardOwner.java: Reformated to make it use our coding standard. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/SpinnerNumberModel.java (SpinnerNumberModel): Implements java.io.Serializable. (serialVersionUID): New field. (SpinnerNumberModel): Added missing @throws tags to javadocs. * javax/swing/UIManager.java (get): New method. (getBoolean): Likewise. (getBorder): Likewise. (getColor): Likewise. (getDimension): Likewise. (getFont): Likewise. (getIcon): Likewise. (getInsets): Likewise. (getInt): Likewise. (getString): Likewise. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JPasswordField.java: Reformated. Implemented construtors. * javax/swing/plaf/basic/BasicPasswordFieldUI.java (create): New method. * javax/swing/text/PlainView.java (selectedColor): Made package-private to allow access from sub-classes in same package too. (unselectedColor): Likewise. (font): Likewise. (drawSelectedText): Make protected. (drawUnselectedText): Likewise. * javax/swing/text/PasswordView.java: New file. * Makefile.am: Added javax/swing/text/PasswordView.java. * Makefile.in: Regenerated. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkFramePeer.java (setMenuBar): Set menu bar's width. * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java (nativeSetHelpMenu): Add FIXME comment. (addHelpMenu): Elide call to nativeSetHelpMenu. * java/awt/Menu.java (isTearOff): Rename to tearOff. (menuSerializedDataVersion): Initialize to 1. (separatorLabel): Mark transient. (insert(MenuItem,int)): Implement. * java/awt/MenuBar.java (setHelpMenu): Call getPeer to retrieve peer. (countMenus): Count help menu. * java/awt/MenuComponent.java (nameExplicitlySet, newEventsOnly, accessibleContext): Add fields. * java/awt/MenuItem.java: Remove event mask FIXME. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (gtkWidgetModifyFont): Only set font if label is non-NULL. (setLabel): Don't treat "-" specially. 2004-11-30 Kim Ho <kho@redhat.com> * javax/swing/colorchooser/DefaultHSBChooserPanel.java: (stateChanged): Only update the image and the track if the values are not being adjusted. (updateChooser): Grab the new mouse point from the spinner values. Update the image and track only if the values are not being adjusted. (getHSBValues): New method. * javax/swing/colorchooser/DefaultRGBChooserPanel.java: (SliderHandler::stateChanged): Changed internalChange to updateChange. Set sliderChange. (SpinnerHandler::stateChanged): Ditto. Set spinnerChange. (spinnerChange): New variable. (sliderChange): Ditto. (updateChange): Renamed from internalChange. (updateChooser): Do not update sliders if the sliders were the original source of the change. Ditto for spinners. * javax/swing/plaf/basic/BasicTabbedPaneUI.java: (mousePress): Don't scroll the JViewport if there will be extra space at the end of the run. Change layout() to revalidate(). (calculateSize): Use the component's width/height unless it is smaller than the max tab width/height. (calculateTabRects): Subtract the tab run overlay. (rotateTabRuns): Don't rotate if there's only one run. (layoutContainer): Reuse the viewport point. (createLayoutManager): Set the viewport to use no layout. (paintTabArea): Don't paint the tabs that are not visible to the JViewport. (paintContentBorderTopEdge): Check for scroll tab layout before looking for gap. (paintContentBorderLeftEdge): Ditto. (paintContentBorderBottomEdge): Ditto. (paintContentBorderRightEdge): Ditto. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkButtonPeer.java (gtkWidgetSetFont): Rename ... (gtkWidgetModifyFont): New method. * gnu/java/awt/peer/gtk/GtkFramePeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c (setMenuBarWidth): New method. (setBounds): Set the menu bar width. (postConfigureEvent): Set the menu bar width if the window's width has changed. * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java (GtkMenuBarPeer): Don't call create. (setFont): New method. * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java (create): New method. (setFont): Likewise. (GtkMenuComponentPeer): Call create and setFont. * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c (connectSignals): Make package private. (gtkWidgetModifyFont): New method. (create): Likewise. (GtkMenuItemPeer): Don't call create. (setFont): New method. * java/awt/CheckboxMenuItem.java (addNotify): Fix peer == null condition. * java/awt/Container.java (validateTree): Fix comment typos. * java/awt/MenuComponent.java (getFont): Return parent's font if our font is null. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c (create): Remove call to deprecated gtk_check_menu_item_set_show_toggle function. 2004-11-30 Hans Boehm <Hans.Boehm@hp.com> * java/lang/natObject.cc (LOCK_LOG, LOG): Add debug tracing. (Almost everywhere): add LOG calls, fix, add comments. (_Jv_MonitorEnter): Replace masking of LOCKED bit with assertion. Add explicit check for LOCKED bit in slow case (PR 16662). (_Jv_MonitorExit): Add casts in debug-only code. Always release LOCKED bit before throwing exception. (_Jv_ObjectCheckMonitor): Lock may be held if lightweight lock isn't. Handle easy cases without lock acquisition. (Object::wait): Use NotifyAll for lock inflation. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkFramePeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c (gtkFixedMove): Remove method. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/Area.java: Implemented. 2004-11-30 Mark Wielaard <mark@klomp.org> * java/awt/geom/Arc2D.java (ArcIterator): Make package private. 2004-11-30 Sven de Marothy <sven@physto.se> * java/awt/geom/Arc2D.java Reformatted. (setArc): Correct documentation to say 'upper left corner'. (setArcByTangent,contains,intersects): Implemented. (containsAngle): Corrected to handle negative extents. (ArcIterator): Set to private. (ArcIterator): Corrected for CHORD-type arcs, negative extents. * java/awt/geom/Ellipse2D.java Documented. (contains,intersects): Implemented. * java/awt/geom/Line2D.java (linesIntersect): Correct handling of special cases. 2004-11-30 Mark Wielaard <mark@klomp.org> * gnu/java/awt/peer/gtk/GdkGraphics.java (setColor): Use Color.BLACK if c == null, don't create new Color object each time. * gnu/java/awt/peer/gtk/GdkGraphics2D.java (comp): New private field. (setColor): Use Color.BLACK when argument null. (setComposite): Set this.comp field. (getComposite): Return this.comp, or AlphaComposite.SrcOver when null. (DrawState.comp): New private field. (DrawState.save): Save Composite. (DrawState.restore): Restore comp field. * java/awt/FontMetrics.java (gRC): New static final private field. (getLineMetrics(String, Graphics)): New method. (getLineMetrics(String, int, int, Graphics)): Likewise. (getLineMetrics(char[], int, int, Graphics)): Likewise. (getLineMetrics(CharacterIterator, int, int, Graphics)): Likewise. * javax/swing/JMenu.java (JMenu(String, boolean)): Ignore tearoff argument. PR SWING/17294. * javax/swing/plaf/basic/BasicGraphicsUtils.java (): Always use the fall-back code since none of the TextArea methods are really implemented now. PR SWING/17296. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c (GdkGlyphVector_setChars): Replace assert() with if block when pango_itemize() returns null. PR AWT/17295. (GdkGlyphVector_allInkExtents): Likewise when vec->glyphitems is null. 2004-11-30 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am (gtk_c_source_files): Add gnu_java_awt_peer_gtk_GtkFramePeer.c. * Makefile.in: Regenerate. * gnu/java/awt/peer/gtk/GdkGraphics.java (getClipBounds): Remove comment. * gnu/java/awt/peer/gtk/GtkButtonPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (create): Pack GtkButton in GtkEventBox. (connectJObject): Remove. (focus_in_cb): New function. (focus_out_cb): Likewise. (connectSignals): Connect focus-in-event and focus-out-event signals. (gtkSetFont): Rename to ... (gtkWidgetModifyFont): New method. (gtkWidgetRequestFocus): New method. * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (gtkSetFont): Rename to ... (gtkWidgetModifyFont): New method. * gnu/java/awt/peer/gtk/GtkComponentPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (isInRepaint): New field. (gtkSetFont): Remove method. (addExposeFilter): Likewise. (removeExposeFilter): Likewise. (gtkWidgetQueueDrawArea): Rename to ... (gtkWidgetRepaintArea): New method. (beginNativeRepaint): New method. (endNativeRepaint): New method. (setComponentBounds): Move implementation here from GtkComponentPeer. (paint): Remove implementation. (repaint): Wrap call to gtkWidgetRepaintArea with calls to beginNativeRepaint and endNativeRepaint. (setBounds): Use menu bar height in bounds calculation. (postExposeEvent): Only post paint event if we're not doing a native repaint. (gtkWidgetSetParent): Replace gtk_layout_put with gtk_fixed_put. (setNativeBounds): Replace gtk_layout_move with gtk_fixed_move. (find_gtk_layout): Remove function. (filter_expose_event_handler): Likewise. * gnu/java/awt/peer/gtk/GtkDialogPeer.java (postExposeEvent): Likewise. * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java (setComponentBounds): Call GtkComponentPeer's setComponentBounds. * gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): New method. (moveLayout): Rename to ... (gtkFixedMove): New method. (gtkLayoutSetVisible): Rename to ... (gtkFixedSetVisible): New method. (setMenuBar): Rearrange, to make the three separate cases clearer. (postExposeEvent): Only post paint event if we're not doing a native repaint. * gnu/java/awt/peer/gtk/GtkGenericPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c (gtkWidgetModifyFont): New method. * gnu/java/awt/peer/gtk/GtkImagePainter.java (GtkImagePainter(GtkImage,GdkGraphics,int,int,int,int,Color)): Call run directly, rather than spawning a new thread. (GtkImagePainter(GtkImage,GdkGraphics,int,int,int,int,int,int,int,int,Color)): Likewise. * gnu/java/awt/peer/gtk/GtkLabelPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (gtkSetFont): Rename to ... (gtkWidgetModifyFont): New method. (create): Rename ebox to eventbox. * gnu/java/awt/peer/gtk/GtkListPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (gtkSetFont): Rename to ... (gtkWidgetModifyFont): New method. * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java (GtkMenuComponentPeer): Set the default font. * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (gtkSetFont): Rename to ... (gtkWidgetModifyFont): New method. * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c: Likewise. * java/awt/Component.java (locale): Initialize to default locale. * java/awt/Container.java (invalidateTree): Make package-private. (paint): Paint self first. (setMenuBar): Call invalidateTree. * java/awt/Panel.java (dispatchEventImpl): Remove method. * java/awt/Window.java (show): Call no-parameter variant of requestFocusInWindow. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (initState): Remove special case for window widget. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c (grab_current_drawable): Likewise. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c (create): Replace GtkLayout with GtkFixed. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Remove special cases for GDK_EXPOSE events. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c: New file. Move all GtkFramePeer native method implementations here from gnu_java_awt_peer_gtk_GtkWindowPeer.c. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c (create): Replace GtkLayout with GtkFixed. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (find_layout): Remove function. (create): Replace GtkLayout with GtkFixed. (connectSignals): Remove find_layout call. (toBack): Replace XFlush with gdk_flush. (toFront): Replace XFlush with gdk_flush. Move GtkFramePeer native method implementations to gnu_java_awt_peer_gtk_GtkFramePeer.c. * jni/gtk-peer/gtkpeer.h: Remove declaration of find_gtk_layout. 2004-11-30 Michael Koch <konqueror@gmx.de> * javax/swing/JTextArea.java (lineWrap): Renamed from "wrapping". (wrapStyleWord): NEw field. (getLineWrap): Re-edited javadoc comment. (setLineWrap): Likewise. (getWrapStyleWord): New method. (setWrapStyleWord): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91544 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/plaf')
-rw-r--r--libjava/javax/swing/plaf/BorderUIResource.java20
-rw-r--r--libjava/javax/swing/plaf/ComponentUI.java6
-rw-r--r--libjava/javax/swing/plaf/FileChooserUI.java4
-rw-r--r--libjava/javax/swing/plaf/IconUIResource.java6
-rw-r--r--libjava/javax/swing/plaf/ListUI.java6
-rw-r--r--libjava/javax/swing/plaf/PopupMenuUI.java5
-rw-r--r--libjava/javax/swing/plaf/SplitPaneUI.java6
-rw-r--r--libjava/javax/swing/plaf/TabbedPaneUI.java6
-rw-r--r--libjava/javax/swing/plaf/TextUI.java6
-rw-r--r--libjava/javax/swing/plaf/TreeUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicArrowButton.java351
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java8
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicColorChooserUI.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java3
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxUI.java31
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboPopup.java280
-rw-r--r--libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java27
-rw-r--r--libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicIconFactory.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java33
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java16
-rw-r--r--libjava/javax/swing/plaf/basic/BasicListUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLookAndFeel.java13
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuBarUI.java24
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuItemUI.java31
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuUI.java14
-rw-r--r--libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java19
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java35
-rw-r--r--libjava/javax/swing/plaf/basic/BasicProgressBarUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRootPaneUI.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollBarUI.java416
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSeparatorUI.java16
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSliderUI.java11
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSpinnerUI.java5
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java121
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java75
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java144
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java85
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableUI.java14
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextAreaUI.java1
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextFieldUI.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextPaneUI.java69
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java33
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java11
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolBarUI.java14
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolTipUI.java69
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java171
-rw-r--r--libjava/javax/swing/plaf/basic/BasicViewportUI.java66
-rw-r--r--libjava/javax/swing/plaf/basic/ComboPopup.java6
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java4
57 files changed, 1279 insertions, 1089 deletions
diff --git a/libjava/javax/swing/plaf/BorderUIResource.java b/libjava/javax/swing/plaf/BorderUIResource.java
index c9ed0111644..6b61f48a090 100644
--- a/libjava/javax/swing/plaf/BorderUIResource.java
+++ b/libjava/javax/swing/plaf/BorderUIResource.java
@@ -1,5 +1,5 @@
/* BorderUIResource.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,14 +38,22 @@ exception statement from your version. */
package javax.swing.plaf;
-import javax.swing.border.*;
-import javax.swing.Icon;
-import java.io.Serializable;
+import java.awt.Color;
import java.awt.Component;
+import java.awt.Font;
import java.awt.Graphics;
import java.awt.Insets;
-import java.awt.Font;
-import java.awt.Color;
+import java.io.Serializable;
+
+import javax.swing.Icon;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.Border;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.border.MatteBorder;
+import javax.swing.border.TitledBorder;
/**
* A wrapper for {@link javax.swing.border.Border} that also
diff --git a/libjava/javax/swing/plaf/ComponentUI.java b/libjava/javax/swing/plaf/ComponentUI.java
index a2ca1f00941..80e60c8f1a7 100644
--- a/libjava/javax/swing/plaf/ComponentUI.java
+++ b/libjava/javax/swing/plaf/ComponentUI.java
@@ -1,5 +1,5 @@
-/* ComponentUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* ComponentUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,10 +40,10 @@ package javax.swing.plaf;
import java.awt.Dimension;
import java.awt.Graphics;
+
import javax.accessibility.Accessible;
import javax.swing.JComponent;
-
/**
* The abstract base class for all delegates that provide the
* pluggable look and feel for Swing components. User applications
diff --git a/libjava/javax/swing/plaf/FileChooserUI.java b/libjava/javax/swing/plaf/FileChooserUI.java
index 6031c4216b8..90371815419 100644
--- a/libjava/javax/swing/plaf/FileChooserUI.java
+++ b/libjava/javax/swing/plaf/FileChooserUI.java
@@ -1,5 +1,5 @@
/* FileChooserUI.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,9 +35,11 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf;
import java.io.File;
+
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileView;
diff --git a/libjava/javax/swing/plaf/IconUIResource.java b/libjava/javax/swing/plaf/IconUIResource.java
index ca1ee7dee10..3af16b757fe 100644
--- a/libjava/javax/swing/plaf/IconUIResource.java
+++ b/libjava/javax/swing/plaf/IconUIResource.java
@@ -1,5 +1,5 @@
-/* IconUIResource.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* IconUIResource.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,8 +41,8 @@ package javax.swing.plaf;
import java.awt.Component;
import java.awt.Graphics;
import java.io.Serializable;
-import javax.swing.Icon;
+import javax.swing.Icon;
/**
* An icon that is marked as <code>UIResource</code>, which
diff --git a/libjava/javax/swing/plaf/ListUI.java b/libjava/javax/swing/plaf/ListUI.java
index 71ec7704cc7..1639c41d3a9 100644
--- a/libjava/javax/swing/plaf/ListUI.java
+++ b/libjava/javax/swing/plaf/ListUI.java
@@ -1,5 +1,5 @@
-/* ListUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* ListUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,8 +40,8 @@ package javax.swing.plaf;
import java.awt.Point;
import java.awt.Rectangle;
-import javax.swing.JList;
+import javax.swing.JList;
/**
* An abstract base class for delegates that implement the pluggable
diff --git a/libjava/javax/swing/plaf/PopupMenuUI.java b/libjava/javax/swing/plaf/PopupMenuUI.java
index 1871b9b7985..7e71a4b2ecb 100644
--- a/libjava/javax/swing/plaf/PopupMenuUI.java
+++ b/libjava/javax/swing/plaf/PopupMenuUI.java
@@ -1,5 +1,5 @@
/* PopupMenuUI.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,14 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf;
import java.awt.event.MouseEvent;
+
import javax.swing.JPopupMenu;
import javax.swing.Popup;
import javax.swing.PopupFactory;
-
/**
* An abstract base class for delegates that implement the pluggable
* look and feel for a <code>JPopupMenu</code>.
diff --git a/libjava/javax/swing/plaf/SplitPaneUI.java b/libjava/javax/swing/plaf/SplitPaneUI.java
index 020a54a626f..146db76644d 100644
--- a/libjava/javax/swing/plaf/SplitPaneUI.java
+++ b/libjava/javax/swing/plaf/SplitPaneUI.java
@@ -1,5 +1,5 @@
/* SplitPaneUI.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,12 +35,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package javax.swing.plaf;
+package javax.swing.plaf;
import java.awt.Graphics;
-import javax.swing.JSplitPane;
+import javax.swing.JSplitPane;
/**
* An abstract base class for delegates that implement the pluggable
diff --git a/libjava/javax/swing/plaf/TabbedPaneUI.java b/libjava/javax/swing/plaf/TabbedPaneUI.java
index 20c36c30c21..f0cf69919f2 100644
--- a/libjava/javax/swing/plaf/TabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/TabbedPaneUI.java
@@ -1,5 +1,5 @@
-/* TabbedPaneUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* TabbedPaneUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,8 +39,8 @@ exception statement from your version. */
package javax.swing.plaf;
import java.awt.Rectangle;
-import javax.swing.JTabbedPane;
+import javax.swing.JTabbedPane;
/**
* An abstract base class for delegates that implement the pluggable
diff --git a/libjava/javax/swing/plaf/TextUI.java b/libjava/javax/swing/plaf/TextUI.java
index 14f89d6006e..b28dd372eef 100644
--- a/libjava/javax/swing/plaf/TextUI.java
+++ b/libjava/javax/swing/plaf/TextUI.java
@@ -1,5 +1,5 @@
-/* TextUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* TextUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,13 +40,13 @@ package javax.swing.plaf;
import java.awt.Point;
import java.awt.Rectangle;
+
import javax.swing.text.BadLocationException;
import javax.swing.text.EditorKit;
import javax.swing.text.JTextComponent;
import javax.swing.text.Position;
import javax.swing.text.View;
-
/**
* An abstract base class for delegates that provide the user
* interface for text editors.
diff --git a/libjava/javax/swing/plaf/TreeUI.java b/libjava/javax/swing/plaf/TreeUI.java
index 55327e2a014..d4bee57cfe4 100644
--- a/libjava/javax/swing/plaf/TreeUI.java
+++ b/libjava/javax/swing/plaf/TreeUI.java
@@ -1,5 +1,5 @@
-/* TreeUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* TreeUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,10 +39,10 @@ exception statement from your version. */
package javax.swing.plaf;
import java.awt.Rectangle;
+
import javax.swing.JTree;
import javax.swing.tree.TreePath;
-
/**
* An abstract base class for delegates that provide the user
* interface for <code>JTree</code>.
diff --git a/libjava/javax/swing/plaf/basic/BasicArrowButton.java b/libjava/javax/swing/plaf/basic/BasicArrowButton.java
index 8354d06a0ce..f876a783fe2 100644
--- a/libjava/javax/swing/plaf/basic/BasicArrowButton.java
+++ b/libjava/javax/swing/plaf/basic/BasicArrowButton.java
@@ -1,4 +1,4 @@
-/* BasicArrowButton.java
+/* BasicArrowButton.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,183 +35,98 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
-import java.awt.Insets;
import java.awt.Graphics;
+import java.awt.Insets;
import java.awt.Polygon;
import java.awt.Rectangle;
-import javax.swing.border.Border;
-import javax.swing.Icon;
+
import javax.swing.JButton;
import javax.swing.SwingConstants;
-
+import javax.swing.border.Border;
/**
* This class draws simple arrow buttons for the Basic Look and Feel.
*/
public class BasicArrowButton extends JButton implements SwingConstants
{
- /**
- * A private helper class that draws icons.
- */
- private class arrowIcon implements Icon
- {
- /** The polygon that describes the icon. */
- private Polygon arrow;
-
- /** The size of the icon. */
- private int size = 10;
-
- /**
- * Creates a new arrowIcon object using the given arrow polygon.
- *
- * @param arrow The polygon that describes the arrow.
- */
- public arrowIcon(Polygon arrow)
- {
- this.arrow = arrow;
- }
-
- /**
- * Returns the height of the icon.
- *
- * @return The height of the icon.
- */
- public int getIconHeight()
- {
- return size;
- }
-
- /**
- * Returns the width of the icon.
- *
- * @return The width of the icon.
- */
- public int getIconWidth()
- {
- return size;
- }
-
- /**
- * Sets the size of the icon.
- *
- * @param size The size of the icon.
- */
- public void setSize(int size)
- {
- this.size = size;
- }
-
- /**
- * Sets the arrow polygon.
- *
- * @param arrow The arrow polygon.
- */
- public void setArrow(Polygon arrow)
- {
- this.arrow = arrow;
- }
-
- /**
- * Paints the icon.
- *
- * @param c The Component to paint for.
- * @param g The Graphics object to draw with.
- * @param x The X coordinate to draw at.
- * @param y The Y coordinate to draw at.
- */
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- Color arrowColor;
- if (c.isEnabled())
- arrowColor = darkShadow;
- else
- arrowColor = shadow;
-
- paintIconImpl(g, x, y, arrowColor);
- }
-
- /**
- * This method does the actual painting work.
- *
- * @param g The Graphics object to paint with.
- * @param x The x coordinate to paint at.
- * @param y The y coordinate to paint at.
- * @param arrowColor The color to paint the arrow with.
- */
- public void paintIconImpl(Graphics g, int x, int y, Color arrowColor)
- {
- g.translate(x, y);
+ /** The default size of the Arrow buttons. */
+ private static int defaultSize = 10;
- Color saved = g.getColor();
+ /** The Polygon that points up. */
+ private static Polygon upIcon = new Polygon(new int[] { 0, 5, 9 },
+ new int[] { 7, 2, 7 }, 3);
- g.setColor(arrowColor);
+ /** The Polygon that points down. */
+ private static Polygon downIcon = new Polygon(new int[] { 1, 5, 9 },
+ new int[] { 3, 7, 3 }, 3);
- g.fillPolygon(arrow);
+ /** The Polygon that points left. */
+ private static Polygon leftIcon = new Polygon(new int[] { 7, 3, 7 },
+ new int[] { 1, 5, 9 }, 3);
- g.setColor(saved);
- g.translate(-x, -y);
- }
- }
+ /** The Polygon that points right. */
+ private static Polygon rightIcon = new Polygon(new int[] { 3, 7, 3 },
+ new int[] { 1, 5, 9 }, 3);
/** The direction to point in. */
protected int direction;
- /** The color the arrow is painted in if disabled and the bottom and
- * right edges of the button. */
- private transient Color shadow = Color.gray;
+ /**
+ * The color the arrow is painted in if disabled and the bottom and right
+ * edges of the button.
+ */
+ private transient Color shadow = Color.GRAY;
- /** The color the arrow is painted in if enabled and the bottom and
- * right edges of the button. */
- private transient Color darkShadow = Color.BLACK;
+ /**
+ * The color the arrow is painted in if enabled and the bottom and right
+ * edges of the button.
+ */
+ private transient Color darkShadow = Color.DARK_GRAY;
/** The top and left edges of the button. */
- private transient Color highlight = Color.BLACK;
+ private transient Color highlight = Color.WHITE;
/** The border around the ArrowButton. */
- private transient Border tmpBorder = new Border()
- {
- public Insets getBorderInsets(Component c)
- {
- return new Insets(0, 0, 0, 0);
- }
-
- public boolean isBorderOpaque()
+ private transient Border buttonBorder = new Border()
{
- return false;
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
- {
- Rectangle bounds = getBounds();
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(2, 2, 2, 2);
+ }
- Color saved = g.getColor();
- g.setColor(highlight);
+ public boolean isBorderOpaque()
+ {
+ return true;
+ }
- g.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height);
- g.drawLine(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y);
+ public void paintBorder(Component c, Graphics g, int x, int y, int w,
+ int h)
+ {
+ Color saved = g.getColor();
+ g.setColor(highlight);
+
+ g.drawLine(x + 1, y + 1, x + w - 1, y + 1);
+ g.drawLine(x + 1, y + 1, x + 1, y + h - 1);
- g.setColor(shadow);
+ g.setColor(shadow);
- g.drawLine(bounds.x + 1, bounds.y + bounds.height - 1,
- bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);
- g.drawLine(bounds.x + bounds.width - 1, bounds.y + 1,
- bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);
+ g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
+ g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
- g.setColor(darkShadow);
+ g.setColor(darkShadow);
- g.drawLine(bounds.x, bounds.y + bounds.height, bounds.x + bounds.width,
- bounds.y + bounds.height);
- g.drawLine(bounds.x + bounds.width, bounds.y, bounds.x + bounds.width,
- bounds.y + bounds.height);
+ g.drawLine(x, y + h, x + w, y + h);
+ g.drawLine(x + w, y, x + w, y + h);
- g.setColor(saved);
- }
- };
+ g.setColor(saved);
+ }
+ };
/**
* Creates a new BasicArrowButton object.
@@ -221,12 +136,12 @@ public class BasicArrowButton extends JButton implements SwingConstants
public BasicArrowButton(int direction)
{
super();
+ setBorder(buttonBorder);
setDirection(direction);
- setBorder(tmpBorder);
}
/**
- * Creates a new BasicArrowButton object with the given colors and
+ * Creates a new BasicArrowButton object with the given colors and
* direction.
*
* @param direction The direction to point in.
@@ -246,6 +161,16 @@ public class BasicArrowButton extends JButton implements SwingConstants
}
/**
+ * This method returns whether the focus can traverse to this component.
+ *
+ * @return Whether the focus can traverse to this component.
+ */
+ public boolean isFocusTraversable()
+ {
+ return false;
+ }
+
+ /**
* This method returns the direction of the arrow.
*
* @return The direction of the arrow.
@@ -262,22 +187,25 @@ public class BasicArrowButton extends JButton implements SwingConstants
*/
public void setDirection(int dir)
{
- Polygon arrow = getArrow(dir, 10);
- if (getIcon() == null)
- setIcon(new arrowIcon(arrow));
- else
- ((arrowIcon) getIcon()).setArrow(arrow);
this.direction = dir;
}
/**
- * This method paints the arrow button.
+ * This method paints the arrow button. The painting is delegated to the
+ * paintTriangle method.
*
* @param g The Graphics object to paint with.
*/
public void paint(Graphics g)
{
super.paint(g);
+ Insets insets = getInsets();
+ Rectangle bounds = getBounds();
+ int x = insets.left
+ + (bounds.width - insets.left - insets.right - defaultSize) / 2;
+ int y = insets.top
+ + (bounds.height - insets.left - insets.right - defaultSize) / 2;
+ paintTriangle(g, x, y, defaultSize, direction, isEnabled());
}
/**
@@ -287,7 +215,11 @@ public class BasicArrowButton extends JButton implements SwingConstants
*/
public Dimension getPreferredSize()
{
- return new Dimension(getIcon().getIconWidth(), getIcon().getIconHeight());
+ Insets insets = getInsets();
+ int w = defaultSize + insets.left + insets.right;
+ int h = defaultSize + insets.top + insets.bottom;
+
+ return new Dimension(w, h);
}
/**
@@ -311,8 +243,8 @@ public class BasicArrowButton extends JButton implements SwingConstants
}
/**
- * The method paints a triangle with the given size and direction at
- * the given x and y coordinates.
+ * The method paints a triangle with the given size and direction at the
+ * given x and y coordinates.
*
* @param g The Graphics object to paint with.
* @param x The x coordinate to paint at.
@@ -324,61 +256,90 @@ public class BasicArrowButton extends JButton implements SwingConstants
public void paintTriangle(Graphics g, int x, int y, int size, int direction,
boolean isEnabled)
{
- Polygon arrow = getArrow(direction, size);
- arrowIcon arrowI = new arrowIcon(arrow);
- arrowI.setSize(size);
-
- Color arrowColor;
- if (isEnabled())
- arrowColor = darkShadow;
- else
- arrowColor = shadow;
-
- arrowI.paintIconImpl(g, x, y, arrowColor);
- }
-
- /**
- * This is a private helper that creates polygons for a given size
- * and direction.
- *
- * @param direction The direction of the arrow.
- * @param size The size of the arrow.
- *
- * @return A new arrow polygon.
- */
- private Polygon getArrow(int direction, int size)
- {
- Polygon arrow;
- double dsize = (double) size;
-
- int one = (int) (dsize * 1 / 10);
- int two = (int) (dsize * 2 / 10);
- int five = (int) (dsize * 5 / 10);
- int eight = (int) (dsize * 8 / 10);
-
+ Polygon arrow = null;
switch (direction)
{
case NORTH:
- arrow = new Polygon(new int[] { eight, five, one },
- new int[] { eight, one, eight }, 3);
+ arrow = upIcon;
break;
case SOUTH:
- arrow = new Polygon(new int[] { eight, five, two },
- new int[] { two, eight, two }, 3);
+ arrow = downIcon;
break;
case EAST:
case RIGHT:
- arrow = new Polygon(new int[] { two, eight, two },
- new int[] { two, five, eight }, 3);
+ arrow = rightIcon;
break;
case WEST:
case LEFT:
- arrow = new Polygon(new int[] { eight, two, eight },
- new int[] { two, five, eight }, 3);
+ arrow = leftIcon;
break;
- default:
- throw new IllegalArgumentException("Invalid direction given.");
}
- return arrow;
+
+ int[] xPoints = arrow.xpoints;
+ int[] yPoints = arrow.ypoints;
+ int x1;
+ int y1;
+ int x2;
+ int y2;
+ x1 = y1 = x2 = y2 = 0;
+
+ if (size != defaultSize)
+ {
+ float scale = size * 1f / defaultSize;
+ for (int i = 0; i < 3; i++)
+ {
+ xPoints[i] *= scale;
+ yPoints[i] *= scale;
+ }
+ }
+ g.translate(x, y);
+
+ switch (direction)
+ {
+ case NORTH:
+ x1 = xPoints[0] + 2;
+ y1 = yPoints[0];
+ y2 = y1;
+ x2 = xPoints[2] - 1;
+ break;
+ case SOUTH:
+ x1 = xPoints[1];
+ y1 = yPoints[1] + 1;
+ x2 = xPoints[2] - 1;
+ y2 = yPoints[2];
+ break;
+ case LEFT:
+ case WEST:
+ x1 = xPoints[0] + 1;
+ y1 = yPoints[0] + 1;
+ x2 = x1;
+ y2 = yPoints[2] + 1;
+ break;
+ case RIGHT:
+ case EAST:
+ x1 = xPoints[2];
+ y1 = yPoints[2] + 1;
+ x2 = xPoints[1] - 1;
+ y2 = yPoints[1] + 1;
+ break;
+ }
+ Color saved = g.getColor();
+
+ if (isEnabled)
+ {
+ g.setColor(Color.DARK_GRAY);
+
+ if (arrow != null)
+ g.fillPolygon(xPoints, yPoints, 3);
+ }
+ else
+ {
+ g.setColor(Color.GRAY);
+ g.fillPolygon(xPoints, yPoints, 3);
+ g.setColor(Color.WHITE);
+ g.drawLine(x1, y1, x2, y2);
+ }
+ g.setColor(saved);
+ g.translate(-x, -y);
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
index 7002d14332c..dd668e35331 100644
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ b/libjava/javax/swing/plaf/basic/BasicBorders.java
@@ -1,5 +1,5 @@
-/* BasicBorders.java
- Copyright (C) 2003 Free Software Foundation, Inc.
+/* BasicBorders.java --
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,6 +44,7 @@ import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.io.Serializable;
+
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.JButton;
@@ -55,11 +56,10 @@ import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
-import javax.swing.plaf.UIResource;
import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.UIResource;
import javax.swing.text.JTextComponent;
-
/**
* Provides various borders for the Basic look and feel.
*
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
index df7ac4269f0..ed04d281254 100644
--- a/libjava/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
@@ -37,15 +37,12 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
-import java.awt.Graphics2D;
import java.awt.Rectangle;
-import java.awt.Stroke;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
@@ -205,7 +202,7 @@ public class BasicButtonUI extends ButtonUI
return d;
}
- static private Icon currentIcon(AbstractButton b)
+ private static Icon currentIcon(AbstractButton b)
{
Icon i = b.getIcon();
ButtonModel model = b.getModel();
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
index c7d88d1a6ae..a0cf5a43fec 100644
--- a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
@@ -1,4 +1,4 @@
-/* BasicCheckBoxMenuItemUI.java
+/* BasicCheckBoxMenuItemUI.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,9 +35,11 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.event.MouseEvent;
+
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.MenuElement;
@@ -46,7 +48,6 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
-
/**
* DOCUMENT ME!
*/
diff --git a/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java b/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java
index 1c2dcd69545..61af43bbf70 100644
--- a/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java
@@ -1,4 +1,4 @@
-/* BasicColorChooserUI.java
+/* BasicColorChooserUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,17 +35,14 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.BorderLayout;
-import java.awt.Component;
import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JColorChooser;
import javax.swing.JComponent;
import javax.swing.JPanel;
@@ -59,7 +56,6 @@ import javax.swing.event.ChangeListener;
import javax.swing.plaf.ColorChooserUI;
import javax.swing.plaf.ComponentUI;
-
/**
* This is the UI Class for the JColorChooser in the Basic Look and Feel.
*/
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java b/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
index a465ff9492b..b306af71d1d 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
@@ -35,18 +35,19 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
+
import javax.swing.ComboBoxEditor;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.UIResource;
-
/**
* This is a component that is responsible for displaying/editting selected
* item in comboBox. By default, the JTextField is returned as
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
index 6bf6a74d5c9..5dc0f489e20 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
@@ -35,12 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
-import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.io.Serializable;
+
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
@@ -51,7 +52,6 @@ import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.UIResource;
-
/**
* This class is renderer for the combo box.
*
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java b/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
index 851392a0f9f..3ba13a2a1e1 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -58,7 +59,7 @@ import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.util.EventListener;
+
import javax.accessibility.Accessible;
import javax.swing.CellRendererPane;
import javax.swing.ComboBoxEditor;
@@ -66,21 +67,14 @@ import javax.swing.ComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
-import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicComboPopup;
-import javax.swing.plaf.basic.BasicGraphicsUtils;
-
/**
* UI Delegate for JComboBox
@@ -796,7 +790,7 @@ public class BasicComboBoxUI extends ComboBoxUI
currentValue,
-1,
isPressed,
- isPressed);
+ hasFocus);
if (! comboBox.isEnabled())
comp.setEnabled(false);
@@ -1127,8 +1121,9 @@ public class BasicComboBoxUI extends ComboBoxUI
*/
public void intervalRemoved(ListDataEvent e)
{
- // must determine if the size of the combo box should change
- // FIXME: need to implement
+ // recalculate display size of the JComboBox.
+ largestItemSize = getLargestItemSize();
+ comboBox.repaint();
}
}
@@ -1142,11 +1137,13 @@ public class BasicComboBoxUI extends ComboBoxUI
{
}
+ /**
+ * This method is invoked whenever bound property of JComboBox changes.
+ */
public void propertyChange(PropertyChangeEvent e)
{
if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY))
{
- // disable arrow button
arrowButton.setEnabled(comboBox.isEnabled());
if (comboBox.isEditable())
@@ -1169,6 +1166,16 @@ public class BasicComboBoxUI extends ComboBoxUI
comboBox.revalidate();
comboBox.repaint();
}
+ else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
+ {
+ // remove ListDataListener from old model and add it to new model
+ ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue();
+ if (oldModel != null)
+ oldModel.removeListDataListener(listDataListener);
+
+ if ((ComboBoxModel) e.getNewValue() != null)
+ comboBox.getModel().addListDataListener(listDataListener);
+ }
// FIXME: Need to handle changes in other bound properties.
}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboPopup.java b/libjava/javax/swing/plaf/basic/BasicComboPopup.java
index 61d2dfbcdad..bec7f058f9d 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboPopup.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboPopup.java
@@ -35,10 +35,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@@ -52,16 +54,18 @@ import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;
-import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPopupMenu;
+import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
@@ -70,7 +74,6 @@ import javax.swing.event.ListSelectionListener;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
-
/**
* UI Delegate for ComboPopup
*
@@ -78,37 +81,32 @@ import javax.swing.event.PopupMenuListener;
*/
public class BasicComboPopup extends JPopupMenu implements ComboPopup
{
+ /* Timer for autoscrolling */
protected Timer autoscrollTimer;
- /**
- * ComboBox associated with this popup
- */
+ /** ComboBox associated with this popup */
protected JComboBox comboBox;
- /*
- * FIXME: Document fields below
- */
+ /** FIXME: Need to document */
protected boolean hasEntered;
- protected boolean isAutoScrolling;
/**
- * ItemListener listening to the selection changes in the combo box
+ * Indicates whether the scroll bar located in popup menu with comboBox's
+ * list of items is currently autoscrolling. This happens when mouse event
+ * originated in the combo box and is dragged outside of its bounds
*/
+ protected boolean isAutoScrolling;
+
+ /** ItemListener listening to the selection changes in the combo box */
protected ItemListener itemListener;
- /**
- * This listener is not used
- */
+ /** This listener is not used */
protected KeyListener keyListener;
- /**
- * JList which is used to display item is the combo box
- */
+ /** JList which is used to display item is the combo box */
protected JList list;
- /**
- * This listener is not used
- */
+ /** This listener is not used */
protected ListDataListener listDataListener;
/**
@@ -123,14 +121,10 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected MouseMotionListener listMouseMotionListener;
- /**
- * This listener is not used
- */
+ /** This listener is not used */
protected ListSelectionListener listSelectionListener;
- /**
- * MouseListener listening to mouse events occuring in the combo box
- */
+ /** MouseListener listening to mouse events occuring in the combo box */
protected MouseListener mouseListener;
/**
@@ -145,21 +139,19 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected PropertyChangeListener propertyChangeListener;
- /*
- * FIXME: Document fields below
- */
- protected static int SCROLL_DOWN = 1;
- protected static int SCROLL_UP = 0;
+ /** direction for scrolling down list of combo box's items */
+ protected static final int SCROLL_DOWN = 1;
+
+ /** direction for scrolling up list of combo box's items */
+ protected static final int SCROLL_UP = 0;
+
+ /** Indicates auto scrolling direction */
protected int scrollDirection;
- /**
- * JScrollPane that contains list portion of the combo box
- */
+ /** JScrollPane that contains list portion of the combo box */
protected JScrollPane scroller;
- /**
- * This field is not used
- */
+ /** This field is not used */
protected boolean valueIsAdjusting;
/**
@@ -171,19 +163,7 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
{
this.comboBox = comboBox;
installComboBoxListeners();
-
- // initialize list that will be used to display elements of the combo box
- this.list = createList();
- ((JLabel) list.getCellRenderer()).setHorizontalAlignment(SwingConstants.LEFT);
- configureList();
-
- // initialize scroller. Add list to the scroller.
- scroller = createScroller();
- configureScroller();
-
- // add scroller with list inside of it to JPopupMenu
- super.add(scroller);
-
+ configurePopup();
setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());
}
@@ -196,11 +176,21 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
// popup should have same width as the comboBox and should be hight anough
// to display number of rows equal to 'maximumRowCount' property
- int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount())
- + 4;
+ int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount());
+ list.setPreferredSize(new Dimension(cbBounds.width, popupHeight));
super.setPopupSize(cbBounds.width, popupHeight);
+ // Highlight selected item in the combo box's drop down list
+ if (comboBox.getSelectedIndex() != -1)
+ list.setSelectedIndex(comboBox.getSelectedIndex());
+
+ //scroll scrollbar s.t. selected item is visible
+ JScrollBar scrollbar = scroller.getVerticalScrollBar();
+ int selectedIndex = comboBox.getSelectedIndex();
+ if (selectedIndex > comboBox.getMaximumRowCount())
+ scrollbar.setValue(getPopupHeightForRowCount(selectedIndex));
+
// location specified is relative to comboBox
super.show(comboBox, 0, cbBounds.height);
}
@@ -293,7 +283,10 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected void firePopupMenuWillBecomeVisible()
{
- // FIXME: Need to implement
+ PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
+
+ for (int i = 0; i < ll.length; i++)
+ ll[i].popupMenuWillBecomeVisible(new PopupMenuEvent(comboBox));
}
/**
@@ -302,7 +295,10 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected void firePopupMenuWillBecomeInvisible()
{
- // FIXME: Need to implement
+ PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
+
+ for (int i = 0; i < ll.length; i++)
+ ll[i].popupMenuWillBecomeInvisible(new PopupMenuEvent(comboBox));
}
/**
@@ -311,7 +307,10 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected void firePopupMenuCanceled()
{
- // FIXME: Need to implement
+ PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
+
+ for (int i = 0; i < ll.length; i++)
+ ll[i].popupMenuCanceled(new PopupMenuEvent(comboBox));
}
/**
@@ -440,11 +439,7 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
protected void configureList()
{
list.setModel(comboBox.getModel());
-
- if (comboBox.getItemCount() < comboBox.getMaximumRowCount())
- list.setVisibleRowCount(comboBox.getItemCount());
- else
- list.setVisibleRowCount(comboBox.getMaximumRowCount());
+ list.setVisibleRowCount(comboBox.getMaximumRowCount());
installListListeners();
}
@@ -493,7 +488,17 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
*/
protected void configurePopup()
{
- // FIXME: Need to implement
+ // initialize list that will be used to display combo box's items
+ this.list = createList();
+ ((JLabel) list.getCellRenderer()).setHorizontalAlignment(SwingConstants.LEFT);
+ configureList();
+
+ // initialize scroller. Add list to the scroller.
+ scroller = createScroller();
+ configureScroller();
+
+ // add scroller with list inside of it to JPopupMenu
+ super.add(scroller);
}
/*
@@ -552,37 +557,68 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
}
/**
- * DOCUMENT ME!
+ * This method start scrolling combo box's list of items either up or down
+ * depending on the specified 'direction'
*
- * @param direction DOCUMENT ME!
+ * @param direction of the scrolling.
*/
protected void startAutoScrolling(int direction)
{
- // FIXME: Need to implement
+ // FIXME: add timer
+ isAutoScrolling = true;
+
+ if (direction == SCROLL_UP)
+ autoScrollUp();
+ else
+ autoScrollDown();
}
/**
- * DOCUMENT ME!
+ * This method stops scrolling the combo box's list of items
*/
protected void stopAutoScrolling()
{
- // FIXME: Need to implement
+ // FIXME: add timer
+ isAutoScrolling = false;
}
/**
- * DOCUMENT ME!
+ * This method scrolls up list of combo box's items up and highlights that
+ * just became visible.
*/
protected void autoScrollUp()
{
- // FIXME: Need to implement
+ // scroll up the scroll bar to make the item above visible
+ JScrollBar scrollbar = scroller.getVerticalScrollBar();
+ int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(),
+ SwingConstants.VERTICAL,
+ SCROLL_UP);
+
+ scrollbar.setValue(scrollbar.getValue() - scrollToNext);
+
+ // If we haven't reached the begging of the combo box's list of items,
+ // then highlight next element above currently highlighted element
+ if (list.getSelectedIndex() != 0)
+ list.setSelectedIndex(list.getSelectedIndex() - 1);
}
/**
- * DOCUMENT ME!
+ * This method scrolls down list of combo box's and highlights item in the
+ * list that just became visible.
*/
protected void autoScrollDown()
{
- // FIXME: Need to implement
+ // scroll scrollbar down to make next item visible
+ JScrollBar scrollbar = scroller.getVerticalScrollBar();
+ int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(),
+ SwingConstants.VERTICAL,
+ SCROLL_DOWN);
+ scrollbar.setValue(scrollbar.getValue() + scrollToNext);
+
+ // If we haven't reached the end of the combo box's list of items
+ // then highlight next element below currently highlighted element
+ if (list.getSelectedIndex() + 1 != comboBox.getItemCount())
+ list.setSelectedIndex(list.getSelectedIndex() + 1);
}
/**
@@ -643,8 +679,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
for (int i = 0; i < maxRowCount; i++)
{
Component comp = rend.getListCellRendererComponent(list,
- list.getModel()
- .getElementAt(i),
+ comboBox.getModel()
+ .getElementAt(i),
-1, false, false);
Dimension dim = comp.getPreferredSize();
totalHeight += dim.height;
@@ -712,15 +748,36 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
}
/**
- * This method is invoked whenever mouse is released
+ * This method is invoked whenever mouse event was originated in the combo
+ * box and released either in the combBox list of items or in the combo
+ * box itself.
*
* @param e MouseEvent that should be handled
*/
public void mouseReleased(MouseEvent e)
{
- // FIXME: should handle dragging events here, if
- // mouse was dragged and released over the list of combobox's items,
- // then item over which it was released should be selected.
+ // Get component over which mouse was released
+ Component src = (Component) e.getSource();
+ int x = e.getX();
+ int y = e.getY();
+ Component releasedComponent = SwingUtilities.getDeepestComponentAt(src,
+ x, y);
+
+ // if mouse was released inside the bounds of combo box then do nothing,
+ // Otherwise if mouse was released inside the list of combo box items
+ // then change selection and close popup
+ if (! (releasedComponent instanceof JComboBox))
+ {
+ // List model contains the item over which mouse is released,
+ // since it is updated every time the mouse is moved over a different
+ // item in the list. Now that the mouse is released we need to
+ // update model of the combo box as well.
+ comboBox.setSelectedIndex(list.getSelectedIndex());
+
+ if (isAutoScrolling)
+ stopAutoScrolling();
+ hide();
+ }
}
}
@@ -737,13 +794,70 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
{
}
+ /**
+ * This method is responsible for highlighting item in the drop down list
+ * over which the mouse is currently being dragged.
+ */
public void mouseDragged(MouseEvent e)
{
+ // convert point of the drag event relative to combo box list component
+ // figure out over which list cell the mouse is currently being dragged
+ // and highlight the cell. The list model is changed but the change has
+ // no effect on combo box's data model. The list model is changed so
+ // that the appropriate item would be highlighted in the combo box's
+ // list.
+ if (BasicComboPopup.this.isVisible())
+ {
+ int cbHeight = (int) comboBox.getPreferredSize().getHeight();
+ int popupHeight = BasicComboPopup.this.getSize().height;
+
+ // if mouse is dragged inside the the combo box's items list.
+ if (e.getY() > cbHeight && ! (e.getY() - cbHeight >= popupHeight))
+ {
+ int index = list.locationToIndex(new Point(e.getX(),
+ (int) (e.getY()
+ - cbHeight)));
+
+ int firstVisibleIndex = list.getFirstVisibleIndex();
+
+ // list.locationToIndex returns item's index that would
+ // be located at the specified point if the first item that
+ // is visible is item 0. However in the JComboBox it is not
+ // necessarily the case since list is contained in the
+ // JScrollPane so we need to adjust the index returned.
+ if (firstVisibleIndex != 0)
+ // FIXME: adjusted index here is off by one. I am adding one
+ // here to compensate for that. This should be
+ // index += firstVisibleIndex. Remove +1 once the bug is fixed.
+ index += firstVisibleIndex + 1;
+
+ list.setSelectedIndex(index);
+ }
+ else
+ {
+ // if mouse is being dragged at the bottom of combo box's list
+ // of items or at the very top then scroll the list in the
+ // desired direction.
+ boolean movingUP = e.getY() < cbHeight;
+ boolean movingDown = e.getY() > cbHeight;
+
+ if (movingUP)
+ {
+ scrollDirection = SCROLL_UP;
+ startAutoScrolling(SCROLL_UP);
+ }
+ else if (movingDown)
+ {
+ scrollDirection = SCROLL_DOWN;
+ startAutoScrolling(SCROLL_DOWN);
+ }
+ }
+ }
}
}
/**
- * ItemHandler is an item listener that listens to selection event occuring
+ * ItemHandler is an item listener that listens to selection events occuring
* in the combo box. FIXME: should specify here what it does when item is
* selected or deselected in the combo box list.
*/
@@ -803,9 +917,11 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
public void mouseMoved(MouseEvent anEvent)
{
- // FIXME: Need to implement
- // NOTE: the change isn't reflected in data model of the combo box.
- // The items are only highlited, but not selected
+ // Highlight list cells over which the mouse is located.
+ // This changes list model, but has no effect on combo box's data model
+ int index = list.locationToIndex(anEvent.getPoint());
+ list.setSelectedIndex(index);
+ list.repaint();
}
}
@@ -828,6 +944,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
revalidate();
repaint();
}
+ if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
+ {
+ list.setModel((ComboBoxModel) e.getNewValue());
+ revalidate();
+ repaint();
+ }
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java b/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java
index b37c2f1e839..4867c27d8ca 100644
--- a/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.BorderLayout;
@@ -50,6 +51,7 @@ import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
+
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
@@ -62,8 +64,6 @@ import javax.swing.event.MouseInputAdapter;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.DesktopIconUI;
-import javax.swing.plaf.DesktopPaneUI;
-
/**
* This class acts as the UI delegate for JDesktopIcons for the Basic look and feel.
diff --git a/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java
index 3d43b362636..a9e7ffceb7b 100644
--- a/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java
@@ -35,31 +35,25 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
import java.awt.event.ActionEvent;
-import java.awt.event.MouseEvent;
import java.beans.PropertyVetoException;
+
import javax.swing.AbstractAction;
import javax.swing.DefaultDesktopManager;
import javax.swing.DesktopManager;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
-import javax.swing.JInternalFrame.JDesktopIcon;
import javax.swing.KeyStroke;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
-import javax.swing.event.MouseInputAdapter;
-import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.DesktopIconUI;
import javax.swing.plaf.DesktopPaneUI;
-
/**
* This class is the UI delegate for JDesktopPane for the Basic look and feel.
*/
@@ -267,24 +261,35 @@ public class BasicDesktopPaneUI extends DesktopPaneUI
}
}
- /** The KeyStroke associated with closing JInternalFrames. */
+ /**
+ * The KeyStroke associated with closing JInternalFrames.
+ * @deprecated
+ */
protected KeyStroke closeKey;
- /** The KeyStroke associated with maximizing JInternalFrames. */
+ /**
+ * The KeyStroke associated with maximizing JInternalFrames.
+ * @deprecated
+ */
protected KeyStroke maximizeKey;
- /** The KeyStroke associated with minimizing JInternalFrames. */
+ /**
+ * The KeyStroke associated with minimizing JInternalFrames.
+ * @deprecated
+ */
protected KeyStroke minimizeKey;
/**
* The KeyStroke associated with navigating (forward?) through
* JInternalFrames.
+ * @deprecated
*/
protected KeyStroke navigateKey;
/**
* The KeyStroke associated with navigating (backward?) through
* JInternalFrames.
+ * @deprecated
*/
protected KeyStroke navigateKey2;
diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
index 0645a373c2b..b1064f48eaa 100644
--- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -1,5 +1,5 @@
/* BasicGraphicsUtils.java
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -455,7 +455,9 @@ public class BasicGraphicsUtils
drawUnderline = (underlinedIndex >= 0) && (underlinedIndex < textLength);
- if (!(g instanceof Graphics2D))
+ // FIXME: unfortunately pango and cairo can't agree on metrics
+ // so for the time being we continue to *not* use TextLayouts.
+ if (true || !(g instanceof Graphics2D))
{
/* Fall-back. This is likely to produce garbage for any text
* containing right-to-left (Hebrew or Arabic) characters, even
diff --git a/libjava/javax/swing/plaf/basic/BasicIconFactory.java b/libjava/javax/swing/plaf/basic/BasicIconFactory.java
index 9f3a5ac5e86..a2acc81167b 100644
--- a/libjava/javax/swing/plaf/basic/BasicIconFactory.java
+++ b/libjava/javax/swing/plaf/basic/BasicIconFactory.java
@@ -1,5 +1,5 @@
-/* BasicIconFactory.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* BasicIconFactory.java --
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,15 +38,17 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.io.Serializable;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Polygon;
+import java.io.Serializable;
+
import javax.swing.AbstractButton;
import javax.swing.Icon;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
+
/**
* STUBBED
*/
@@ -54,7 +56,7 @@ public class BasicIconFactory implements Serializable
{
static final long serialVersionUID = 5605588811185324383L;
- static private class DummyIcon
+ private static class DummyIcon
implements Icon
{
public int getIconHeight() { return 10; }
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
index 3b8a2a20ca2..36bb4ec2e93 100644
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+++ b/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
@@ -7,6 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -34,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -52,6 +54,7 @@ import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
+
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
@@ -64,10 +67,8 @@ import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.UIManager;
import javax.swing.UIDefaults;
-
+import javax.swing.UIManager;
/**
* This class acts as a titlebar for JInternalFrames.
@@ -77,7 +78,7 @@ public class BasicInternalFrameTitlePane extends JComponent
/**
* The Action responsible for closing the JInternalFrame.
*/
- protected class CloseAction extends AbstractAction
+ public class CloseAction extends AbstractAction
{
/**
* This method is called when something closes the JInternalFrame.
@@ -102,7 +103,7 @@ public class BasicInternalFrameTitlePane extends JComponent
/**
* This Action is responsible for iconifying the JInternalFrame.
*/
- protected class IconifyAction extends AbstractAction
+ public class IconifyAction extends AbstractAction
{
/**
* This method is called when the user wants to iconify the
@@ -128,7 +129,7 @@ public class BasicInternalFrameTitlePane extends JComponent
/**
* This Action is responsible for maximizing the JInternalFrame.
*/
- protected class MaximizeAction extends AbstractAction
+ public class MaximizeAction extends AbstractAction
{
/**
* This method is called when the user wants to maximize the
@@ -154,7 +155,7 @@ public class BasicInternalFrameTitlePane extends JComponent
/**
* This Action is responsible for dragging the JInternalFrame.
*/
- protected class MoveAction extends AbstractAction
+ public class MoveAction extends AbstractAction
{
/**
* This method is called when the user wants to drag the JInternalFrame.
@@ -171,7 +172,7 @@ public class BasicInternalFrameTitlePane extends JComponent
* This Action is responsible for restoring the JInternalFrame. Restoring
* the JInternalFrame is the same as setting the maximum property to false.
*/
- protected class RestoreAction extends AbstractAction
+ public class RestoreAction extends AbstractAction
{
/**
* This method is called when the user wants to restore the
@@ -197,7 +198,7 @@ public class BasicInternalFrameTitlePane extends JComponent
/**
* This action is responsible for sizing the JInternalFrame.
*/
- protected class SizeAction extends AbstractAction
+ public class SizeAction extends AbstractAction
{
/**
* This method is called when the user wants to resize the JInternalFrame.
@@ -236,7 +237,7 @@ public class BasicInternalFrameTitlePane extends JComponent
* This class acts as the MenuBar for the TitlePane. Clicking on the Frame
* Icon in the top left corner will activate it.
*/
- protected class SystemMenuBar extends JMenuBar
+ public class SystemMenuBar extends JMenuBar
{
/**
* This method returns true if it can receive focus.
@@ -439,22 +440,22 @@ public class BasicInternalFrameTitlePane extends JComponent
}
/** The action command for the Close action. */
- protected static String CLOSE_CMD = "Close";
+ protected static final String CLOSE_CMD = "Close";
/** The action command for the Minimize action. */
- protected static String ICONIFY_CMD = "Minimize";
+ protected static final String ICONIFY_CMD = "Minimize";
/** The action command for the Maximize action. */
- protected static String MAXIMIZE_CMD = "Maximize";
+ protected static final String MAXIMIZE_CMD = "Maximize";
/** The action command for the Move action. */
- protected static String MOVE_CMD = "Move";
+ protected static final String MOVE_CMD = "Move";
/** The action command for the Restore action. */
- protected static String RESTORE_CMD = "Restore";
+ protected static final String RESTORE_CMD = "Restore";
/** The action command for the Size action. */
- protected static String SIZE_CMD = "Size";
+ protected static final String SIZE_CMD = "Size";
/** The action associated with closing the JInternalFrame. */
protected Action closeAction;
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
index 7101d427dd3..990a3e3f9e0 100644
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.AWTEvent;
@@ -42,29 +43,22 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
-import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
-import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
+
import javax.swing.DefaultDesktopManager;
import javax.swing.DesktopManager;
-import javax.swing.Icon;
-import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
-import javax.swing.JLabel;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
@@ -77,7 +71,6 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.InternalFrameUI;
import javax.swing.plaf.UIResource;
-
/**
* This is the UI delegate for the Basic look and feel for JInternalFrames.
*/
@@ -1053,7 +1046,10 @@ public class BasicInternalFrameUI extends InternalFrameUI
/** The JComponent placed at the west region of the JInternalFrame. */
protected JComponent westPane;
- /** The Keystroke bound to open the menu. */
+ /**
+ * The Keystroke bound to open the menu.
+ * @deprecated
+ */
protected KeyStroke openMenuKey;
/** The TitlePane displayed at the top of the JInternalFrame. */
diff --git a/libjava/javax/swing/plaf/basic/BasicListUI.java b/libjava/javax/swing/plaf/basic/BasicListUI.java
index bd5c53b04ff..50bbb819f62 100644
--- a/libjava/javax/swing/plaf/basic/BasicListUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicListUI.java
@@ -1,4 +1,4 @@
-/* BasicListUI.java
+/* BasicListUI.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -48,6 +49,7 @@ import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
@@ -63,7 +65,6 @@ import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ListUI;
-
/**
* The Basic Look and Feel UI delegate for the
* JList.
diff --git a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
index 689cd8f57af..40bf972f25e 100644
--- a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -46,6 +46,7 @@ import java.awt.event.KeyEvent;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.ResourceBundle;
+
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;
import javax.swing.LookAndFeel;
@@ -137,6 +138,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"TabbedPaneUI", "javax.swing.plaf.basic.BasicTabbedPaneUI",
"TableHeaderUI", "javax.swing.plaf.basic.BasicTableHeaderUI",
"TableUI", "javax.swing.plaf.basic.BasicTableUI",
+ "TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
"TextAreaUI", "javax.swing.plaf.basic.BasicTextAreaUI",
"TextFieldUI", "javax.swing.plaf.basic.BasicTextFieldUI",
"TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
@@ -900,8 +902,8 @@ public abstract class BasicLookAndFeel extends LookAndFeel
}),
"Tree.background", new ColorUIResource(Color.white),
"Tree.changeSelectionWithFocus", Boolean.TRUE,
- // XXX Don't use gif
- "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.gif")),
+ "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),
+ "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")),
"Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
"Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray),
"Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
@@ -949,13 +951,12 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"ctrl PAGE_DOWN", "scrollDownChangeLead"
}),
"Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),
+ "Tree.expandedIcon", new IconUIResource(new ImageIcon("icons/TreeExpanded.png")),
"Tree.foreground", new ColorUIResource(Color.black),
"Tree.hash", new ColorUIResource(Color.gray),
- // XXX Don't use gif
- "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.gif")),
+ "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")),
"Tree.leftChildIndent", new Integer(7),
- // XXX Don't use gif
- "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.gif")),
+ "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")),
"Tree.rightChildIndent", new Integer(13),
"Tree.rowHeight", new Integer(16),
"Tree.scrollsOnExpand", Boolean.TRUE,
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java b/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
index f0bd73fa0bf..a1920fb5e31 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
@@ -35,44 +35,24 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.Insets;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.BoxLayout;
-import javax.swing.ButtonModel;
-import javax.swing.Icon;
-import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
-import javax.swing.JMenu;
import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.KeyStroke;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import javax.swing.event.MenuDragMouseEvent;
-import javax.swing.event.MenuDragMouseListener;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuKeyEvent;
-import javax.swing.event.MenuKeyListener;
-import javax.swing.event.MenuListener;
-import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.MenuBarUI;
-import javax.swing.plaf.MenuItemUI;
-
/**
* UI Delegate for JMenuBar.
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
index e52d3f63e79..da3f5598d05 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -45,26 +46,21 @@ import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
-import java.awt.Stroke;
-import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
-import java.util.Vector;
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
+
import javax.swing.Icon;
-import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
import javax.swing.KeyStroke;
import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
+import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
@@ -76,7 +72,6 @@ import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.MenuItemUI;
-
/**
* UI Delegate for JMenuItem.
*/
@@ -398,6 +393,9 @@ public class BasicMenuItemUI extends MenuItemUI
selectionBackground = defaults.getColor("MenuItem.selectionBackground");
selectionForeground = defaults.getColor("MenuItem.selectionForeground");
acceleratorDelimiter = defaults.getString("MenuItem.acceleratorDelimiter");
+
+ menuItem.setHorizontalTextPosition(SwingConstants.TRAILING);
+ menuItem.setHorizontalAlignment(SwingConstants.LEADING);
}
/**
@@ -557,23 +555,14 @@ public class BasicMenuItemUI extends MenuItemUI
}
}
- // paint icon
- // FIXME: should paint different icon at different button state's.
- // i.e disabled icon when button is disabled.. etc.
- Icon i = m.getIcon();
- if (i != null)
- {
- i.paintIcon(c, g, vr.x, vr.y);
-
- // Adjust view rectangle, s.t text would be drawn after menu item's icon.
- vr.x += i.getIconWidth() + defaultTextIconGap;
- }
-
// paint text and user menu icon if it exists
- SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), m.getIcon(),
+ Icon i = m.getIcon();
+ SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i,
vertAlign, horAlign, vertTextPos,
horTextPos, vr, ir, tr,
defaultTextIconGap);
+ if (i != null)
+ i.paintIcon(c, g, ir.x, ir.y);
paintText(g, m, tr, m.getText());
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuUI.java b/libjava/javax/swing/plaf/basic/BasicMenuUI.java
index 01dca763dbd..98af9546a4b 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuUI.java
@@ -35,26 +35,18 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
-import java.awt.Component;
import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
-import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
@@ -68,8 +60,6 @@ import javax.swing.event.MenuKeyListener;
import javax.swing.event.MenuListener;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.MenuItemUI;
-
/**
* UI Delegate for JMenu
diff --git a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
index 8a696b8cbc1..609fd11ab8a 100644
--- a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
@@ -1,4 +1,4 @@
-/* BasicOptionPaneUI.java
+/* BasicOptionPaneUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.BorderLayout;
@@ -42,21 +43,19 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Polygon;
-import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
+
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.Icon;
@@ -75,10 +74,8 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.IconUIResource;
import javax.swing.plaf.OptionPaneUI;
-
/**
* This class is the UI delegate for JOptionPane in the Basic Look and Feel.
*/
@@ -475,7 +472,7 @@ public class BasicOptionPaneUI extends OptionPaneUI
* A helper class that implements Icon. This is used temporarily until
* ImageIcons are fixed.
*/
- private static class messageIcon implements Icon
+ private static class MessageIcon implements Icon
{
/**
* This method returns the width of the icon.
@@ -512,7 +509,7 @@ public class BasicOptionPaneUI extends OptionPaneUI
}
/** The icon displayed for ERROR_MESSAGE. */
- private static messageIcon errorIcon = new messageIcon()
+ private static MessageIcon errorIcon = new MessageIcon()
{
public void paintIcon(Component c, Graphics g, int x, int y)
{
@@ -534,7 +531,7 @@ public class BasicOptionPaneUI extends OptionPaneUI
};
/** The icon displayed for INFORMATION_MESSAGE. */
- private static messageIcon infoIcon = new messageIcon()
+ private static MessageIcon infoIcon = new MessageIcon()
{
public void paintIcon(Component c, Graphics g, int x, int y)
{
@@ -560,7 +557,7 @@ public class BasicOptionPaneUI extends OptionPaneUI
};
/** The icon displayed for WARNING_MESSAGE. */
- private static messageIcon warningIcon = new messageIcon()
+ private static MessageIcon warningIcon = new MessageIcon()
{
public void paintIcon(Component c, Graphics g, int x, int y)
{
@@ -585,7 +582,7 @@ public class BasicOptionPaneUI extends OptionPaneUI
};
/** The icon displayed for MESSAGE_ICON. */
- private static messageIcon questionIcon = new messageIcon()
+ private static MessageIcon questionIcon = new MessageIcon()
{
public void paintIcon(Component c, Graphics g, int x, int y)
{
diff --git a/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java b/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java
index fe1c4902ac6..0350f7437f7 100644
--- a/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java
@@ -41,6 +41,7 @@ package javax.swing.plaf.basic;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.Element;
+import javax.swing.text.PasswordView;
import javax.swing.text.View;
public class BasicPasswordFieldUI extends BasicTextFieldUI
@@ -49,6 +50,11 @@ public class BasicPasswordFieldUI extends BasicTextFieldUI
{
}
+ public View create(Element elem)
+ {
+ return new PasswordView(elem);
+ }
+
public static ComponentUI createUI(JComponent c)
{
return new BasicPasswordFieldUI();
diff --git a/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
index caa5f8ddd34..d0df9d3477c 100644
--- a/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
@@ -1,4 +1,4 @@
-/* BasicPopupMenuSeparatorUI.java
+/* BasicPopupMenuSeparatorUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,22 +35,18 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.Insets;
import java.awt.Rectangle;
+
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
-import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SeparatorUI;
-
/**
* The Basic Look and Feel UI delegate for JPopupMenu.Separator.
diff --git a/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java b/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java
index 35fb005b9b9..796af5643cc 100644
--- a/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java
@@ -37,58 +37,25 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.awt.AWTKeyStroke;
-import java.awt.BasicStroke;
-import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
import java.awt.GridBagLayout;
-import java.awt.GridLayout;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.Stroke;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.EventListener;
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
-import javax.swing.Icon;
-import javax.swing.JCheckBoxMenuItem;
+
import javax.swing.JComponent;
-import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.KeyStroke;
import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.MenuDragMouseEvent;
-import javax.swing.event.MenuDragMouseListener;
-import javax.swing.event.MenuKeyEvent;
-import javax.swing.event.MenuKeyListener;
import javax.swing.event.MouseInputListener;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.MenuItemUI;
import javax.swing.plaf.PopupMenuUI;
diff --git a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java b/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
index fa84267efa2..9398ab86c1b 100644
--- a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
@@ -1,4 +1,4 @@
-/* BasicProgressBarUI.java
+/* BasicProgressBarUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -49,6 +50,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JComponent;
import javax.swing.JProgressBar;
import javax.swing.SwingConstants;
@@ -61,7 +63,6 @@ import javax.swing.event.ChangeListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ProgressBarUI;
-
/**
* The Basic Look and Feel UI delegate for the
* JProgressBar.
diff --git a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
index a63c95fbc55..3b17f3608d0 100644
--- a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
@@ -1,4 +1,4 @@
-/* BasicRadioButtonMenuItemUI.java
+/* BasicRadioButtonMenuItemUI.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,9 +35,11 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.event.MouseEvent;
+
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.MenuElement;
@@ -46,7 +48,6 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
-
/**
* UI Delegator for JRadioButtonMenuItem
*/
diff --git a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java b/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
index 7201549a209..110200e58ab 100644
--- a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
@@ -1,4 +1,4 @@
-/* BasicPanelUI.java
+/* BasicPanelUI.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,12 +40,12 @@ package javax.swing.plaf.basic;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.RootPaneUI;
-
public class BasicRootPaneUI extends RootPaneUI
implements PropertyChangeListener
{
diff --git a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
index 913b3260b91..446726e8bf8 100644
--- a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
@@ -1,4 +1,4 @@
-/* BasicScrollBarUI.java
+/* BasicScrollBarUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -56,7 +57,6 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.BoundedRangeModel;
-import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JScrollBar;
@@ -70,7 +70,6 @@ import javax.swing.event.ChangeListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ScrollBarUI;
-
/**
* The Basic Look and Feel UI delegate for JScrollBar.
*/
@@ -78,15 +77,14 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
SwingConstants
{
/**
- * A helper class that listens to the two JButtons on each end
- * of the JScrollBar.
+ * A helper class that listens to the two JButtons on each end of the
+ * JScrollBar.
*/
protected class ArrowButtonListener extends MouseAdapter
{
/**
- * Move the thumb in the direction specified by the
- * button's arrow. If this button is held down, then
- * it should keep moving the thumb.
+ * Move the thumb in the direction specified by the button's arrow. If
+ * this button is held down, then it should keep moving the thumb.
*
* @param e The MouseEvent fired by the JButton.
*/
@@ -113,8 +111,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * A helper class that listens to the ScrollBar's model
- * for ChangeEvents.
+ * A helper class that listens to the ScrollBar's model for ChangeEvents.
*/
protected class ModelListener implements ChangeListener
{
@@ -127,7 +124,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
{
// System.err.println(this + ".stateChanged()");
calculatePreferredSize();
- layoutContainer(scrollbar);
+ layoutContainer(scrollbar);
getThumbBounds();
scrollbar.repaint();
}
@@ -157,19 +154,19 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
decrButton.removeMouseListener(buttonListener);
incrButton = createIncreaseButton(scrollbar.getOrientation());
decrButton = createDecreaseButton(scrollbar.getOrientation());
- incrButton.addMouseListener(buttonListener);
- decrButton.addMouseListener(buttonListener);
- calculatePreferredSize();
- layoutContainer(scrollbar);
- }
+ incrButton.addMouseListener(buttonListener);
+ decrButton.addMouseListener(buttonListener);
+ calculatePreferredSize();
+ layoutContainer(scrollbar);
+ }
layoutContainer(scrollbar);
scrollbar.repaint();
}
}
/**
- * A helper class that listens for events from
- * the timer that is used to move the thumb.
+ * A helper class that listens for events from the timer that is used to
+ * move the thumb.
*/
protected class ScrollListener implements ActionListener
{
@@ -180,8 +177,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
private transient boolean block;
/**
- * Creates a new ScrollListener object.
- * The default is scrolling positively with block movement.
+ * Creates a new ScrollListener object. The default is scrolling
+ * positively with block movement.
*/
public ScrollListener()
{
@@ -190,8 +187,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * Creates a new ScrollListener object using
- * the given direction and block.
+ * Creates a new ScrollListener object using the given direction and
+ * block.
*
* @param dir The direction to move in.
* @param block Whether movement will be in blocks.
@@ -234,8 +231,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
// Only need to check it if it's block scrolling
// We only block scroll if the click occurs
// in the track.
-
- if (!trackListener.shouldScroll(direction))
+ if (! trackListener.shouldScroll(direction))
{
trackHighlight = NO_HIGHLIGHT;
scrollbar.repaint();
@@ -260,13 +256,14 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
/** The current Y coordinate of the mouse. */
protected int currentMouseY;
- /** The offset between the current mouse cursor and the
- current value of the scrollbar. */
+ /**
+ * The offset between the current mouse cursor and the current value of
+ * the scrollbar.
+ */
protected int offset;
/**
- * This method is called when the mouse is being
- * dragged.
+ * This method is called when the mouse is being dragged.
*
* @param e The MouseEvent given.
*/
@@ -275,15 +272,15 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
currentMouseX = e.getX();
currentMouseY = e.getY();
if (scrollbar.getValueIsAdjusting())
- {
- int value;
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- value = valueForXPosition(currentMouseX) - offset;
- else
- value = valueForYPosition(currentMouseY) - offset;
-
- scrollbar.setValue(value);
- }
+ {
+ int value;
+ if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
+ value = valueForXPosition(currentMouseX) - offset;
+ else
+ value = valueForYPosition(currentMouseY) - offset;
+
+ scrollbar.setValue(value);
+ }
}
/**
@@ -298,9 +295,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method is called when the mouse is
- * pressed. When it is pressed, the thumb should
- * move in blocks towards the cursor.
+ * This method is called when the mouse is pressed. When it is pressed,
+ * the thumb should move in blocks towards the cursor.
*
* @param e The MouseEvent given.
*/
@@ -318,7 +314,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
if (value == scrollbar.getValue())
return;
- if (!thumbRect.contains(e.getPoint()))
+ if (! thumbRect.contains(e.getPoint()))
{
scrollTimer.stop();
scrollListener.setScrollByBlock(true);
@@ -344,13 +340,13 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
// to that value.
scrollbar.setValueIsAdjusting(true);
offset = value - scrollbar.getValue();
- }
- scrollbar.repaint();
+ }
+ scrollbar.repaint();
}
/**
- * This method is called when the mouse is released.
- * It should stop movement on the thumb
+ * This method is called when the mouse is released. It should stop
+ * movement on the thumb
*
* @param e The MouseEvent given.
*/
@@ -358,32 +354,32 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
{
trackHighlight = NO_HIGHLIGHT;
scrollTimer.stop();
-
+
if (scrollbar.getValueIsAdjusting())
- scrollbar.setValueIsAdjusting(false);
+ scrollbar.setValueIsAdjusting(false);
scrollbar.repaint();
}
-
+
/**
- * A helper method that decides whether we should
- * keep scrolling in the given direction.
+ * A helper method that decides whether we should keep scrolling in the
+ * given direction.
*
* @param direction The direction to check for.
*
* @return Whether the thumb should keep scrolling.
*/
- public boolean shouldScroll (int direction)
+ public boolean shouldScroll(int direction)
{
int value;
if (scrollbar.getOrientation() == HORIZONTAL)
- value = valueForXPosition(currentMouseX);
+ value = valueForXPosition(currentMouseX);
else
- value = valueForYPosition(currentMouseY);
+ value = valueForYPosition(currentMouseY);
if (direction == POSITIVE_SCROLL)
- return (value > scrollbar.getValue());
+ return (value > scrollbar.getValue());
else
- return (value < scrollbar.getValue());
+ return (value < scrollbar.getValue());
}
}
@@ -393,8 +389,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
/** The listener that listens to the model. */
protected ModelListener modelListener;
- /** The listener that listens to the scrollbar for property
- changes. */
+ /** The listener that listens to the scrollbar for property changes. */
protected PropertyChangeListener propertyChangeListener;
/** The listener that listens to the timer. */
@@ -410,10 +405,10 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
protected JButton incrButton;
/** The dimensions of the maximum thumb size. */
- protected static Dimension maximumThumbSize;
+ protected Dimension maximumThumbSize;
/** The dimensions of the minimum thumb size. */
- protected static Dimension minimumThumbSize;
+ protected Dimension minimumThumbSize;
/** The color of the thumb. */
protected Color thumbColor;
@@ -427,8 +422,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
/** The outer light shadow for the thumb. */
protected Color thumbLightShadowColor;
- /** The color that is used when the mouse press
- occurs in the track. */
+ /** The color that is used when the mouse press occurs in the track. */
protected Color trackHighlightColor;
/** The color of the track. */
@@ -441,19 +435,19 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
protected Rectangle thumbRect;
/** Indicates that the decrease highlight should be painted. */
- protected static int DECREASE_HIGHLIGHT = 1;
+ protected static final int DECREASE_HIGHLIGHT = 1;
/** Indicates that the increase highlight should be painted. */
- protected static int INCREASE_HIGHLIGHT = 2;
+ protected static final int INCREASE_HIGHLIGHT = 2;
/** Indicates that no highlight should be painted. */
- protected static int NO_HIGHLIGHT = 0;
+ protected static final int NO_HIGHLIGHT = 0;
/** Indicates that the scrolling direction is positive. */
- private static int POSITIVE_SCROLL = 1;
+ private static final int POSITIVE_SCROLL = 1;
/** Indicates that the scrolling direction is negative. */
- private static int NEGATIVE_SCROLL = -1;
+ private static final int NEGATIVE_SCROLL = -1;
/** The cached preferred size for the scrollbar. */
private transient Dimension preferredSize;
@@ -471,88 +465,6 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
protected JScrollBar scrollbar;
/**
- * A helper class that allows us to draw icons for
- * the JButton.
- */
- private static class arrowIcon implements Icon
- {
- /** The polygon that describes the icon. */
- private Polygon arrow;
-
- /**
- * Creates a new arrowIcon object.
- *
- * @param arrow The polygon that describes the arrow.
- */
- public arrowIcon(Polygon arrow)
- {
- this.arrow = arrow;
- }
-
- /**
- * Returns the height of the icon.
- *
- * @return The height of the icon.
- */
- public int getIconHeight()
- {
- return 10;
- }
-
- /**
- * Returns the width of the icon.
- *
- * @return The width of the icon.
- */
- public int getIconWidth()
- {
- return 10;
- }
-
- /**
- * Paints the icon.
- *
- * @param c The Component to paint for.
- * @param g The Graphics object to draw with.
- * @param x The X coordinate to draw at.
- * @param y The Y coordinate to draw at.
- */
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
-
- Color saved = g.getColor();
-
- g.setColor(Color.BLACK);
-
- g.fillPolygon(arrow);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- }
-
- /** The Icon that points up. */
- private static Icon upIcon = new arrowIcon(new Polygon(new int[] { 2, 5, 8 },
- new int[] { 7, 3, 7 },
- 3));
-
- /** The Icon that points down. */
- private static Icon downIcon = new arrowIcon(new Polygon(new int[] { 2, 5, 8 },
- new int[] { 3, 7, 3 },
- 3));
-
- /** The Icon that points left. */
- private static Icon leftIcon = new arrowIcon(new Polygon(new int[] { 7, 3, 7 },
- new int[] { 2, 5, 8 },
- 3));
-
- /** The Icon that points right. */
- private static Icon rightIcon = new arrowIcon(new Polygon(new int[] { 3, 7, 3},
- new int[] { 2, 5, 8},
- 3));
-
- /**
* This method adds a component to the layout.
*
* @param name The name to associate with the component that is added.
@@ -565,19 +477,19 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method configures the scrollbar's colors. This can be
- * done by looking up the standard colors from the Look and Feel defaults.
+ * This method configures the scrollbar's colors. This can be done by
+ * looking up the standard colors from the Look and Feel defaults.
*/
protected void configureScrollBarColors()
{
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
+
trackColor = defaults.getColor("ScrollBar.track");
trackHighlightColor = defaults.getColor("ScrollBar.trackHighlight");
thumbColor = defaults.getColor("ScrollBar.thumb");
thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
- thumbLightShadowColor = defaults.getColor("ScrollBar.thumbLightShadow");
+ thumbLightShadowColor = defaults.getColor("ScrollBar.thumbLightShadow");
}
/**
@@ -590,9 +502,9 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
return new ArrowButtonListener();
}
- /**
- * This method creates a new JButton with the appropriate
- * icon for the orientation.
+ /**
+ * This method creates a new JButton with the appropriate icon for the
+ * orientation.
*
* @param orientation The orientation this JButton uses.
*
@@ -601,26 +513,22 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
protected JButton createIncreaseButton(int orientation)
{
if (incrButton == null)
+ incrButton = new BasicArrowButton((orientation == SwingConstants.HORIZONTAL)
+ ? SwingConstants.EAST
+ : SwingConstants.SOUTH);
+ else
{
- incrButton = new JButton();
- incrButton.setMargin(new Insets(0,0,0,0));
- incrButton.setHorizontalAlignment(SwingConstants.CENTER);
- incrButton.setHorizontalTextPosition(SwingConstants.CENTER);
- incrButton.setVerticalAlignment(SwingConstants.CENTER);
- incrButton.setVerticalTextPosition(SwingConstants.CENTER);
+ if (orientation == SwingConstants.HORIZONTAL)
+ ((BasicArrowButton) incrButton).setDirection(SwingConstants.EAST);
+ else
+ ((BasicArrowButton) incrButton).setDirection(SwingConstants.SOUTH);
}
-
- if (orientation == SwingConstants.HORIZONTAL)
- incrButton.setIcon(rightIcon);
- else
- incrButton.setIcon(downIcon);
-
return incrButton;
}
/**
- * This method creates a new JButton with the appropriate
- * icon for the orientation.
+ * This method creates a new JButton with the appropriate icon for the
+ * orientation.
*
* @param orientation The orientation this JButton uses.
*
@@ -629,20 +537,16 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
protected JButton createDecreaseButton(int orientation)
{
if (decrButton == null)
+ decrButton = new BasicArrowButton((orientation == SwingConstants.HORIZONTAL)
+ ? SwingConstants.WEST
+ : SwingConstants.NORTH);
+ else
{
- decrButton = new JButton();
- decrButton.setMargin(new Insets(0,0,0,0));
- decrButton.setHorizontalAlignment(SwingConstants.CENTER);
- decrButton.setHorizontalTextPosition(SwingConstants.CENTER);
- decrButton.setVerticalAlignment(SwingConstants.CENTER);
- decrButton.setVerticalTextPosition(SwingConstants.CENTER);
+ if (orientation == SwingConstants.HORIZONTAL)
+ ((BasicArrowButton) decrButton).setDirection(SwingConstants.WEST);
+ else
+ ((BasicArrowButton) decrButton).setDirection(SwingConstants.NORTH);
}
-
- if (orientation == SwingConstants.HORIZONTAL)
- decrButton.setIcon(leftIcon);
- else
- decrButton.setIcon(upIcon);
-
return decrButton;
}
@@ -743,13 +647,12 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method calculates the preferred size since
- * calling getPreferredSize() returns a cached value.
+ * This method calculates the preferred size since calling
+ * getPreferredSize() returns a cached value.
*/
private void calculatePreferredSize()
{
// System.err.println(this + ".calculatePreferredSize()");
-
int height;
int width;
height = width = 0;
@@ -790,11 +693,11 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method returns a cached value of the preferredSize.
- * The only restrictions are: If the scrollbar is horizontal, the
- * height should be the maximum of the height of the JButtons and
- * the minimum width of the thumb. For vertical scrollbars, the
- * calculation is similar (swap width for height and vice versa).
+ * This method returns a cached value of the preferredSize. The only
+ * restrictions are: If the scrollbar is horizontal, the height should be
+ * the maximum of the height of the JButtons and the minimum width of the
+ * thumb. For vertical scrollbars, the calculation is similar (swap width
+ * for height and vice versa).
*
* @param c The JComponent to measure.
*
@@ -807,9 +710,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method returns the thumb's bounds based on the
- * current value of the scrollbar. This method updates the
- * cached value and returns that.
+ * This method returns the thumb's bounds based on the current value of the
+ * scrollbar. This method updates the cached value and returns that.
*
* @return The thumb bounds.
*/
@@ -821,24 +723,22 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
int extent = scrollbar.getVisibleAmount();
// System.err.println(this + ".getThumbBounds()");
-
if (max == min)
- {
- thumbRect.x = trackRect.x;
- thumbRect.y = trackRect.y;
- if (scrollbar.getOrientation() == HORIZONTAL)
{
- thumbRect.width = getMinimumThumbSize().width;
- thumbRect.height = trackRect.height;
- }
- else
- {
- thumbRect.width = trackRect.width;
- thumbRect.height = getMinimumThumbSize().height;
+ thumbRect.x = trackRect.x;
+ thumbRect.y = trackRect.y;
+ if (scrollbar.getOrientation() == HORIZONTAL)
+ {
+ thumbRect.width = getMinimumThumbSize().width;
+ thumbRect.height = trackRect.height;
+ }
+ else
+ {
+ thumbRect.width = trackRect.width;
+ thumbRect.height = getMinimumThumbSize().height;
+ }
+ return thumbRect;
}
- return thumbRect;
- }
-
if (scrollbar.getOrientation() == HORIZONTAL)
{
@@ -852,8 +752,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
else
{
thumbRect.x = trackRect.x;
- thumbRect.y = trackRect.y
- + value * trackRect.height / (max - min);
+ thumbRect.y = trackRect.y + value * trackRect.height / (max - min);
thumbRect.width = trackRect.width;
thumbRect.height = extent * trackRect.height / (max - min);
@@ -862,8 +761,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method calculates the bounds of the track. This method
- * updates the cached value and returns it.
+ * This method calculates the bounds of the track. This method updates the
+ * cached value and returns it.
*
* @return The track's bounds.
*/
@@ -889,8 +788,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method installs any addition Components that
- * are a part of or related to this scrollbar.
+ * This method installs any addition Components that are a part of or
+ * related to this scrollbar.
*/
protected void installComponents()
{
@@ -901,8 +800,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method installs the defaults for the scrollbar specified
- * by the Basic Look and Feel.
+ * This method installs the defaults for the scrollbar specified by the
+ * Basic Look and Feel.
*/
protected void installDefaults()
{
@@ -926,9 +825,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method installs any listeners for the scrollbar.
- * This method also installs listeners for things such as
- * the JButtons and the timer.
+ * This method installs any listeners for the scrollbar. This method also
+ * installs listeners for things such as the JButtons and the timer.
*/
protected void installListeners()
{
@@ -951,10 +849,9 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method installs the UI for the component.
- * This can include setting up listeners, defaults,
- * and components. This also includes initializing any data
- * objects.
+ * This method installs the UI for the component. This can include setting
+ * up listeners, defaults, and components. This also includes initializing
+ * any data objects.
*
* @param c The JComponent to install.
*/
@@ -977,7 +874,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
configureScrollBarColors();
calculatePreferredSize();
- layoutContainer(scrollbar);
+ layoutContainer(scrollbar);
}
}
@@ -1073,9 +970,9 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method is called when repainting and the mouse is
- * pressed in the track. It paints the track below the thumb
- * with the trackHighlight color.
+ * This method is called when repainting and the mouse is pressed in the
+ * track. It paints the track below the thumb with the trackHighlight
+ * color.
*
* @param g The Graphics object to paint with.
*/
@@ -1088,15 +985,15 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
g.fillRect(trackRect.x, trackRect.y, thumbRect.x - trackRect.x,
trackRect.height);
else
- g.fillRect(trackRect.x, trackRect.y, trackRect.width,
+ g.fillRect(trackRect.x, trackRect.y, trackRect.width,
thumbRect.y - trackRect.y);
g.setColor(saved);
}
/**
- * This method is called when repainting and the mouse is
- * pressed in the track. It paints the track above the thumb
- * with the trackHighlight color.
+ * This method is called when repainting and the mouse is pressed in the
+ * track. It paints the track above the thumb with the trackHighlight
+ * color.
*
* @param g The Graphics objet to paint with.
*/
@@ -1109,11 +1006,10 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
g.fillRect(thumbRect.x + thumbRect.width, trackRect.y,
trackRect.x + trackRect.width - thumbRect.x - thumbRect.width,
trackRect.height);
- else
- g.fillRect(trackRect.x, thumbRect.y + thumbRect.height,
- trackRect.width,
- trackRect.y + trackRect.height - thumbRect.y -
- thumbRect.height);
+ else
+ g.fillRect(trackRect.x, thumbRect.y + thumbRect.height, trackRect.width,
+ trackRect.y + trackRect.height - thumbRect.y
+ - thumbRect.height);
g.setColor(saved);
}
@@ -1217,25 +1113,25 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * The method scrolls the thumb by a block in the
- * direction specified.
+ * The method scrolls the thumb by a block in the direction specified.
*
* @param direction The direction to scroll.
*/
protected void scrollByBlock(int direction)
{
- scrollbar.setValue(scrollbar.getValue() + scrollbar.getBlockIncrement(direction));
+ scrollbar.setValue(scrollbar.getValue()
+ + scrollbar.getBlockIncrement(direction));
}
/**
- * The method scrolls the thumb by a unit in the
- * direction specified.
+ * The method scrolls the thumb by a unit in the direction specified.
*
* @param direction The direction to scroll.
*/
protected void scrollByUnit(int direction)
{
- scrollbar.setValue(scrollbar.getValue() + scrollbar.getUnitIncrement(direction));
+ scrollbar.setValue(scrollbar.getValue()
+ + scrollbar.getUnitIncrement(direction));
}
/**
@@ -1255,8 +1151,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method uninstalls any components that
- * are a part of or related to this scrollbar.
+ * This method uninstalls any components that are a part of or related to
+ * this scrollbar.
*/
protected void uninstallComponents()
{
@@ -1267,8 +1163,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method uninstalls any defaults that this
- * scrollbar acquired from the Basic Look and Feel defaults.
+ * This method uninstalls any defaults that this scrollbar acquired from the
+ * Basic Look and Feel defaults.
*/
protected void uninstallDefaults()
{
@@ -1278,8 +1174,8 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method uninstalls any keyboard
- * actions this scrollbar acquired during install.
+ * This method uninstalls any keyboard actions this scrollbar acquired
+ * during install.
*/
protected void uninstallKeyboardActions()
{
@@ -1287,22 +1183,21 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method uninstalls any listeners that
- * were registered during install.
+ * This method uninstalls any listeners that were registered during install.
*/
protected void uninstallListeners()
{
scrollTimer.removeActionListener(scrollListener);
-
+
scrollbar.getModel().removeChangeListener(modelListener);
scrollbar.removePropertyChangeListener(propertyChangeListener);
-
+
decrButton.removeMouseListener(buttonListener);
incrButton.removeMouseListener(buttonListener);
-
+
scrollbar.removeMouseListener(trackListener);
scrollbar.removeMouseMotionListener(trackListener);
-
+
propertyChangeListener = null;
modelListener = null;
buttonListener = null;
@@ -1311,10 +1206,9 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
}
/**
- * This method uninstalls the UI. This includes
- * removing any defaults, listeners, and components
- * that this UI may have initialized. It also nulls
- * any instance data.
+ * This method uninstalls the UI. This includes removing any defaults,
+ * listeners, and components that this UI may have initialized. It also
+ * nulls any instance data.
*
* @param c The Component to uninstall for.
*/
@@ -1323,19 +1217,19 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
uninstallDefaults();
uninstallListeners();
uninstallComponents();
-
+
scrollTimer = null;
-
+
thumbRect = null;
trackRect = null;
-
+
trackColor = null;
trackHighlightColor = null;
thumbColor = null;
thumbHighlightColor = null;
thumbDarkShadowColor = null;
thumbLightShadowColor = null;
-
+
scrollbar = null;
}
diff --git a/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java
index 9149cb85d80..db2d164580f 100644
--- a/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java
@@ -1,4 +1,4 @@
-/* BasicSeparatorUI.java
+/* BasicSeparatorUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,20 +35,22 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
-import java.awt.Dimension;
import java.awt.Color;
-import java.awt.Rectangle;
+import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SeparatorUI;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
+import java.awt.Rectangle;
+
import javax.swing.JComponent;
import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.SeparatorUI;
/**
* The Basic Look and Feel UI delegate for JSeparator.
diff --git a/libjava/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/javax/swing/plaf/basic/BasicSliderUI.java
index b5c95cb68c3..648e332639b 100644
--- a/libjava/javax/swing/plaf/basic/BasicSliderUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicSliderUI.java
@@ -1,4 +1,4 @@
-/* BasicSliderUI.java
+/* BasicSliderUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -58,6 +59,7 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Dictionary;
import java.util.Enumeration;
+
import javax.swing.BoundedRangeModel;
import javax.swing.JComponent;
import javax.swing.JLabel;
@@ -72,7 +74,6 @@ import javax.swing.event.MouseInputAdapter;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.SliderUI;
-
/**
* <p>
* BasicSliderUI.java This is the UI delegate in the Basic look and feel that
@@ -320,7 +321,7 @@ public class BasicSliderUI extends SliderUI
/**
* Helper class that listens for mouse events.
*/
- protected class TrackListener extends MouseInputAdapter
+ public class TrackListener extends MouseInputAdapter
{
/** The current X position of the mouse. */
protected int currentMouseX;
@@ -1955,10 +1956,10 @@ public class BasicSliderUI extends SliderUI
}
g.setColor(Color.WHITE);
- g.drawPolygon(bright);
+ g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints);
g.setColor(Color.BLACK);
- g.drawPolygon(dark);
+ g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints);
g.setColor(Color.GRAY);
g.fillPolygon(all);
diff --git a/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java b/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java
index 0f5e761d3d7..919cde78670 100644
--- a/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java
@@ -1,5 +1,5 @@
/* SpinnerUI.java --
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Component;
@@ -48,6 +49,7 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JSpinner;
@@ -57,7 +59,6 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.SpinnerUI;
-
/**
* DOCUMENT ME!
*
diff --git a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
index e06eb05f580..1ee1bb6d993 100644
--- a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ b/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
@@ -1,4 +1,4 @@
-/* BasicSplitPaneDivider.java
+/* BasicSplitPaneDivider.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -49,12 +50,12 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.SwingConstants;
import javax.swing.border.Border;
-
/**
* The divider that separates the two parts of a JSplitPane in the Basic look
* and feel.
@@ -153,32 +154,35 @@ public class BasicSplitPaneDivider extends Container
// left (top), middle, right(bottom)
// 0 1 2
- /** Keeps track of where the divider should be placed when using one touch expand
- * buttons. */
+ /**
+ * Keeps track of where the divider should be placed when using one touch
+ * expand buttons.
+ */
private transient int currentDividerLocation = 1;
private transient Border tmpBorder = new Border()
- {
- public Insets getBorderInsets(Component c)
{
- return new Insets(2, 2, 2, 2);
- }
-
- public boolean isBorderOpaque()
- {
- return false;
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
- {
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawRect(x + 2, y + 2, width - 4, height - 4);
-
- g.setColor(saved);
- }
- };
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(2, 2, 2, 2);
+ }
+
+ public boolean isBorderOpaque()
+ {
+ return false;
+ }
+
+ public void paintBorder(Component c, Graphics g, int x, int y,
+ int width, int height)
+ {
+ Color saved = g.getColor();
+ g.setColor(Color.BLACK);
+
+ g.drawRect(x + 2, y + 2, width - 4, height - 4);
+
+ g.setColor(saved);
+ }
+ };
/**
* Constructs a new divider.
@@ -420,7 +424,7 @@ public class BasicSplitPaneDivider extends Container
if (orientation == JSplitPane.VERTICAL_SPLIT)
dir = SwingConstants.NORTH;
JButton button = new BasicArrowButton(dir);
- button.setBorderPainted(false);
+ button.setBorder(null);
return button;
}
@@ -437,7 +441,7 @@ public class BasicSplitPaneDivider extends Container
if (orientation == JSplitPane.VERTICAL_SPLIT)
dir = SwingConstants.SOUTH;
JButton button = new BasicArrowButton(dir);
- button.setBorderPainted(false);
+ button.setBorder(null);
return button;
}
@@ -484,11 +488,10 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This helper method moves the divider to one of the
- * three locations when using one touch expand buttons.
- * Location 0 is the left (or top) most location.
- * Location 1 is the middle.
- * Location 2 is the right (or bottom) most location.
+ * This helper method moves the divider to one of the three locations when
+ * using one touch expand buttons. Location 0 is the left (or top) most
+ * location. Location 1 is the middle. Location 2 is the right (or bottom)
+ * most location.
*
* @param locationIndex The location to move to.
*/
@@ -612,8 +615,10 @@ public class BasicSplitPaneDivider extends Container
*/
protected class DragController
{
- /** The difference between where the mouse is clicked and the
- * initial divider location. */
+ /**
+ * The difference between where the mouse is clicked and the initial
+ * divider location.
+ */
transient int offset;
/**
@@ -650,8 +655,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method returns one of the two paramters
- * for the orientation. In this case, it returns x.
+ * This method returns one of the two paramters for the orientation. In
+ * this case, it returns x.
*
* @param x The x coordinate.
* @param y The y coordinate.
@@ -664,8 +669,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method is called to pass on the drag information
- * to the UI through dragDividerTo.
+ * This method is called to pass on the drag information to the UI through
+ * dragDividerTo.
*
* @param newX The x coordinate of the MouseEvent.
* @param newY The y coordinate of the MouseEvent.
@@ -677,8 +682,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method is called to pass on the drag information
- * to the UI through dragDividerTo.
+ * This method is called to pass on the drag information to the UI
+ * through dragDividerTo.
*
* @param e The MouseEvent.
*/
@@ -689,8 +694,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method is called to finish the drag session
- * by calling finishDraggingTo.
+ * This method is called to finish the drag session by calling
+ * finishDraggingTo.
*
* @param x The x coordinate of the MouseEvent.
* @param y The y coordinate of the MouseEvent.
@@ -701,8 +706,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method is called to finish the drag session
- * by calling finishDraggingTo.
+ * This method is called to finish the drag session by calling
+ * finishDraggingTo.
*
* @param e The MouseEvent.
*/
@@ -710,10 +715,10 @@ public class BasicSplitPaneDivider extends Container
{
finishDraggingTo(positionForMouseEvent(e));
}
-
+
/**
- * This is a helper method that includes the offset
- * in the needed location.
+ * This is a helper method that includes the offset in the needed
+ * location.
*
* @param x The x coordinate of the MouseEvent.
* @param y The y coordinate of the MouseEvent.
@@ -727,8 +732,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This is a helper class that controls dragging when
- * the orientation is VERTICAL_SPLIT.
+ * This is a helper class that controls dragging when the orientation is
+ * VERTICAL_SPLIT.
*/
protected class VerticalDragController extends DragController
{
@@ -744,8 +749,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method returns one of the two parameters given
- * the orientation. In this case, it returns y.
+ * This method returns one of the two parameters given the orientation. In
+ * this case, it returns y.
*
* @param x The x coordinate of the MouseEvent.
* @param y The y coordinate of the MouseEvent.
@@ -758,8 +763,7 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method returns the new location of the divider
- * given a MouseEvent.
+ * This method returns the new location of the divider given a MouseEvent.
*
* @param e The MouseEvent.
*
@@ -771,8 +775,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This is a helper method that includes the offset
- * in the needed location.
+ * This is a helper method that includes the offset in the needed
+ * location.
*
* @param x The x coordinate of the MouseEvent.
* @param y The y coordinate of the MouseEvent.
@@ -782,12 +786,11 @@ public class BasicSplitPaneDivider extends Container
int adjust(int x, int y)
{
return getNeededLocation(x, y) + getY() - offset;
- }
+ }
}
/**
- * This helper class acts as the Layout Manager for
- * the divider.
+ * This helper class acts as the Layout Manager for the divider.
*/
protected class DividerLayout implements LayoutManager
{
@@ -858,8 +861,8 @@ public class BasicSplitPaneDivider extends Container
}
/**
- * This method changes the button orientation when
- * the orientation of the SplitPane changes.
+ * This method changes the button orientation when the orientation of the
+ * SplitPane changes.
*/
private void changeButtonOrientation()
{
diff --git a/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java b/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java
index f73b52045ba..fbcc1889630 100644
--- a/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -1,4 +1,4 @@
-/* BasicSplitPaneUI.java
+/* BasicSplitPaneUI.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Canvas;
@@ -51,10 +52,9 @@ import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
-import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import javax.swing.JButton;
+
import javax.swing.JComponent;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
@@ -63,7 +63,6 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.SplitPaneUI;
-
/**
* This is the Basic Look and Feel implementation of the SplitPaneUI class.
*/
@@ -682,7 +681,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This is a deprecated class. It is supposed to be used for handling down
* and right key presses.
*/
- protected class KeyboardDownRightHandler implements ActionListener
+ public class KeyboardDownRightHandler implements ActionListener
{
/**
* This method is called when the down or right keys are pressed.
@@ -699,7 +698,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This is a deprecated class. It is supposed to be used for handling end
* key presses.
*/
- protected class KeyboardEndHandler implements ActionListener
+ public class KeyboardEndHandler implements ActionListener
{
/**
* This method is called when the end key is pressed.
@@ -716,7 +715,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This is a deprecated class. It is supposed to be used for handling home
* key presses.
*/
- protected class KeyboardHomeHandler implements ActionListener
+ public class KeyboardHomeHandler implements ActionListener
{
/**
* This method is called when the home key is pressed.
@@ -733,7 +732,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This is a deprecated class. It is supposed to be used for handling resize
* toggles.
*/
- protected class KeyboardResizeToggleHandler implements ActionListener
+ public class KeyboardResizeToggleHandler implements ActionListener
{
/**
* This method is called when a resize is toggled.
@@ -750,7 +749,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This is a deprecated class. It is supposed to be used for handler up and
* left key presses.
*/
- protected class KeyboardUpLeftHandler implements ActionListener
+ public class KeyboardUpLeftHandler implements ActionListener
{
/**
* This method is called when the left or up keys are pressed.
@@ -767,7 +766,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
* This helper class handles PropertyChangeEvents from the JSplitPane. When
* a property changes, this will update the UI accordingly.
*/
- protected class PropertyHandler implements PropertyChangeListener
+ public class PropertyHandler implements PropertyChangeListener
{
/**
* This method is called whenever one of the JSplitPane's properties
@@ -846,43 +845,43 @@ public class BasicSplitPaneUI extends SplitPaneUI
/** The JSplitPane's focus handler. */
protected FocusListener focusListener;
- /** Deprecated. The handler for down and right key presses. */
+ /** @deprecated The handler for down and right key presses. */
protected ActionListener keyboardDownRightListener;
- /** Deprecated. The handler for end key presses. */
+ /** @deprecated The handler for end key presses. */
protected ActionListener keyboardEndListener;
- /** Deprecated. The handler for home key presses. */
+ /** @deprecated The handler for home key presses. */
protected ActionListener keyboardHomeListener;
- /** Deprecated. The handler for toggling resizes. */
+ /** @deprecated The handler for toggling resizes. */
protected ActionListener keyboardResizeToggleListener;
- /** Deprecated. The handler for up and left key presses. */
+ /** @deprecated The handler for up and left key presses. */
protected ActionListener keyboardUpLeftListener;
/** The JSplitPane's current layout manager. */
protected BasicHorizontalLayoutManager layoutManager;
- /** Deprecated. The divider resize toggle key. */
+ /** @deprecated The divider resize toggle key. */
protected KeyStroke dividerResizeToggleKey;
- /** Deprecated. The down key. */
+ /** @deprecated The down key. */
protected KeyStroke downKey;
- /** Deprecated. The end key. */
+ /** @deprecated The end key. */
protected KeyStroke endKey;
- /** Deprecated. The home key. */
+ /** @deprecated The home key. */
protected KeyStroke homeKey;
- /** Deprecated. The left key. */
+ /** @deprecated The left key. */
protected KeyStroke leftKey;
- /** Deprecated. The right key. */
+ /** @deprecated The right key. */
protected KeyStroke rightKey;
- /** Deprecated. The up key. */
+ /** @deprecated The up key. */
protected KeyStroke upKey;
/** Set to true when dragging heavy weight components. */
@@ -892,7 +891,8 @@ public class BasicSplitPaneUI extends SplitPaneUI
* The constraints object used when adding the non-continuous divider to the
* JSplitPane.
*/
- protected static String NON_CONTINUOUS_DIVIDER;
+ protected static final String NON_CONTINUOUS_DIVIDER
+ = "nonContinuousDivider";
/** The dark divider used when dragging in non-continuous layout mode. */
protected Component nonContinuousLayoutDivider;
@@ -1042,10 +1042,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Deprecated. This method creates a new ActionListener for up and left key
- * presses.
+ * This method creates a new ActionListener for up and left key presses.
*
* @return A new ActionListener for up and left keys.
+ *
+ * @deprecated 1.3
*/
protected ActionListener createKeyboardUpLeftListener()
{
@@ -1053,10 +1054,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Deprecated. This method creates a new ActionListener for down and right
- * key presses.
+ * This method creates a new ActionListener for down and right key presses.
*
* @return A new ActionListener for down and right keys.
+ *
+ * @deprecated 1.3
*/
protected ActionListener createKeyboardDownRightListener()
{
@@ -1064,10 +1066,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Deprecated. This method creates a new ActionListener for home key
- * presses.
+ * This method creates a new ActionListener for home key presses.
*
* @return A new ActionListener for home keys.
+ *
+ * @deprecated
*/
protected ActionListener createKeyboardHomeListener()
{
@@ -1075,9 +1078,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Deprecated. This method creates a new ActionListener for end key presses.
+ * This method creates a new ActionListener for end key presses.i
*
* @return A new ActionListener for end keys.
+ *
+ * @deprecated 1.3
*/
protected ActionListener createKeyboardEndListener()
{
@@ -1085,10 +1090,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Depcreated. This method creates a new ActionListener for resize toggle
- * key events.
+ * This method creates a new ActionListener for resize toggle key events.
*
* @return A new ActionListener for resize toggle keys.
+ *
+ * @deprecated 1.3
*/
protected ActionListener createKeyboardResizeToggleListener()
{
@@ -1482,10 +1488,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
}
/**
- * Deprecated. This method returns the width of one of the sides of the
- * divider's border.
+ * This method returns the width of one of the sides of the divider's border.
*
* @return The width of one side of the divider's border.
+ *
+ * @deprecated 1.3
*/
protected int getDividerBorderSize()
{
diff --git a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index 44e302b0188..7073086aae5 100644
--- a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -28,7 +28,7 @@ permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of7 the license of that
+independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
@@ -132,11 +132,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
if (++currentScrollLocation >= tabCount)
currentScrollLocation = tabCount - 1;
- if (currentScrollLocation == tabCount - 1)
- incrButton.setEnabled(false);
+
+ int width = 0;
+ for (int i = currentScrollLocation - 1; i < tabCount; i++)
+ width += rects[i].width;
+ if (width < viewport.getWidth())
+ // FIXME: Still getting mouse events after the button is disabled.
+ // incrButton.setEnabled(false);
+ currentScrollLocation--;
else if (! decrButton.isEnabled())
decrButton.setEnabled(true);
- tabPane.layout();
+ tabPane.revalidate();
tabPane.repaint();
return;
}
@@ -148,7 +154,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
decrButton.setEnabled(false);
else if (! incrButton.isEnabled())
incrButton.setEnabled(true);
- tabPane.layout();
+ tabPane.revalidate();
tabPane.repaint();
return;
}
@@ -160,7 +166,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
// e.g. in the inset area.
if (index != -1 && tabPane.isEnabledAt(index))
tabPane.setSelectedIndex(index);
- tabPane.layout();
+ tabPane.revalidate();
tabPane.repaint();
}
}
@@ -168,7 +174,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
/**
* This class handles PropertyChangeEvents fired from the JTabbedPane.
*/
- protected class PropertyChangeHandler implements PropertyChangeListener
+ public class PropertyChangeHandler implements PropertyChangeListener
{
/**
* This method is called whenever one of the properties of the JTabbedPane
@@ -269,18 +275,16 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
if (tabPlacement == SwingConstants.TOP
|| tabPlacement == SwingConstants.BOTTOM)
{
- width = calculateMaxTabWidth(tabPlacement) * tabPane.getTabCount();
- calcRect = tabPane.getParent().getBounds();
- width = Math.max(width, componentWidth);
+ int min = calculateMaxTabWidth(tabPlacement);
+ width = Math.max(min, componentWidth);
int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width);
height = tabAreaHeight + componentHeight;
}
else
{
- height = calculateMaxTabHeight(tabPlacement) * tabPane.getTabCount();
- calcRect = tabPane.getParent().getBounds();
- height = Math.max(height, componentHeight);
+ int min = calculateMaxTabHeight(tabPlacement);
+ height = Math.max(min, componentHeight);
int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height);
width = tabAreaWidth + componentWidth;
@@ -454,7 +458,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
for (int j = first; j <= last; j++)
rects[j].y += (runCount - i) * maxTabHeight
- + (runCount - i) * tabRunOverlay;
+ - (runCount - i) * tabRunOverlay;
}
if (tabPlacement == SwingConstants.BOTTOM)
@@ -810,7 +814,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
protected void rotateTabRuns(int tabPlacement, int selectedRun)
{
- if (selectedRun == 1 || selectedRun == -1)
+ if (runCount == 1 || selectedRun == 1 || selectedRun == -1)
return;
int[] newTabRuns = new int[tabRuns.length];
int currentRun = selectedRun;
@@ -1025,6 +1029,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
super.layoutContainer(pane);
int tabCount = tabPane.getTabCount();
+ Point p = null;
if (tabCount == 0)
return;
int tabPlacement = tabPane.getTabPlacement();
@@ -1083,20 +1088,21 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width);
int h = Math.max(rects[tabC].height, tabAreaRect.height);
- Point p = findPointForIndex(currentScrollLocation);
+ p = findPointForIndex(currentScrollLocation);
// we want to cover that entire space so that borders that run under
// the tab area don't show up when we move the viewport around.
panel.setSize(w + p.x, h + p.y);
}
- viewport.setViewPosition(findPointForIndex(currentScrollLocation));
+ viewport.setViewPosition(p);
+ viewport.repaint();
}
}
/**
* This class handles ChangeEvents from the JTabbedPane.
*/
- protected class TabSelectionHandler implements ChangeListener
+ public class TabSelectionHandler implements ChangeListener
{
/**
* This method is called whenever a ChangeEvent is fired from the
@@ -1257,16 +1263,32 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
/** This array keeps track of which tabs are in which run. See above. */
protected int[] tabRuns;
- /** Deprecated. This is the keystroke for moving down. */
+ /**
+ * This is the keystroke for moving down.
+ *
+ * @deprecated 1.3
+ */
protected KeyStroke downKey;
- /** Deprecated. This is the keystroke for moving left. */
+ /**
+ * This is the keystroke for moving left.
+ *
+ * @deprecated 1.3
+ */
protected KeyStroke leftKey;
- /** Deprecated. This is the keystroke for moving right. */
+ /**
+ * This is the keystroke for moving right.
+ *
+ * @deprecated 1.3
+ */
protected KeyStroke rightKey;
- /** Deprecated. This is the keystroke for moving up. */
+ /**
+ * This is the keystroke for moving up.
+ *
+ * @deprecated 1.3
+ */
protected KeyStroke upKey;
/** The listener that listens for focus events. */
@@ -1446,6 +1468,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
incrButton = createIncreaseButton();
decrButton = createDecreaseButton();
viewport = new ScrollingViewport();
+ viewport.setLayout(null);
panel = new ScrollingPanel();
viewport.setView(panel);
tabPane.add(incrButton);
@@ -1690,6 +1713,8 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
Rectangle ir = new Rectangle();
Rectangle tr = new Rectangle();
+ boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT;
+
// Please note: the ordering of the painting is important.
// we WANT to paint the outermost run first and then work our way in.
int tabCount = tabPane.getTabCount();
@@ -1702,17 +1727,33 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
for (int i = 0; i < runCount; i++)
{
int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1;
- if (first == tabCount)
+ if (isScroll)
+ first = currentScrollLocation;
+ else if (first == tabCount)
first = 0;
int last = lastTabInRun(tabCount, currRun);
+ if (isScroll)
+ {
+ for (int k = first; k < tabCount; k++)
+ {
+ if (rects[k].x + rects[k].width - rects[first].x > viewport
+ .getWidth())
+ {
+ last = k;
+ break;
+ }
+ }
+ }
+
for (int j = first; j <= last; j++)
{
- if (j != selectedIndex)
+ if (j != selectedIndex || isScroll)
paintTab(g, tabPlacement, rects, j, ir, tr);
}
- currRun = getNextTabRun(currRun);
+ currRun = getPreviousTabRun(currRun);
}
- paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);
+ if (! isScroll)
+ paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);
}
/**
@@ -1975,7 +2016,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int x, int y, int w, int h, boolean isSelected)
{
Color saved = g.getColor();
-
+
if (! isSelected || tabPlacement != SwingConstants.TOP)
{
g.setColor(shadow);
@@ -2030,7 +2071,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
Color bg = tabPane.getBackgroundAt(tabIndex);
if (bg == null)
- bg = tabPane.getBackground();
+ bg = Color.GRAY;
g.setColor(bg);
}
@@ -2083,14 +2124,14 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int diff = 0;
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.x;
- }
-
if (tabPlacement == SwingConstants.TOP)
{
+ if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ Point p = findPointForIndex(currentScrollLocation);
+ diff = p.x;
+ }
+
g.drawLine(x, y, startgap - diff, y);
g.drawLine(endgap - diff, y, x + w, y);
}
@@ -2123,14 +2164,14 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int diff = 0;
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.y;
- }
-
if (tabPlacement == SwingConstants.LEFT)
{
+ if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ Point p = findPointForIndex(currentScrollLocation);
+ diff = p.y;
+ }
+
g.drawLine(x, y, x, startgap - diff);
g.drawLine(x, endgap - diff, x, y + h);
}
@@ -2162,14 +2203,14 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int diff = 0;
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.x;
- }
-
if (tabPlacement == SwingConstants.BOTTOM)
{
+ if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ Point p = findPointForIndex(currentScrollLocation);
+ diff = p.x;
+ }
+
g.setColor(shadow);
g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1);
g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1);
@@ -2209,14 +2250,15 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
int diff = 0;
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.y;
- }
if (tabPlacement == SwingConstants.RIGHT)
{
+ if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ Point p = findPointForIndex(currentScrollLocation);
+ diff = p.y;
+ }
+
g.setColor(shadow);
g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff);
g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1);
diff --git a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java b/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
index c55c9400fa2..ea7dfc0cd6d 100644
--- a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
@@ -1,4 +1,4 @@
-/* BasicTableHeaderUI.java
+/* BasicTableHeaderUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Component;
@@ -42,6 +43,7 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
+
import javax.swing.CellRendererPane;
import javax.swing.JComponent;
import javax.swing.UIDefaults;
@@ -55,7 +57,6 @@ import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
-
public class BasicTableHeaderUI
extends TableHeaderUI
{
@@ -180,84 +181,6 @@ public class BasicTableHeaderUI
}
}
-
- public Dimension getMaximumSize(JComponent c)
- {
- TableColumnModel cmod = header.getColumnModel();
- TableCellRenderer defaultRend = header.getDefaultRenderer();
- int ncols = cmod.getColumnCount();
- int spacing = 0;
- Dimension ret = getPreferredSize(c);
-
- if (header.getTable() != null
- && header.getTable().getInterCellSpacing() != null)
- spacing = header.getTable().getInterCellSpacing().width;
-
- ret.width = 0;
- for (int i = 0; i < ncols; ++i)
- {
- TableColumn col = cmod.getColumn(i);
- TableCellRenderer rend = col.getHeaderRenderer();
- if (rend == null)
- rend = defaultRend;
- Object val = col.getHeaderValue();
- Component comp = rend.getTableCellRendererComponent(header.getTable(),
- val,
- false, // isSelected
- false, // isFocused
- -1, i);
- comp.setFont(header.getFont());
- comp.setBackground(header.getBackground());
- comp.setForeground(header.getForeground());
- if (comp instanceof JComponent)
- ((JComponent)comp).setBorder(cellBorder);
-
- Dimension d = comp.getMaximumSize();
- ret.width += col.getMaxWidth();
- ret.height = Math.max(ret.height, d.height);
- ret.width += spacing;
- }
- return ret;
- }
-
- public Dimension getMinimumSize(JComponent c)
- {
- TableColumnModel cmod = header.getColumnModel();
- TableCellRenderer defaultRend = header.getDefaultRenderer();
- int ncols = cmod.getColumnCount();
- int spacing = 0;
- Dimension ret = getPreferredSize(c);
-
- if (header.getTable() != null
- && header.getTable().getInterCellSpacing() != null)
- spacing = header.getTable().getInterCellSpacing().width;
-
- ret.width = 0;
- for (int i = 0; i < ncols; ++i)
- {
- TableColumn col = cmod.getColumn(i);
- TableCellRenderer rend = col.getHeaderRenderer();
- if (rend == null)
- rend = defaultRend;
- Object val = col.getHeaderValue();
- Component comp = rend.getTableCellRendererComponent(header.getTable(),
- val,
- false, // isSelected
- false, // isFocused
- -1, i);
- comp.setFont(header.getFont());
- comp.setBackground(header.getBackground());
- comp.setForeground(header.getForeground());
- if (comp instanceof JComponent)
- ((JComponent)comp).setBorder(cellBorder);
-
- Dimension d = comp.getMinimumSize();
- ret.width += col.getMinWidth();
- ret.width += spacing;
- ret.height = Math.max(ret.height, d.height);
- }
- return ret;
- }
public Dimension getPreferredSize(JComponent c)
{
@@ -290,10 +213,10 @@ public class BasicTableHeaderUI
((JComponent)comp).setBorder(cellBorder);
Dimension d = comp.getPreferredSize();
- ret.width += d.width;
ret.width += spacing;
ret.height = Math.max(d.height, ret.height);
}
+ ret.width = cmod.getTotalColumnWidth();
return ret;
}
diff --git a/libjava/javax/swing/plaf/basic/BasicTableUI.java b/libjava/javax/swing/plaf/basic/BasicTableUI.java
index 5fa8fb71312..eb0054bb645 100644
--- a/libjava/javax/swing/plaf/basic/BasicTableUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTableUI.java
@@ -1,4 +1,4 @@
-/* BasicTableUI.java
+/* BasicTableUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -43,29 +44,28 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
+
import javax.swing.CellRendererPane;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.TableUI;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-
public class BasicTableUI
extends TableUI
{
-
public static ComponentUI createUI(JComponent comp)
{
return new BasicTableUI();
diff --git a/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java b/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java
index f1714c20d35..61d025ddd04 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.beans.PropertyChangeEvent;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
diff --git a/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java b/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java
index b43fd97cf07..e7cf33b1baf 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java
@@ -41,11 +41,9 @@ package javax.swing.plaf.basic;
import java.beans.PropertyChangeEvent;
import javax.swing.JComponent;
-import javax.swing.JTextField;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.Element;
import javax.swing.text.FieldView;
-import javax.swing.text.PlainDocument;
import javax.swing.text.View;
public class BasicTextFieldUI extends BasicTextUI
diff --git a/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
new file mode 100644
index 00000000000..615c74b2bff
--- /dev/null
+++ b/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
@@ -0,0 +1,69 @@
+/* BasicTextPaneUI.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.basic;
+
+import java.beans.PropertyChangeEvent;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.text.Element;
+import javax.swing.text.PlainView;
+import javax.swing.text.View;
+
+public class BasicTextPaneUI extends BasicTextUI
+{
+ public static ComponentUI createUI(JComponent comp)
+ {
+ return new BasicTextPaneUI();
+ }
+
+ public BasicTextPaneUI()
+ {
+ }
+
+ public View create(Element elem)
+ {
+ return new PlainView(elem);
+ }
+
+ protected String getPropertyPrefix()
+ {
+ return "TextPane";
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
index 2ccf2fa5e08..b3d03dbae68 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextUI.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -46,6 +45,8 @@ import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -56,7 +57,6 @@ import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.TextUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.BadLocationException;
@@ -70,7 +70,6 @@ import javax.swing.text.Element;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
import javax.swing.text.Keymap;
-import javax.swing.text.PlainDocument;
import javax.swing.text.PlainView;
import javax.swing.text.Position;
import javax.swing.text.View;
@@ -231,9 +230,20 @@ public abstract class BasicTextUI extends TextUI
caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate"));
}
+ private FocusListener focuslistener = new FocusListener() {
+ public void focusGained(FocusEvent e)
+ {
+ textComponent.repaint();
+ }
+ public void focusLost(FocusEvent e)
+ {
+ textComponent.repaint();
+ }
+ };
+
protected void installListeners()
{
- // Do nothing here.
+ textComponent.addFocusListener(focuslistener);
}
protected String getKeymapName()
@@ -331,7 +341,7 @@ public abstract class BasicTextUI extends TextUI
protected void uninstallListeners()
{
- // Do nothing here.
+ textComponent.removeFocusListener(focuslistener);
}
protected void uninstallKeyboardActions()
@@ -370,7 +380,7 @@ public abstract class BasicTextUI extends TextUI
rootView.paint(g, getVisibleEditorRect());
- if (caret != null)
+ if (caret != null && textComponent.hasFocus())
caret.paint(g);
}
@@ -464,8 +474,17 @@ public abstract class BasicTextUI extends TextUI
protected void modelChanged()
{
+ if (textComponent == null || rootView == null)
+ return;
ViewFactory factory = rootView.getViewFactory();
- Element elem = textComponent.getDocument().getDefaultRootElement();
+ if (factory == null)
+ return;
+ Document doc = textComponent.getDocument();
+ if (doc == null)
+ return;
+ Element elem = doc.getDefaultRootElement();
+ if (elem == null)
+ return;
setView(factory.create(elem));
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
index f35968c6530..72554c0f45c 100644
--- a/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
@@ -1,4 +1,4 @@
-/* BasicToolBarSeparatorUI.java
+/* BasicToolBarSeparatorUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,22 +35,17 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
-import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
+
import javax.swing.JComponent;
-import javax.swing.JToolBar.Separator;
import javax.swing.JSeparator;
-import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SeparatorUI;
-
/**
* The Basic Look and Feel UI delegate for Separator.
diff --git a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
index 99e447501a5..8315fc05f09 100644
--- a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
@@ -1,4 +1,4 @@
-/* BasicToolBarUI.java
+/* BasicToolBarUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,16 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
-import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
@@ -53,15 +52,14 @@ import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
-import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.util.Enumeration;
import java.util.Hashtable;
+
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
@@ -74,13 +72,11 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.BorderUIResource;
import javax.swing.plaf.BorderUIResource.EtchedBorderUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ToolBarUI;
import javax.swing.plaf.UIResource;
-
/**
* This is the Basic Look and Feel UI class for JToolBar.
*/
@@ -1331,10 +1327,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
private static class ToolBarBorder implements Border
{
/** The size of the larger, draggable side of the border. */
- private static int offset = 10;
+ private static final int offset = 10;
/** The other sides. */
- private static int regular = 2;
+ private static final int regular = 2;
/**
* This method returns the border insets for the JToolBar.
diff --git a/libjava/javax/swing/plaf/basic/BasicToolTipUI.java b/libjava/javax/swing/plaf/basic/BasicToolTipUI.java
index 3b5941f1bef..b561cce7174 100644
--- a/libjava/javax/swing/plaf/basic/BasicToolTipUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicToolTipUI.java
@@ -1,39 +1,40 @@
/* BasicToolTipUI.java --
Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of GNU Classpath.
-
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Classpath; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
package javax.swing.plaf.basic;
@@ -44,6 +45,7 @@ import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
+
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.SwingConstants;
@@ -54,7 +56,6 @@ import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ToolTipUI;
-
/**
* This is the Basic Look and Feel UI class for JToolTip.
*/
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
index dac2f01601b..93e3900750a 100644
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
@@ -1,5 +1,5 @@
-/* BasicTreeUI.java
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* BasicTreeUI.java --
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,11 +38,21 @@ exception statement from your version. */
package javax.swing.plaf.basic;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
import java.awt.Rectangle;
+
+import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
import javax.swing.JTree;
import javax.swing.plaf.TreeUI;
+import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreePath;
-
+import javax.swing.tree.TreeModel;
/**
* A delegate providing the user interface for <code>JTree</code>
@@ -57,6 +67,7 @@ import javax.swing.tree.TreePath;
public class BasicTreeUI
extends TreeUI
{
+
/**
* Determines the geometric extent of the label that is
* drawn for a path.
@@ -191,7 +202,6 @@ public class BasicTreeUI
return true; // FIXME: not implemented
}
-
/**
* Cancels editing a tree cell, discarding any entered value.
* If no editing session is active, nothing happens. The cell
@@ -233,4 +243,157 @@ public class BasicTreeUI
{
return null; // FIXME: not implemented
}
+
+ public static ComponentUI createUI(JComponent c)
+ {
+ return new BasicTreeUI();
+ }
+
+ int rightChildIndent;
+ int leftChildIndent;
+ int rowHeight;
+ Color hashColor;
+
+ protected void installDefaults(JTree tree)
+ {
+ UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+
+ tree.setFont(defaults.getFont("Tree.font"));
+ tree.setForeground(defaults.getColor("Tree.foreground"));
+ tree.setBackground(defaults.getColor("Tree.background"));
+ tree.setOpaque(true);
+
+ hashColor = defaults.getColor("Tree.hash");
+ rightChildIndent = defaults.getInt("Tree.rightChildIndent");
+ leftChildIndent = defaults.getInt("Tree.leftChildIndent");
+ rowHeight = defaults.getInt("Tree.rowHeight");
+ }
+
+ protected void installKeyboardActions()
+ {
+ }
+
+ protected void installListeners()
+ {
+ }
+
+ public void installUI(JComponent c)
+ {
+ installDefaults((JTree) c);
+ }
+
+
+ protected void uninstallDefaults(JTree tree)
+ {
+ tree.setFont(null);
+ tree.setForeground(null);
+ tree.setBackground(null);
+
+ tree.setCellRenderer(null);
+ }
+
+ public void uninstallUI(JComponent c)
+ {
+ uninstallDefaults((JTree) c);
+ }
+
+ public Dimension getPreferredSize(JComponent c)
+ {
+ return new Dimension(200,200);
+ }
+
+ protected void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf)
+ {
+ Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree,
+ leaf,
+ false, // selected
+ false, // expanded
+ true, // leaf
+ 0, // row
+ false // hasFocus
+ );
+ g.translate(x, y);
+ c.paint(g);
+ g.translate(-x, -y);
+ }
+
+ protected void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf)
+ {
+ Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree,
+ nonLeaf,
+ false, // selected
+ false, // expanded
+ false, // leaf
+ 0, // row
+ false // hasFocus
+ );
+ g.translate(x, y);
+ c.paint(g);
+ g.translate(-x, -y);
+ }
+
+ protected int paintRecursive(Graphics g,
+ int indentation,
+ int descent,
+ int childNumber,
+ int depth,
+ JTree tree,
+ TreeModel mod,
+ Object curr)
+ {
+ Rectangle clip = g.getClipBounds();
+ if (indentation > clip.x + clip.width + rightChildIndent ||
+ descent > clip.y + clip.height + rowHeight)
+ return descent;
+
+
+ int halfHeight = rowHeight / 2;
+ int halfWidth = rightChildIndent / 2;
+ int y0 = descent + halfHeight;
+
+ if (mod.isLeaf(curr))
+ {
+ paintLeaf(g, indentation, descent, tree, curr);
+ descent += rowHeight;
+ }
+ else
+ {
+ if (depth > 0 || tree.isRootVisible())
+ {
+ paintNonLeaf(g, indentation, descent, tree, curr);
+ descent += rowHeight;
+ y0 += halfHeight;
+ }
+ int max = mod.getChildCount(curr);
+ for (int i = 0; i < max; ++i)
+ {
+ g.setColor(hashColor);
+ g.drawLine(indentation + halfWidth, descent + halfHeight,
+ indentation + rightChildIndent, descent + halfHeight);
+ descent = paintRecursive(g,
+ indentation + rightChildIndent, descent,
+ i, depth+1,
+ tree, mod, mod.getChild(curr, i));
+ }
+ }
+
+ int y1 = descent - halfHeight;
+ if (y0 != y1)
+ {
+ g.setColor(hashColor);
+ g.drawLine(indentation + halfWidth, y0,
+ indentation + halfWidth, y1);
+ }
+
+ return descent;
+ }
+
+ public void paint(Graphics g, JComponent c)
+ {
+ JTree tree = (JTree) c;
+ TreeModel mod = tree.getModel();
+ g.translate(10, 10);
+ paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot());
+ g.translate(-10, -10);
+ }
}
diff --git a/libjava/javax/swing/plaf/basic/BasicViewportUI.java b/libjava/javax/swing/plaf/basic/BasicViewportUI.java
index feefacaae9b..1e0421b025f 100644
--- a/libjava/javax/swing/plaf/basic/BasicViewportUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicViewportUI.java
@@ -1,4 +1,4 @@
-/* BasicViewportUI.java
+/* BasicViewportUI.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,6 +45,7 @@ import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.image.ImageObserver;
+
import javax.swing.JComponent;
import javax.swing.JViewport;
import javax.swing.ViewportLayout;
@@ -119,17 +120,16 @@ public class BasicViewportUI extends ViewportUI
}
public void paint(Graphics g, JComponent c)
- {
-
- JViewport v = (JViewport)c;
- Component view = v.getView();
+ {
+ JViewport port = (JViewport)c;
+ Component view = port.getView();
if (view == null)
return;
- Point pos = v.getViewPosition();
+ Point pos = port.getViewPosition();
Rectangle viewBounds = view.getBounds();
- Rectangle portBounds = v.getBounds();
+ Rectangle portBounds = port.getBounds();
if (viewBounds.width == 0
|| viewBounds.height == 0
@@ -137,6 +137,51 @@ public class BasicViewportUI extends ViewportUI
|| portBounds.height == 0)
return;
+ switch (port.getScrollMode())
+ {
+
+ case JViewport.BACKINGSTORE_SCROLL_MODE:
+ paintBackingStore(g, port, view, pos, viewBounds, portBounds);
+ break;
+
+ case JViewport.BLIT_SCROLL_MODE:
+ // FIXME: implement separate blit mode
+
+ case JViewport.SIMPLE_SCROLL_MODE:
+ default:
+ paintSimple(g, port, view, pos, viewBounds, portBounds);
+ break;
+ }
+ }
+
+ private void paintSimple(Graphics g,
+ JViewport v,
+ Component view,
+ Point pos,
+ Rectangle viewBounds,
+ Rectangle portBounds)
+ {
+ Rectangle oldClip = g.getClipBounds ();
+ g.setClip (oldClip.intersection (viewBounds));
+ g.translate (-pos.x, -pos.y);
+ try
+ {
+ view.paint(g);
+ }
+ finally
+ {
+ g.translate (pos.x, pos.y);
+ g.setClip (oldClip);
+ }
+ }
+
+ private void paintBackingStore(Graphics g,
+ JViewport v,
+ Component view,
+ Point pos,
+ Rectangle viewBounds,
+ Rectangle portBounds)
+ {
if (backingStoreImage == null
|| backingStoreWidth != viewBounds.width
|| backingStoreHeight != viewBounds.height)
@@ -148,18 +193,17 @@ public class BasicViewportUI extends ViewportUI
Graphics g2 = backingStoreImage.getGraphics();
-
- if (c.getBackground() != null)
+ if (v.getBackground() != null)
{
// fill the backing store background
java.awt.Color save = g2.getColor();
- g2.setColor(c.getBackground());
+ g2.setColor(v.getBackground());
g2.fillRect (0, 0, backingStoreWidth, backingStoreHeight);
g2.setColor(save);
// fill the viewport background
save = g.getColor();
- g.setColor(c.getBackground());
+ g.setColor(v.getBackground());
g.fillRect (0, 0, portBounds.width, portBounds.height);
g.setColor(save);
diff --git a/libjava/javax/swing/plaf/basic/ComboPopup.java b/libjava/javax/swing/plaf/basic/ComboPopup.java
index d4ef1f2e598..4cd518df5a5 100644
--- a/libjava/javax/swing/plaf/basic/ComboPopup.java
+++ b/libjava/javax/swing/plaf/basic/ComboPopup.java
@@ -1,4 +1,4 @@
-/* ComboPopup.java
+/* ComboPopup.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,14 +35,14 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
-import javax.swing.JList;
+import javax.swing.JList;
public interface ComboPopup
{
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
index 20becaf7ec8..fb6f27b88c1 100644
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -43,7 +43,9 @@ import javax.swing.UIDefaults;
import javax.swing.plaf.basic.BasicLookAndFeel;
public class MetalLookAndFeel extends BasicLookAndFeel
- {
+{
+ private static final long serialVersionUID = 6680646159193457980L;
+
public boolean isNativeLookAndFeel() { return true; }
public boolean isSupportedLookAndFeel() { return true; }
public String getDescription() { return "Metal look and feel"; }