Sitemap

Amicuk Programming Answers

How to position things based on the size of Text widget

-0001-11-30   Views:0

Advertisement

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do? Text t = new Text("Hello"); t.setTextOrigin(VPos.BASELINE); I was thinking of doing something like: t.setTranslateX(-width/2.0); But I c

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do?
Text t = new Text("Hello");
t.setTextOrigin(VPos.BASELINE);
I was thinking of doing something like:
t.setTranslateX(-width/2.0);
But I can't get the width. Text does not have a "width" property!
How do I know what X coordinate corresponds to the center of the Text node?
Font doesn't have any methods for computing bounds of characters or strings
EDIT....
As usually I think I've found a way a couple seconds after posting...
text.prefWidth(-1) appears to return a reasonable value.
EDIT #2...
Looked reasonable but isn't right. So far I've had to wrap the Text in a Pane just so I can bind to the width of the Pane. That seems like jumping through too many hoops.
Edited by: swpalmer on Dec 19, 2011 11:41 AM

The replay answer
Advertisement
Well, you can not create dependencies like this, but you could use nested master pages. You would still need 30 master pages for 30 chapters, in order to place the chapter number in different positions, but you
would only need one or two main master pages for the rest of master page content. That would make it at least easier to change something on all master pages at once.

Go to See the other 2 answers

How to position things based on the size of Text widget

Category:DefaultRelease time:-0001-11-30Views:130

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do? Text t = new Text("Hello"); t.setTextOrigin(VPos.BASELINE); I was thinking of doing something like: t.setTranslateX(-width/2.0); But I c[More]

RandomAccessFile date position changed  while increasing font size of text

Category:DefaultRelease time:-0001-11-30Views:130

i have created RandomAccessFile and write data in a specific locations using seek() in it but problem is when i changed font size of that file data position is changed please anybody can guide me how can i solve it.fonts have nothing to do with rando[More]

Photo Gallery w/ Images adjusting size based on Browser size.

Category:DefaultRelease time:2015-10-11Views:130

I'm new to web design but I'm trying to create a photo gallery with images that dynamically size based on the size of the browser window. Similar to this http://pageduke.com/#/Residential/Colonial%20Revival-Nashville1/1. I know th is a flsh site, but[More]

Creating fonts based on pixels size

Category:DefaultRelease time:2015-10-11Views:130

Hi i'am still a java beginner and i am switching from .NET so anyone can help on how can I create a font based on Pixels size rather than Point SizeYou can translate between points size and pixels size using the DPI: http://java.sun.com/products/java[More]

How to pick the multiples based on file size

Category:DefaultRelease time:2015-10-11Views:130

Hi All, my sender file adapter needs to pick up 5 files based on file size. for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb. here my requirement is, my file adapter needs to pick in the b[More]

Set font size based on component size

Category:DefaultRelease time:-0001-11-30Views:130

Hi everybody, This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a[More]

Set maximum size in Text Form Field Options for a field in bi publisher RTF

Category:DefaultRelease time:2015-10-11Views:130

Hi All, How to set maximum size in Text Form Field Options for a field in bi publisher RTF. I have a RTF whch is having a field in that i need to add some validation condition but after adding certain condition in Add help text tab ,it is not accepti[More]

When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box, for a specific area on the page...instead of it going on in one straight long line...?

Category:DefaultRelease time:2015-10-11Views:130

When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box on a specific area of the page...instead of the text box going on in one straight long line....? I'm not seeing there's an option or ability to do so, j[More]

How to increase the size of text boxes in FCPX without stretching the text inside?

Category:DefaultRelease time:2015-10-11Views:130

How to increase the size of text boxes in FCPX without stretching the text inside?There are two basic Title formats - I should say Layouts - available:  Text (plain) and Paragraph.  (The plain text version usually does not appear with the blue dot co[More]

How to change the font size of text and case in smartforms

Category:DefaultRelease time:2015-10-11Views:130

hi,    could any one explain how to change the font size of text in smartforms. ex. previously i had taken P4 left aligned and C6 but now i want to decrease the font without making it bold. pl......... guide me    secondly the value which are coming[More]

How to change the font size of text element in smartform

Category:DefaultRelease time:2015-10-11Views:130

Hi i want to know how to change the font size of text element in smartform regards GincyHi You can create Smartstyles, in which you can define paragraph formats for texts and character formats for character level changes. Paragraph format ---> alignm[More]

Hot
I was running 3.6.21 and auto upgrade took me to 3.6.22 my weather gadget from the uk met office was working. When Firefox came up it showed me V6.0.2. I installed it but as the weather gadget wasn't supported at this level I downgraded back to 3.6.2 [More]
I want to modify the logic in Oracle Apps (both Oracle self-service (pure HTML and JSP) and Oracle Forms applications) to make real-time calls to a mainframe system. The page needs to take different actions depending on the data from the mainframe sy [More]
Hi My (early 2008) Mac Pro recently froze and wouldn't boot from the HD. I managed to start it once from a Snow Leopard install disc and carry out a disk repair on the HD. Now it won't boot from the HD or the install disc. When I try to boot it from [More]
Hello, I have problem with Canon LPB 6670, while printing both sides the paper is jammed every timeFirst clarify this statement... I captured video, and when I went on FCP and did log and capture, it said the camcorder was offline.<</div> Have yo [More]
Hi, I'm working on a report which contains charts (stacked area chart). The data being reported on is samples taken every 5 minutes for a month so there are many elements. CR is writing the X-axis data labels bunched together so they're unreadable. I [More]
Hi, I have a requirement to Conver the Dats from format: YYYYMMDD into the Format : MM/DD/YYYY. Can you  please suggest me a suitabble Standard Function Module if exists? If not please suggest me a solution for this data conversion. Thanks, Rajan.SAH [More]
Hi, Dreamweaver creates a "Connections" folder in the site root where all database connection files are stored. I want to move this folder to another path but then DW can't find the connection (for example in admin/includes/Connections). How can [More]
Is there a feature in cs5 where I can convert images (monochrome) to a halftone pattern ready for printing on a litho press?Photoshop's Help turns this up: http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7966a.h tml [More]
Can SQL*Plus reports be automated to run at certain days/times? Thxcall sqlreport in .ksh file then put ksh file in jobfile as follows. 0 1 * * 1-5 sqlrep.ksh crontab jobfile now crontab run jobfile job every Monday-Friday at 1am.Read other 6 answers [More]
Hello Everyone I am looking at a 600Mhz Logic Board from an iMac g3 DV I found on eBay for my 350Mhz iMac G3. Is it possible to swap them? Also, is there any documentation from Apple or somewhere on the internet that explains the process of swapping [More]