/** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new javax.swing.JScrollPane(); view = new org.jhotdraw.draw.DefaultDrawingView(); setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(view); add(scrollPane, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents
/** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new javax.swing.JScrollPane(); view = new org.jhotdraw.draw.DefaultDrawingView(); setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(view); add(scrollPane, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables
/** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new javax.swing.JScrollPane(); view = new org.jhotdraw.draw.DefaultDrawingView(); setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(view); add(scrollPane, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables
view = new org.jhotdraw.draw.DefaultDrawingView(); jPanel1 = new javax.swing.JPanel(); creationToolbar = new javax.swing.JToolBar();
view = new org.jhotdraw.draw.DefaultDrawingView(); jPanel1 = new javax.swing.JPanel(); creationToolbar = new javax.swing.JToolBar();
/** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new javax.swing.JScrollPane(); view = new org.jhotdraw.draw.DefaultDrawingView(); propertiesPanel = new org.jhotdraw.samples.odg.ODGPropertiesPanel(); setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(view); add(scrollPane, java.awt.BorderLayout.CENTER); add(propertiesPanel, java.awt.BorderLayout.SOUTH); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables
view = new org.jhotdraw.draw.DefaultDrawingView(); jPanel1 = new javax.swing.JPanel(); creationToolbar = new javax.swing.JToolBar();
view = new org.jhotdraw.draw.DefaultDrawingView(); jPanel1 = new javax.swing.JPanel(); creationToolbar = new javax.swing.JToolBar();
DrawingView view1 = new DefaultDrawingView(); DrawingView view2 = new DefaultDrawingView(); DrawingView view3 = new DefaultDrawingView(); DrawingView view4 = new DefaultDrawingView(); view1.setDrawing(createDrawing()); view2.setDrawing(createDrawing());
DrawingView view1 = new DefaultDrawingView(); view1.setDrawing(createDrawing()); DrawingView view2 = new DefaultDrawingView(); view2.setDrawing(createDrawing()); DrawingView view3 = new DefaultDrawingView(); view3.setDrawing(createDrawing()); DrawingView view4 = new DefaultDrawingView(); view4.setDrawing(createDrawing());
view = new org.jhotdraw.draw.DefaultDrawingView(); toolsPanel = new javax.swing.JPanel(); toolsScrollPane = new javax.swing.JScrollPane();
f.setSize(600, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing);
@Override public void run() { // Create a simple drawing consisting of three // text areas and an elbow connection. LabeledEllipseFigure ta = new LabeledEllipseFigure(); ta.setBounds(new Point2D.Double(10, 10), new Point2D.Double(100, 100)); LabeledEllipseFigure tb = new LabeledEllipseFigure(); tb.setBounds(new Point2D.Double(220, 120), new Point2D.Double(310, 210)); LabeledEllipseFigure tc = new LabeledEllipseFigure(); tc.setBounds(new Point2D.Double(220, 10), new Point2D.Double(310, 100)); Drawing drawing = new DefaultDrawing(); drawing.add(ta); drawing.add(tb); drawing.add(tc); // Create a frame with a drawing view and a drawing editor JFrame f = new JFrame("My Drawing"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.add(view.getComponent()); f.add(new JLabel("Press space bar to toggle handles."), BorderLayout.SOUTH); DrawingEditor editor = new DefaultDrawingEditor(); editor.add(view); editor.setTool(new DelegationSelectionTool()); f.setVisible(true); } });
DrawingView view = new DefaultDrawingView(); DefaultDrawing drawing = new DefaultDrawing(); drawing.addInputFormat(new SerializationInputOutputFormat());
/** Creates new form AnimationSample */ public AnimationSample() { initComponents(); DefaultDrawingView view = new DefaultDrawingView(); view.setDrawingDoubleBuffered(false); add(view); setSize(400, 400); Drawing d = new DefaultDrawing(); d.set(CANVAS_FILL_COLOR, new Color(0x76a9d2)); final EllipseFigure ellipse = new EllipseFigure(160, 160, 80, 80); ellipse.set(STROKE_WIDTH, 7d); d.add(ellipse); view.setDrawing(d); Timer t = new Timer(10, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { double alpha = 2d * Math.PI * (System.currentTimeMillis() % 1000) / 1000d; ellipse.willChange(); ellipse.setBounds(new Rectangle2D.Double(160 + Math.sin(alpha) * 100, 160 + Math.cos(alpha) * 100, 80, 80)); ellipse.changed(); } }); t.setRepeats(true); t.start(); }
f.setSize(400,300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent());
@Override public void run() { // Create a graphical composite figure. GraphicalCompositeFigure composite = new GraphicalCompositeFigure(); // Add child figures to the composite figure composite.add(new TextFigure("Above the line")); composite.add(new LineFigure()); composite.add(new TextFigure("Below the line")); // Set a layouter and perform the layout composite.setLayouter(new VerticalLayouter()); composite.layout(); // Add the composite figure to a drawing Drawing drawing = new DefaultDrawing(); drawing.add(composite); // Create a frame with a drawing view and a drawing editor JFrame f = new JFrame("My Drawing"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent()); DrawingEditor editor = new DefaultDrawingEditor(); editor.add(view); editor.setTool(new DelegationSelectionTool()); f.setVisible(true); } });
DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent());
f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent());