/******************************************************************* Copyright (c) 2001-2007 Apprisant Technologies Inc. All rights reserved. Apprisant Technologies permits non-exclusive royalty free use, copying and modification of this demo program source code for the purposes of evaluating the Apprisant Toolkit or building applications that use it. This software and documentation is provided "AS IS". APPRISANT TECHNOLOGIES DISCLAIMS ANY REPRESENTATIONS AND WARRANTIES, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS OF THIS PRODUCT FOR ANY PARTICULAR PURPOSE. APPRISANT TECHNOLOGIES SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY ANY PARTY, INCLUDING LOST PROFITS, ARISING FROM THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ITS DERIVATIONS. ********************************************************************/ package examples; import java.awt.*; import javax.swing.*; import apprisant.diagram.*; import apprisant.diagram.io.*; import apprisant.diagram.env.*; /** This example demonstrates the BoundsRenderer. The program is identical to BasicEx except that it reads elements from jtech.elt and renderers from bounds.rdr. Click on an item to see the BoundsRenderer's graphic. */ public class BoundsRenEx extends JFrame { Diagram diagram; //**************************************************************** BoundsRenEx() { super("Bounds Renderer Example"); // Instantiate and configure a diagram diagram = new Diagram("BoundsRen"); diagram.setBackground(new Color(140,140,140)); diagram.getViewManager().setMargin(new Dimension(20, 20)); try { // Read the renderers diagram.readRenderers("bounds.rdr"); // Read the elements diagram.readElements("jtech.elt"); } catch (Exception e) { AGLog.log("BoundsRenEx", null, AGLog.ERROR, e); System.exit(1); } add(new JScrollPane(diagram), BorderLayout.CENTER); } //**************************************************************** public static void main (final String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new BoundsRenEx(); frame.setLocation(100, 100); if (args.length == 0 || ! args[0].equals(Runner.NAME)) { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } frame.pack(); frame.setVisible(true); } }); } }