Bug 121357 - New Editor View Hierarchy
New Editor View Hierarchy
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Painting & Printing
6.x
PC All
: P2 with 29 votes (vote)
: 7.0
Assigned To: Miloslav Metelka
issues@editor
:
: 191986 (view as bug list)
Depends on: 207670
Blocks: 104688 179047 56464 89894 136539 151916 152491
  Show dependency treegraph
 
Reported: 2007-11-07 11:25 UTC by Miloslav Metelka
Modified: 2012-01-24 10:01 UTC (History)
7 users (show)

See Also:
Issue Type: TASK
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2007-11-07 11:25:45 UTC
Replace present view hierarchy consisting of DrawEngineDocView and DrawEngineLineView with a new more efficient view
hierarchy.
Features:
 - Drop rendering through DrawEngine and DrawLayers completely. Only HighlightLayers will be supported.
 - Drop measurements (modelToView() and viewToModel()) through DrawEngine completely. Leaf views will measure naturally
through FontMetrics or GlyphVector.
 - Partial view creation. It should be possible to (re)create views for the visible area only without any considerable
visual glitches (repaint problems, imprecise vertical scrollbar sizes etc.). Horizontal scrollbar increases (once the
visible area encounters a long line) are generally allowed.
 - Uniform line height. The code editors generally do not need variable line height and it's common that highlights
(that might affect line height) get rebuilt completely (e.g. after a document reparse) relatively frequently. There are
 advantages of having the uniform line height - mainly precise vertical scrollbar for partial view creation.
 - Line wrapping - the new view hierarchy should support line wrapping. Vertical scrollbar may be somewhat imprecise due
to this (in combination with partial view creation) but generally there are not many long lines in a typical code.
 - modelToViewY() - certain functionality (e.g. Error stripe or Code folding side bar) only need a offset-to-y
translation and the performance would be improved.
 - Consider change events firing. The Swing's view hierarchy does not fire any events. However there are usecases that
would certainly benefit from that. For example Error stripe (since it cannot recompute its visual marks after each
keystroke) needs to mirror listening for causes that lead to view hierarchy changes i.e. it listens for document
modifications that add/remove lines and it listens on fold hierarchy for fold collapse/expand. If the view hierarchy
would fire events describing its changes this could be eliminated and it should also be more efficient.
 - Limited extensibility. It should be possible to create custom views although there might be certain constraints
imposed on it.
Comment 1 Vitezslav Stejskal 2008-08-20 08:04:16 UTC
See also issue #112464, which may imply some additional work.
Comment 2 chris4beta 2009-09-11 22:18:26 UTC
I'm wondering where this fits into the Netbeans development plans? This has been TBD for almost 2 years, and basic stuff
like adding word wrap depend on it. Any updates?
Comment 3 Vitezslav Stejskal 2009-09-16 14:24:37 UTC
Well, currently we have no plans to implement this in foreseeable future. It's too complicated and risky. We are sorry. 
Comment 4 00kell 2009-09-16 15:19:04 UTC
:-(

Word wrap is a killer feature which depends on this and has a large number of users voting for it (me included!).

Please reconsider. 
Comment 5 chris4beta 2009-09-16 16:59:51 UTC
So then you are saying that word wrap will never happen either?
Comment 6 Miloslav Metelka 2009-09-17 08:45:13 UTC
I work on a new view hierarchy prototype in my spare time but I'm unable to say when it will be ready to be included into a plan.
Comment 7 Miloslav Metelka 2009-11-21 11:13:55 UTC
I'm progressing with the new view hierarchy prototype. Within the next two weeks I will create a branch for further development and testing. Unless there would be any serious problem the new view hierarchy should be present in NB 6.9.
Features:
- Word wrap
- Invisible characters (tabs etc.) marking
- Optimized for frequent rebuilds (due to refreshing of the highlighting information because of reparses).
- No delegation to legacy DrawEngine should improve rendering performance and model<->view performance considerably.
Comment 8 00kell 2009-11-25 04:56:17 UTC
Thank you Miloslav!

I really appreciate you putting your time into this.
Comment 9 chris4beta 2009-11-25 09:46:17 UTC
Yes, thank you so much for working on this!
Comment 10 Vitezslav Stejskal 2009-11-30 01:19:40 UTC
This might be useful - http://wiki.netbeans.org/PrototypesRepo
Comment 11 Miloslav Metelka 2010-03-04 12:39:04 UTC
I have integrated initial version of new view hierarchy supporting line wrap and showing of invisible characters.
Since it's not stable enough yet the new view hierarchy is switched off by default and to turn it on it is necessary to add
  -J-Dorg.netbeans.editor.linewrap=true
to netbeans.conf.
 I continue working on
1) proper handling of '\t' characters.
2) handling of collapsed folds.
3) word-level of wrapping (currently just character-level wrapping is present)
4) performance improvements.

http://hg.netbeans.org/jet-main/rev/656a27790c32
Comment 12 Quality Engineering 2010-03-04 22:13:56 UTC
Integrated into 'main-golden', will be available in build *201003050200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3ed1fede4c1b
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #4619: adding 'Show Non-printable Characters' action to 'View' main menu (note: it's disabled until #121357 is resolved)
Comment 13 Quality Engineering 2010-03-10 23:11:12 UTC
Integrated into 'main-golden', will be available in build *201003110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fc67751824c9
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #121357 - View Hierarchy - proper tab characters displaying and bug fixes.
Comment 14 Quality Engineering 2010-03-16 05:16:13 UTC
Integrated into 'main-golden', will be available in build *201003160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0ec7d94de63b
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #121357 - New Editor View Hierarchy - width recomputation fixes.
Comment 15 Miloslav Metelka 2010-03-18 22:41:10 UTC
After the latest fix http://hg.netbeans.org/jet-main/rev/78eec7471be7
the typing should be relatively stable and the hierarchy could be considered for testing by turning it on by default.
 I've found that rendering of red square box (e.g. during renaming) also needs to be fixed so I'll do that first.
Comment 16 Quality Engineering 2010-03-20 06:32:07 UTC
Integrated into 'main-golden', will be available in build *201003200200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/78eec7471be7
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #121357 - New Editor View Hierarchy - stabilization of insert/remove updates.
Comment 17 Quality Engineering 2010-03-25 05:52:36 UTC
Integrated into 'main-golden', will be available in build *201003250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1f59a06a2795
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #121357 - Editor View Hierarchy - added rectangular highlights.
Comment 18 Jan Jancura 2010-04-06 13:14:06 UTC
fixed by 121357
Comment 19 Jan Jancura 2010-04-06 13:17:02 UTC
mistake
Comment 20 Miloslav Metelka 2010-10-25 09:10:00 UTC
The new view hierarchy is integrated and active and important issues should be resolved in NB7.0 timeframe.
Comment 21 Miloslav Metelka 2011-10-17 10:04:00 UTC
*** Bug 191986 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo