Search in sources :

Example 1 with DefaultBackgroundRenderer

use of y.view.DefaultBackgroundRenderer in project binnavi by google.

the class CLayoutFunctions method updateBackground.

/**
   * Updates the background depending on the graph settings.
   *
   * @param graph The graph whose backround is updated.
   */
public static void updateBackground(final ZyGraph graph) {
    Preconditions.checkNotNull(graph, "IE02126: Graph argument can not be null");
    // TODO: Buffer and share the background gradient between views
    final DefaultBackgroundRenderer dBGRender = new DefaultBackgroundRenderer(graph.getView());
    if (graph.getSettings().getDisplaySettings().getGradientBackground()) {
        dBGRender.setImage(new ImageIcon(CMain.class.getResource("data/gradientbackground2.jpg")).getImage());
        dBGRender.setMode(DefaultBackgroundRenderer.FULLSCREEN);
    } else {
        dBGRender.setColor(new Color(250, 250, 250));
    }
    graph.getView().setBackgroundRenderer(dBGRender);
    graph.updateViews();
}
Also used : DefaultBackgroundRenderer(y.view.DefaultBackgroundRenderer) ImageIcon(javax.swing.ImageIcon) Color(java.awt.Color) CMain(com.google.security.zynamics.binnavi.CMain)

Example 2 with DefaultBackgroundRenderer

use of y.view.DefaultBackgroundRenderer in project binnavi by google.

the class CRootNodeComponent method createGui.

/**
   * Creates the GUI of this component.
   */
private void createGui() {
    final Graph2DView view = new ZyGraph2DView(new Graph2D());
    view.setScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    final DefaultBackgroundRenderer backgroundRenderer = new DefaultBackgroundRenderer(view);
    backgroundRenderer.setImage(BACKGROUND_IMAGE);
    backgroundRenderer.setMode(DefaultBackgroundRenderer.CENTERED);
    backgroundRenderer.setColor(Color.white);
    view.setBackgroundRenderer(backgroundRenderer);
    add(view, BorderLayout.CENTER);
}
Also used : DefaultBackgroundRenderer(y.view.DefaultBackgroundRenderer) ZyGraph2DView(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView) Graph2DView(y.view.Graph2DView) ZyGraph2DView(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView) Graph2D(y.view.Graph2D)

Aggregations

DefaultBackgroundRenderer (y.view.DefaultBackgroundRenderer)2 CMain (com.google.security.zynamics.binnavi.CMain)1 ZyGraph2DView (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView)1 Color (java.awt.Color)1 ImageIcon (javax.swing.ImageIcon)1 Graph2D (y.view.Graph2D)1 Graph2DView (y.view.Graph2DView)1