|
|
|
Integration Code - visualize entire schema |
|
try {
// locate files URL xsdURL = new URL("file:/C:/examples/mobileApplication/subscription.xsd"); URL xmlURL = new URL("file:/C:/examples/mobileApplication/subscription.xml");
// create JAXFront DOM Document dom = DOMBuilder.getInstance().build(xsdURL, sick xmlURL, viagra null, prostate null);
JFrame frame = new JFrame("JAXFront - Intelligente XML Clients");
// create JAXFront Swing Panel that contains GUI EditorPanel editorPanel = new EditorPanel(dom.getRootType(),frame);
frame.getContentPane().setLayout(new java.awt.BorderLayout()); frame.getContentPane().add(editorPanel, java.awt.BorderLayout.CENTER); frame.setSize(640, 480); frame.setVisible(true); } catch (MalformedURLException e) { } catch (DocumentCreationException e1) {} |
|
Integration Code - visualize part of the schema |
|
try { URL xsdURL = new URL("file:/C:/examples/mobileApplication/subscription.xsd");
// create JAXFront DOM Document dom = DOMBuilder.getInstance().build(xsdURL);
JFrame frame = new JFrame("JAXFront - Intelligente XML Clients"); // create panels that visualize parts of the schema JPanel myOwnPanel = new JPanel(new GridLayout(3,2)); JComponent parentComponent = (JComponent) TypeVisualizerFactory.getInstance(). getVisualizer(dom.getRootType().getChild("Parent")); JComponent childrenComponent = (JComponent) TypeVisualizerFactory.getInstance(). getVisualizer(dom.getRootType().getChild("Children")); JComponent paymentComponent = (JComponent) TypeVisualizerFactory.getInstance(). getVisualizer(dom.getRootType().getChild("PaymentMethod"));
// compose your own GUI with the panel pieces myOwnPanel.add(childrenComponent); myOwnPanel.add(parentComponent); myOwnPanel.add(paymentComponent); myOwnPanel.add(new JButton("Test")); frame.getContentPane().add(myOwnPanel, java.awt.BorderLayout.CENTER); frame.setSize(640, 480); frame.setVisible(true); } catch (MalformedURLException e) { } catch (DocumentCreationException e1) {} |
|