// @topic T11728 2D Graphics demo 02 -- scratch pad designer // @brief class <tt>ViewSimulation</tt> extends <tt>JFrame</tt> /* * ViewSimulation.java * * Created on Mar 26, 2013, 10:00:02 AM */ package shopsimulation; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; public class ViewSimulation extends javax.swing.JFrame { /** Creates new form ViewSimulation */ public ViewSimulation() { initComponents(); } //operations public D2Canvas getCanvas() { return d2CanvasPanel; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { pnlBottom = new javax.swing.JPanel(); d2CanvasPanel = new shopsimulation.D2Canvas(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout pnlBottomLayout = new javax.swing.GroupLayout(pnlBottom); pnlBottom.setLayout(pnlBottomLayout); pnlBottomLayout.setHorizontalGroup( pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 400, Short.MAX_VALUE) ); pnlBottomLayout.setVerticalGroup( pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 55, Short.MAX_VALUE) ); javax.swing.GroupLayout d2CanvasPanelLayout = new javax.swing.GroupLayout(d2CanvasPanel); d2CanvasPanel.setLayout(d2CanvasPanelLayout); d2CanvasPanelLayout.setHorizontalGroup( d2CanvasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 400, Short.MAX_VALUE) ); d2CanvasPanelLayout.setVerticalGroup( d2CanvasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 234, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pnlBottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(d2CanvasPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(d2CanvasPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(pnlBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { ViewSimulation window = new ViewSimulation(); window.setVisible(true); // create and start new thread: ThreadPainter thp = new ThreadPainter( window ); Thread th = new Thread( thp ); th.start(); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private shopsimulation.D2Canvas d2CanvasPanel; private javax.swing.JPanel pnlBottom; // End of variables declaration//GEN-END:variables }