summaryrefslogtreecommitdiff
path: root/javax
Commit message (Collapse)AuthorAgeFilesLines
* 2006-12-05 Roman Kennke <kennke@aicas.com>Mark Wielaard2006-12-0819-210/+1113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/ImageView.java (imageUpdate): Use spans field to determine if the CSS width/height are set. Call safePreferenceChanged to protect view structure from threading issues. (spans): Made package private. (ImageView): Initialize loadOnDemand with false. (loadImage): Call Toolkit.prepareImage() to make sure we have our Observer registered. (safePreferenceChanged): New helper method. Calls preferenceChanged in a thread safe environment. 2006-12-05 Roman Kennke <kennke@aicas.com> * NEWS: Add entry about improved HTML support. 2006-12-05 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/ImageView.java (ImageView): Initialize spans array here. (setPropertiesFromAttributes): Moved init of spans array to constructor. 2006-12-05 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/BlockView.java (painter): Made package visible. * javax/swing/text/html/StyleSheet.java (translateBorder): New helper method. (translateHTMLToCSS): Add mappings for border attributes. * javax/swing/text/html/TableView.java Made class subclass of BlockView to get CSS goodness. (CellView.rowSpan): New field. (CellView.setPropertiesFromAttributes): Fetch rowspan. (RowView.overlap): New field. (RowView.rowIndex): New field. (RowView.layoutMajorAxis): Skip overlapping cells. (RowView.layoutMinorAxis): Layout cells that span more than 1 row. (numColumns): New field. (tmpRect): New field. (TableView): Initialize tmpRect. (calculateColumnRequirements): Adjusted and fixed for multirows. (getAlignment): Overridden to center tables. (paint): Overridden to fix clipping. (getStyleSheet): Made protected. (layoutMajorAxis): Invalidate rows. (setPropertiesFromAttributes): Made protected and call super. (updateGrid): Update the overlapping information for multirows. 2006-12-05 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/HTMLEditorKit.java (HTMLFactory.create): Removed debug output. * javax/swing/text/html/InlineView.java (getBreakWeight): Likewise. * javax/swing/text/html/StyleSheet.java (addRule): Likewise. (ListPainter.paint): Removed debug output. 2006-12-06 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/BlockView.java (getAlignment): Align blocks horizontally by the superclass. * javax/swing/text/html/HTMLEditorKit.java (HTMLFactory.create): Replace equals comparison by == for efficiency. Add mapping for misplaced tr, td and th tags. Include object mapping. * javax/swing/text/html/TableView.java (RowView.replace): Invalidate grid early. (gridValid): Initialize with false. (create): Only create RowView and CellView for correctly placed tags. Avoid unnecessary casts. (getAlignment): Removed. (replace): Invalidate grid early. 2006-12-06 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/TableView.java (RowView.layoutMajorAxis): Check column index for invalid value. (updateGrid): Check column index for invalid value. 2006-12-06 Roman Kennke <kennke@aicas.com> * javax/swing/JEditorPane.java (getStream): Buffer the stream for efficiency. (setPage): Don't scroll the view at this point. * javax/swing/plaf/basic/BasicTextUI.java (RootView.paint): Call RootView's setSize to get synchronization. (RootView.setSize): Synchronize to prevent race in layout code. * javax/swing/text/AbstractDocument.java (notifyListeners): New field. (fireChangedUpdate): Track notifyListener field. (fireRemoveUpdate): Track notifyListener field. (fireIndertUpdate): Track notifyListener field. (writeLock): Check notifyListener and throw IllegalStateException. * javax/swing/text/View.java (preferenceChanged): Create local var for better thread safety and more efficiency. 2006-12-06 Roman Kennke <kennke@aicas.com> * examples/gnu/classpath/examples/icons/back.png, * examples/gnu/classpath/examples/icons/reload.png: New icons for the HTML browser. * examples/gnu/classpath/examples/swing/HtmlDemo.java (history): New field. Manages the browsing history. (HtmlDemo): Initialize history. (createContent): Set location and add history. Add toolbar. (createToolBar): New helper method. (main): Make default size bigger. * examples/gnu/classpath/examples/swing/frame1.html, * examples/gnu/classpath/examples/swing/frame2.html, * examples/gnu/classpath/examples/swing/frame3.html, * examples/gnu/classpath/examples/swing/frame4.html, * examples/gnu/classpath/examples/swing/frames.html, * examples/gnu/classpath/examples/swing/tables.html: New example pages. * examples/gnu/classpath/examples/swing/welcome.html Add a couple of links and new test pages. 2006-12-06 Roman Kennke <kennke@aicas.com> * examples/gnu/classpath/examples/swing/Demo.java (getIcon): Made package private. * examples/gnu/classpath/examples/swing/HtmlDemo.java (hyperlinkUpdate): Convert URL to string. 2006-12-06 Roman Kennke <kennke@aicas.com> * javax/swing/text/DefaultCaret.java (appear): Adjust visibility here. (setDotImpl): Don't adjust visibility here. (moveDotImpl): Don't adjust visibility here. 2006-12-06 Roman Kennke <kennke@aicas.com> * javax/swing/text/html/FormView.java (SubmitThread.postData): Implemented. (SubmitThread.run): Pass data to postData(). (actionPerformed): Reset form when reset button is activated. (createComponent): Add support for select lists and comboboxes. Don't set value of text and password fields here, this is done now in HTMLDocument for consistency. (getElementFormData): Add support for fetching form data from select lists and comboboxes as well as textareas. (getSelectData): New helper method. Fetches form data from select boxes. (getTextAreaData): New helper method. Fetches form data from textareas. (resetForm): New helper method. Resets the entire form. * javax/swing/text/html/HTMLDocument.java (HTMLReader.FormAction.end): Handle SELECT and OPTION tags. (HTMLReader.FormAction.start): Handle SELECT and OPTION tags. (HTMLReader.FormAction.setModel): Initialize text and password values here. Also, use the resetable special models. Group radio buttons into ButtonGroup for exclusive selection. (HTMLReader.FormTagAction): New class. Handles FORM tags. (HTMLReader.buttonGroups): New field. (HTMLReader.numOptions): New field. (HTMLReader.option): New field. (HTMLReader.selectModel): New field. (HTMLReader.textAreaDocument): Make ResetablePlainDocument. (HTMLReader.handleText): Handle OPTION text. (HTMLReader.initTags): Map FORM tags to FormTagAction. (HTMLReader.textAreaContent): Set initial content. * javax/swing/text/html/Option.java (Option): Make copy of attribute set. Initialize selected state. (getValue): Fetch value from attribute set. * javax/swing/text/html/ResetableModel.java: New interface. * javax/swing/text/html/ResetablePlainDocument.java: New class. Supports resetting the state. * javax/swing/text/html/ResetableToggleButtonModel.java: Likewise. * javax/swing/text/html/SelectComboBoxModel.java: Likewise. * javax/swing/text/html/SelectListModel.java: Likewise. 2006-12-06 Roman Kennke <kennke@aicas.com> * examples/gnu/classpath/examples/swing/BrowserEditorKit.java: New class. * examples/gnu/classpath/examples/swing/HtmlDemo.java (LoadActionListener): Call setPage() helper method. (createContent): Register tweaked editor kit. For FormSubmitEvents call submitForm(), otherwise setPage(). (postData): Helper method for posting form data. (setPage): Helper method for navigating to a new URL. (submitForm): Helper method for submitting a form. * examples/gnu/classpath/examples/swing/forms.html: Added text/password fields and select boxes. * examples/gnu/classpath/examples/swing/welcome.html: Fixed typo. 2006-12-07 Mark Wielaard <mark@klomp.org> * java/net/URL.java (URL(URL,String,URLStreamHandler,boolean)): New private constructor. (URL(URL,String,URLStreamHandler)): Call new constructor. (URL(URL,String)): Likewise. (URL(String)): Likewise. 2006-12-07 Mark Wielaard <mark@klomp.org> * javax/swing/JEditorPane.java (createEditorKitForContentType): Always load from system class loader.
* 2006-12-06 Ben Konrath <bkonrath@redhat.com>Mark Wielaard2006-12-082-1/+102
| | | | | | | | | | | | | | | | | | | | | | | | | Fixes PR 29853. * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and newValue are the same. * gnu/xml/dom/DomNode.java: Set parent if null during mutation. 2006-12-06 Chris Burdess <dog@gnu.org> Fixes PR 29272. * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc. * gnu/xml/stream/SAXParser.java: Fix file descriptor leak. 2006-12-06 Chris Burdess <dog@gnu.org> Fixes PR 29264. * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in writeDTD method. 2006-12-056 Chris Burdess <dog@gnu.org> Fixes PR 28816. * javax/xml/validation/SchemaFactory.java: Use correct algorithm to discover schema factory implementation class.
* * javax/swing/text/html/CSS.java (parseMarginShorthand):Mark Wielaard2006-12-051-1/+0
| | | | Remove debug output.
* 2006-12-04 Roman Kennke <kennke@aicas.com>Mark Wielaard2006-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/BoxView.java (paint): Replaced painting algorithm with more simple and more reliable painting of the box. * javax/swing/text/html/BlockView.java (PositionInfo): New inner class. Stores additional CSS positioning information. (positionInfo): New field. (BlockView): Initialize positionInfo field. (fetchLayoutInfo): New helper method. Fetches additional CSS positioning information. (layoutMajorAxis): Perform additional CSS layout. (layoutMinorAxis): Perform additional CSS layout. (positionView): New helper method. (replace): Overridden to fetch additional layout information. * javax/swing/text/html/CSS.java (Attribute.POSITION): New field. (Attribute.LEFT): New field. (Attribute.RIGHT): New field. (Attribute.TOP): New field. (Attribute.BOTTOM): New field. (getValue): Create Length for left, right, top and bottom attributes. 2006-12-04 Roman Kennke <kennke@aicas.com> * gnu/javax/swing/text/html/parser/support/Parser.java (Sgml): Consume any whitespace that immediately follows and sgml insertion. (parseDocument): Consume any initial whitespace.
* * javax/swing/text/html/CSS.java (parseMarginShorthand):Mark Wielaard2006-12-041-1/+0
| | | | Remove debug output.
* 2006-12-04 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-041-1/+174
| | | | | | | * javax/swing/text/GlyphView.java (J2DGlyphPainter): New inner class. (checkPainter): For Java2D capable environments create a J2DGlyphPainter.
* 2006-12-04 Andrew John Hughes <gnu_andrew@member.fsf.org>Andrew John Hughes2006-12-041-3/+3
| | | | | | | | | | | * gnu/java/lang/management/BeanImpl.java: (translate(String)): Don't assume the list uses "E", just use the first and only type variable. * java/lang/management/ManagementFactory.java: (getPlatformMBeanServer()): Register logging bean. * javax/management/openmbean/OpenType.java: (OpenType(String,String,String)): Actually use the string created to handle arrays.
* 2006-12-04 Andrew John Hughes <gnu_andrew@member.fsf.org>Andrew John Hughes2006-12-041-0/+405
| | | | | | | | | | | * gnu/javax/management/Server.java: Make map final and initialise it. (unregisterMBean(ObjectName)): Match against delegate's object name and not the instance. * java/lang/management/ManagementFactory.java: Added constant fields. (getPlatformMBeanServer()): Implemented. * javax/management/MBeanServerFactory.java: New file.
* 2006-12-04 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-033-85/+270
| | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/BoxView.java (paint): Replaced painting algorithm with more simple and more reliable painting of the box. * javax/swing/text/html/BlockView.java (PositionInfo): New inner class. Stores additional CSS positioning information. (positionInfo): New field. (BlockView): Initialize positionInfo field. (fetchLayoutInfo): New helper method. Fetches additional CSS positioning information. (layoutMajorAxis): Perform additional CSS layout. (layoutMinorAxis): Perform additional CSS layout. (positionView): New helper method. (replace): Overridden to fetch additional layout information. * javax/swing/text/html/CSS.java (Attribute.POSITION): New field. (Attribute.LEFT): New field. (Attribute.RIGHT): New field. (Attribute.TOP): New field. (Attribute.BOTTOM): New field. (getValue): Create Length for left, right, top and bottom attributes.
* * javax/swing/JEditorPane.java (PageLoader.in): Made a PageStream.Mark Wielaard2006-12-031-28/+19
| | | | | | | | | (PageLoader.page): Made package local. (PageLoader.run): Don't reset loader. (PageLoader.cancel): New method. (loading): Renamed to loader. (getPage): Return loader.page. (setPage): Always set loader. Never reset to null.
* * javax/swing/plaf/basic/BasicTreeUI.java (paint): Check whetherMark Wielaard2006-12-031-8/+14
| | | | | path[k] is null. (isLastChild): Return false when path is null.
* 2006-12-02 Andrew John Hughes <gnu_andrew@member.fsf.org>Andrew John Hughes2006-12-021-0/+102
| | | | * javax/management/MBeanServerBuilder.java: New file.
* 2006-12-01 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-016-26/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/HTML.java (Attribute.DYNAMIC_CLASS): New field. (Attribute.PSEUDO_CLASS): New field. * javax/swing/text/html/HTMLDocument.java (HTMLReader.CharacterAction.start): Initialize anchor with link pseudo attribute. (updateSpecialClass): New helper method. Updates the dynamic or pseudo class for anchor tags. * javax/swing/text/html/HTMLEditorKit.java (LinkController.lastAnchorElement): New field. For tracking enter/exit of anchors. (LinkController.activateLink): Set pseudo class to 'visited'. (LinkController.mouseMoved): Added support for tracking the 'hover' dynamic class. * javax/swing/text/html/InlineView.java (changedUpdate): Fetch new properties. * javax/swing/text/html/StyleSheet.java (attributeSetToMap): New helper method. (getRule): Also append dynamic and pseudo class to key. (resolveStyle): Resolve style based generally on all attributes. * javax/swing/text/html/TableView.java (RowView.layoutMajorAxis): Make sure the grid is valid. (updateGrid): Made package private. * gnu/javax/swing/text/html/css/Selector.java (calculateSpecificity): Added support for dynamic and pseudo classes. (matches): Changed to operate on general attributes. Added support for dynamic and pseudo classes.
* 2006-12-01 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-012-20/+186
| | | | | | | | | | | | | | | | | | | | | | | | * gnu/javax/swing/text/html/css/BorderStyle.java: New class for handling border styles. * gnu/javax/swing/text/html/css/BorderWidth.java (isValid): New method. * gnu/javax/swing/text/html/css/Length.java (isValid): New method. * javax/swing/text/html/CSS.java (addInternal): Added shorthand parsing for border, padding and margin. (parseBackgroundShorthand): Added API docs. (parsePaddingShorthand): New method. Handles padding shorthand values. (parseMarginShorthand): New method. Handles margin shorthand values. (parseBorderShorthand): New method. Handles border shorthand values. * javax/swing/text/html/StyleSheet.java (translateHTMLToCSS): Set specific padding attributes. (BoxPainter.BoxPainter): Don't handle PADDING and MARGIN here. These shorthands are now handled in CSS. (BoxPainter.paint): Exclude the outer margin.
* 2006-11-30 Roman Kennke <kennke@aicas.com>Roman Kennke2006-12-017-80/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/javax/swing/text/html/css/Length.java (emBase): New field. (exBase): New field. (isFontEMRelative): New field. (isFontEXRelative): New field. (Length): Recognize and setup EM and EX relative values. (getValue): Handle EM and EX relative values. (isEMRelative): New method. (isEXRelative): New method. (setEMBase): New method. (setEXBase): New method. (setFontBases): New method. * gnu/javax/swing/text/html/parser/support/Parser.java (_handleEmptyTag): Use new isBlock() helper method. (_handleEndTag_remaining): Use new isBlock() helper method. (_handleStartTag): Consume whitespace after block start tag. (Comment): Consume whitespace after a comment. (isBlock): New helper method. (readAttributes): Consider all characters in unquoted attribute values. * javax/swing/text/html/BlockView.java (layoutMinorAxis): Use cached span value. (paint): Added debug code (commented out). (setPropertiesFromAttributes): Set the EM and EX base on lengths. * javax/swing/text/html/CSSBorder.java (CSSBorder): Take StyleSheet as argument. Call getBorderWidth() with stylesheet. (getBorderWidth): Set the EM and EX base on the length values. * javax/swing/text/html/HTMLDocument.java (HTMLReader.ParagraphAction.end): Do not set the inParagraph field. (HTMLReader.ParagraphAction.start): Do not set the inParagraph field. (HTMLReader.inImpliedParagraph): Removed. (HTMLReader.inParagraph): Removed. (HTMLReader.parseStack): New field. (HTMLReader.addContent): Use new paragraph handling. (HTMLReader.addSpecialElement): Use new paragraph handling. (HTMLReader.blockClose): Use new paragraph handling. (HTMLReader.blockOpen): Use new paragraph handling. (HTMLReader.inImpliedParagraph): New helper method. (HTMLReader.inParagraph): New helper method. * javax/swing/text/html/ImageView.java (attributes): New field. Caches view attributes. (spans): New field. Caches CSS spans. (getAttributes): Correctly setup CSS view attributes. (getPreferredSpan): Use caches spans. (getStyleSheet): Use the view's getDocument() method. (setPropertiesFromAttributes): Cache spans and setup EM and EX. (updateSize): Use cached spans. * javax/swing/text/html/ParagraphView.java (setPropertiesFromAttributes): Setup EM and EX. * javax/swing/text/html/StyleSheet.java (BoxPainter.BoxPainter): Setup EM and EX correctly. (getEMBase): New helper method. (getEXBase): New helper method. * javax/swing/text/html/TableView.java (width): New field. Caches the table width. (calculateMinorAxisRequirements): Use caches span. (setPropertiesFromAttributes): Cache span and setup EM/EX. (updateGrid): Correctly setup EM/EX.
* 2006-11-30 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-305-24/+834
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/FormSubmitEvent.java: New class. * javax/swing/text/html/FormView.java (SubmitThread): New class for submitting data in a separate thread. (actionPerformed): Fetch the actual for data. (addData): New helper method. (getElementFormData): New helper method. (getFormData): New helper method. (getInputFormData): New helper method. (submitData): Implemented. * javax/swing/text/html/FrameView.java (createComponent): Add this as hyperlink listener. Set the target document as frame document. (getTopEditorPane): New helper method. (hyperlinkUpdate): Implementation of the HyperlinkListener interface. (handleHyperlinkEvent): New helper method. (handleFormSubmitEvent): New helper method. * javax/swing/text/html/HTMLDocument.java (HTMLReader.BaseAction.start): Track the base target. (HTMLReader.BaseAction.end): Removed. (baseTarget): New field. (frameDocument): New field. (getBaseTarget): New property accessor. (isFrameDocument): New property accessor. (processHTMLFrameHyperlinkEvent): Implemented. (setFrameDocument): New property accessor. (updateFrame): New helper method. (updateFrameSet): New helper method. * javax/swing/text/html/HTMLEditorKit.java (LinkController.createHyperlinkEvent): Handle frame documents. (autoFormSubmission): New field. (HTMLEditorKit): Set autoFormSubmission to true. (isAutoFormSubmission): New property accessor. (setAutoFormSubmission): New property accessor.
* 2006-11-30 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-301-56/+147
| | | | | | | | | | | | | | | | | | * javax/swing/text/ElementIterator.java (ElementRef): New inner class. (currentDepth): Removed. (currentElement): Removed. (previousItem): Removed. (stack): New field. Holds the iteration stack. (state): Removed. (ElementIterator(Document)): Removed init of removed fields. (ElementIterator(Element)): Removed init of removed fields. (current): Changed to stack based algorithm. (deepestLeaf): New helper method. (depth): Changed to stack based algorithm. (first): Changed to stack based algorithm. (next): Changed to stack based algorithm. (previous): Changed to stack based algorithm.
* 2006-11-30 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-304-6/+382
| | | | | | | | | | | | | * javax/swing/text/html/FrameSetView.java: New class. Implements HTML framesets. * javax/swing/text/html/FrameView.java: New class. Implements HTML frames. * javax/swing/text/html/HTMLDocument.java: (HTMLReader.addSpecialElement): Only add one artificial space. * javax/swing/text/html/HTMLEditorKit.java (HTMLFactory.create): Uncomment code for FrameSetView and FrameView. * gnu/javax/swing/text/html/parser/support/Parser.java (_handleEmptyTag): Also consume whitespace after frame tags.
* 2006-11-29 David Gilbert <david.gilbert@object-refinery.com>David Gilbert2006-11-291-28/+32
| | | | | | * javax/swing/plaf/metal/MetalIconFactory.java (HorizontalSliderThumbIcon.paintIcon()): Commented out gradient paint, (VerticalSliderThumbIcon.paintIcon()): Likewise.
* 2006-11-28 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-281-1/+6
| | | | | | * javax/swing/JComponent.java (putClientProperty): Do not fire event when both old and new value are == null.
* 2006-11-25 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-251-15/+24
| | | | | | | * javax/swing/text/GapContent.java (getPositionsInRange): Rewritten to use the more efficient binary search searchFirst() and avoid an NPE that was caused by GC'ed positions.
* * javax/swing/text/CompositeView.java (modelToView): Never returnMark Wielaard2006-11-251-5/+5
| | | | null.
* * javax/swing/text/html/TableView.java (calculateColumnRequirements):Mark Wielaard2006-11-251-6/+18
| | | | | Check whether rowView instanceof RowView. (updateGrid): Likewise.
* * javax/swing/text/html/StyleSheet.java (paint): Guard againstMark Wielaard2006-11-251-3/+6
| | | | getChildAllocation() returning null.
* 2006-11-22 Tania Bento <tbento@redhat.com>Tania Bento2006-11-221-3/+9
| | | | | | * javax/swing/JRootPane.java (setLayeredPane): Added documentation; throw IllegalComponentStateException if layered pane parameter is null.
* 2006-11-20 Tania Bento <tbento@redhat.com>Tania Bento2006-11-201-0/+4
| | | | | | * javax/swing/ButtonGroup.java: (setSelected): Select the ButtonModel if all conditions are met.
* 2006-11-20 Tania Bento <tbento@redhat.com>Tania Bento2006-11-201-1/+1
| | | | | * javax/swing/JSlider.java: (updateLabelUIs): Removed casting.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-33/+37
| | | | | | | | | | | * javax/swing/text/html/StyleSheet.java (linked): New field. (styleSheet): Replaced by linked. (addStyleSheet): Use an arraylist for simplicity. (getRule): Removed useless instantiation. (getStyleSheets): Convert array list to array. (removeStyleSheet): Use an arraylist for simplicity. (resolveStyle): Include styles from linked lists.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-207-89/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/BoxView.java (BoxView): Initialize with invalid req's. (forwardUpdate): Trigger repaint when children changed the major axis. (getResizeWeight): Return resizable when the pref differs from the min or the pref differs from the max size. (layoutMajorAxis): Actually sum up the preferred sizes. (paint): Made binary search more robust. (replace): Let arrays shrink when needed. (replaceLayoutArray): Let arrays shrink when needed. (setAxis): Trigger preferenceChanged. * javax/swing/text/CompositeView.java (getInsideAllocation): Call insets method to take account of overriding subclasses. * javax/swing/text/DefaultStyledDocument.java (ElementBuffer.finishEdit): Clear the stack and edits buffer. (ElementBuffer.insertUpdate): Only remove the found element, not all. * javax/swing/text/GlyphView.java (insertUpdate): Pass null in preferenceChanged. (removeUpdate): Pass null in preferenceChanged. (changedUpdate): Pass null in preferenceChanged. * javax/swing/text/Utilities.java (drawTabbedText): Avoid single calls to charWidth() and instead call charsWidth() on whole chunks. * javax/swing/text/html/HTMLDocument.java (BlockElement.getName): Fall back to super when necessary. (RunElement.getName): Fall back to super when necessary. (HTMLReader.MAX_THRESHOLD): New constant field. (HTMLReader.GROW_THRESHOLD): New constant field. (HTMLReader.theshold): New field. (HTMLReader.HTMLReader): Fetch threshold from document. (HTMLReader.addContent): Sucessivly grow the threshold. (createLeafElement): Don't create two elemens and don't set attribute. * javax/swing/text/html/TableView.java (RowView.replace): Invalidate grid. (gridValid): Made package private. (layoutMinorAxis): Mark all rows as invalid. (replace): Invalidate grid.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-87/+116
| | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/AbstractDocument.java (DefaultDocumentEvent.changes): Changed to be a HashMap. (DefaultDocumentEvent.modified): Made private. (DefaultDocumentEvent.THRESHOLD): New constant field. (DefaultDocumentEvent.DefaultDocumentEvent): Don't initialize changes table. (DefaultDocumentEvent.addEdit): Switch to hashmap only when exceeding threshold. (DefaultDocumentEvent.getChange): Use iterative approach when we have no hashmap yet. (documentCV): Removed. (numWriters): Renamed from numWritersWaiting. (createPosition): Reformat. (getCurrentWriter): Synchronized. (readLock): Implement more straightforward. (readUnlock): Implement more straightforward. (writeLock): Implement more straightforward. (writeUnlock): Implement more straightforward. (remove): Write-lock here. (removeImpl): Don't write-lock here.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-0/+1
| | | | | * javax/swing/JEditorPane.java (setPage): Set priority on loading thread.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-10/+52
| | | | | | | | | | | | * javax/swing/plaf/basic/BasicTextUI.java (RootView.paint): Avoid allocation. (cachedInsets): New field. Caches an Insets instance. (getNextVisualPositionFrom): Read-lock the document to avoid thread nastiness. Push allocation. (getPreferredSize): Push fake allocation when not yet laid out. (getVisibleEditorRect): Use cached insets. (viewToModel): Read-lock the document to avoid thread nastiness. Push allocation.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-7/+15
| | | | | | | | | | | * javax/swing/text/StyleContext.java (attributeSetPool): Synchronize this map. (addAttribute): Synchronize this method. (addAttributes: Synchronize this method. (readObject): Install synchronized map on target object. (removeAttribute): Synchronize this method. (removeAttributes): Synchronize this method. (removeAttributes): Synchronize this method.
* 2006-11-20 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-201-232/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/GapContent.java (GapContentPosition.GapContentPosition): Removed constructor. (Mark): Made subclass of WeakReference to refer directly to the associated position. (Mark.refCount): Removed. (Mark.Mark(int,GapContentPosition,ReferenceQueue): New constructor. Used to reference a position and register the reference queue. (Mark.Mark(index)): Call super and don't adjust mark offset. (Mark.compareTo): Removed. (Mark.equals): Removed. (Mark.getOffset): Return at least null. Removed assert. (Mark.getPosition): New helper method. (garbageMarks): New field. (positions): Removed. (searchMark): New field. (GapContent): Removed init of positions map. (addImpl): New helper method. (adjustPositionsInRange): Removed. (compare): New helper method. (createPosition): Rewritten for new datastructures. This now performs a much more efficient binary search for finding a position at the requested offste. (garbageCollect): Rewritten to collect unused marks. (getPositionsInRange): Adjusted for new data structures. (removeImpl): New helper method. (replace): Use new addImpl() and removeImpl() helper method for correctly adjusting the positions and gap. (search): Rewritten. Implements a more suitable binary search. (searchFirst): New helper method. (setPositionsInRange): Removed. (shiftEnd): Update the marks here. (shiftGap): Update the marks here. (shiftGapEndUp): Update the marks here. (shiftGapStartDown): Update the marks here.
* 2006-11-19 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-195-51/+302
| | | | | | | | | | | | | | | | | | | | | | | * javax/swing/JEditorPane.java (PageStream): New inner class. (PageLoader): New inner class. (loading): New field. (setPage): Implemented asynchronous loading. * javax/swing/text/DefaultStyledDocument.java (ElementBuffer.create): New helper method. (create): Use new ElementBuffer method instead of hack. * javax/swing/text/html/HTMLDocument.java (HTMLReader.flushImpl): New helper method. (HTMLReader.addContent): Use flushImpl(). (HTMLReader.blockClose): Added null check. (HTMLReader.flush): Use flushImpl(). * javax/swing/text/html/HTMLEditorKit.java (createDefaultDocument): Set load priority to 4 and token threshold to 100. * javax/swing/text/html/TableView.java (insertUpdate): Overridden to provide correct view factory. (removeUpdate): Overridden to provide correct view factory. (changedUpdate): Overridden to provide correct view factory.
* 2006-11-19 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-193-108/+198
| | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/BoxView.java (clipRect): New field. (tmpRect): New field. (layout): Reorganized code. Now uses layoutAxis() helper method. (layoutAxis): New helper method. (paint): Optimized by using cached Rectangle objects and a binary search for child views inside the clip. * javax/swing/text/CompositeView.java (insideAllocation): Made private and initialized in constructor. (getInsideAllocation): Removed initialization block for insideAllocation field. Avoid unnecessary allocations. * javax/swing/text/GlyphView.java (DefaultGlyphPainter.paint): Only paint the actual glyphs here The remaining stuff (background, underline and striking) is done in the GlpyhView itself. Avoid unnecessary allocations. (cached): A cached Segment instance. (getText): Return cached segment. (paint): Paint underline, strike and background here. Avoid unecessary allocs.
* 2006-11-19 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-191-3/+35
| | | | | | | | * javax/swing/text/html/StyleSheet.java (getFontSize): Removed debug output. (ListPainter.tmpRect): New field. (ListPainter.paint): Align bullet vertically centered to the first line of the paragraph.
* 2006-11-18 Andrew John Hughes <gnu_andrew@member.fsf.org>Andrew John Hughes2006-11-183-0/+762
| | | | | | | | | * gnu/javax/management/Server.java: Initial implementation of a GNU management server. * javax/management/MBeanPermission.java, * javax/management/MBeanRegistration.java, * javax/management/MBeanTrustPermission.java: Implemented.
* 2006-11-17 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-172-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/javax/swing/text/html/css/CSSParser.java (parseDeclaration): Trim string before reporting. * gnu/javax/swing/text/html/css/FontSize.java (size): New field. (isRelative): New field. (sizeIndex): New field. (FontSize): Initialize new fields. (getValue): Changed to call getValue(int). (getValue(int)): New method. Implements relative font sizes. (isRelative): New method. (mapAbsolute): Store index. (mapEM): New helper method. (mapLarger): New helper method. (mapPercent): New helper method. (mapRelative): New helper method. (mapSmaller): New helper method. (mapValue): New helper method. * javax/swing/text/html/CSS.java (parseBackgroundShorthand): Create CSSColor directly. * javax/swing/text/html/StyleSheet.java (addRule): Invalidate resolved styles. (getFont): Call new getFontSize() method to resolve relative font sizes. (getFontSize): New helper method. Resolves relative font sizes. (translateHTMLToCSS): Create CSS objects directly.
* 2006-11-16 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-162-13/+36
| | | | | | | | | | | | | | | | | | | * gnu/javax/swing/text/html/css/CSSParser.java (parseRuleset): Support 'combined' selectors. (main): Adapt callback for combined selectors support. * gnu/javax/swing/text/html/css/CSSParserCallback.java (startStatement): Take selector array as argument, to support combined selectors. * javax/swing/text/html/BlockView.java (calculateMinorAxisRequirements): Fetch and apply alignment. * javax/swing/text/html/StyleSheet.java (CSSStyle): Inverted the constants for correct precedence. (CSSStyleSheetParserCallback.styles): New field. Stores the current styles. (CSSStyleSheetParserCallback.style): Removed. (CSSStyleSheetParserCallback.declaration): Update multiple styles. (CSSStyleSheetParserCallback.end): Push multiple styles. (CSSStyleSheetParserCallback.start): Initialize multiple styles.
* 2006-11-16 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-164-75/+57
| | | | | | | | | | | | | | | | | | | | | * javax/swing/text/FlowView.java (LogicalView.getPreferredSpan): Calculate maximum correctly. * javax/swing/text/GlyphView.java (tabExpander): New field. (tabX): New field. (breakView): Set tabX on broken view. (getPartialSpan): Let the painter fetch the span. (getTabbedSpan): Update the tab expander field. Maybe trigger relayout. (getTabExpander): Simply return the stored expander. * javax/swing/text/Utilities.java (getTabbedTextOffset): Made algoritm a little smarter and more efficient. (getTabbedTextWidth): Don't add single char widths, instead add chunks of characters. * javax/swing/text/html/ParagraphView.java (calculateMinorAxisRequirements): Adjust margin only when the CSS span is not fixed.
* 2006-11-15 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-151-28/+166
| | | | | | | | | | | | | * javax/swing/text/html/HTMLEditorKit.java (InsertHTMLTextAction.actionPerformed): Also try inserting the alternate tag. Adjust the selection accordingly. (InsertHTMLTextAction.adjustSelection): New helper method. Adjusts the selection after an insertion. (insertAtBoundary): Delegate to deprecated method. (insertAtBoundry): Implemented missing method. (tryInsert): New helper method. (defaultActions): Implemented to fill the array with a couple of InsertHTMLTextActions.
* 2006-11-15 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-151-95/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/ImageView.java (Observer): New class. Observes image loading. (haveHeight): New field. (haveWidth): New field. (height): New field. (width): New field. (image): New field. (imageIcon): New field. (loading): New field. (observer): New field. (reloadImage): New field. (reloadProperties): New field. (ImageView): Initialize observer and some flags. (getImage): Update the image state and return the image. (loadImage): New helper method. Actually starts loading. (paint): Rewritten to paint the image directly, not via Icon. (reloadImage): Rewritten. Loads the image and its properties. (renderIcon): Removed. No more necessary. (setPropertiesFromAttributes): Don't nullify image here. Added comment about missing impl. (setSize): Added comment about missing impl. (updateSize): New helper method. Updates the size attributes. (updateState): New helper method. Makes sure the image and its properties are valid.
* 2006-11-15 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-151-23/+3
| | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/HTMLDocument.java (HTMLReader.ParagraphAction.end): Call super instead of blockClose() directly. (HTMLReader.ParagraphAction.start): Call super instead of blockOpen() directly. (HTMLReader.parseStack): Removed. (HTMLReader.blockClose): Simply call addContent() with ' ' instead of doing more complicated stuff. Removed parseStack handling. (HTMLReader.blockOpen): Removed parseStack handling. (getInsertingReader): Removed parseStack init. * gnu/javax/swing/text/html/parser/htmlValidator.java (closeTag): Return true only when the tag actually should be closed. * gnu/javax/swing/text/html/parser/support/Parser.java (_handleEndTag): Only actually close the tag when the validator allows it.
* 2006-11-15 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-153-10/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * javax/swing/text/html/CSS.java (Attribute.BORDER_SPACING): New field for the CSS border-spacing attribute. * javax/swing/text/html/StyleSheet.java (BoxPainter.bottomPadding): New field. (BoxPainter.leftPadding): New field. (BoxPainter.rightPadding): New field. (BoxPainter.topPadding): New field. (BoxPainter.BoxPainter): Fetch the MARGIN and PADDING* attributes too. (BoxPainter.getInset): Recognize and include the padding. (translateHTMLToCSS): Added mapping for CELLPADDING and CELLSPACING. javax/swing/text/html/TableView.java (RowView.calculateMajorAxisRequirements): Adjust req's for cellSpacing. (RowView.layoutMajorAxis): Adjust multi-column span for cellSpacing. (cellSpacing): New field. (columnRequirements): Made package private to avoid accessor method. (calculateMinorAxisRequirements): Include cellSpacing. (calculateMajorAxisRequirements): Overridden to include cellSpacing. (layoutMajorAxis): Likewise. (layoutColumns): Respect cellSpacing. (setParent): Overridden to fetch the CSS attributes when view gets connected. (setPropertiesFromAttributes): New method. Fetches the cell spacing from the CSS attributes.
* 2006-11-14 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-142-8/+36
| | | | | | | | | | | | | | | | | | * javax/swing/text/html/ImageView.java (getPreferredSpan): Use CSS length values. * javax/swing/text/html/TableView.java (CellView.calculateMajorAxisRequirements): Overridden to set the maximum reqs to maximum. (RowView.getMaximumSize): For the X_AXIS, set the maximum span to maximum. (RowView.getMinimumSpan): Overridden. For the X_AXIS, return the total column reqs. (RowView.getPreferredSpan): Overridden. For the X_AXIS, return the total column reqs. * gnu/javax/swing/text/html/css/CSSColor.java (convertValue): Catch NumberFormatExceptions for more robustness. * gnu/javax/swing/text/html/css/FontSize.java (mapPixels): Actually map px values. Catch NFE for more robustness.
* 2006-11-14 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-141-2/+6
| | | | | | * javax/swing/RepaintManager.java (RepaintManager): Fetch the default state for the double buffering from a system property gnu.swing.doublebuffering.
* 2006-11-11 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-115-16/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/javax/swing/text/html/css/CSSColor.java (isValidColor): New helper method. Checks strings if they form a valid color value. * gnu/javax/swing/text/html/css/Length.java (Length): Catch number format exceptions. * javax/swing/text/html/CSS.java (addInternal): New method. Checks for shorthand CSS attributes and parses them. (parseBackgroundShorthand): New method. Parses the background shorthand attribute. * javax/swing/text/html/HTMLDocument.java (HTMLReader.LinkAction): Made class a subclass of HiddenAction. (HTMLReader.LinkAction.start): Implemented to load the linked stylesheet. (HTMLReader.LinkAction.end): Removed. This is not needed. * javax/swing/text/html/StyleSheet.java (CSSStyleSheetParserCallback.declaration): Push declaration through CSS.addInternal() to parse shorthand attributes. (addCSSAttribute): Push declaration through CSS.addInternal() to parse shorthand attributes. (importStyleSheet): Implemented. This adds a stylesheet from an URL. * javax/swing/text/html/TableView.java (calculateColumnRequirements): Increase column index for non CellView children to avoid endless loop. * javax/swing/text/CompositeView.java (setParent): Comparen with numChildren not with real arraylength.
* 2006-11-10 Roman Kennke <kennke@aicas.com>Roman Kennke2006-11-101-4/+6
| | | | | * javax/swing/text/View.java (updateLayout): Only repaint when needed.
* 2006-11-10 David Fu <fchoong@netbeans.jp>Roman Kennke2006-11-101-46/+4
| | | | | | | | * javax/swing/text/html/HTMLWriter.java (traverse): Removed Classpath specific handling of implied tags. (traverseHtmlFragment): Removed Classpath specific handling of implied tags.