osdir.com
mailing list archive

Subject: Set background color of satellite view - msg#00005

List: java.netbeans.modules.graph.user

Date: Prev Next Index Thread: Prev Next Index
Hi,

dumb question - but I have not figured it out ... maybe you can help

I am having a jSplitPane in a TopComponent with each side of the SplitPane having a jScrollPane and code like below.  Whatever I try, the background of the satellite view is always the default gray. Any idea what I am doing wrong ? (The background of the 2 scroll panes are white



            scene = new Scene();
            imageMainView = scene.createView();
            scene.getActions().addAction(ActionFactory.createSelectAction(new CreateProvider()));
            jScrollPaneLeft.setViewportView(imageMainView);
            jSplitPane1.setBackground(Color.WHITE);

            bhImage = Utilities.loadImage(bhImageFilename);
            imageLayer = new ImageWidget(scene, bhImage);
            jScrollPaneLeft.setSize(bhImage.getWidth(null), bhImage.getHeight(null));

            scene.addChild(imageLayer);

            JComponent satellite = scene.createSatelliteView();
            add(satellite, BorderLayout.WEST);
            satellite.setBackground(Color.WHITE);   // TODO seems not to work still gray





The generated code of the TopComponent is like the following - also here I set the Background to white....


   // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPaneLeft = new javax.swing.JScrollPane();
        jScrollPaneRight = new javax.swing.JScrollPane();

        setBackground(java.awt.Color.white);
        setLayout(new java.awt.BorderLayout());

        jSplitPane1.setDoubleBuffered(true);

        jScrollPaneLeft.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jScrollPaneLeft.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        jScrollPaneLeft.setDoubleBuffered(true);
        jScrollPaneLeft.setMaximumSize(new java.awt.Dimension(512, 999999));
        jSplitPane1.setLeftComponent(jScrollPaneLeft);
        jScrollPaneLeft.getAccessibleContext().setAccessibleParent(jSplitPane1);

        jScrollPaneRight.setBackground(new java.awt.Color(255, 255, 255));
        jScrollPaneRight.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        jScrollPaneRight.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        jSplitPane1.setRightComponent(jScrollPaneRight);

        add(jSplitPane1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>

    // Variables declaration - do not modify
    private javax.swing.JScrollPane jScrollPaneLeft;
    private javax.swing.JScrollPane jScrollPaneRight;
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration



Thanx
B-)





Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Snapping a connection to a pin

Hello,I was wondering what controls the snapping behavior when a connection is near a target.  I have a small circular pin attached to a much larger widget, I can attach to the pin if I drop the connection right onto it but I can't figure out how to get the connection to snap to that small pin.  I want to snap to the tiny pin any time I am anywhere near the large widget. I looked for examples of how to use the ConnectProvider.resolveTargetWidget method, thinking that it might help, but I found no examples anywhere.Thanks,Joe

Next Message by Date: click to view message preview

Re: Set background color of satellite view

If you are talking about the border around the scene, this is actually form the owner of the satellite view.    I just tested this modifying the test.multiview.MultiviewTest class.  I used the following code to get the following image.   ...       contentPane.setBackground(Color.BLUE);   contentPane.add (scene.createSatelliteView(), BorderLayout.WEST);   ...If you are talking about the background color of the scene, the satellite view actually draws the scene with the same colors as the normal view.  So, if you change the background of the scene, you also change the background of the satellite view.  The one nuance is that the satellite view has a transparent gray rectangle over the region that is is viewable in the normal view.  You can move the region to change the viewable region n the normal view.  The color of the transparent rectangle is not able to be changed.  Perhaps we need to create an RFE to allow the transparent box color to be changed.On Apr 4, 2008, at 2:59 PM, bruehlicke wrote:Hi,dumb question - but I have not figured it out ... maybe you can helpI am having a jSplitPane in a TopComponent with each side of the SplitPane having a jScrollPane and code like below.  Whatever I try, the background of the satellite view is always the default gray. Any idea what I am doing wrong ? (The background of the 2 scroll panes are white             scene = new Scene();            imageMainView = scene.createView();            scene.getActions().addAction(ActionFactory.createSelectAction(new CreateProvider()));            jScrollPaneLeft.setViewportView(imageMainView);             jSplitPane1.setBackground(Color.WHITE);            bhImage = Utilities.loadImage(bhImageFilename);            imageLayer = new ImageWidget(scene, bhImage);            jScrollPaneLeft.setSize(bhImage.getWidth(null), bhImage.getHeight(null));             scene.addChild(imageLayer);            JComponent satellite = scene.createSatelliteView();            add(satellite, BorderLayout.WEST);            satellite.setBackground(Color.WHITE);   // TODO seems not to work still gray The generated code of the TopComponent is like the following - also here I set the Background to white....   // <editor-fold defaultstate="collapsed" desc="Generated Code">     private void initComponents() {        jSplitPane1 = new javax.swing.JSplitPane();        jScrollPaneLeft = new javax.swing.JScrollPane();        jScrollPaneRight = new javax.swing.JScrollPane();         setBackground(java.awt.Color.white);        setLayout(new java.awt.BorderLayout());        jSplitPane1.setDoubleBuffered(true);        jScrollPaneLeft.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);         jScrollPaneLeft.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);        jScrollPaneLeft.setDoubleBuffered(true);        jScrollPaneLeft.setMaximumSize(new java.awt.Dimension(512, 999999));         jSplitPane1.setLeftComponent(jScrollPaneLeft);        jScrollPaneLeft.getAccessibleContext().setAccessibleParent(jSplitPane1);        jScrollPaneRight.setBackground(new java.awt.Color(255, 255, 255));         jScrollPaneRight.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);        jScrollPaneRight.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);         jSplitPane1.setRightComponent(jScrollPaneRight);        add(jSplitPane1, java.awt.BorderLayout.CENTER);    }// </editor-fold>    // Variables declaration - do not modify    private javax.swing.JScrollPane jScrollPaneLeft;     private javax.swing.JScrollPane jScrollPaneRight;    private javax.swing.JSplitPane jSplitPane1;    // End of variables declarationThanxB-) Trey SpivaUML ArchitectBlog: http://blogs.sun.com/treyspiva/Leonard.Spiva-xsfywfwIY+M@xxxxxxxxxxxxxxxx

Previous Message by Thread: click to view message preview

Snapping a connection to a pin

Hello,I was wondering what controls the snapping behavior when a connection is near a target.  I have a small circular pin attached to a much larger widget, I can attach to the pin if I drop the connection right onto it but I can't figure out how to get the connection to snap to that small pin.  I want to snap to the tiny pin any time I am anywhere near the large widget. I looked for examples of how to use the ConnectProvider.resolveTargetWidget method, thinking that it might help, but I found no examples anywhere.Thanks,Joe

Next Message by Thread: click to view message preview

Re: Set background color of satellite view

If you are talking about the border around the scene, this is actually form the owner of the satellite view.    I just tested this modifying the test.multiview.MultiviewTest class.  I used the following code to get the following image.   ...       contentPane.setBackground(Color.BLUE);   contentPane.add (scene.createSatelliteView(), BorderLayout.WEST);   ...If you are talking about the background color of the scene, the satellite view actually draws the scene with the same colors as the normal view.  So, if you change the background of the scene, you also change the background of the satellite view.  The one nuance is that the satellite view has a transparent gray rectangle over the region that is is viewable in the normal view.  You can move the region to change the viewable region n the normal view.  The color of the transparent rectangle is not able to be changed.  Perhaps we need to create an RFE to allow the transparent box color to be changed.On Apr 4, 2008, at 2:59 PM, bruehlicke wrote:Hi,dumb question - but I have not figured it out ... maybe you can helpI am having a jSplitPane in a TopComponent with each side of the SplitPane having a jScrollPane and code like below.  Whatever I try, the background of the satellite view is always the default gray. Any idea what I am doing wrong ? (The background of the 2 scroll panes are white             scene = new Scene();            imageMainView = scene.createView();            scene.getActions().addAction(ActionFactory.createSelectAction(new CreateProvider()));            jScrollPaneLeft.setViewportView(imageMainView);             jSplitPane1.setBackground(Color.WHITE);            bhImage = Utilities.loadImage(bhImageFilename);            imageLayer = new ImageWidget(scene, bhImage);            jScrollPaneLeft.setSize(bhImage.getWidth(null), bhImage.getHeight(null));             scene.addChild(imageLayer);            JComponent satellite = scene.createSatelliteView();            add(satellite, BorderLayout.WEST);            satellite.setBackground(Color.WHITE);   // TODO seems not to work still gray The generated code of the TopComponent is like the following - also here I set the Background to white....   // <editor-fold defaultstate="collapsed" desc="Generated Code">     private void initComponents() {        jSplitPane1 = new javax.swing.JSplitPane();        jScrollPaneLeft = new javax.swing.JScrollPane();        jScrollPaneRight = new javax.swing.JScrollPane();         setBackground(java.awt.Color.white);        setLayout(new java.awt.BorderLayout());        jSplitPane1.setDoubleBuffered(true);        jScrollPaneLeft.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);         jScrollPaneLeft.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);        jScrollPaneLeft.setDoubleBuffered(true);        jScrollPaneLeft.setMaximumSize(new java.awt.Dimension(512, 999999));         jSplitPane1.setLeftComponent(jScrollPaneLeft);        jScrollPaneLeft.getAccessibleContext().setAccessibleParent(jSplitPane1);        jScrollPaneRight.setBackground(new java.awt.Color(255, 255, 255));         jScrollPaneRight.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);        jScrollPaneRight.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);         jSplitPane1.setRightComponent(jScrollPaneRight);        add(jSplitPane1, java.awt.BorderLayout.CENTER);    }// </editor-fold>    // Variables declaration - do not modify    private javax.swing.JScrollPane jScrollPaneLeft;     private javax.swing.JScrollPane jScrollPaneRight;    private javax.swing.JSplitPane jSplitPane1;    // End of variables declarationThanxB-) Trey SpivaUML ArchitectBlog: http://blogs.sun.com/treyspiva/Leonard.Spiva-xsfywfwIY+M@xxxxxxxxxxxxxxxx
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by