svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toolListeners / snapping / gui / testDialog.java @ 40558
History | View | Annotate | Download (3.08 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.project.documents.view.toolListeners.snapping.gui; |
25 |
|
26 |
import java.util.ArrayList; |
27 |
|
28 |
import javax.swing.AbstractAction; |
29 |
import javax.swing.Action; |
30 |
import javax.swing.JButton; |
31 |
import javax.swing.JDialog; |
32 |
import javax.swing.UIManager; |
33 |
import javax.swing.UnsupportedLookAndFeelException; |
34 |
|
35 |
import org.gvsig.app.project.documents.view.toolListeners.snapping.snappers.FinalPointSnapper; |
36 |
import org.gvsig.fmap.mapcontrol.MapControl; |
37 |
|
38 |
|
39 |
public class testDialog { |
40 |
public static void main(String[] args) { |
41 |
|
42 |
try {
|
43 |
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
44 |
} catch (ClassNotFoundException e) { |
45 |
// TODO Auto-generated catch block
|
46 |
e.printStackTrace(); |
47 |
} catch (InstantiationException e) { |
48 |
// TODO Auto-generated catch block
|
49 |
e.printStackTrace(); |
50 |
} catch (IllegalAccessException e) { |
51 |
// TODO Auto-generated catch block
|
52 |
e.printStackTrace(); |
53 |
} catch (UnsupportedLookAndFeelException e) { |
54 |
// TODO Auto-generated catch block
|
55 |
e.printStackTrace(); |
56 |
} |
57 |
|
58 |
JDialog dlg = new JDialog(); |
59 |
|
60 |
ArrayList list = new ArrayList(); |
61 |
for (int i=0; i < 20; i++) |
62 |
list.add(new FinalPointSnapper());
|
63 |
SnapConfig panel = new SnapConfig(new MapControl()); |
64 |
panel.setSnappers(); |
65 |
Action act = new AbstractAction(){ |
66 |
public void actionPerformed(java.awt.event.ActionEvent arg0) { |
67 |
System.out.println("HOla"); |
68 |
// HashPrintRequestAttributeSet att = new HashPrintRequestAttributeSet();
|
69 |
//
|
70 |
// PrinterJob job = PrinterJob.getPrinterJob();
|
71 |
// PageFormat defaulFormat = job.defaultPage();
|
72 |
// // PageFormat selectedFormat = job.pageDialog(defaulFormat);
|
73 |
// Paper paper = new Paper();
|
74 |
// paper.setSize(MediaSize.ISO.A5.getX(MediaSize.INCH),MediaSize.ISO.A5.getY(MediaSize.INCH));
|
75 |
// defaulFormat.setPaper(paper);
|
76 |
// job.defaultPage(defaulFormat);
|
77 |
// if (job.printDialog()) {
|
78 |
// // System.out.println(job.)
|
79 |
// }
|
80 |
}; |
81 |
}; |
82 |
JButton btnPrint = new JButton(act); |
83 |
|
84 |
dlg.getContentPane().add(panel); |
85 |
// dlg.getContentPane().add(btnPrint);
|
86 |
// dlg.getContentPane().setSize(panel.getSize());
|
87 |
dlg.pack(); |
88 |
dlg.show(true);
|
89 |
} |
90 |
|
91 |
} |