Compositing interior and exterior

Using RAW images, where can tutorials be found for compositing interior shots with a view out a window?
TIA

Whether you can do it in real time depends on things like the processor speed, video frame size/rate, and complexity of the compositied graphics. To use JMF, you will have to write a codec to modify the video stream as it's being displayed (you can base it on Sun's FrameAccessCodec example). The codec would receive each frame as a JMF Buffer, convert it to a BufferedImage which you can use Java2D to draw on, convert it back to a Buffer, and pass it on for display.
Other approaches, such as drawing the graphics on a panel over the movie may not work reliably due to heavy/lightweight component conflicts.

Similar Messages

  • RGB, Composite, Firewire and S-video capture device for FCP

    Hi,
    I was just wondering if anyone could suggest some of the better capture cards that support RGB composite, firewire and s-video inputs that will work with FCP.
    The set up is on Mac Pro and the device needs to be as reliable and noise free as possible as it will be used for the capturing of video for evidence in court cases.
    Any help is this area would be very grateful,
    Regards,
    Martin.

    Hello,
    I have no experience with the AJA product line but I know that many of the folks here have used them. They make a good line of cards that will do what you are asking for. They don't have firewire on the cards, but the computer you are using should have one I would assume.
    Since you said 'S-Video' my thoughts are that you are only using SD? If that is going to be the case for a long time then look at this card:
    http://www.aja.com/products/kona/kona-lse-ls.php
    It has composite and S-Video inputs. IF there is the chance that you are going to be doing HD and IF it is still tape based, then look at one of the higher models. But again, that is if you are going to be upgrading to HD sometime soon.
    Hope this helps.
    -Jay

  • Question about composite index and index skip scan

    Hi,
    I have a confusion.
    I have read Burleson's post on composite index column ordering (http://www.dba-oracle.com/t_composite_index_multi_column_ordering.htm) where he writes that
    "......for composite indexes the most restrictive column value(the column with the highest unique values) should be put first to trim down the result set..."
    But 10g performance tuning book tells this about INDEX SKIP SCAN ::
    "... Index Skip scanning lets a composite index be split logically into smaller subindexes. In skip
    scanning, the initial column of the composite index is not specified in the query. In other words, it is skipped.
    The number of logical subindexes is determined by the number of distinct values in the initial column.
    Skip scanning is advantageous if there are few distinct values in the leading column of the composite index and many distinct values in the non-leading key of the index......."
    So if we design Composite indexes acc. to what Burleson said then how can we take advantage of index skip scanning. These two staements oppose each other,don't they ?
    Can anybody explain this ?

    Dear,
    For the moment forget the distinct values and the compressibility. I've tried to reproduce your case here below (using jonathan lewis table script)
    create table t1
    as
    with generator as (
        select    --+ materialize
            rownum id
        from dual
        connect by
            rownum <= 10000
    select
        rownum              c1,
        mod(rownum,1000)    c2,
        mod(rownum,5000)    c3,
        mod(rownum,10000)   c4,
        lpad(rownum,10,'0') c5,
        rpad('x',5)         c6
    from
        generator    v1,
        generator    v2
    where
        rownum <= 1000
    alter table t1 add constraint t1_pk primary key (c3,c4,c5,C6);
    create index idx_1 on t1 (c1,c2);
    begin
         dbms_stats.gather_table_stats(
              ownname           => user,
              tabname           =>'T1',
              estimate_percent => 100,
              method_opt       => 'for all columns size 1'
    end;
    /and here are what I got with your two selects
    mho.sql>> SELECT c1,c2
      2  FROM t1
      3  WHERE c2 = 3;
            C1         C2
             3          3
    Elapsed: 00:00:00.00
    mho.sql>> start dispcursor
    PLAN_TABLE_OUTPUT
    SQL_ID  4dbgq3m2utd9f, child number 0
    SELECT c1,c2 FROM t1 WHERE c2 = 3
    Plan hash value: 3723378319
    | Id  | Operation            | Name  | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |*  1 |  INDEX FAST FULL SCAN| IDX_1 |      1 |      1 |      1 |00:00:00.01 |       7 |
    Predicate Information (identified by operation id):
       1 - filter("C2"=3)
    17 rows selected.
    Elapsed: 00:00:00.34
    mho.sql>> SELECT c3,c4,c5,c6
      2  FROM t1
      3  WHERE c4 = 3
      4  AND c5 = '0000000003'
      5  AND c6 = 'x    ';
            C3         C4 C5         C6
             3          3 0000000003 x
    Elapsed: 00:00:00.00
    mho.sql>> @dispcursor
    PLAN_TABLE_OUTPUT
    SQL_ID  fv62c9uqtktw9, child number 0
    SELECT c3,c4,c5,c6 FROM t1 WHERE c4 = 3 AND c5 = '0000000003' AND c6 = 'x    '
    Plan hash value: 2969533764
    | Id  | Operation            | Name  | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |*  1 |  INDEX FAST FULL SCAN| T1_PK |      1 |      1 |      1 |00:00:00.01 |       9 |
    Predicate Information (identified by operation id):
       1 - filter(("C4"=3 AND "C5"='0000000003' AND "C6"='x    '))
    17 rows selected.I didn't succeed to reproduce your index skip scan situation.
    Best Regards
    Mohamed Houri

  • Why is my Hardware Accelerate Composition, Layer, and Footage Panels check box disabled

    Hello anyone!
    I have all the requirements to meet Adobe's standards for GPU requirements, but this check box (Hardware Accelerate Composition, Layer, and Footage Panels)[Edit>Preferences>Display] is disabled for me, why? Do I need to worry about this setting? Does it really matter? Any information on this topic would be helpful. Thanks in adavance for your feedback.
    GPU Information:
    Fast Draft:
    Available
    Texture Memory:
    924.00 MB
    Ray-tracing:
    GPU
    OpenGL
    Vendor:
    NVIDIA Corporation
    Device:
    GeForce GTX 470/PCIe/SSE2
    Version:
    3.0.0
    Total Memory:
    1.20 GB
    Shader Model:
    4.0 or later
    CUDA
    Driver Version:
    4.2
    Devices:
    1 (GeForce GTX 470)
    Current Usable Memory:
    608.00 MB (at application launch)
    Maximum Usable Memory:
    1.25 GB
    Computer:
    Windows 7 64bit SP1
    24GB MEM
    i7 intel
    Feature support levels
    There are three tiers or levels, from lowest to highest requirements, of support:
    Level 1: For OpenGL SwapBuffer:
    This level simply requires a GPU that can do OpenGL 1.5, or greater, with Shader Model 3.0, or greater. Most ATI and NVIDIA cards, and the Intel HD Graphics 3000 chipset (available in the MacBook Air, Mac Mini, various Windows machines, etc.) and 4000 (Windows only at this time) are supported. If your GPU does not support these requirements, software OS blitting like CS5.5 occurs, and there are improvements for software blitting in After Effects CS6, as well.
    Level 2: For Fast Draft previews, Hardware BlitPipe, and Cartoon GPU acceleration:
    Includes Level 1 features. This level requires OpenGL 2.0, or greater (with Shader Model 4.0, or greater, on Windows), and 256 MB, or greater, of texture memory. Most ATI and NVIDIA cards released in the past five years, plus the Intel HD Graphics 3000/4000, support this level.
    If your GPU does not support these requirements, these features will be disabled:
    Fast Draft mode
    The "Hardware Accelerate Composition, Layer, and Footage Panels" preference.
    The Cartoon effect's "Use OpenGL When Available" option (the Cartoon effect then runs on the CPU).
    Level 3: For Ray-traced 3D rendering on the GPU:
    Includes Level 1 & 2 features (for machines with attached monitors). This level requires a supported NVIDIA GPU and 512 MB, or greater, of texture memory. For a current list of supported GPUs, see the Adobe website.

    Well, you should be concerned that it isn't available  - there is still some configuration issue with your graphics card - but you can live without it most of the time.
    Mylenium

  • JSF 2.0: Composite Components and their ID

    I'm using Composite Components with JSF 2.0.
    Template:
    <composite:interface />
    <composite:implementation>
        <h:inputText id="text" />
    </composite:implementation>Template Client:
    <h:form id="form">
        <components:myComponent />
    </h:form>In the rendered result, the h:inputText's id will be "form:j_id1060595728_4b62ee3:text".
    How can I override that default ID?
    I tried to set an id attribute on composite:interface and composite:implementation, however, that doesn't have any effect.
    Using ui:debug, I found that the component with ID "j_id1060595728_4b62ee3" is a UINamingContainer.
    When using my own UINamingContainer implementation, i.e., ...
    <composite:interface componentType="util.jsf.UINamingContainerWithID" />
    @FacesComponent("util.jsf.UINamingContainerWithID")
    public class UINamingContainerWithID extends UINamingContainer {
         private String id = "foo";
         @Override
         public String getId() {
              return id;
         @Override
         public void setId(String id) {
              // this.id = id;
         public void setFooID(String id) {
              this.id = id;
    }... I can prevent the id from being set in setId(String), and h:inputText's id will be "form:foo:text".
    (I have tried to debug but the source code is slightly out of sync.)
    I also tried to add an attribute fooID to composite:interface and composite:implementation, with no effect.
    How do you work with Composite Components and their IDs?
    Thanks

    All composite components are NamingContainers. This is necessary to prevent ID collisions.
    In order to avoid a generated ID on a particulare composite component, specify an ID in the component
    within the using page:
    <h:form id="form">
        <components:myComponent id="c" />
    </h:form>So the client ID of the text component would be: form:c:text.

  • Composite photo and background layer question

    I would appreciate some help with a workflow problem when dealing with a composite, selection and background layer. My normal workflow is to start of in LR4, and if need be do an "edit in, CS6". I am relatively new to CS6, so bear with me.
    I have some portraits I want to put different backgrounds on. I am using Matt Kloskowski's Layers book and Composites books written for CS5. I also have Martin Evening's book on CS6 and the workflow for doing a composite is pretty much the same. The catch is that none of them start off in LR with the original photo. They all describe the following basic workflow pattern:
    1. Bring up the main photo in CS using "edit in CS6"
    2. Change the photo from a background layer to a regular layer
    3. Make a selection.
    4. Make a layer mask
    5. Refine the edge
    6. open the background photo you want to place the selection in (steps 4 and 5 are sometimes reversed so you are refining the edge on the new background)
    7. copy and paste the original photo onto the new background
    8. Refine the edge if not already done
    9. Save and exit back to LR with the composite
    If I follow this procedure I run into a couple of problems:
    1. My backgrounds are in a separate folder on my computer and not cataloged in LR. So, if I open them in photoshop and paste the original photo onto that image, LR will not know that I want to take the new composite back to the original folder along with the protrait. If I go to save the image, CS want to take the composite back to the folder on my computer where I got the background from. I tried playing around and tried renaming the composite similar to the naming convention I use for my photos in LR and then importing it into that folder after I have saved it in the background folder. This had some unintended consequences. First, I had trouble renaming the composite photo. For some reason Windows kept plugging in an old photo file name from one of my photos taken two years ago. After I discovered that  I could work around it. But after the first composite finally got into LR, when I tried to do it again, the import button on the left side of my LR went dark and I couldn't import the second composite photo I was working on. This could have been a coincident and unconnected LR glitch, but I have never had that problem before.
    So...I was thinking of modifying the workflow to the following:
    1. Bring up the main photo in CS using "edit in CS6"
    2. Change the photo from a background layer to a regular layer
    3. Make a selection.
    4. Make a layer mask
    5. Refine the edge
    6. open the background photo you want to place the selection in
    7. copy and paste the new BACKGROUND onto the original photo
    8. Move or make the new background layer THE "Background" layer
    10. Refine the edge
    11. Save and exit back to LR with the composite
    I am envisioning this will ensure that my composite will wind up back in LR because it is still keeping track of the original photo which now has gotten the new background, regardless of what the file name of the new background was.
    Does any of this make sense? Does any one know a better way of handling this?
    Thanks for any help,
    Jim

    Yes, it makes sense and I think you should go ahead and try it.

  • Hardware Accelerate Composition, Layer, and Footage Panels - optimize

    Hello.
    The AE preference for "Hardware Accelerate Composition, Layer, and Footage Panels" makes my deep compositions workable - for a limited time, and then simple selection tasks slow down substantially, as if I had turned this checkbox off. What can I upgrade to have more "fast time" with After Effects? Thanks for any insight into how to make my system work. Also, this may be my last Mac.... Is anyone out there able to run hundreds or thousands of layers in After Effects on a PC without having simple select tasks slow down?
    • simple selection task = "select all" in a single open composition with 10 layers or with 400 layers, although only in a project which contains deep compositions.
    • This slowdown exhibits with or without caps lock enabled
    • This slowdown exhibits before and after purge all
    • CC, CC 2014 latest update | Mac OS 10.8.5 | MacPro5,1 | 2 x 2.66 GHz 6-Core Intel Xeon | 96 GB 1333 MHz DDR3 ECC | 3 separate Mercury Accelsior > 500 MB/s read/write for System & Apps, Projects & Media and Cache | NVIDIA Quadro 4000 2048 MB | CUDA Driver: latest update | Wacom Intuos 5 | LED Cinema Display | Dell 2407WFP

    You are using to graphics cards of different model? That's probably why. I've really tried to see a difference with that switch and it's not measurable, so don't worry about it!
    - Jonas Hummelstrand
    http://generalspecialist.com/

  • My Muse compositions, panels and slideshows dosen't work (preview).

    Hi!
    What's wrong? I didn't have any problems with muse earlier... older version and older Win XP.
    Now I have the latest version of Muse and Win8.
    My compositions, panels and slideshows dosen't work when I try to preview designt site in browser.
    Is something missing on my computer? Or what's wrong?
    Regards from Finland!
    -Nanna

    Hello,
    Please provide us with the site URL and if possible, screenshots showing the exact issues.
    Cheers
    Parikshit

  • USB interface to composite video and audio

    I've been searching a long time for a compatible, low cost and convenient capture device for composite video and audio. The EasyCap devices are super cheap, but their audio section is just horrid. Others won't provide audio usable by Adobe Connect. The EZCap 116 seems to work very well with Adobe Connect, providing a single USB cable connection that carries both audio and video. To get it to work with Skype you need to use Splitcam. the only reminaing annoyance is that you have to use the bundled software each time you want to get the device to use composite or S-video inputs. Sure wish the Flash module would let you configure webcam settings directly.
    My main application for the gadget is to interface our institutional VC codecs (which have VCR outputs) to Adobe Connect users.

    Studio X: Doh!, you beat me, with your maximally cryptic reply!

  • Composition Environment and CAF

    Can someone please let me know, in simple terms what is Composition Environment and when is it needed (in business sense). i.e. What functionality it provides that is not available with normal NW based systems.
    Secondly, what is composite applications in reference to EP system.

    Hi,
    1.The main idea of CE 7.1 was to build Composite applications. It is not a complete portal. EP 7 is a complete portal platform with KM.TREX and Collaboration. CE 7.1 doesnu2019t have all these components and it cannot be used as a complete portal platform. You can integrate CE 7.1 with EP 7 using Federated portal
    Below help link will help you on [CE library|http://help.sap.com/saphelp_nwce10/helpdata/en/f2/94388477bd48edaa4616f0bbd28425/frameset.htm]
    2.Tooling for Business Process Management and Business Rules Management (since NetWeaver CE 7.1 EHP 1). Please refer this [Document|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/307336b8-098c-2d10-be9c-d41ae345f0ff?QuickLink=index&overridelayout=true]
    3.Introduction On [CE|http://help.sap.com/saphelp_nwce10/helpdata/en/45/ff9fc1d8986c06e10000000a1553f6/content.htm]
    CAF:
    [Composite Application Framework Tutorial Center|http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/d8dbd703-0801-0010-c9bf-c04bc52f562f]
    Best Regards
    Vijay K

  • Representing SOA/Composite service and operations

    Which diagram/diagrams do you recommend for depicting a SOA/Composite Service and their operations?
    Example:
    We have a process function "Mutual Acceptance" that requires customer data,
    which is in another software module for handling customer master data.
    The service is called "Manage Customer" and the operation "Query Customer".
    I am thankful for any input, best regards Fredrik.

    Hi Fredrik,
    Just some quick notes regarding this complex theme.
    To describe the relationships of a business service to other architecture elements create a Business Service Allocation model for each Business Service. Therefore use the diagram type IS Context Model to depict:
    * software services implementing the business service
    * business data owned by the service
    * capabilities
    * organizational units
    Furthermore Access diagrams can be used to depict a software service with its operations, data input and output, capabilities and roles (as far as notifications or workflows included). An Access diagram gets autoomatically generated while the import of a WSDL. Enrich the diagramm type according to your requirements (for operations you can use the symbol IT Procedure). At the end of the day the model shall serve a descrption for the implementation. Hope this is what you were looking for.
    Best regards,
    Danilo

  • Discovery V3 with Composite Environment and ESR

    Dear experts,
    is it possible to upgrade the SAP discovery system V3 to an v3 enhanced?
    Concret: Unfortunatelly in the v3 system the composite environment and the ESR is missing. Is it possible to integrate these two elements in the v3 system?
    Thanks a lot.
    Gordon Borst

    Hello Gordon,
    I also have DS v3. But to have CE on top of it i have downloaded the trail version of CE 7.2 from sdn and installed on DS v3. Now i have already prototyped many scenarios using both the platforms. And i can see they both fit together very well.
    So i am sure you can also do the same. And its quite a task.
    Good luck.
    Prasad.

  • Odd behavior when using custom Composite/CompositeContext and antialiasing

    Hi,
    I created a custom Composite/CompositeContext class and when I use it with antialiasing it causes a black bar to appear. I seems it has nothing to do with the compose() code but just that fact that I set my own Composite object. The submitted code will show you what I mean. There are 3 check boxes 1) allows to use the custom Composite object, 2) allows to ignore the compose() code in the CompositeContext and 3) toggles the antialiasing flag in the rendering hints. When the antialiasing flag is set and the Composite object is used the bar appears regardless of if the compose() method is executed or not. If the Composite object is not used the bar goes away.
    The Composite/CompositeContext class performs clipping and gradient paint using a Ellipse2D.Float instance.
    a) When the Composite is not used the code does a rectangular fill.
    b) When the Composite is used it should clip the rectangular fill to only the inside of a circle and do a gradient merge of background color and current color.
    c) If the compose() method is ignored then only the background is painted.
    d) When antialiasing is turned on the black bar appears, i) if you ignore the compose() method it remains, ii) if you do not use the Composite object the bar disappears (???)
    NOTE: the compose method's code is only for illustration purposes, I know that AlphaComposite, clipping and/or Gradient paint can be used to do what the example does. What I am trying to find out is why the fact of simply using my Composite object with antialiasing will cause the odd behavior.  Been trying to figure it out but haven't, any help is appreciated.
    Thx.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                for(int sy = src.getMinY(); sy < src.getMinY() + src.getHeight(); sy++) {
                    for(int sx = src.getMinX(); sx < src.getMinX() + src.getWidth(); sx++) {
                        int cx = sx - dstOut.getSampleModelTranslateX();
                        int cy = sy - dstOut.getSampleModelTranslateY();
                        if(!clippingShape.contains(cx, cy)) continue;
                        srcPixel = src.getPixel(sx, sy, srcPixel);
                        int ox = dstOut.getMinX() + sx - src.getMinX();
                        int oy = dstOut.getMinY() + sy - src.getMinY();
                        if(ox < dstOut.getMinX() || ox >= dstOut.getMinX() + dstOut.getWidth()) continue;
                        if(oy < dstOut.getMinY() || oy >= dstOut.getMinY() + dstOut.getHeight()) continue;
                        dstPixel = dstIn.getPixel(ox, oy, dstPixel);
                        float mergeFactor = 1.0f * (cy - 100) / 100;
                        dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                        dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                        dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                        dstOut.setPixel(ox, oy, dstPixel);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

    I got a better version to work as expected. Though there will probably be issues with the transformation to display coordinates as mentioned before. At least figured out some of the kinks of using a custom Composite/CompositeContext object.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
    //            dumpRaster("SRC   ", src);
    //            dumpRaster("DSTIN ", dstIn);
    //            dumpRaster("DSTOUT", dstOut);
    //            System.out.println();
                if(dstIn != dstOut)
                    dstOut.setDataElements(0, 0, dstIn);
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                int w = Math.min(src.getWidth(), dstIn.getWidth());
                int h = Math.min(src.getHeight(), dstIn.getHeight());
                int xMax = src.getMinX() + w;
                int yMax = src.getMinY() + h;
                for(int x = src.getMinX(); x < xMax; x++) {
                    for(int y = src.getMinY(); y < yMax; y++) {
                        try {
                            // THIS MIGHT NOT WORK ALL THE TIME
                            int cx = x - dstIn.getSampleModelTranslateX();
                            int cy = y - dstIn.getSampleModelTranslateY();
                            if(!clippingShape.contains(cx, cy)) {
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                dstOut.setPixel(x, y, dstPixel);
                            else {
                                srcPixel = src.getPixel(x, y, srcPixel);
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                float mergeFactor = 1.0f * (cy - 100) / 100;
                                dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                                dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                                dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                                dstOut.setPixel(x, y, dstPixel);
                        catch(Throwable t) {
                            System.out.println(t.getMessage() + " x=" + x + " y=" + y);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            protected void dumpRaster(String lbl,
                                      Raster raster) {
                System.out.print(lbl + ":");
                System.out.print(" mx=" + format(raster.getMinX()));
                System.out.print(" my=" + format(raster.getMinY()));
                System.out.print(" rw=" + format(raster.getWidth()));
                System.out.print(" rh=" + format(raster.getHeight()));
                System.out.print(" tx=" + format(raster.getSampleModelTranslateX()));
                System.out.print(" ty=" + format(raster.getSampleModelTranslateY()));
                System.out.print(" sm=" + raster.getSampleModel().getClass().getName());
                System.out.println();
            protected String format(int value) {
                String txt = Integer.toString(value);
                while(txt.length() < 4)
                    txt = " " + txt;
                return txt;
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

  • Composite windows and Fle dialogs

    Hi everyone,
    I am working on a GUI object of type Composite which has a text field and a (Browse) button. It has been programmed so that when the user presses the Browse button, a file dialog opens up. Now the problem that i am having is that after the file dialog opens up i am still able to bring the Composite window, sitting in the background, up front by clicking on it which i don't want. I have tried using the setEnabled() method on the Composite but it just disables the browse button and the text field, but does not completely block the user from the composite window since one can still bring it up front. Is there any way to achieve the following functionality?
    The user clicks browse the file dialog opens and as long as the user selects the file the file dialog is active and the composite window in the background remains inactive, once the user has selected the file the composite becomes active again.
    This is just like if, in your Internet browser, you click file->open and out pops the web address input window where you type in the web address of the web page you want to visit. During this time you can't click on anything in the background unless and until you close the web address input window. Any help is appreciated. Thanks!

    As suggested above if you are using JFileChooser then
    is is automatically displayed as a modal dialog.
    If you are creating your own FileDialog, then you
    need to make the dialog modal and specify the JFrame
    as the parent when you create the dialog.Thanks for support.

  • URGENT: How to selectively migrate composite instances and task data from one env to another

    Gurus,
    We've come across a situation whereby we need to migrate instance data (including Human Task related) of some specific composites from one environment to another.
    (Environment is equivalent here to a different domain installation on different physical server.)
    Is this possible in some standard way like using Oracle import-export utility or script?
    If not, how can this be achieved?
    Thanks in advance for any help you can provide on this.
    With regards-
    Ashish

    Hi,
    If your SharePoint environment supports InfoPath Forms, then you can customize the form and add rules to make the list items as read only when user A submits the form.
    you can then write a form load event to check the logged in user using username() function. This logic can be implemented in variety of ways, like setting a flag when User A submits the form, or storing user A username in a form variable etc., else comparing
    User A and User B values within form Load event.
    Another way of doing this is using Views or grouping all of the User A fields within a section etc.,
    The above would take care of Form logic, and for the workflow, you can use SharePoint designer to create a custom workflow, where it will run on onItemCreate and onItemChange events.
    The logic for workflow would be if the form Submitted for the first time, the workflow will start and send an email to User B, and when User B submits the Data then onItemChange change event will start the workflow to send an email to approver to approve
    the data.
    here are some links for your reference -
    http://office.microsoft.com/en-us/infopath-help/add-formulas-and-functions-in-infopath-2010-HA101821255.aspx
    http://office.microsoft.com/en-us/videos/video-create-an-approval-workflow-in-sharepoint-designer-2010-VA101897477.aspx
    http://blogs.technet.com/b/meacoex/archive/2010/11/01/get-manager-approval-in-sharepoint-designer-2010-step-by-step.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

Maybe you are looking for

  • Deployment of Flex app to web and app server

    Hi I'm working on putting a Flex front-end on an existing J2EE app which gets deployed as an ear file. The architecture consists of web server, app server and database server. Is the following approach to deployment possible / recommended? My Flex ap

  • Electronic Signatures in xMII

    Hi all, I've been asked to estimate my time on something I have no idea on how to accomplish the task.  So if you know anything about xMII and electronic signatures - please respond. Does anyone have experience with implementing electronic signatures

  • How do I fix a corrupt .jpg from Photoshop?

    I try to upload .jpg images, which I saved from Photoshop, onto walgreens.com and shutterfly.com, and each site tells me that my file is corrupted. Can someone please help me find a solution to "uncorrupting" my .jpgs?

  • Outlook and CSV files on a mac book

    I have a Mc Book Pro REtina and use MS outlook 2011 version 14.3.9 as my contact data base. I need to export my contacts to a csv file so i can upload them to google so i can sync with my iphone 5

  • JetSend does not work from HP9100C to P3015D

    Hi Everyone, I have Docu Centre HP9100C device, which has JetSend function. It works via JetDirect adaptors inserted into Scanner (HP9100C) and Printer. For HP8500 and HP4050 it worked pretty fine. But when I purchased a printer P3015D, installed the