Dynamic sizing

I'm working on a spinner control, similar to JSpinner under Swing. It should look like this: < value >
Two arrows and a value in between.
The whole control thing I've got setup ok, I'm having trouble with the painting. The spinner is constructed of three nodes: Arrow, Label, Arrow held together in a GridPane.
          // the layout
          GridPane lGridPane = new GridPane();
          // left arrow
          Arrow lLeftArrow = new Arrow(true);
          lGridPane.add(lLeftArrow, 0, 0);
          // for showing the value
          Label lValueLabel = new Label("test");
          lGridPane.add(lValueLabel, 1, 0);
          // right arrow
          Arrow lRightArrow = new Arrow(true);
          lGridPane.add(lRightArrow, 2, 0);
          // add to self
          getChildren().add(lGridPane); // TODO: use GridPane but get the CSS layout to work
     }The Arrow naturally is a single class with a rotation and transform to get the left pointing or right pointing version. Something like this:
     class Arrow extends Region
          public Arrow(boolean left)
                    Line line = new Line();
                    line.setStartX(0.0f);
                    line.setStartY(0.0f);
                    line.setEndX(10.0f);
                    line.setEndY(10.0f);
                    getChildren().add(line);
                    Line line = new Line();
                    line.setStartX(10.0f);
                    line.setStartY(10.0f);
                    line.setEndX(0.0f);
                    line.setEndY(20.0f);
                    getChildren().add(line);
               // optionally rotate 180
               if (left)
                    this.getTransforms().add(new Translate(10, 20));
                    this.getTransforms().add(Transform.rotate(180, 0, 0));
     }My question is: the styling of the label is done in CSS, so I do not know how large the font will be. How do I bind the height and width of the Arrow to the size of the outside container?
The GridLayout makes the Arrow now the same height as the label, so I've tried different bindings, like
Bindings.add(line.endYProperty(), this.heightProperty().multiply(0.5));But with no succes.

But I don't know how to dynamically size the RAW buffer. Any advice gratefully received.The only way (I can think of) that you can dynamically declare length, precision, or scale for a PL/SQL variable is to do within an anonymous PL/SQL block of Native Dynamic SQL.
Doing this is probably more of a headache than it is worth - very impractical to code/debug/maintain/scale.
Michael

Similar Messages

  • Dynamic sizing of a component to fit the content

    Hi All,
    How can I make my component so that it will be dynamically sized to fit the content height?  I would like to create a component that will have a variable height.  It has a serious of user input controls.  Depending on the answers given, more input from the user may be necessary--specifically, they will have to provide an explanation in a textbox.
    So, my thinking is that I don't want to display the textbox unless they answer "yes" to any questions that require additional explanation.  If they do, then I want display the TextArea control along with instructions to enter an additional explanation here.
    However, when I do that, it will cause my component's height to grow.  I don't want to reserve space for that textbox in the component's dimensions--I would prefer it simply grow (pushing anything below it further down) if and when the textbox appears.
    How would I go about doing this?
      -Josh

    I think the standard JSF solution would be not to do the create/delete of inputs on the client side, but to do it on the server side.
    If that is not your cup of tea, I think that the standard components will not be sufficient. So you are looking at either not binding the inputs to a component and just getting the values via the request parameters or creating a custom component capable of dealing with this.

  • Creating dynamic sized arrays and filling them automatically on speedy 33

    hi all,
    I am trying to create dynamic sized arrays on Speedy-33. Specifically, depending on the user input, I want to be able to create
    arrays with 128 or 256 elements and fill them automatically. However,
    array constant element is fixed for Speedy 33; thus I have to manually set the
    size of the array with the mouse and enter the values in to the array by
    myself. I want to make this tedious process automatic. Would this be possible? thanks so much for comments!
    ~casiopea

    Casiopea,
    There is a really great article on using arrays with LabVIEW DSC which can be found here:
    How Can I Be Successful With Arrays In the LabVIEW DSP Module?
    One of the biggest things that should be noted about DSP is that there is no dynamic memory allocation.  Your array size must be fixed, and thus, your array needs to be initialized by using a constant. 
    An easy way to initialize an array constant that has many elements that are all the same is to simply create a numeric constant that has the value that you want.  Then, create a new blank array constant and drag the numeric into it.  In the index input for the array constant, type in the index of the last element that you want to be initialized.  Then type in the value in the element that is displayed and all of the elements before it will be initialized to the default value of the numeric constant that you dropped into the array constant.  I hope this helps.  I would really recommend reading through that article, as it has a lot of great information about using arrays with DSC.
    Brian Coalson
    Software Engineer
    National Instruments

  • Dynamic sizing of RAW datatype

    Hi All,
    I want to read BLOBs out of a table using the DBMS_LOB package
    I would like to do something like...
    my_blob_length := DBMS_LOB.GETLENGTH(my_blob);
    DECLARE
    my_buffer RAW(my_blob_length); -- this is the bit I'm stuck with ;-)
    DBMS_LOB.READ(my_blob, my_blob_length, 0, my_buffer);
    But I don't know how to dynamically size the RAW buffer. Any advice gratefully received.
    Cheers,
    Ewan

    But I don't know how to dynamically size the RAW buffer. Any advice gratefully received.The only way (I can think of) that you can dynamically declare length, precision, or scale for a PL/SQL variable is to do within an anonymous PL/SQL block of Native Dynamic SQL.
    Doing this is probably more of a headache than it is worth - very impractical to code/debug/maintain/scale.
    Michael

  • Smart forms - Dynamic sizing of the windows.

    Hi gurus, iam working on smartforms, i have a problem.
    My requirement is: Printing a table data on the smart form. Is the window which prints this table data is resized with the amount of table data, if so, what is the procedure i should follow for to print this data in the window.
    Please give me the steps to go with the above issue. iam new to smartforms. what is the size of the window i should give in the Form painter and what all the attributes i should declare.
    Plz give a detailed explanation..
    Regards,
    chaitanya

    Hi Chaitanya.
    I would like to suggest a few references,
    [SDN - Reference for Smart form - setting dynamic window height  |Smart form-setting dynamic window height;
    [SDN Library - Standard Reference - Dynamic Window Height - SMARTFORM Tutorial|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d937ec90-0201-0010-0ca8-b6cb3b6dd1ef]
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • Dynamic sizing of Column Width

    Is there a way that the table columns can be dynamically adjusted widthwise in an RTF template ? I do not want my $Total to wrap around.

    Try doing the calcualations in-line. getButtonWidth() is a
    function, and thus hard to bind to.
    <mx:Button id="submitButton" label="SQL"
    width="{15/100*summaryPanel.width}" textAlign="center"/>
    Since summaryPanel.width is reference directly in the
    binding, the compiler will automatically adjust the button's width
    for you whenever summaryPanel's width changes.

  • Dynamically Sized JSPs

    Hello:
    I'm looking for some information in regard to...
    What is the equivalent of Struts DynaForms in regular JSP?
    I have developed an application using Struts - where I use DynaForms, Indexed Properties and such on a JSP - and we are having a problem trying to run that app in our production env which uses iPlanet.
    So, I'm looking for an alternative to achieve the same functionality without using DynaForms (i.e.) construct a dynamically sizeable JSP based on DB results, (e.g.) a JSP displaying a class' student list with ability to edit the data shown.
    Since I'm new to this technology, I do not know how this can be achieved.
    Any pointers/ideas please...
    Thanks in advance.

    I am not able to clearly get ur problem, Is that u r trying to get a indexed property from the JSP and ur not able to handle it with struts????
    Can u be more specific with the piece of code and the error.......
    -Bala

  • Dynamically sizing a group of textfields based on font size

    Hi,
    I have made a UI control which contains a bunch of TextFields representing the members of an Array. I draw these un a list like in a combo box's drop down. Currently I hard code the height of the TextFields, iterate through the Array and position the TextFields by adding the hard coded height each time. Simple enough.
    But now I would like to put the control in another place where I must use smaller text. So I would like to make the thing general so I can resuse it whenever I want, simply by applying a new TextFormat. My problem is that I want to still be able to position the TextFields accurately regardless of the font size used in the TextFormat. I have tried just creating the TextField, applying the TextFormat, setting the text, and then trying to read the TextField's height, but alas this does not work.
    Can anyone please tell me what the best way is to find each TextField's height so that I can build my list?
    Thanks!

    You can check to see if the (maxscroll >1)== true (text extends beyond visible area), and if it is, then set size smaller,

  • ThreadPoolExecutor with dynamic sizing

    ExecutorService executor = new
    ThreadPoolExecutor(1, 5, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());with the above piece of code in our application, the number of processor/active threads doesn't go above 1.
    when i analyzed the behavior with a profiling tool, i see that there is no more free time for the single thread to process the runnable tasks. In this case why doesn't the executor let one (or more) threads to work on the runnables that are piling up the queue and then (later when the queue is nearing empty) shutdown the extra threads (after waiting for the given 10 seconds).
    or i got the concept wrong?

    Let's answer a few of your questions:
    kramasundar wrote:
    1. How (using which metric/statistics) does the executor decide that it has to create a new thread (say the second or third or fourth or fifth thread)?
    currently i am looking into the JDK implementation to figure this out.The executors don't use any statistics or metrics. It is quite simple, and defined in the API: ThreadPoolExecutor
    1) If the number of threads is less than the corePoolSize, create a new Thread to run a new task
    2) If the number of threads is equal (or greater than) the corePoolSize, put the task into the queue
    3) If the queue is filled, and the number of threads is less than the maxPoolSize, create a new thread to run tasks in.
    4) If the queue is filled, and the number of threads is greater than or equal to maxPoolSize, reject the task.
    kramasundar wrote:
    I didn't know the magic behind the SynchronousQueue. ...
    In the case of LinkedBlockingQueue we dont have to care about the size issue right?There is no magic. With SynchronousQueue, the queue has no capacity. which means the queue is 'always filled' which means new threads will be created up through the maxPoolSize. Then, when new tasks get added, if there isn't an idle thread they get rejected.
    For the LinkedBlockingQueue, the queue is unbounded, it never gets filled. Which means new threads will ONLY be created up through the corePoolSize, after which all your tasks get queued up. This is important in your case because you keep using a corePoolSize of 1 with an unbounded queue - so no more than 1 thread will be used.
    kramasundar wrote:
    2. Here the executor created 1 thread only. Also i could see that one thread was not enough to handle the load. The throughput was ~ 4000 TPS (i am telling you this since the next run 3 runs fine with higher TPS).
    _executor = new ThreadPoolExecutor(1, 20, 60, TimeUnit.SECONDS,
    new ArrayBlockingQueue<Runnable>(100), new SimpleThreadFactory());3. Here the executor created 15 threads (but not more). Nevertheless the TPS is higher ~12000 TPS. This run confirms that in run 2 Executor could have spawned some more threads to increase the TPS.
    _executor = new ThreadPoolExecutor(15, 20, 60, TimeUnit.SECONDS,
    new ArrayBlockingQueue<Runnable>(100), new SimpleThreadFactory());Does the above runs conclude that in run 2 a queue of size 100 is never full. If it had been full atleast once then the executor would have spawned another thread?First: "This run confirms that in run 2 Executor could have spawned some more threads to increase the TPS."
    No, this confirms that you could configure the executor to run more threads. The executor can't do more than what it is configured to do. It can't spawn new threads to increase your metric of speed, it can only create threads following its own, well defined set of rules.
    Now, " Does the above runs conclude that in run 2 a queue of size 100 is never full. If it had been full atleast once then the executor would have spawned another thread?"
    That is the conclusion I would make, yes. As Kajbj said, otherwise you would see rejected executions.

  • Dynamic sizing of chart?

    I am using CR 2008 and I have a pretty simple sub-report where I have a text field and three value fields in the details section.  I have two group headers, one of which is a fake group header with group labels (GH1a) to act as the page header.  The other group header (GH1b) has a horizontal side by side bar chart.  The text field is the "On Change of" field.  One of the value fields, which is a variance of the other two value fields and is suppressed in the details section, is the "Show values" field.  This section has the "Underlay Following Sections" checkbox checked.
    My question is, the details section can have a varying number of records that come back.  From 1 to at least 20.  Can I have the horizontal bar for each detail come back along side of the detail that it represents?  Right now my chart always comes back the size that it is in Design mode.
    Thanks for any and all help.

    It doesn't look to be an option. All of the size option of the chart object are grayed out.
    Add your feature suggestion to the Idea place.

  • Dynamic sizing of buttons

    I am working on a flex application where I want the button
    sizes to appear based on the size of the browser window and the
    resolution of the screen so I don't want to hard code the width of
    the buttons.
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    But when I change it to:-
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="20%" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="820%" textAlign="center"/>
    It doesnt seem to work.
    Now if I change it to
    <mx:Button id="submitButton" label="SQL"
    width="{getButtonWidth()}" textAlign="center"/>
    and have a function:-
    private function getButtonWidth():int{
    var w:int = 15/100*summaryPanel.width;
    return w;
    where summaryPanel is a container holding the buttons, thats
    failing as well since in this case the summaryPanel.width always
    turns out to be zero at the time when the button sizes are
    calculated. What else can I do and how can I work around it?

    Try doing the calcualations in-line. getButtonWidth() is a
    function, and thus hard to bind to.
    <mx:Button id="submitButton" label="SQL"
    width="{15/100*summaryPanel.width}" textAlign="center"/>
    Since summaryPanel.width is reference directly in the
    binding, the compiler will automatically adjust the button's width
    for you whenever summaryPanel's width changes.

  • Dynamically sizing the flash window

    I would like to be able to run my Flash at 600 X 600 until it
    ends then change it to 100 X 100.
    Is this possible? If so how do I do it?
    I apologize if this is in the wrong section.

    Have flash call the javascript that resizes it on the html
    page. This is a weird request so it will probably require some
    crazy javascript on the html page to resize the swf. I have seen
    the ability to change to full screen, so it seems possible.

  • SGA dynamic or not ?

    Hi Forum,
    when is SGA dynamic ? One SAP note says that the use of parameter db_cache_size make SGA dynamically sizing its buffers. Others say that parameter sga_target
    <> 0 decides on dynamic or not. If db_cache_size is set but sga_target is 0, what does this mean ?
    Kind regards
    hakort

    DB_CACHE_SIZE itself is a dynamic parameter. Even if you mention SGA_TARGET as 0, its still can be changed dynamically with alter system command. The dynamic word has been used at several places in oracle docs. By making db_cache_size dynamic, any changes done to it are immediately effected. But this doesn't mean that the entire SGA has become dynamic.
    With dynamic sga(started from 10g onwards), 5 parameters, which are mentioned by Laura are made dynamic and are collectively set by the SGA_TARGET parameter. This leaves the entire SGA over Oracle's discretion that how to allocate/deallocate memory among these parameters. This setting works only when the SGA_TAGET is set to some non-zero value. Once set to 0, Oracle reverts back to the manual SGA where the parameters can be changed by you dynamically but the entire SGA is still controlled by you. By entire SGA I mean the 5 parameters and the other non-dynamic parameters like Log_buffer and so on.
    HTH
    Aman....

  • Dynamically changing windows size

    Hi Folks,
    Is it possible to dynamically change the dimensions of windows i.e. Main and Secondary windows.

    Hi,
    See the fallowing link
    Smart forms - Dynamic sizing of the windows.
    Regards,
    Vijay.

  • Table auto re-sizing issue

    Is it possible to turn-off the auto re-sizing feature of WD table UI element ? Tried setting the width property to px and %...and looks like this does not over-ride the dynamic sizing feature. Even setting the columns to fixed width did not help.
    Any suggestions ??
    Thanks in advance !

    Hi Srikanth,
    Setting the column widths in pixels will help you to restrict the width of the table.But the corresponding celleditor's properties should also be set accordingly. For eg:, if you are using TextView as a celleditor, it's wrapping property should be set to true. If you are using an input field, either it's width has to be set in pixels or the length has to be specified as the no: of characters. Like wise, setting the width for all columns will restrict the table width itself.
    Hope this helps,
    Best Regards,
    Nibu.

Maybe you are looking for