List of usage examples for javax.swing BorderFactory createEmptyBorder
public static Border createEmptyBorder(int top, int left, int bottom, int right)
From source file:com.intel.stl.ui.monitor.view.PSEventsCardView.java
@Override protected JComponent getMainComponent() { if (mainPanel != null) { return mainPanel; }//from www.jav a 2s . c o m mainPanel = new JPanel(new GridBagLayout()); mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 2, 5, 5)); GridBagConstraints gc = new GridBagConstraints(); gc.fill = GridBagConstraints.NONE; gc.weightx = 0; piePanel = new NodeStatesPie(false); piePanel.setOpaque(false); mainPanel.add(piePanel, gc); gc.fill = GridBagConstraints.BOTH; gc.weightx = 1; gc.weighty = 1; gc.gridwidth = GridBagConstraints.REMAINDER; barPanel = new ChartPanel(null); barPanel.setPreferredSize(new Dimension(60, 20)); barPanel.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { barPanel.setMaximumDrawHeight(e.getComponent().getHeight()); barPanel.setMaximumDrawWidth(e.getComponent().getWidth()); barPanel.setMinimumDrawWidth(e.getComponent().getWidth()); barPanel.setMinimumDrawHeight(e.getComponent().getHeight()); } }); barPanel.setOpaque(false); mainPanel.add(barPanel, gc); return mainPanel; }
From source file:misc.AccessibleScrollDemo.java
public AccessibleScrollDemo() { // Get the image to use. ImageIcon bee = createImageIcon("images/flyingBee.jpg", "Photograph of a flying bee."); // Create the row and column headers. columnView = new Rule(Rule.HORIZONTAL, true); if (bee != null) { columnView.setPreferredWidth(bee.getIconWidth()); } else {// w ww.ja va 2s . c o m columnView.setPreferredWidth(320); } columnView.getAccessibleContext().setAccessibleName("Column Header"); columnView.getAccessibleContext() .setAccessibleDescription("Displays horizontal ruler for " + "measuring scroll pane client."); rowView = new Rule(Rule.VERTICAL, true); if (bee != null) { rowView.setPreferredHeight(bee.getIconHeight()); } else { rowView.setPreferredHeight(480); } rowView.getAccessibleContext().setAccessibleName("Row Header"); rowView.getAccessibleContext() .setAccessibleDescription("Displays vertical ruler for " + "measuring scroll pane client."); // Create the corners. JPanel buttonCorner = new JPanel(); isMetric = new JToggleButton("cm", true); isMetric.setFont(new Font("SansSerif", Font.PLAIN, 11)); isMetric.setMargin(new Insets(2, 2, 2, 2)); isMetric.addItemListener(this); isMetric.setToolTipText("Toggles rulers' unit of measure " + "between inches and centimeters."); buttonCorner.add(isMetric); //Use the default FlowLayout buttonCorner.getAccessibleContext().setAccessibleName("Upper Left Corner"); String desc = "Fills the corner of a scroll pane " + "with color for aesthetic reasons."; Corner lowerLeft = new Corner(); lowerLeft.getAccessibleContext().setAccessibleName("Lower Left Corner"); lowerLeft.getAccessibleContext().setAccessibleDescription(desc); Corner upperRight = new Corner(); upperRight.getAccessibleContext().setAccessibleName("Upper Right Corner"); upperRight.getAccessibleContext().setAccessibleDescription(desc); // Set up the scroll pane. picture = new ScrollablePicture(bee, columnView.getIncrement()); picture.setToolTipText(bee.getDescription()); picture.getAccessibleContext().setAccessibleName("Scroll pane client"); JScrollPane pictureScrollPane = new JScrollPane(picture); pictureScrollPane.setPreferredSize(new Dimension(300, 250)); pictureScrollPane.setViewportBorder(BorderFactory.createLineBorder(Color.black)); pictureScrollPane.setColumnHeaderView(columnView); pictureScrollPane.setRowHeaderView(rowView); // In theory, to support internationalization you would change // UPPER_LEFT_CORNER to UPPER_LEADING_CORNER, // LOWER_LEFT_CORNER to LOWER_LEADING_CORNER, and // UPPER_RIGHT_CORNER to UPPER_TRAILING_CORNER. In practice, // bug #4467063 makes that impossible (at least in 1.4.0). pictureScrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, buttonCorner); pictureScrollPane.setCorner(JScrollPane.LOWER_LEFT_CORNER, lowerLeft); pictureScrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, upperRight); // Put it in this panel. setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); add(pictureScrollPane); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:org.nees.rpi.vis.ui.ProfilePlotFrame.java
private void initChartArea() { JFreeChart chart;/*ww w . j a v a 2 s .c om*/ xyDataset = new XYSeriesCollection(); chart = ChartFactory.createXYLineChart(null, "Sensor Reading", "Sensor Depth", xyDataset, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(Color.WHITE); XYPlot plot = (XYPlot) chart.getPlot(); plot.getDomainAxis().setAutoRange(false); XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); renderer.setShapesVisible(true); renderer.setShapesFilled(true); chartPanel = new ChartPanel(chart); chartPanel.setFillZoomRectangle(true); chartPanel.setHorizontalAxisTrace(true); chartPanel.setVerticalAxisTrace(true); chartPanel.setOpaque(false); VisSaveJChartPlotToImageButton saveButton = new VisSaveJChartPlotToImageButton(this, chart); JPanel buttonArea = new JPanel(); buttonArea.setOpaque(false); buttonArea.setLayout(new FlowLayout(FlowLayout.LEFT)); buttonArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 3)); buttonArea.add(saveButton); JPanel chartArea = new JPanel(); chartArea.setOpaque(false); chartArea.setLayout(new BorderLayout()); chartArea.add(chartPanel, BorderLayout.CENTER); chartArea.add(buttonArea, BorderLayout.NORTH); contentPane.add(chartArea, BorderLayout.CENTER); }
From source file:edu.ku.brc.af.prefs.PreferencesDlg.java
/** * Constructor.//from w w w. ja v a 2s. c om * @param addSearchUI true adds the search ui */ public PreferencesDlg(final boolean addSearchUI) { super((Frame) UIRegistry.getTopWindow(), getResourceString("PreferencesDlg.PREFERENCES"), true, //$NON-NLS-1$ OKCANCELHELP, null); this.skinItem = SkinsMgr.getSkinItem("PrefDlg"); glassPane = new SimpleGlassPane("", 24, false); setGlassPane(glassPane); glassPane.setVisible(false); glassPane.setFillColor(new Color(0, 0, 0, 96)); glassPane.setDelegateRenderer(delegateRenderer); //delegateRenderer.setIndexVisible(inx, visible); createUI(); initAsToolbar(addSearchUI); pack(); okBtn.setEnabled(false); mainPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); }
From source file:captureplugin.drivers.defaultdriver.AdditionalParams.java
/** * Create List-Panel// w ww.ja v a 2s . c o m * @return List-Panel */ private Component createListPanel() { JPanel panel = new JPanel(new BorderLayout(0, 2)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); panel.add(new JLabel(mLocalizer.msg("command", "Command")), BorderLayout.NORTH); mList = new JList(mListModel); panel.add(new JScrollPane(mList), BorderLayout.CENTER); JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT)); JButton add = new JButton(TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL)); add.setToolTipText(Localizer.getLocalization(Localizer.I18N_ADD)); add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addPressed(); } }); buttons.add(add); JButton remove = new JButton(TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL)); remove.setToolTipText(Localizer.getLocalization(Localizer.I18N_DELETE)); remove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { removePressed(); } }); buttons.add(remove); final JButton up = new JButton(TVBrowserIcons.up(TVBrowserIcons.SIZE_SMALL)); up.setToolTipText(Localizer.getLocalization(Localizer.I18N_UP)); buttons.add(up); up.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { upPressed(); } }); final JButton down = new JButton(TVBrowserIcons.down(TVBrowserIcons.SIZE_SMALL)); down.setToolTipText(Localizer.getLocalization(Localizer.I18N_DOWN)); buttons.add(down); down.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { downPressed(); } }); mStartStop = new JButton(mStartIcon); mStartStop.setToolTipText(mLocalizer.msg("startstop", "Activate or Deactivate Parameter")); mStartStop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { startStopPressed(); } }); buttons.add(mStartStop); panel.add(buttons, BorderLayout.SOUTH); mList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { selectionChanged(); if (mList.getSelectedIndex() == 0) { up.setEnabled(false); down.setEnabled(true); } else if (mList.getSelectedIndex() == mListModel.getSize() - 1) { up.setEnabled(true); down.setEnabled(false); } else { up.setEnabled(true); down.setEnabled(true); } } }); selectionChanged(); return panel; }
From source file:com.floreantpos.ui.views.payment.SettleTicketDialog.java
public SettleTicketDialog(Ticket ticket) { super();//from www.ja v a2 s . c o m this.ticket = ticket; if (ticket.getOrderType().isConsolidateItemsInReceipt()) { ticket.consolidateTicketItems(); } setTitle(Messages.getString("SettleTicketDialog.6")); //$NON-NLS-1$ getContentPane().setLayout(new BorderLayout()); JPanel centerPanel = new JPanel(new BorderLayout(5, 5)); centerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 0)); ticketViewerTable = new TicketViewerTable(ticket); ticketScrollPane = new PosScrollPane(ticketViewerTable); centerPanel.add(createTicketInfoPanel(), BorderLayout.NORTH); centerPanel.add(ticketScrollPane, BorderLayout.CENTER); centerPanel.add(createTotalViewerPanel(), BorderLayout.SOUTH); paymentView = new PaymentView(this); paymentView.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); getContentPane().add(centerPanel, BorderLayout.CENTER); getContentPane().add(paymentView, BorderLayout.EAST); paymentView.updateView(); paymentView.setDefaultFocus(); updateView(); }
From source file:LocationSensitiveDemo.java
public LocationSensitiveDemo() { super("Location Sensitive Drag and Drop Demo"); treeModel = getDefaultTreeModel();//from w w w. j a v a 2 s.c o m tree = new JTree(treeModel); tree.setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 4)); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); tree.setDropMode(DropMode.ON); namesPath = tree.getPathForRow(2); tree.expandRow(2); tree.expandRow(1); tree.setRowHeight(0); tree.setTransferHandler(new TransferHandler() { public boolean canImport(TransferHandler.TransferSupport info) { // for the demo, we'll only support drops (not clipboard paste) if (!info.isDrop()) { return false; } String item = (String) indicateCombo.getSelectedItem(); if (item.equals("Always")) { info.setShowDropLocation(true); } else if (item.equals("Never")) { info.setShowDropLocation(false); } // we only import Strings if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) { return false; } // fetch the drop location JTree.DropLocation dl = (JTree.DropLocation) info.getDropLocation(); TreePath path = dl.getPath(); // we don't support invalid paths or descendants of the names folder if (path == null || namesPath.isDescendant(path)) { return false; } return true; } public boolean importData(TransferHandler.TransferSupport info) { // if we can't handle the import, say so if (!canImport(info)) { return false; } // fetch the drop location JTree.DropLocation dl = (JTree.DropLocation) info.getDropLocation(); // fetch the path and child index from the drop location TreePath path = dl.getPath(); int childIndex = dl.getChildIndex(); // fetch the data and bail if this fails String data; try { data = (String) info.getTransferable().getTransferData(DataFlavor.stringFlavor); } catch (UnsupportedFlavorException e) { return false; } catch (IOException e) { return false; } // if child index is -1, the drop was on top of the path, so we'll // treat it as inserting at the end of that path's list of children if (childIndex == -1) { childIndex = tree.getModel().getChildCount(path.getLastPathComponent()); } // create a new node to represent the data and insert it into the model DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(data); DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) path.getLastPathComponent(); treeModel.insertNodeInto(newNode, parentNode, childIndex); // make the new node visible and scroll so that it's visible tree.makeVisible(path.pathByAddingChild(newNode)); tree.scrollRectToVisible(tree.getPathBounds(path.pathByAddingChild(newNode))); // demo stuff - remove for blog model.removeAllElements(); model.insertElementAt("String " + (++count), 0); // end demo stuff return true; } }); JList dragFrom = new JList(model); dragFrom.setFocusable(false); dragFrom.setPrototypeCellValue("String 0123456789"); model.insertElementAt("String " + count, 0); dragFrom.setDragEnabled(true); dragFrom.setBorder(BorderFactory.createLoweredBevelBorder()); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); JPanel wrap = new JPanel(); wrap.add(new JLabel("Drag from here:")); wrap.add(dragFrom); p.add(Box.createHorizontalStrut(4)); p.add(Box.createGlue()); p.add(wrap); p.add(Box.createGlue()); p.add(Box.createHorizontalStrut(4)); getContentPane().add(p, BorderLayout.NORTH); getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER); indicateCombo = new JComboBox(new String[] { "Default", "Always", "Never" }); indicateCombo.setSelectedItem("INSERT"); p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); wrap = new JPanel(); wrap.add(new JLabel("Show drop location:")); wrap.add(indicateCombo); p.add(Box.createHorizontalStrut(4)); p.add(Box.createGlue()); p.add(wrap); p.add(Box.createGlue()); p.add(Box.createHorizontalStrut(4)); getContentPane().add(p, BorderLayout.SOUTH); getContentPane().setPreferredSize(new Dimension(400, 450)); }
From source file:FormattedTextFieldDemo.java
public FormattedTextFieldDemo() { super(new BorderLayout()); setUpFormats();//from ww w . java 2 s .c om double payment = computePayment(amount, rate, numPeriods); //Create the labels. amountLabel = new JLabel(amountString); rateLabel = new JLabel(rateString); numPeriodsLabel = new JLabel(numPeriodsString); paymentLabel = new JLabel(paymentString); //Create the text fields and set them up. amountField = new JFormattedTextField(amountFormat); amountField.setValue(new Double(amount)); amountField.setColumns(10); amountField.addPropertyChangeListener("value", this); rateField = new JFormattedTextField(percentFormat); rateField.setValue(new Double(rate)); rateField.setColumns(10); rateField.addPropertyChangeListener("value", this); numPeriodsField = new JFormattedTextField(); numPeriodsField.setValue(new Integer(numPeriods)); numPeriodsField.setColumns(10); numPeriodsField.addPropertyChangeListener("value", this); paymentField = new JFormattedTextField(paymentFormat); paymentField.setValue(new Double(payment)); paymentField.setColumns(10); paymentField.setEditable(false); paymentField.setForeground(Color.red); //Tell accessibility tools about label/textfield pairs. amountLabel.setLabelFor(amountField); rateLabel.setLabelFor(rateField); numPeriodsLabel.setLabelFor(numPeriodsField); paymentLabel.setLabelFor(paymentField); //Lay out the labels in a panel. JPanel labelPane = new JPanel(new GridLayout(0, 1)); labelPane.add(amountLabel); labelPane.add(rateLabel); labelPane.add(numPeriodsLabel); labelPane.add(paymentLabel); //Layout the text fields in a panel. JPanel fieldPane = new JPanel(new GridLayout(0, 1)); fieldPane.add(amountField); fieldPane.add(rateField); fieldPane.add(numPeriodsField); fieldPane.add(paymentField); //Put the panels in this panel, labels on left, //text fields on right. setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); add(labelPane, BorderLayout.CENTER); add(fieldPane, BorderLayout.LINE_END); }
From source file:com.floreantpos.ui.views.payment.GroupSettleTicketDialog.java
public GroupSettleTicketDialog(List<Ticket> tickets) { super();// w w w . jav a2s .c om this.tickets = tickets; for (Ticket ticket : tickets) { if (ticket.getOrderType().isConsolidateItemsInReceipt()) { ticket.consolidateTicketItems(); } } setTitle(Messages.getString("SettleTicketDialog.6")); //$NON-NLS-1$ getContentPane().setLayout(new BorderLayout()); ticketDetailView = new TicketDetailView(); ticketScrollPane = new PosScrollPane(ticketDetailView); JPanel centerPanel = new JPanel(new BorderLayout(5, 5)); centerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 0)); centerPanel.add(createTicketInfoPanel(), BorderLayout.NORTH); centerPanel.add(ticketScrollPane, BorderLayout.CENTER); centerPanel.add(createTotalViewerPanel(), BorderLayout.SOUTH); paymentView = new GroupPaymentView(this); paymentView.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); getContentPane().add(centerPanel, BorderLayout.CENTER); getContentPane().add(paymentView, BorderLayout.EAST); setSize(Application.getPosWindow().getSize()); updateView(); paymentView.updateView(); paymentView.setDefaultFocus(); }
From source file:edu.ku.brc.specify.utilapps.ERDVisualizer.java
public ERDVisualizer() { boolean showTreeHierarchy = false; Locale.setDefault(currLang);//from ww w . ja v a 2s . co m UIRegistry.setResourceLocale(currLang); Vector<DBTableInfo> tables = DBTableIdMgr.getInstance().getTables(); Collections.sort(tables); SchemaLocalizerXMLHelper schemaXMLHelper = new SchemaLocalizerXMLHelper(SpLocaleContainer.CORE_SCHEMA, DBTableIdMgr.getInstance()); schemaXMLHelper.load(true); schemaXMLHelper.setTitlesIntoSchema(); ERDTable.setDisplayType(showTreeHierarchy ? ERDTable.DisplayType.Title : ERDTable.DisplayType.All); tblTracker = new TableTracker(); String schemDirName = adjustFileNameForLocale("schema%s"); final File localSchemaDir = new File(schemDirName); if (!localSchemaDir.exists()) { localSchemaDir.mkdir(); } else { try { FileUtils.cleanDirectory(localSchemaDir); } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ERDVisualizer.class, ex); ex.printStackTrace(); } } this.schemaDir = localSchemaDir; JPanel p = new JPanel(new BorderLayout()); p.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); p.add(mainPanel = new ERDPanel(tblTracker), BorderLayout.CENTER); setContentPane(new JScrollPane(p)); p.setBackground(Color.WHITE); mainPanel.setBackground(Color.WHITE); try { File templateFile = new File( UIRegistry.getDefaultWorkingPath() + File.separator + "site/template.html"); mapTemplate = FileUtils.readFileToString(templateFile); } catch (IOException ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ERDVisualizer.class, ex); ex.printStackTrace(); } if (StringUtils.isEmpty(mapTemplate)) { System.err.println("The template file is empty!"); } try { File srcDir = new File(UIRegistry.getDefaultWorkingPath() + File.separator + "site"); for (File f : srcDir.listFiles()) { if (!f.getName().startsWith(".")) { File dst = new File(UIRegistry.getDefaultWorkingPath() + File.separator + schemDirName + File.separator + f.getName()); if (!FilenameUtils.getExtension(f.getName()).toLowerCase().equals("html")) { FileUtils.copyFile(f, dst); } } } } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ERDVisualizer.class, ex); ex.printStackTrace(); } // Choose what to display if (!showTreeHierarchy) { advance(); int period = isDoShadow() ? 10000 : 1000; int delay = isDoShadow() ? 5000 : 1000; timer = new Timer(); if (true) { timer.scheduleAtFixedRate(new TimerTask() { public void run() { advance(); } }, period, delay); } } else { ERDTable.setDisplayType(ERDTable.DisplayType.Title); //this.tblTracker.setFont(this.tblTracker.getFont().deriveFont((float)10.0)); ERDTable root = null; boolean doCollectionSchema = true; if (doCollectionSchema) { root = tblTracker.getTable("Discipline"); // skip, processKids, alwaysAKid, processAnyRel, okWhenParent tblTracker.addNodeInfo("Agent", false, true, true, false, null); tblTracker.addNodeInfo("Determination", false, true, true, true, null); tblTracker.addNodeInfo("ConservDescription", false, true, true, true, null); tblTracker.addNodeInfo("Attachment", true, true, true, false, null); tblTracker.addNodeInfo("AttributeDef", true, true, true, false, null); tblTracker.addNodeInfo("SpAppResourceDir", true, true, true, false, null); tblTracker.addNodeInfo("SpLocaleContainer", true, true, true, false, null); tblTracker.addNodeInfo("DeaccessionPreparation", true, true, true, false, null); tblTracker.addNodeInfo("OtherIdentifier", true, true, true, false, null); tblTracker.addNodeInfo("CollectionRelationship", true, true, true, false, null); tblTracker.addNodeInfo("ProjectCollectionObject", true, true, true, false, null); tblTracker.addNodeInfo("CollectionObjectAttr", true, true, true, false, null); tblTracker.addNodeInfo("CollectionObjectAttachment", true, true, true, false, null); tblTracker.addNodeInfo("ConservDescriptionAttachment", true, true, true, false, null); tblTracker.addNodeInfo("ConservEventAttachment", true, true, true, false, null); // No Kids tblTracker.addNodeInfo("Discipline", false, false, true, false, null); tblTracker.addNodeInfo("Collection", false, false, true, false, null); tblTracker.addNodeInfo("Taxon", false, false, true, false, null); tblTracker.addNodeInfo("TaxonCitation", false, false, true, false, null); // tblTracker.addNodeInfo("DeterminationCitation", false, false, true, false, null); tblTracker.addNodeInfo("ReferenceWork", false, false, true, false, null); tblTracker.addNodeInfo("Journal", false, false, true, false, null); tblTracker.addNodeInfo("CollectingEvent", false, false, true, false, null); tblTracker.addNodeInfo("Locality", false, false, true, false, null); tblTracker.addNodeInfo("Geography", false, false, true, false, null); tblTracker.addNodeInfo("PaleoContext", false, false, true, false, null); tblTracker.addNodeInfo("LithoStrat", false, false, true, false, null); tblTracker.addNodeInfo("GeologicTimePeriod", false, false, true, false, null); tblTracker.addNodeInfo("CollectionObjectCitation", false, false, true, false, null); tblTracker.addNodeInfo("Accession", false, false, true, false, null); tblTracker.addNodeInfo("AccessionAuthorization", false, false, true, false, null); tblTracker.addNodeInfo("AccessionAgent", false, false, true, false, null); tblTracker.addNodeInfo("Agent", false, false, true, false, null); tblTracker.addNodeInfo("Preparation", false, false, true, false, null); tblTracker.addNodeInfo("PrepType", false, false, true, false, null); tblTracker.addNodeInfo("RepositoryAgreement", false, false, true, false, null); tblTracker.addNodeInfo("ConservEvent", false, false, true, false, null); tblTracker.addNodeInfo("DNASequence", false, false, true, false, null); tblTracker.addNodeInfo("TreatmentEvent", false, false, true, false, null); tblTracker.addNodeInfo("Ipm", false, false, true, false, null); tblTracker.addNodeInfo("FieldNotebook", false, false, true, false, null); tblTracker.addNodeInfo("FieldNotebookPageSet", false, false, true, false, null); tblTracker.addNodeInfo("FieldNotebookPage", false, false, true, false, null); NodeInfo det = tblTracker.getNodeInfo("Determination"); det.addKid(tblTracker.getTable("Taxon")); // det.addKid(tblTracker.getTable("DeterminationStatus")); NodeInfo ni = tblTracker.getNodeInfo("Taxon"); ni.addKid(tblTracker.getTable("TaxonCitation")); ni = tblTracker.getNodeInfo("Discipline"); ni.addKid(tblTracker.getTable("Collection")); ni = tblTracker.getNodeInfo("Collection"); ni.addKid(tblTracker.getTable("FieldNotebook")); ni.addKid(tblTracker.getTable("CollectionObject")); ni = tblTracker.getNodeInfo("CollectionObjectCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("TaxonCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("ReferenceWork"); ni.setOkToDuplicate(true); ni.addKid(tblTracker.getTable("Journal")); ni = tblTracker.getNodeInfo("GeologicTimePeriod"); ni.setOkToDuplicate(true); ni = tblTracker.getNodeInfo("Journal"); ni.setOkToDuplicate(true); ni = tblTracker.getNodeInfo("CollectingEvent"); ni.addKid(tblTracker.getTable("Locality")); ni = tblTracker.getNodeInfo("CollectionObject"); ni.addKid(tblTracker.getTable("CollectingEvent")); ni.addKid(tblTracker.getTable("PaleoContext")); ni.addKid(tblTracker.getTable("Accession")); ni.addKid(tblTracker.getTable("DNASequence")); ni.addKid(tblTracker.getTable("TreatmentEvent")); ni.addKid(tblTracker.getTable("Ipm")); ni = tblTracker.getNodeInfo("Locality"); ni.addKid(tblTracker.getTable("Geography")); ni = tblTracker.getNodeInfo("PaleoContext"); ni.addKid(tblTracker.getTable("LithoStrat")); ni.addKid(tblTracker.getTable("GeologicTimePeriod")); ni = tblTracker.getNodeInfo("DeterminationCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("Preparation"); ni.addKid(tblTracker.getTable("PrepType")); ni = tblTracker.getNodeInfo("Accession"); ni.addKid(tblTracker.getTable("AccessionAuthorization")); ni.addKid(tblTracker.getTable("AccessionAgent")); ni.addKid(tblTracker.getTable("RepositoryAgreement")); //ni.addKid(tblTracker.getTable("Attachment")); //protected RepositoryAgreement repositoryAgreement; ni = tblTracker.getNodeInfo("ConservEvent"); ni.addKid(tblTracker.getTable("ConservRecommendation")); ni = tblTracker.getNodeInfo("FieldNotebook"); ni.addKid(tblTracker.getTable("FieldNotebookPageSet")); ni = tblTracker.getNodeInfo("FieldNotebookPageSet"); ni.addKid(tblTracker.getTable("FieldNotebookPage")); } else { root = tblTracker.getTable("SpAppResourceDir"); // skip, processKids, alwaysAKid, processAnyRel, okWhenParent //tblTracker.addNodeInfo("Agent", false, true, true, false, null); // No Kids tblTracker.addNodeInfo("SpAppResourceData", false, false, true, false, null); tblTracker.addNodeInfo("Collection", false, false, true, false, null); tblTracker.addNodeInfo("Discipline", false, false, true, false, null); tblTracker.addNodeInfo("SpecifyUser", false, false, true, false, null); tblTracker.addNodeInfo("SpAppResource", false, false, true, false, null); tblTracker.addNodeInfo("SpViewSetObj", false, false, true, false, null); tblTracker.addNodeInfo("SpUIViewSet", false, false, true, false, null); tblTracker.addNodeInfo("SpUIView", false, false, true, false, null); tblTracker.addNodeInfo("SpUIViewDef", false, false, true, false, null); tblTracker.addNodeInfo("SpUIAltView", false, false, true, false, null); tblTracker.addNodeInfo("SpUIColumn", false, false, true, false, null); tblTracker.addNodeInfo("SpUIRow", false, false, true, false, null); tblTracker.addNodeInfo("SpUICell", false, false, true, false, null); NodeInfo ni = tblTracker.getNodeInfo("SpAppResourceDir"); ni.addKid(tblTracker.getTable("SpAppResource")); ni.addKid(tblTracker.getTable("SpViewSetObj")); //ni.addKid(tblTracker.getTable("Collection")); //ni.addKid(tblTracker.getTable("Discipline")); //ni.addKid(tblTracker.getTable("SpecifyUser")); ni = tblTracker.getNodeInfo("SpAppResource"); ni.addKid(tblTracker.getTable("SpAppResourceData")); ni = tblTracker.getNodeInfo("SpViewSetObj"); ni.addKid(tblTracker.getTable("SpAppResourceData")); ni.addKid(tblTracker.getTable("SpUIViewSet")); ni = tblTracker.getNodeInfo("SpUIViewSet"); ni.addKid(tblTracker.getTable("SpUIView")); ni.addKid(tblTracker.getTable("SpUIViewDef")); ni = tblTracker.getNodeInfo("SpUIView"); ni.addKid(tblTracker.getTable("SpUIAltView")); ni = tblTracker.getNodeInfo("SpUIViewDef"); ni.addKid(tblTracker.getTable("SpUIColumn")); ni.addKid(tblTracker.getTable("SpUIRow")); ni = tblTracker.getNodeInfo("SpUIRow"); ni.addKid(tblTracker.getTable("SpUICell")); //ni.addKid(tblTracker.getTable("SpUIViewDef")); //ni = tblTracker.getNodeInfo("SpUIAltView"); //ni.addKid(tblTracker.getTable("SpUIView")); //ni.addKid(tblTracker.getTable("SpUIViewDef")); ni = tblTracker.getNodeInfo("SpAppResourceData"); ni.setOkToDuplicate(true); if (false) { NodeInfo det = tblTracker.getNodeInfo("Determination"); det.addKid(tblTracker.getTable("Taxon")); // det.addKid(tblTracker.getTable("DeterminationStatus")); ni = tblTracker.getNodeInfo("Taxon"); ni.addKid(tblTracker.getTable("TaxonCitation")); ni = tblTracker.getNodeInfo("CollectionObjectCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("TaxonCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("ReferenceWork"); ni.setOkToDuplicate(true); ni.addKid(tblTracker.getTable("Journal")); ni = tblTracker.getNodeInfo("GeologicTimePeriod"); ni.setOkToDuplicate(true); ni = tblTracker.getNodeInfo("Journal"); ni.setOkToDuplicate(true); ni = tblTracker.getNodeInfo("CollectingEvent"); ni.addKid(tblTracker.getTable("Locality")); ni = tblTracker.getNodeInfo("CollectionObject"); ni.addKid(tblTracker.getTable("CollectingEvent")); ni.addKid(tblTracker.getTable("PaleoContext")); ni.addKid(tblTracker.getTable("Accession")); ni = tblTracker.getNodeInfo("Locality"); ni.addKid(tblTracker.getTable("Geography")); ni = tblTracker.getNodeInfo("PaleoContext"); ni.addKid(tblTracker.getTable("LithoStrat")); ni.addKid(tblTracker.getTable("GeologicTimePeriod")); ni = tblTracker.getNodeInfo("DeterminationCitation"); ni.addKid(tblTracker.getTable("ReferenceWork")); ni = tblTracker.getNodeInfo("Preparation"); ni.addKid(tblTracker.getTable("PrepType")); ni = tblTracker.getNodeInfo("Accession"); ni.addKid(tblTracker.getTable("AccessionAuthorization")); ni.addKid(tblTracker.getTable("AccessionAgent")); ni.addKid(tblTracker.getTable("RepositoryAgreement")); } } if (false) { NodeInfo ni = tblTracker.getNodeInfo("Agent"); ni.setOkToDuplicate(true); String[] toAddAgent = { "CollectionObject", "Accession", "Determination", "Preparation", }; for (String name : toAddAgent) { ni = tblTracker.getNodeInfo(name); ni.addKid(tblTracker.getTable("Agent")); } } processAsTree(root, 0); mainPanel.addTree(root); final SwingWorker worker = new SwingWorker() { public Object construct() { try { Thread.sleep(3000); } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ERDVisualizer.class, ex); ex.printStackTrace(); } return null; } //Runs on the event-dispatching thread. public void finished() { generate(); System.out.println("Done."); } }; worker.start(); } createIndexFile(); }