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 just got a new iphone 5C. I am trying to clear my old phone and delete the icloud account. BUT on my old phone in the icloud settings it is still wanting to use an old email account that is no longer active, therefor it wont allow me to sign in and [More]
Is it possible to create a hyperlink (shortcut) in a program, such as excel or word, that when clicked would open a PDF file in adobe (pro in my case) and open that file at a particular bookmark in that file. I couldn't find anything in the help file [More]
I have a user who cannot receive a message from a particular external sender. That senders assistant (same domain and server as the external sender with the issue) is able to forward the exact same message to my user and it arrives as it should. In m [More]
Why can't I save my files in adobe photoshop cc .  It says "write access not granted"...Without system information and other details we can't tell you anything. Generally this is a user privileges/ file permissions issue on your computer, nothin [More]
Is there a better / alternative music player available anywhere for the N97? The default player is poor in my opinion - the player I had on my 2 year old Sony W960 was way ahead of this Nokia product. Simple things like being able to hide artists ass [More]
Hello Guys: Currently I have a requieremnt to clasify the attachments you can upload into SRM transactions (Bid Invitations, Bids and Contracts). It is requiered to identify or load files into diferent sections. Currently when you load files all of t [More]
Hello, since recently I cannot do much with my virtual box archlinux guest. It seems that / is full. On the other hand, this is a dynamically growing volume and it currently has only little more than 1 GB in size, which seems ok to me as it is a head [More]
)? Hi there, i got this problem i got XF-i titanium gamer edition PCI and my new card Auzentech prelude 7. both of themhave same problem on official drivers and Danie_k drivers. If i got more than 3.9gb ram (right now i got 6gb ram) on VIsta 32 and 6 [More]
Hi everyone, I have a situation that I believe is unique and am trying to find a good way to deal with it. I am hoping that someone out there may have a different view on how we might achieve the goal of using our existing collection of extensions an [More]
Hi. Currently I installed Oracle 10g database on fedora core 6... can i connect oracle 6i form with oracle 10g database in fedora core 6.. please guide me.. thanks in advance.. [email protected]Hi, I need some help regarding installation of 10g devel [More]