Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8337287: Update image in javax.swing.text.Document.insert #20376

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Jul 29, 2024

This changeset updates the image in the documentation for the Document.insert method. The image in Document.remove was updated by JDK-4622866 in PR #15701.

Now the illustration of inserting looks similar to removing. The new image is in SVG format.

For reference:

As in the case with remove, I marked up to classes and members with {@code}.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8337287: Update image in javax.swing.text.Document.insert (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20376/head:pull/20376
$ git checkout pull/20376

Update a local copy of the PR:
$ git checkout pull/20376
$ git pull https://git.openjdk.org/jdk.git pull/20376/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20376

View PR using the GUI difftool:
$ git pr show -t 20376

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20376.diff

Webrev

Link to Webrev Comment

Replace the image which illustrates insertion of a string
from GIF format to SVG.
Mark up class and method references with {@code}.
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 29, 2024

👋 Welcome back aivanov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 29, 2024

@aivanov-jdk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8337287: Update image in javax.swing.text.Document.insert

Reviewed-by: serb, prr, abhiscxk

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1038 new commits pushed to the master branch:

  • 8591109: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning
  • 0784011: 8340488: Clarify LocaleServiceProvider deployment on application module path
  • 4dcc7f3: 8337536: AArch64: Enable BTI branch protection for runtime part
  • 28252bb: 8341444: Unnecessary check for JSRs in CDS
  • 8174cbd: 8341978: Improve JButton/bug4490179.java
  • 9201e9f: 8342409: [s390x] C1 unwind_handler fails to unlock synchronized methods with LM_MONITOR
  • 0963b9e: 8341664: ReferenceClassDescImpl cache internalName
  • c51a086: 8339694: ciTypeFlow does not correctly handle unresolved constant dynamic of array type
  • 7f4ed50: 8341020: Error handler crashes when Metaspace is not fully initialized
  • f50bd0d: 8341513: Remove the unused thread_type field from OSThread
  • ... and 1028 more: https://git.openjdk.org/jdk/compare/5ff7c57f9ff5428ef3d2aedd7e860bb1e8ff29ea...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 29, 2024
@openjdk
Copy link

openjdk bot commented Jul 29, 2024

@aivanov-jdk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented Jul 29, 2024

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 29, 2024
@aivanov-jdk
Copy link
Member Author

@prrace Does it make sense to add a sentence which describes the image? I added one for remove to explain all the Positions in the removed area are collapsed.

Inserting a string is more straightforward: all the Positions at and after the insertion point are moved by the length of the inserted string.

@prrace
Copy link
Contributor

prrace commented Aug 23, 2024

@prrace Does it make sense to add a sentence which describes the image? I added one for remove to explain all the Positions in the removed area are collapsed.

Inserting a string is more straightforward: all the Positions at and after the insertion point are moved by the length of the inserted string.

I missed this question. Yes, sure.

@mrserb
Copy link
Member

mrserb commented Aug 24, 2024

Just curious why the chars are not in the middle of the boxes?

@aivanov-jdk
Copy link
Member Author

aivanov-jdk commented Sep 16, 2024

Just curious why the chars are not in the middle of the boxes?

They're aligned according to CSS rules:

            text-anchor: middle;
            dominant-baseline: middle;

The text is positioned in the middle of the box -0.5 pixels.

However, I agree the text looks visually unbalanced. Indeed, at 200% scale and Arial font, there are 6 pixels on top of ‘T’ and ‘h’, but there are 8 pixels on the bottom of ‘q’. If I use Calibri font, the values are 8 and 9 pixels correspondingly. So it depends on the font used. The situation is similar on macOS.

@aivanov-jdk
Copy link
Member Author

The text is positioned in the middle of the box -0.5 pixels.

Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side.

This needs to be done for the image in remove too, so I'd rather do that separately, at a later time.

At this time, the diagrams for insertString and remove look the same.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 22, 2024
@aivanov-jdk
Copy link
Member Author

Just curious why the chars are not in the middle of the boxes?

The text is positioned in the middle of the box -0.5 pixels.

Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side.

This needs to be done for the image in remove too, so I'd rather do that separately, at a later time.

Submitted JDK-8340580: Characters in Document diagrams not in the middle.

@aivanov-jdk
Copy link
Member Author

Does it make sense to add a sentence which describes the image? I added one for remove to explain all the Positions in the removed area are collapsed.

I missed this question. Yes, sure.

@prrace I updated the PR with an example, look for “For example, if the document contains the text…”.

@aivanov-jdk
Copy link
Member Author

aivanov-jdk commented Sep 30, 2024

@mrserb Do you have any other questions?

I'll update the position of text in Document-insert.svg and Document-remove.svg separately after this PR is integrated.

@aivanov-jdk
Copy link
Member Author

Pinging… Do you, @prrace and @mrserb, have any additional comments?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants