/******************************************************************* Copyright (c) 2001-2010 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.env.*; /** This basic program uses a renderer file transform.rdr that shows transformations applied to an aligned text renderer. The elements are read from stations.elt. */ public class TransformEx extends JFrame { Diagram diagram; //**************************************************************** TransformEx() { super("Transform Example"); // Instantiate and configure a diagram diagram = new Diagram("Transform"); diagram.setBackground(new Color(197,197,202)); diagram.getViewManager().setMargin(new Dimension(20, 20)); try { // Read the renderers diagram.readRenderers("transform.rdr"); // Read the elements diagram.readElements("stations.elt"); } catch (Exception e) { AGLog.log("TransformEx", 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 TransformEx(); frame.setLocation(100, 100); if (args.length == 0 || ! args[0].equals(Runner.NAME)) { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } frame.pack(); frame.setVisible(true); } }); } }