This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 123733 - JComponent->Scene resolver
Summary: JComponent->Scene resolver
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-10 09:54 UTC by David Kaspar
Modified: 2007-12-10 09:54 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kaspar 2007-12-10 09:54:51 UTC
SceneSupport.getScene(JComponent):Scene method should be added to obtain a scene instance from a JComponent that
represents a scene main or side view.

As a workaround, please, add following code into SceneSupport file in "widget" package manually:
public class SceneSupport {
  public static Scene getSceneForComponent (Component component) {
    if (component instanceof SceneComponent) {
      return ((SceneComponent) component).getScene ();
    return null;
  }
}
Also as a temporary workaround you may use java-reflection:
        JComponent view = ...;// scene.createView ();
        Field field = view.getClass ().getDeclaredField ("scene");
        field.setAccessible (true);
        System.out.println ("field.get (view) = " + field.get (view));