Clipping of SwingLabel

Hi,
does anyone know how to clip SwingLabel or controls in general? I'd like to create a component that displays HTML formatted text. I've got a rectangle that should contain SwingLabel and this SwingLabel has a ScrollBar attached to it. So far, I have problem with clipping of text - it exceeds size of the rectangle. The only way how to avoid it now is to have same color of text and background (scene, stage, node).

Okay, here's what I've got so far. I got the clipping correctly, but there's a bug because I'm getting
Exception in trigger:
com.sun.javafx.runtime.AssignToBoundException: Cannot assign to bound variable
after I resize the rectangle and then try to scroll down the content. Any help with this will be appreciated :)
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.ext.swing.SwingLabel;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.ClipView;
import javafx.scene.input.MouseEvent;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
* @author jiri
var nodeW: Number = 320; var nodeH: Number = 180;
var nodeX: Number = 0; var nodeY: Number = 0;
var contentFont: Font = Font {
    size: 12
var content: SwingLabel = SwingLabel {
    width: bind nodeW - 17, height: 700
    translateX: 5
    foreground: Color.WHITE
    font: contentFont
    text: "<html><head></head><body>"
          "<h2>Bend your Pixels with Flex 4</h2>"
          "<p align=\"justify\">Flex filters make many complex image-processing operations easy. By simply attaching a filter to an object, you can get many different visual effects: glows, shadows, blurs, sharpening, and more. Until Flex 4, though, there was a slight problem with these filters: they were all you got. If you liked the approach of filters, but wanted to apply some custom image-processing algorithm not achievable with the various filter classes that Flex provided, you were out of luck</p>"
          "<p><a href=\"http://www.dredwerkz.cz\">Dr3dweRkZ</a></p>"
          "<p align=\"justify\">In Flex 4, however, you can use a pixel shader with a ShaderFilter to filter your Flex object. A pixel shader is a small program, written using Adobe's Pixel Bender Toolkit. A shader is run for every pixel of an image, computing its resulting value from various input images and parameters.</p>"
          "<p align=\"justify\">The Grayer application lets the user drag the slider back and forth, changing the image from completely grayscale (when the thumb is on the left) to its original color version (when the thumb is on the right). The grayscaler shader used by this Flex application takes an input image and a colorization parameter and produces an image which is a blend of the original image and the grayscale version of that image. The blend is determined by the colorization parameter, where a value of 1 results in the original color image and a value of 0 results in a completely grayscaled image.</p>"
          "<p align=\"justify\">The grayscale calculation is based on a standard formula which combines the red, green, and blue channels of the original image to produce a gray pixel of a similar intensity with the calculation graypixel = red*.11 + green*.33 + blue*.55. The shader works by operating on each pixel of the original image, multiplying it times the grayscale formula to derive the gray version of that pixel, then blending that gray version with the original color pixel in the proportion determined by the colorization parameter.</p>"
          "</body></html>"
var scroll = ScrollBar {
    min: 0
    max: content.boundsInLocal.height
    vertical: true
    height: bind nodeH - 30 //30 is 2 * arcHeight
    translateX: bind nodeW - 12 //default scrollbar width
    translateY: 15
var clip = ClipView {
    clipY: bind scroll.value
    node: content
    pannable: false
    width: bind nodeW - 12
    height: bind nodeH
var node = Rectangle {
    x: bind nodeX, y: bind nodeY
    width: bind nodeW, height: bind nodeH
    arcWidth: 15, arcHeight: 15
    fill: Color.BLACK
    stroke: Color.RED
    strokeWidth: 2
    onMouseDragged: function(drag: MouseEvent): Void {
        if (drag.altDown) {
            nodeX = drag.x;
            nodeY = drag.y
        } else {
            nodeW = drag.sceneX;
            nodeH = drag.sceneY;
var s: Stage = Stage {
    title: "Resizable HTML Node"
    scene: Scene {
        width: 512
        height: 512
        content: [node, clip, scroll]
}

Similar Messages

  • Partner application and web clipping.

    Hi All,
    I am trying to add an external application (say my.yahoo.com) to a webclipping and its throwing the below error in the application log.
    WC-517 : SSL handshake failed with the url ...
    I have checked the file ca-bundle.crt and the certificates are in place. Does anybody know how to go about debugging this problem as I am quite new to portals and at my wits end to solve it.
    Also I would be greatful if anybody can suggest me the steps on adding an Apex application configured as partner application with SSO authentication to a web clipping.There seems to be little or no-documentation at all in this regard(as far as my search goes).
    Thanks in advance
    -Venkat

    I finally got it working by VERY CAREFULLY reading the instructions in the install.txt document in the SSO SDK package. You have to set up the partner application with a new schema in the login server database, and run the regapp.sql script AFTER editing it to insert data from the Login Server Partner Application admin screen. After you register the partner app in Portal, it gives you some info (site token, listener token, encryption key, etc). You have to MANUALLY copy these and paste them into the regapp.sql script, then run the script in the partner app schema. Make sure you don't confuse capital I with numeral 1 (like I did, since Oracle so nicely uses a non-serif font where you can not tell the difference).
    Also make sure you copy the exact values for these parameters into your code when you use the SSOEnabler class. The listener token was very confusing since different documents appear to disagree on whether it should include the partner app name or not. It does require the partner app name:
    app-name:hostname:port
    hostname and port are for the web server that is handling http requests for the login server (usually your main portal web server).
    John H.

  • Loading sound clips in my swing application

    I have searched all the forums, din't find what i want.
    I have many small sound files to be played in my application. Even on mouse Pressed, Drage etc etc....
    Now I was looking for a better way of Loading the Sound files in memory as the application starts.....
    If I use the Clip Interface of javax.sound and initilize them and open a stream, invoke the open() method, and store it in hashmap. So that when ever i need that file i will lookup for that clip and trigger the start() method which actually plays the sound. IS the approach the right approach, will not the Cip object keep the IO handle open, I have nearly 40 Clips to be loaded.
    Can any one suggest me the better way of implementing this.
    TIA
    Zoha

    As far as I know,there is no facility for detecting mouse scrolling wheel in JDK 1.3.
    Check it in the later releases of JDK.

  • Problem with clipping and concerned objects (or rather their color)

    Greeting everyone,
    I hope i don't bother you with things that are already known or, in the end, are a product of my own stupidity ;P
    My problem is the following:
    I was working on a neat design for a list. The first version (without clipping) looked like this:
    [http://www.7pics.info/?image=GHApp-Gradient-Mobile-HowItShouldBe_2c5.jpg]
    As you can see on the bottom, the list was on top of all graphical elements.
    And because this looks stupid, i decide to simply clip the list via "clip: Rectangle{...}".
    Well... turns out it's not as easy as i hoped it would be; all of a sudden the list looks like this:
    [http://www.7pics.info/?image=GHApp-GradientProblem-Mobile-1_fb7.jpg]
    From the left to the right you see the following: first picture is what you'd see initially, from the second to the last i scrolled down one entry each (respectively moved the list up 30 pixels).
    Further scrolling down doesn't change the look, it stays like in the last picture.
    Scrolling up again delivers the same image, but in reverse order.
    The clipping seems to change something in the style of the list elements.
    To be more specific, the gradient of a single element is now applied to the whole list.
    here is a Listing
    //the group which contains the list and the clipping
    Group{
         clip: Rectangle {
              x: 0, y: 70
              width: PublicVars.screenWidth, height: 210
              fill: Color.BLACK        //which color i use doesn't change the look
         content:[
              createChoicesList()
    //create a box for each entry and add text from a string sequence "results"
    createChoicesList():Node[]{
          for(result in results){
                           singleField = Group{
                   Rectangle {
                        fill:  LinearGradient {
                             startX : 0.0
                             startY : 0.0
                             endX : 0.250
                             endY : 0.250
                             stops: [
                                  Stop {
                                       color : Color.LIGHTBLUE
                                       offset: 0.0
                                  Stop {
                                       color : PublicVars.coolGradientBlueTransparent
                                       offset: 0.5
    }I have no clue why this happens. I tried to shift some things around, thinking it had to do something with the order of some elements but... it didn't change anything.
    Another thing i noticed afterwards:
    If i run the App as a desktop program, the gradient effect is all messed up. but this time it doesn't matter if I clip the list or not:
    [http://www.7pics.info/?image=GHApp-GradientProblem-Desktop-1_d5e.jpg]
    The gradients are totally misplaced and if I scroll down they move and appear/disappear randomly across the list entries. sometimes the highlighted elements even look like this:
    [http://www.7pics.info/?image=GHApp-GradientProblem-Desktop-2_89f.jpg]
    Any Ideas?
    P.s.:
    Could it be that retrieving the resolution of a mobile device via
    "var screenWidth = java.lang.Integer.parseInt(FX.getProperty("javafx.screen.width"));"
    isn't very accurate?
    If i use the values i get from this method for the desktop application, the screen will be smaller than in the emulated mobile phone
    Edited by: Mr._Moe on 04.09.2009 21:31

    Not sure about your problem, but I can answer your last question: you can now use the [javafx.stage.Screen|http://java.sun.com/javafx/1.2/docs/api/javafx.stage/javafx.stage.Screen.html] class to get screen dimensions.

  • How can I display & split the audio & video from the same digitized clip?

    I digitized a scene into iMovie that I edited on a professional system which I don't have access to anymore. The whole scene is 1 clip. Now I see a few tweaks that I want to make, so I was hoping to do them in iMovie.
    I want to "pull up" the audio in one section - meaning I want to take cut about 20 frames of audio from the end of a shot, and then move all the other audio up to fill the hole. To compensate for the missing 20 frames, I'll cut video off the head of the next shot. Some call this prelapping. Some call it an L-cut. Some call it asymmetrical trimming. Either way, I can't figure out how to do it in iMovie.
    My clip appears in the timeline as one track - a single track that contains the video and 2 audio tracks. How can I display the audio that's tied to the video on its own track? Then I think I could split audio & video wherever I wanted and trim things up - but I can't figure out how to do it.
    Am I asking too much of this software?
    BTW, I never see the option to "Split audio clip at playhead". I'm not displaying clip volume or waveforms. Choosing to display waveforms doesn't show me anything. Maybe iMovie thinks I'd only want to see waveforms of audio that isn't tied to my video-and-audio clips?
    Thanks in advance for any help...

    Jordon,
    "Am I asking too much of this software?"
    No, you're not.
    You first want to select your clip(s) and choose Advanced>Extract Audio.
    This will copy the audio from the video clip and place it on one of the two separate audio tracks while lowering the audio level to zero in the original video track.
    You can now edit and move the audio independently of the video.
    With the audio clip selected, you'll find you now have access to Edit>Split Selected Audio Clip at Playhead.
    Matt

  • How can I move clips from one library to another? Clips are still in original drive and not in new drive.

    I am using iMovie 10.0.7 on a 1-week old iMac 27" running Yosemite 10.10.2. I migrated from iMovie 9 on a 2008 iMac running Snow Leopard and updated the libraries and events, etc.
    I have two external drives connected via USB. I want to move / consolidate the library and clips from one of the external drives to the new iMac's 3TB fusion drive. This is to make room on the external drive to run Time Machine backups.
    Apple's instructions on managing libraries and moving/copying clips/events tell me to drag to move between libraries and to Option-drag to copy. However, simply dragging only copies. I find that if I Command-drag the events/clips, I can "move" them. But when I look outside iMovie in the Mac OS X Finder, the event folders and clip files themselves are still sitting in the original drive.
    I'm very perplexed as to how to really move the clips and event structure. Should I manually copy the clips and event folder structure outside of iMovie? I worry I will mess up iMovie's internal record keeping and folder structure information.
    Thanks in advance.

    Ahh, Ok. I actually had to go to Lynda.com to watch a training video of this highly bassackwards maneuver, but now I have it. In other words, while the intuitive thing is to make a new event to hold the clip you want and then open the old event and drag the clip into it's new event, the only way to accomplish this maneuver is to NOT create a new event, but rather, go to the clip AFTER the one you want to move, select it and then Right-Click on it and select SPLIT EVENT BEFORE SELECTED CLIP (or go to FILE>SPLIT EVENT BEFORE SELECTED CLIP). Then you wait a few seconds while the program thinks a bit (no feedback it is doing this - just a pause) and then it automatically creates a new event with the clip you wanted. Now just double-click the new event and name it something meaningful.
    Thanks for your help!

  • How to play one clip multiple times at the same time?

    I am writing a little game where a certain sound has to be played quite frequently. I load it as a Clip and play it with
    myClip.setFramePosition(0);
    myClip.loop(0);If the sound has to be played again but is still being played by another event, the setFramePosition() method resets the sound and the first playing instance is cut off.
    A workaround would be that each object that needs to play this sound would get its own copy, but that is not feasible due to heavy memory consumption.
    So here it goes: How can I play a single sound multiple times at the same time? Is that possible?
    Edited by: andrasz on Feb 27, 2009 12:37 AM

    If the sound has to be played again but is still being played by another event, the setFramePosition() method resets the sound and the first playing instance is cut off.
    A workaround would be that each object that needs to play this sound would get its own copy, but that is not feasible due to heavy memory consumption.
    So here it goes: How can I play a single sound multiple times at the same time? Is that possible?Ummmm, if you're using a clip, you'll have to maintain one copy per object that needs to play the sound concurrently. You could keep one master copy, and then create copies of the clip as necessary to play them, and then just dump the copies to decrease memory consumption.
    A second idea would be to write your own Clip class. Esentially, all you would need to do is dump some sound data onto a TargetDataline to play it. It'll handle the buffering and playing at the correct speed itself. If that's all you did, you should be able to dump multiple times from the same instance and play it multiple times.
    Obviously, that's just a theory. In practice, it may not work that way...

  • How can I create a video clip that has multiple copies of the same subject playing at the same time?  Basically like one person became 50 backup dancers!

    Hello Everyone,
    I am trying to create a single video clip where my original subject (dancer) is multiplied on the screen many times.  Basically I am trying to create a background video for a dance team and want to make it look like an army of the same person dancing behind them.  Amy guidance would be great!
    Thanks
    Madisonman 2013

    Motion ($50) can do this with a replicator.
    Russ

  • Managing Family Clips on a Mac - Help - New Mac User

    I am new to the Mac and am looking for the most efficient way to manage my media. I have 300+ files that are in the later stages of being converted to Mp4. All of the files will reside in /Movies/imported.
    What should I do next?
    Should I import everything into iMovie using the "move" option?
    Should I import into Itunes and only import Movies I want to edit or post online. I am assuming this option will give me duplicates.
    I think iPhoto can manage movies thoughts ?
    My goal is to have only one local copy of the files (30+ gig), have access through iTunes, and finally iMovie access to edit and post online without importing and duplicating data.
    Does any of this make sense ? I think I am OCD...
    What would you do with 30gig of family clips?
    null

    Hello Richard,
    I would place all the MPEG4 clips into iPhoto, where you could sort them to subject, year, etc. Then you could make a copy by dragging a clip to your desktop, leaving your original in iPhoto. Work with that copy in iMovie.

  • How do I move multiple clips at once in the project rather than one a time?

    I know how to cut and then paste to move one clip within the project to a new place within the project, but how do I move a group all at once rather than one at a time?

    This did not help and that did not work.  I had already tried that   Holding down either the command key does "highlight" multiple items but then you cannot move those items to a new spot.

  • HT4589 How do I move video clip clip up or down after setting letterbox, i used to be able to do this until i upgraded to 10.0.6

    I used to be able to manually move my video clip up and down in the event the browser using one of the settings. It was a vertical settings that i would use to pull a video clip down after i applied a letterbox to the clip, so I could see the top of the the video clip that got blocked out by the letterbox. Still looking no luck....I used to be able to do this just upgraded to FCPX 10.0.6 now i dont have the setting..

    think i might have solved my own problem the feature is not there i have to upgrade again to 10.0.7...this is getting annoying...

  • How do I sync multiple audio clips to one video clip?

    I have video (with stereo audio from a camera mic), and for each take, there are also four additional mono audio tracks that line up with it. It was footage shot outdoors in the city, so I guess the filmmakers just wanted to have as many options for sound mixing as possible given how much background noise there would be. I have tried selecting the video clip and the four audio clips at once and selecting "synchronize clips," but it doesn't work. It spits out a synchronized clip that seems to have converted two of the mono tracks into one stereo track... and then disregarded the remaining two mono tracks. It's a mess. It's likely someone else will fine tune the audio once I'm done cutting the video together... but I'd like to get all the audio tracks properly synced from the start. Thanks for any help you can offer.

    Do you mean manual syncing? I've been reading this thread about workaround, which aren't working for me: http://forums.creativecow.net/thread/344/21236
    But the question they are asking is the same one I am asking. Isn't this a typical situation, having multiple mics for one camera? For example, if someone filmed a concert with one camera but used both the camera audio, and ambient mic, and a mix from the board, then that would be 3 audio tracks with 1 video track. I'm in a similar situation, and I'm finding it hard to believe that FCPX isn't equipped to edit this way. There must be some way to get one video clip (with reference audio) to sync with four audio tracks.

  • Is there a way to see all my compound clips created on the timeline, in the browser as an accessible thumbnail list....?

    I am facing a problem that
    due to big footage I first extracted the seemingly fine clips in chunks in one timeline in various layers which is still enormous for my RAM
    now I have to take out smaller and more appropriate bits from this timeline
    I have opened another timeline where I just copy paste the best shots from my previous enormous timeline and this works fine due to less media for 6gb RAM mac pro
    but it is really tedious to go back and forth to copy paste
    it would be so wonderful if I could extract those bits from the clips just like we do with any other new footage from the browser window with all the clips visible
    I think one way can be to export these compound clips seperately and import them as events into the browser but that would be a generation loss
    is there any other way.....? to view these compound clips infront of my eyes all at once or keeping all that footage on the timeline besides the finalising layer is the only option...?
    I am facing this rare problem because I'm editing a music video and no shot is more than 2 seconds and that too from several groups of footage that has to be mixed.....so all the data has to be visible to decide if a bit of guitar piece would look good here or drums or close up or long shot.....so everything has to be seen....can you suggest me a smarter workaround please ?

    Thank you.Ok say for e.g.
    500 video files imported in fcpx
    800 clips extracted from these obviously on the timeline and joined/compounded according to their content in say 15 layers according to 15 instruments used ,so now just to see the entire usable footage ....
    now one 7 minute song sequence has to be made where bits would be simultaneously taken from these 15 layers as all instruments are playing simultaneously
    these shots are not more than 2 secs each according to the beat........
    when I try to work with these 15 layers as well as the Final primary layer that I'm making in the same timeline my fcpx becomes slow
    but when I drag individual layer to individual timelines it is fine so that is the only option
    but now for every 2 second bit I have to go back to the 15 layered timeline and find one single suitable shot
    So I was wondering is there a way to be able to see these layers and clips on the timeline in the browser in a systematic fashion like the way we get with keywords  ?
    and keywords can only be used in the imported clips already in the browser ,and not after we drag it on the timeline.....
    Till now I think exporting and importing back is the only option ...but is there another work around ?

  • Is there a way to speed up video clips in imovie on ipad

    is there a way to speed up video clips in imovie on ipad? I'm currently editing some videos and would like to speed up a few clips to make the video shorter. Is this possible on ipad or just mac pcs only?

    actually, no 'add-ons' possible or avail for iMovie/MacOS/iOS…

  • How can I select just the clips, or just the transitions?

    If I have a timeline with 50 or more clips (or still shots, in my case) with cross dissolves between each one, I would like to select just the clips, or just the transitions, but not both. How do I do this?
    Why? I am creating a video with hundreds of stills and a few video clips, and occasiionally need to change the duration of all stills at the same time (from 3 seconds to 4, for example). Or, if I want all of the cross dissolves to last 1:15 instead of 1:00, it would be nice to select and change them all at once. However, in both cases, I can't figure out how to select all 50 without having to Command-click 50 times.
    Any ideas you have will be appreciated.
    Bart

    To perform the same duration change on just the transitions (cross dissolves, in this example), this technique will work:
    Open timeline index.
    Enter "cross" in the search box (or whatever transition you're wanting to change).
    Select all cross dissolves in list (click one, then type Command-A).
    Click the time strip in the top of the timeline area.
    All of the transitions in the list should now be selected in the timeline.
    Control-D to change duration.
    Enter new duration.
    Hit Return.
    I hope this saves someone all of the time I spent on it today. I'm still ahead, though, thanks to Tom's help. This saved litterally hundreds of Command-clicks.
    Bart

Maybe you are looking for

  • How to keep hotspot on particular field in alv interactive report

    hi all, i have a small requirement.i developed one interactive alv.in vasic alv wheni click on sales order number it shows secondary alv.but here i would like to keep hotspot symbol so user can understand that he has to click on this sales order numb

  • Cover Flow in Finder doesn't display Preview Annotations

    When looking at PDFs using Cover Flow in Finder, the Preview Annotations aren't shown. Both Quick Look and Preview will show them.

  • Comma instead of decimal point

    Is there a global way to doubles and floats to use a comma instead of a decimal point (like we do in Europe) when output as a string? (as opposed to having to reformat each number individually every time I want to display it)

  • Persistently scrolling video for video out

    Maybe someone can help me here I just got a mac mini and want to use it for video I hoooked it up to an old RCA tube, using S video and the video adapter. I accidentally hit the frame rate to PAL while setting it up and it started scrolling & became

  • If I don't install lion will I be cloud less next june

    I am not planning on installing lion.  On reason is iTunes 10.  I don't like it, the only reason I have it installed is to update my iPhone.  I use iTunes 9 for everything else.  iTunes is colorless and it sounds like finder is also.  If I don't upgr