/*
 * Copyright (c) 2003, The JUNG Authors
 * All rights reserved.
 * 
 * This software is open-source under the BSD license; see either "license.txt"
 * or https://github.com/jrtom/jung/blob/master/LICENSE for a description.
 * 
 */
package edu.uci.ics.jung.samples;

import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.geom.GeneralPath;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.ToolTipManager;

import edu.uci.ics.jung.algorithms.layout.FRLayout;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.util.TestGraphs;
import edu.uci.ics.jung.visualization.DefaultVisualizationModel;
import edu.uci.ics.jung.visualization.GraphZoomScrollPane;
import edu.uci.ics.jung.visualization.Layer;
import edu.uci.ics.jung.visualization.VisualizationModel;
import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.VisualizationServer.Paintable;
import edu.uci.ics.jung.visualization.control.CrossoverScalingControl;
import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse;
import edu.uci.ics.jung.visualization.control.SatelliteVisualizationViewer;
import edu.uci.ics.jung.visualization.control.ScalingControl;
import edu.uci.ics.jung.visualization.decorators.PickableEdgePaintTransformer;
import edu.uci.ics.jung.visualization.decorators.PickableVertexPaintTransformer;
import edu.uci.ics.jung.visualization.decorators.ToStringLabeller;
import edu.uci.ics.jung.visualization.renderers.GradientVertexRenderer;
import edu.uci.ics.jung.visualization.renderers.Renderer;
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer;

/**
 * Demonstrates the construction of a graph visualization with a main and 
 * a satellite view. The satellite
 * view is smaller, always contains the entire graph, and contains
 * a lens shape that shows the boundaries of the visible part of the
 * graph in the main view. Using the mouse, you can pick, translate,
 * layout-scale, view-scale, rotate, shear, and region-select in either
 * view. Using the mouse in either window affects only the main view
 * and the lens shape in the satellite view.
 * 
 * @author Tom Nelson
 * 
 */
@SuppressWarnings("serial")
public class SatelliteViewDemo extends JApplet {

    static final String instructions = 
        ""+
        "

Instructions for Mouse Listeners

"+ "

There are two modes, Transforming and Picking."+ "

The modes are selected with a combo box."+ "

Transforming Mode:"+ "

    "+ "
  • Mouse1+drag pans the graph"+ "
  • Mouse1+Shift+drag rotates the graph"+ "
  • Mouse1+CTRL(or Command)+drag shears the graph"+ "
"+ "Picking Mode:"+ "
    "+ "
  • Mouse1 on a Vertex selects the vertex"+ "
  • Mouse1 elsewhere unselects all Vertices"+ "
  • Mouse1+Shift on a Vertex adds/removes Vertex selection"+ "
  • Mouse1+drag on a Vertex moves all selected Vertices"+ "
  • Mouse1+drag elsewhere selects Vertices in a region"+ "
  • Mouse1+Shift+drag adds selection of Vertices in a new region"+ "
  • Mouse1+CTRL on a Vertex selects the vertex and centers the display on it"+ "
"+ "Both Modes:"+ "

Ads help maintain this website.